[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] BooleanUGens (was Re: conditional statement in SynthDef)



Mine are more typing.

I made the == and != ones because there seemed to be a need, and since <, > <= and >= were an easy cut and paste away, I did them also. Forgot about the one's that were already there.

Josh

******************************************
Joshua D. Parmenter
http://homepage.mac.com/joshpar/

"...Some people think a composer's supposed to please them, but in a way a composer is a chronicler... He's supposed to report on what he's seen and lived." -Charles Mingus

On Sep 5, 2005, at 5:25 AM, Scott Wilson wrote:

Hey Josh,

Maybe I'm missing something, but how are these different than the existing > < >= and <= binary op ugens? Only the equals and not equal ugens seem to be new.

S.


On 4 Sep 2005, at 21:50, Joshua Parmenter wrote:


Hi everyone,

After talking to Dan a little bit, I decided to make a few quick UGens that do some basic Boolean stuff. They return 0 for false, 1 for true. There is:

IsEqual, IsNotEqual, IsLess, IsLessOrEqual, IsGreater, IsGreaterOrEqual

These can be used pretty easily in the SynthDef if statements for a good either / or result.

There are helpfiles for them, as well as a new helpfile for Balance (which also has some improvements).

You can get them all at:

http://homepage.mac.com/joshpar/JoshUgenPack.tar.gz

Josh

******************************************
Joshua D. Parmenter
http://homepage.mac.com/joshpar/

"...Some people think a composer's supposed to please them, but in a way a composer is a chronicler... He's supposed to report on what he's seen and lived." -Charles Mingus

On Sep 3, 2005, at 1:33 AM, Dan Stowell wrote:


2005/8/31, James Harkins <jamshark70@xxxxxxxxx>:


...
Also remember that the server knows nothing about the language.
"if(high == 1)" is meaningless to the server (as is "freq = 220" in the if branch). The expressions are evaluated in the language once, when the synthdef is built, and the result is hardcoded into the synthdef
structure. And, of course, anOutputProxy == 1 is always going to be
false.



and < comparisons should work, though. someUGen > someUGen produces a


BinaryOpUGen that outputs 0 when false and 1 when true.

       freq = if(high > 0, 440, 220);




OK, maybe this is a naive question, but why should > and < behave so
very differently from == within a synth? Seems counter-intuitive. Is
there any reason why "someUGen == someUGen" shouldn't produce a
BinaryOpUGen that outputs 1 when the signals match and 0 when they
don't?

Dan

_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users



_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users



_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users