Generative music sequencer based on the popular Eurorack module by Tom Whitwell. Also inspired by the Encoder Audio Turing Machine for Max/MSP.
The Turing machine will emit a random but controllable sequence of MIDI notes.
The sequencer state is made up of up to 16 bits. Every tick, the bit values all shift one space to the left. Depending on the value of “probability”, the rightmost bit is either set randomly (Probability knob centered), set to the value of the previous leftmost bit that was shifted out (Probability knob to the left), or set to the inverse value of the previous leftmost bit (Probability knob to the right).
Whenever a bit is set in a position that also has a gate marker set, a note is generated. The pitch of the note is based on the value of the sequencer bits, as well as the “Root”, “Range”, “Scale” parameters and MIDI input.
Effectively, the pitch is set by the following formula:
MIDI Note = (base pitch) + ((sequencer value / maximum possible value) * (range))
So, a negative value of range will generate notes that are below the base pitch, and positive range values will generate notes above the base pitch.
The length of the note is fixed based on the NoteLen parameter.
The UI is broken into two pages. You change UI pages by pressing “SHIFT”.
Pads control the state of each bit in the sequencer. Tap a pad to alter the sequencer state.
Knob 0 controls the likelihood the rightmost bit will be a random value (center), the previously leftmost value (counter-clockwise), or the inverse of the previously leftmost value (clockwise). Values between these knob positions allow the user to control the likelihood of repetition – set the knob slightly away from an extreme for a pattern that slowly evolves over time.
Knob 1 sets the root pitch. With no MIDI input, this is the “base pitch” for the note. This also sets the scale root.
Knob 2 sets the note range. This sets the pitch range for note generation. Negative values will generate notes below the root pitch.
Knob 3 sets the scale.
Pads control which bits, when set, emit notes. If bit[position] is set and gate[position] is set, for any sequencer position, then a MIDI note will be generated on a given step.
Knob 0 controls sequencer speed.
Knob 1 controls note length. Note lengths are fixed and are (20 ms) * (note length parameter).
Knob 2 controls the number of sequencer bits, which controls the both the length of the loop as well as the number of different possible values of the sequencer.
Knob 3 determines whether or not the sequencer auto-plays. When 1, sequencer auto plays. When 0, sequencer position is incremented every time a MIDI note is received.
Incoming MIDI notes will set a new base pitch (but not change the scale root), and set the output MIDI velocity.
When sequencer autoplay is disabled (see Page 2), incoming MIDI notes will also increment the sequencer position, possibly emitting a MIDI note (if the gate conditions are true).
You can chain Turing Machines – try feeding a 1/8th note machine with a 1 bar (or slower) machine to get melodies that also change root positions!