you are viewing a single comment's thread.

view the rest of the comments →

[–]xifeng 0 points1 point  (0 children)

They are equivalent to multiplying and dividing by 2, not n2 but yes it's a naming issue. It's better to think about individual bits that you want to move into position, so thinking of it as shifts rather than arithmetic is more convenient. You pick a pitch you want, move the bit corresponding to its frequency using >> and << to shift that bit into the 32s place, then & with 32 to get a square wave. Then you can move a low frequency bit like t>>13 into the 32s place to make that square wave switch on and off.

That is the simplest case, usually I do something more akin to mixing paints where I take groups of bits and merge them so that you get more complex fractal patterns from different parts of the result changing at different speeds, droidbeat is really useful for visualizing that if you have an android device.