flonum

Poly-rhythm generator

To create a poly-rhythm generator, this example chooses a division and articulates every attack point of that division. Use a metro synched to the transport to specify the divisions (or the tempo object, if preferred), and then use a counter (or a % object with the output of tempo) to specify the articulation points.

MIDI to Frequency Math

To better understand the function of a mtof object, it can be recreated with an expr object. There are very slight differences between the output of mtof and expr. The differences are pretty minuscule and should not be a problem in most cases, as they are on the order of a few 1/10,000ths of a Hz.

Representing all decibel values as positive

Is it possible to see decibel values that start at 0 dB so that the values are all positive? Yes, you just need to decide what you want to use as your 0 dB reference amplitude. In digital audio, an amplitude of 1 is used as the 0 dB reference. In measuring real-world sound, the human threshold of hearing at 1 KHz (something like .0002 microbar) is usually used as the 0 dB reference value. Here’s an example using (roughly) the smallest obtainable nonzero amplitude in a 16-bit signal as the reference value, yielding a scale from about 0 to 90 dB.