Getting an error in "How to control volume faders in Pro Tools using a MIDI controller. "
Hey,
I went through the step by step on how to control the volume faders with midi, but when I run the command I get the following error:

- Christian Scheuer @chrscheuer2021-12-21 14:00:41.900Z
Hi Ryan,
I just checked your account. It looks like you may be trying to run this script by clicking Run Command?
The idea is that you need to add a MIDI trigger to the command (MIDI Faders) so that the script will be run every time MIDI is received.
You're seeing this error because the script tries to read which MIDI was received, but it can't since it's not being run by a MIDI trigger.
- RRyan Allam @Ryan_Allam
Thanks!!!!!!!!
- RIn reply toRyan_Allam⬆:Ryan Allam @Ryan_Allam
Hey Chris,
My first CC number is 74 instead of 7. So I replaced that in your code and now only the first fader is working. The reason being, my faders aren't numbered with a + 1 increment. My numbers are the following:
Fader 1: 74
Fader 2: 71
Fader 3: 81
Fader 4: 91
Fader 5: 16
Fader 6: 80
Fader 7: 19
Fader 8: 2I'm assuming that this part of the code is giving number 75 to the second fader correct?
But my 2nd midi number is 71 instead.
I changed it to the following but it stopped working and now when I move fader one I get an errorerror is:
Christian Scheuer @chrscheuer2021-12-21 17:43:08.318Z
Gotcha, yea we can fix that. Can I get you to copy/paste the code in here so I can take a look?
(see this for help: How to quote code in the SoundFlow forum. )
Christian Scheuer @chrscheuer2021-12-21 17:48:20.937Z
Nevermind, I wrote it from the image you sent and made some changes so that it should support faders with arbitrary CC numbers.
const ccNumbers = [ 74, 71, 81, 91, 16, 80, 19, 2 ]; let m = event.trigger.midiBytes; let m0 = m[0], m1 = m[1], m2 = m[2]; if (m0 == 0xB0) { let ccIndex = ccNumbers.indexOf(m1); if (ccIndex >= 0) { let val = m2 * 127; sf.midi.huiFader({ faderNum: ccIndex + 1, value: val, touchAndRelease: true, }); } }
- RIn reply toRyan_Allam⬆:Ryan Allam @Ryan_Allam
That's your original code.
const firstFaderCC = 74;
const numberOfFaders = 8;let m = event.trigger.midiBytes;
let m1 = m[0], m2 = m[1], m3 = m[2];if (m1 == 0xb0 && m2 >= firstFaderCC && m2 <= (firstFaderCC + numberOfFaders - 1)) {
let val = m3 * 127;sf.midi.huiFader({
faderNum: m2 - firstFaderCC + 1,
value: val,
touchAndRelease: true,
});
} - RIn reply toRyan_Allam⬆:Ryan Allam @Ryan_Allam
that's what I tried to do:
const firstFaderCC = 74;
const numberOfFaders = 8;let m = event.trigger.midiBytes;
let m1 = m[0], m2 = m[1], m3 = m[2];if (m1 == 0xb0 && m2 >= firstFaderCC && m2 <= (firstFaderCC + numberOfFaders - 1)) {
let val = m3 * 127;sf.midi.huiFader({
faderNum: m2 - firstFaderCC - 3,
value: val,
touchAndRelease: true,
});
} - RIn reply toRyan_Allam⬆:Ryan Allam @Ryan_Allam
Thanks for the code!
Still, only the one fader work whenever I "Ctrl" + "Shift" + Click BUT here's the new thing :
It's always the midi trigger that works. For example, If I use my 3rd midi knob (that has a value 81) for the midi trigger, then only the 3rd fader will work. If I use the first midi knob then it's only the first fader that works.Christian Scheuer @chrscheuer2021-12-21 21:45:16.400Z
It sounds like you're using the RECORD button when you create your MIDI trigger. That would bind the MIDI trigger to a specific fader. Make sure that All Channels and All Events is selected
- RIn reply toRyan_Allam⬆:Ryan Allam @Ryan_Allam
No, I got All channels. The way I resoled it is by creating 8 different Midi scripts one for each fader. It worked :) I know it's not ideal but for now it's fine.
Quick question, is it possible to link midi knobs to the EQ7 in Pro Tools? I would need that much more than volume. Is it doable?Christian Scheuer @chrscheuer2021-12-22 11:01:15.055Z
Hi Ryan,
There's no need to create more than one script. Your MIDI triggers here haven't selected All Channels and All Events. Note that "All Events" is the most important one here.
The only thing that should be selected in your trigger is the MIDI Device.
Christian Scheuer @chrscheuer2021-12-22 11:01:48.113Z
Your entire trigger should look like this:
Christian Scheuer @chrscheuer2021-12-22 11:02:38.709Z
For now, changing plugins from MIDI is not possible, but watch this space, we may have something coming soon :) (I can't say any more though)