[chuck-users] Power operator in chuck

Tennessee Leeuwenburg tennessee at tennessee.id.au
Mon Nov 28 23:53:09 EST 2005

Ge Wang wrote:

> Welcome Tennessee!
>> I just downloaded chuck. Perhaps I'm being a bit blind/dense, but
>> there doesn't seem to be a simple power operator in chuck. Given that 
>> power-laws appear in many places, it would be a very useful operator. 
>> Hopefully I'm just missing it?
> Currently, there is math.pow( float, float ) but no dedicated power 
> operator (like ** in python?).  Other languages sometimes use a^b to 
> denote power, however ^ is the xor binary operator in ChucK (like in 
> C). Unless there is a really compelling reason to include a specialized
> power operator, it is unlikely chuck will support it (at least for now).

My bad, I hadn't discovered the math library yet.

As note progressions (and pitch perceptions) are logarithmic, being able 
to access a decent power operator seems important. I want to start with 
a walk up an octave, divided into an arbitrary number of segments. (12 
notes in an octave? Well, maybe if you're limited by a keyboard...)

Chuck is like a breath of fresh air after days of wondering where to 
find a decent scripting language for music. I want to play around, and 
nothing else ... fits me right. :)


More information about the chuck-users mailing list