#Messing with Modulation–randomly moving velocity threshold
I made a couple of modules to try adding some controlled variability to a looping midi note stream by creating a slow moving, sinusoidal modulation signal (aka LFO) that runs from the minimum to maximum velocity recorded in the loop, then use that signal as a threshold to determine which samples to pass along for playback. I added some logic to pass to a separate output the excluded samples for play using a different voice or synth module.
Some variability comes from the nominal LFO rhythm beating against the loop’s rhythm. Additional variability comes by randomly varying the period of the LFO at the end of each cycle. Nominal LFO period and center-weighted random noise is set by the Jittery Knob Simulator module.
I added these modules to my White Key Scale player project, which defaults in scale play mode, where the black keys control five switches. The player uses the “it’s a trap!” drum kit. The three triggers on the left are pads for the kit. Change key by switching to chromatic mode with the button, hitting any key (it plays in the proper tone), then putting it back in scale play mode.
To start, hit a Bb on the MIDI keyboard to pass the clock from the BPM box to the tap tempo box. Once it’s up to tempo, hit Eb to turn on loop recording then start playing, using a mix of velocities. The player is set as uploaded with a minor pentatonic scale selected.
The Autoranging Threshold Modulator (for lack of a better name!) finds the highest and lowest velocity in input gate pulses and then transforms a varying +/- 1 LFO signal to vary between those two values.
Frequency Jumping LFO. The LFO in this case is a sinusoidal waveform with frequency divided from the master BPM clock, and which randomly varies each cycle over a pre-set range, and scaling the tails of the distribution to avoid pileups at zero or one when you’ve set your variability bigger than the distance to that rail.
Pulses louder than the threshold at that moment are passed to output (and corresponding octave signal is latched), and those softer are passed to the “rejected” output.
The frequency divider knob values (the module uses the standard Audulus library freq divider module) for the LFO are generated by the “Jittery Knob Simulator” module on the left that generates random “knob” values, with a “nominal” knob, and a “variability” knob. Random distribution is made approximately Gaussian by passing it to a STS Normal Distribution module, setting std deviation to equal one third of the dialed in variability. The noise signal is then applied to the 0-1 value set by the nominal knob.
Here’s a picture of the whole (unholy) mess: