Using midi CC to control tracktion engine app

I would like to control my traction engine app using midi CC coming from a midi controller. I have several screens and would like for these screens to essentially listen for CC events (ie screen 1 listens for midi CC 1 and does something when that occurs, screen 2 also listens for midi CC1 and does something else relevant to screen 2 etc…)

I saw the control surface code in the engine, and that seems like essentially what I would need (I would just need a hardcoded mapping really, no need for the ability to provide a custom mapping). However I see that Dave mentioned in this post that that code is some of the oldest code in the engine. Is there a better way of doing this rather than relying on this older code?

The problem with the ExternalController/ControlSurface code is that there are a set of hard-coded actions you can perform so it isn’t really easily extensible.

The easiest thing for you might be to simply open the juce::MidiInput and listen to messages?

Either that or you might want to create a ControlSurface and override the acceptMidiMessage method to simply do your own delegation of controls rather than trying to use the fixed actions of the ExternalController/ControlSurface classes?

1 Like

Alright thank you Dave I will give those a try and see where that gets me

@dave96 and @stonepresto
I don’t think this works on Android. The way the api works right now on Android openDevice will return null if the device was already open, either through tracktion engine or Juce and the two don’t synchronize. This is especially a problem because there isn’t a way to add Juce listeners and tracktion listeners together.
Either android should support returning the midi device that is already open with openDevice or tracktion needs a better interface to send back midi messages to a custom handler