MIDI Communication

MIDI  MIDI  MIDI  MIDI  MIDI  MIDI  MIDI 

I feel like at some point I should find a better way to create communication between sound systems and other engines but for now, lets review how MIDI works and what I can use for this project in particular.

So MIDI protocol allows specific messages to be sent and received through a MIDI channel or device. These messages coincide with those that are sent by keyboards and MIDI controllers and so most engines have a way to connect these messages to control parameters and functions.

Specifically in Music or sound related systems, the MIDI protocol is very helpful, Note On/Off messages for example, sent specific Note information with the velocity of each note being played, allowing for semi realistic playing coming from virtual instruments not being played live.

For our purposes however, we are much more interested in CC or control change messages, which allow us to send messages about what we need an specific value to be. Even though most of the channels values in CC are mapped out in the MIDI protocol, if we are sending messages to a synthesis software like VCV we can use the CC to control specific parameters as we mentioned in the previous post.

SO HOW DO WE USE MIDI MESSAGES    

At this point we are unsure as to which engine we will use for the final project (either TD or Unreal) so I'm going to explain how to do MIDI messages in both ... Weehee!

TouchDesigner:

Alright this one is easy, I've done some work using TD and MIDI together in the past, there is a "midiout" CHOP, that sends a particular message and value to the selected device, as long as we have previously made sure that the default MIDI device is our connection, for this program we are using LoopBe1 (a free virtual MIDI cable controller).

As for specifications, there are a couple things to note, first, MIDI communicates using values from 0-127, but the midiout CHOP allows us to select if we want values to be normalized (0 to 1 or -1 to 1 values instead of the standard 0 to 127). 

The key factor to take note when using midiout is that the address to which the message is being sent and the selected control to be changed, are set through the name of the channel in which the value changes. Which means it's necessary to use a "rename" CHOP function that sets the address correctly.

 A screenshot of a computer program

Description automatically generated

Unreal:

Unreal works similarly, in theory at least. However, we need to make sure that the required plugins are installed in our project. Looking through, the MIDI Device Support plugin adds the functions that we will call later on, but we will also need the "Sound Utilities" plugin

We need to make sure that the code we are running uses the correct device to send the message. We can configure the address through ID and the parameters of the project, but we can also call it directly by name to make sure we are sending the message to the correct address.  

After selecting the correct Output Device, we need to create a MIDI Device Output controller and transform the Device's ID into a variable. Which in turn will open the MIDI Device Output Controller functions. Among them the MIDI Control Change that works the same as it does in TD without the option to normalize.

 A screenshot of a computer program

Description automatically generated

Comments

Popular Posts