Tuesday, July 24, 2012

12 Tone MIDI Sequencer


This is my MIDI sequencer I built using an arduino microcontroller. I put it in a cigar box which I bought for $1 from a tobacco shop in Harvard Square. It generates a random sequence of notes (tone row) without repeating any pitches and spreads them over three octaves. This is the fundamental rule of 12 tone music, the idea being that there is no tonal center.

The algorithm takes the chromatic scale (numbers 0-11) and randomly selects one note to put into a new array, shifts it by 0, 1 or 2 octaves and deletes it from the original array. This repeats, each time selecting a different note and randomly selecting the octave. This algorithm is a function which is called whenever the current sequence is finished if the tone row button is held down. The sequence is sent out to MIDI, and I've been using it with a Midisport 2x2 connected to Reason.

The controls give you the ability to change the duration of the notes (they're all the same length), velocity of the notes, reverse the sequence, modulate the whole sequence up or down by a semitone, produce random note durations (arrhythmic) and generate a new random sequence. The ability to modulate by a semitone means that in that transition there will be a repeated note, but heck it sounds cool so I just left it.

A fun thing to do is to crank the duration way down and modulate the pitch using the pitch knob. Also holding down the "new tone row" button while you do this makes it sound pretty crazy. It's also fun to flip the arrhythmic switch and let the Arduino make it's own music. Sometimes I like to let computers do the composing just to see how soulful a dead thing can be.

For version two, I'd like to get rid of the repeated note when reversing the sequence and also allow the ability to invert the sequence. I'm not really sure how to do the inversion if the tone row is spread across three octaves though. Maybe a switch to randomly select octaves while the sequence is running would be cool too.


1 comment:

  1. Do you have the arduino source code available? I'd like to try something like this.

    ReplyDelete