this is a thread for discussing and testing teletype MIDI IN ops. this feature should be considered experimental for now - there might be some possible issues, it should be tested with more devices, and the ops themselves can change based on the discussion here.
the most obvious use cases are using a MIDI keyboard with the teletype converting notes to i2c ops so you could play just friends / er-301 / txo (with possibly some additional transformation done by teletype - how about using the param knob as an octave switcher?) and using a MIDI controller to control the scene itself or various txo / er-301 / disting ex etc parameters. the cool thing is - you can use teletype to additionally process MIDI events, so in essence you get a scriptable MIDI-CV and MIDI-I2C controller.
it should be noted that while it should be okay in most cases to plug your MIDI device to teletype USB port directly, it’s best to power it externally (using monome switch or two>one or a y-cable etc) if you have the older edition teletype (green PCB). and make sure you have extra 500ma available on your +5v rail!
so far i’ve tested and can confirm it works with: faderfox mx12, faderfox pc12, midi twister, arturia player keyboard. it didn’t work with nakedboards mc 24 - i have a suspicion it’s teensy based, and teensy based devices that report themselves as serial might not get properly recognized. will investigate later.
here is how it works: first, you use an op to assign a script to a MIDI event. then, whenever an event is received, it will execute the assigned script. additional ops allow you to get specific event details - note, velocity, controller number/value etc.
MI.$ event_type
MI.$ event_type script
assign a script to an event or get the currently assigned script
event_type is one of the following:
0 - all events
1 - note on
2 - note off
3 - controller change
4 - clock
5 - start
6 - stop
7 - continue
the clock is not supported for now (need to figure out how it should work, more details later).
if there is no script assigned to a given event type it returns -1.
similarly, if you want to remove the assigned script, just assign any value outside of 1…10 range.
if you want to remove all assigned scripts do MI.$ 0 -1
once the assigned script is triggered, you can use the following ops to get the details:
MI.LE
get the latest event type - useful when multiple events are assigned to the same script
MI.LCH
get the latest channel
MI.LN
get the latest note on 0…127
MI.LNV
get the latest note on scaled to teletype range (shortcut for N MI.LN
)
MI.LV
get the latest velocity 0…127
MI.LVV
get the latest velocity scaled to 0…16383 range (0…+10V)
MI.LO
get the latest note off
MI.LC
get the latest controller number
MI.LCC
get the latest controller value
MI.LCCV
get the latest controller value scaled to 0…16383 range (0…+10V)
now comes the tricky part. in order to make teletype being able to handle other tasks, scripts assigned to MIDI events are triggered only every 50ms. this means it’s possible more than one MIDI event happened since the last time a script was executed - think chords or multiple knobs turned etc.
you can still process all these events properly, but you’ll want to do it in a loop. and since you’ll likely use a loop the ops that return event details for each event use I
variable as the index. for instance, to send all midi note on events to just friends you could simply do:
L 1 MI.NL: JF.NOTE MI.NV MI.VV
what this means: send a note to just friends for each note on event. the event count gets reset each time the assigned script is executed.
MI.NL
get the number of note on
events
MI.NCH
get the note on event channel at I
index
MI.N
get the note on at I
index
MI.NV
get the note on at I
index scaled to 0…+10V range
MI.V
get the velocity at I
index
MI.VV
get the velocity at I
index scaled to 0…+10V range
MI.OL
get the number of note off
events
MI.OCH
get the note off event channel at I
index
MI.O
get the note off at I
index
MI.CL
get the number of controller events
MI.CCH
get the controller event channel at I
index
MI.C
get the controller number at I
index
MI.CC
get the controller value at I
index
MI.CCV
get the controller value at I
index scaled to 0…+10V range
included in the latest beta posted here: Teletype 3.2+ feature requests and discussions
changelog
- new ops:
MI.LCH
,MI.NCH
,MI.OCH
,MI.CCH
,MI.LE
[2] - changed script timer to run every 25ms [2]
- rebased on the latest beta firmware [2]
- fixed a bug where assigning a script to all events (
MI.$ 0 x
) didn’t work [3] - added new ops:
MI.CLKD
,M.CLKR
for devs, the branch is here: GitHub - scanner-darkly/teletype at midi_in