Fencepost Rhythms

The idea here is to calculate some function at regular intervals (the fenceposts) and based on some condition being true generate a MIDI event, otherwise to extend silence. An improvement may involve a graph of the equation and the fenceposts so that you can better see what the equation is doing, but that is more work.

Link

Link

f(x) = sin(5x) + cos(2x)

f(x) = sin(7x) + cos(11 * sin(x/5))

The step is 0.05, so the equation is being run at 0, 0.05, 0.1, or so, these being floating point values. There are many things to fiddle with here. For example, the MIDI dtime values could vary, e.g. the rests might use a shorter value and the note event a longer sustain? More advanced would be to construct (or start to construct) a software synth with square waves, saw waves, etc.

Actual uses for these rhythms might be to select snippets that work, or to use the beats for machine or space noises that need to be regular but not really conform to expected musical rhythms.


Source