Nice quick and simple tutorial looking at setting up and using a MIDI controller inside touchdesigner, including making our own midiMap.
So, first thing you'll need is an actual MIDI controller.
In this video we are using the AKAI pro, LPD8 pad controller
A fairly simply, low cost unit - has some amazing customization software from AKAI with it if you want to use it with music apps etc.
However, touchdesigner might be too guilty of giving us too much control over our devices.
By default the MIDI devices wont be connected or mapped within the TD environment.
At 1:26 in the video we have a look at the 'MIDI device mapper' dialog within the interface. This allows us to add midi devices to the touchdesigner environment that will be saved within the .toe file.
We simply add a new mapping and take the windows identified LPD8 in, and whatever we want out (in this tutorial we aren't going to use midi out at all).
Now, both the MIDI in CHOP and MIDI Event DAT should be showing values as defined by the midi controller.
The DAT will act as a console and print all activity on the MIDI device's serial port.
The CHOP is more of a conventional value controller as we would expect in touchdesigner. Depending on your goal - both are good.
At 3:00, One node that is still not populating is the 'Midi in map' CHOP. This is because although we have defined a MIDI device map, we have not assigned a controller device map to that channel (the one we made above about 2 minutes ago).
Adding a specific device map (in this case one we are going to make) means we can get more control over A: The MIDI buttons/sliders we have access too, B: The ability to more confidently move between different hardware setups and know that our devices will still work - MIDI device specific, not software.
From 4:00 - 6:30 we add custom value maps for our sliders (there are 8 in total on the LPD8).
So back into the Midi device mapping dialog window we go....
Midi messages are predominantly via a serial communication method, using hexadecimal language to pass data/signal. So setting up these values can seem rather nonsensical to begin with.
In simple terms, the message for the first dial on our pad is "b0 01 xx" xx denoting a changing value for what the dial is set too. In hexadecimal it can range from 00 (nothing) through to 7f (which is 127 in decimal format - the common max for midi device channels).
b0 - tells is which channel or program that the dial is currently active on, this becomes more important when accessing and utilizing the dial across more than one function based on how the pad is set up.
01 - literally tells us the index of the dial (01 for the first, 02 for the second etc through to 08)
In the device mapping page, to link our slider to the new slider variable we created, we direct touchdesigner to single out the b0 01 messages, and take whatever the value as the channel value.
In theory you could build a system that did this via the midi event DAT - but why when there is a system already built into touch? Nobody hates themselves that much!
6:30 - 10:30 The buttons are implemented. Each midi device is different, but the LPD8 specifically separates out the 'on' and 'off' of its pads to two separate channels. This is presumably to remove a software lag on button triggers. The device mapper is built to handle this.
A button, is built up of the message "90 <index> <press velocity>" for ON,
"80 <index> 7f" for OFF.
The interesting value being press velocity. With the LPD8 being a slightly higher end pad it is able to read how hard a press is on each pad. Something the midi in map CHOP allows us to utilize. (this is looked at at 10:30)
The last few minutes of the tutorial look at a super direct implementation using the fixed channel mapping from the MIDI in MAP chop.