a thread to discuss how we can integrate MIDI with teletype. 2 obvious use cases:
- use MIDI controllers to trigger and control scripts
- sequence other MIDI gear
but the main attraction, of course, is being able to use TT scripting to process MIDI messages. it would be really easy to write scripts to merge / split channels, to transpose sequences, to create arpeggiations - basically, you’d have a pretty powerful scriptable MIDI processor with the ability to have multiple presets. and then you could integrate it with the rest of the modular via I2C and CV.
the 2 main questions are - how do we get MIDI into teletype, and how do we output MIDI from teletype? obviously there are CV-to-MIDI and MIDI-to-CV converters but that’s not what we’re interested in.
sending MIDI: this would require an expander of some sort, that would translate TT I2C messages to MIDI. as it happens, we already have 2 options:
with the faderbank ops you can send MIDI notes to either USB MIDI or minijack MIDI. the only requirement here (other than updating the firmware itself) is having faderbank connected to TT via I2C. this is a nice option as more folks now have 16n, but it would be great to have a smaller solution just for the MIDI output.
something like the I2C-select bus or a similar solution - a teensy (or some other CPU) based little board or a small module or board that would do I2C-MIDI conversion (extra bonus points for something that can connect to intellijel’s MIDI tiles).
the experimental ops we used so far for the above are:
FB.ON channel note velocity FB.OFF channel note
send MIDI notes to faderbank (could add an op to send CCs too)
MIDI.ON channel note vel MIDI.OFF channel note MIDI.CC channel cc value MIDI.PRG channel program
send MIDI messages to I2C-select bus (see the link above for more info)
receiving MIDI: as TT works as a USB host, MIDI sequencers/controllers could be simply plugged directly into the TT USB port. one thing to consider is that some MIDI devices will require power that TT is not capable of providing - basically, the same rule applies as with TT and grids - if you have the latest rev TT you could likely plug directly into it, if you have an earlier rev you’ll need to power it externally (using offworld or monome switch or two>one module). i did a super quick test yesterday with MIDI twister and it seems to work fine (big thanks to @ngwese for doing all the heavy lifting by adding MIDI support to libavr32).
here is how it could work: we could have ops that would assign MIDI messages (notes and CCs, maybe others) to specific scripts. then whenever a MIDI message is received that is assigned to a script it would trigger that script. additional ops would return the latest received note or CC.
not sure what would be a good name base for such ops -
M.IN for “MIDI in”? then we could have the following:
M.IN.NR channel start end script
assign Note Range (all notes between start and end) from the specified channel to the specified script (0 to receive from any channel, 0 for both start and end to receive all notes)
M.IN.CCR channel start end script
same thing for CCs
get the last received note’s pitch
get the last received note’s velocity
get the last received CC
get the last channel
get the type of last message received (0 - note off, 1 - note on, 2 - CC etc)
here is a scene that would merge all channels to channel 1 and transpose all notes up by an octave:
#I M.IN.NR 0 0 0 1 #1 I + 12 M.IN.N IF NZ M.IN.T: MIDI.ON 1 I M.IN.V ELSE: MIDI.OFF 1 I M.IN.V