Help with Sysex to Control Bus Sends with MIDI

M/X Air Digital Mixer Series
Post Reply
kmitchell
Posts: 244
Joined: Fri Apr 16, 2021 6:15 pm

Help with Sysex to Control Bus Sends with MIDI

Post by kmitchell »

One of the key things missing with the MIDI implementation is the ability to control bus sends. I'm working on a way to use Sysex to send OSC over MIDI. I've been using @pvannatto 's Sysex Generator as a reference and that's how I figured out that I need to send values as text strings instead of integers or floats. This is kind of where I'm stuck.

Let's say I have a fader that goes from 0-1. Normally, I'd just send an OSC message with the value as a float. With the Sysex method, I have to convert 0-1 to a dB level between -inf and +10 and then make it a string. The last part is easy, it's the value mapping I'm struggling with.

Any guidance would be appreciated.

EDIT: Just wanted to add that I have the basic generator code working and I can send a Mute ON or OFF message via Sysex. Celebrating life's little victories.
User avatar
pvannatto
Posts: 1352
Joined: Wed Apr 14, 2021 3:48 pm
Location: Ontario, Canada

Re: Help with Sysex to Control Bus Sends with MIDI

Post by pvannatto »

kmitchell wrote: Mon Mar 18, 2024 4:27 pm it's the value mapping I'm struggling with.
Patrick has that already done and is included in the X32 OSC Protocol doc (page 132). Here is a copy of that page

The paragraphs below show a C‐like conversion to go from [0.0, 1.0] to dB [‐90 , +10] with value 0 matching –oo,
and vice‐versa. This can be useful to map with other programs or tools used, or for programmers who need to
match the float values returned by OSC functions to dB values in their programs.
// float to dB
// “f” represents OSC float data. f: [0.0, 1.0]
// “d” represents the dB float data. d:[-oo, +10]
if (f >= 0.5) d = f * 40. - 30.; // max dB value: +10.
else if (f >= 0.25) d = f * 80. - 50.;
else if (f >= 0.0625) d = f * 160. - 70.;
else if (f >= 0.0) d = f * 480. - 90.; // min dB value: -90 or -oo61.

// dB to float
// “d” represents the dB float data. d:[-90, +10]
// “f” represents OSC float data. f: [0.0, 1.0]
if (d < -60.) f = (d + 90.) / 480.;
else if (d < -30.) f = (d + 70.) / 160.;
else if (d < -10.) f = (d + 50.) / 80.;
else if (d <= 10.) f = (d + 30.) / 40.;

// Optionally round “f” to a X32 known value
f = int(f * 1023.5) / 1023.0;62
Paul Vannatto
Global Moderator
kmitchell
Posts: 244
Joined: Fri Apr 16, 2021 6:15 pm

Re: Help with Sysex to Control Bus Sends with MIDI

Post by kmitchell »

Thanks Paul. I'll review this and post any questions I might have.

Ken
kmitchell
Posts: 244
Joined: Fri Apr 16, 2021 6:15 pm

Re: Help with Sysex to Control Bus Sends with MIDI

Post by kmitchell »

Thanks again @pvannatto .

I got the bus sends working but now I'm looking into bus send pan. It's my understanding that this allows a channel send to be panned to an odd bus. While using SYSEX to control the mixer it still sends OSC updates to X-Air Edit, so I can see when the SYSEX is working. However I can find send panning in X-Air Edit.

An example OSC command is '/ch/15/mix/01/pan' with a value of -100 to 100. Where would that be seen in X-Air Edit? The OSC spec says this is only valid for sends 01, 03, and 05.

I'm clearly missing something.
User avatar
pvannatto
Posts: 1352
Joined: Wed Apr 14, 2021 3:48 pm
Location: Ontario, Canada

Re: Help with Sysex to Control Bus Sends with MIDI

Post by pvannatto »

kmitchell wrote: Wed Mar 20, 2024 8:27 pm Where would that be seen in X-Air Edit?
Stereo link a bus pair. Then select a channel and go to the Sends screen. Just above the faders and just below the scribble strips is the pan to that stereo linked bus pair.
kmitchell wrote: Wed Mar 20, 2024 8:27 pm The OSC spec says this is only valid for sends 01, 03, and 05.
According to the wiki X-Air OSC, text values (which SYSEX uses) are in the range of -100 and +100.
Paul Vannatto
Global Moderator
kmitchell
Posts: 244
Joined: Fri Apr 16, 2021 6:15 pm

Re: Help with Sysex to Control Bus Sends with MIDI

Post by kmitchell »

pvannatto wrote: Wed Mar 20, 2024 9:28 pm
kmitchell wrote: Wed Mar 20, 2024 8:27 pm Where would that be seen in X-Air Edit?
Stereo link a bus pair. Then select a channel and go to the Sends screen. Just above the faders and just below the scribble strips is the pan to that stereo linked bus pair.
kmitchell wrote: Wed Mar 20, 2024 8:27 pm The OSC spec says this is only valid for sends 01, 03, and 05.
According to the wiki X-Air OSC, text values (which SYSEX uses) are in the range of -100 and +100.
Duh. Thank you Paul. Of course it has to be a stereo linked bus pair before I can see it. I'll bookmark this answer so I don't ask the same question a year from now.

Thanks again.
Post Reply

Return to “M/X-Air Digital Mixers”