No internet connection
  1. Home
  2. Tutorials

How to control volume faders in Pro Tools using a MIDI controller.

Enable SoundFlow HUI Output

To set up the SoundFlow HUI with a valid MIDI input.

  • Click the menu "Setup → MIDI → MIDI Input Devices..." and the following dialog will appear:

  • Make sure that the "SoundFlow HUI Output" is checked, and then click "OK".

1. Setting up “SoundFlow HUI Peripherals…”

First, we'll need to make the connection between Pro Tools and SoundFlow's HUI device emulator.

  • In Pro Tools, Click the Settings menu and then select “Peripherals…
  • Choose the “MIDI Controllers” tab. It should look like this;

  • In slot “#1”, under “Type: none”, click the drop-down and choose "HUI".

  • In the “Receive From” drop-down, choose "Predefined → SoundFlow HUI Output".

  • In the "Send To" column, choose "Predefined → SoundFlow HUI Input".

Your settings should now look like this;


Make sure you click OK to save your settings.

You have now successfully set up SoundFlow's HUI emulator.

2. Creating the SoundFlow Command

The next step we need to take is to create the SoundFlow command that receives input from your MIDI device and forwards it as HUI messages to SoundFlow's emulator.

a. Creating the command

First, let's create a new command and call it “MIDI Faders”.

  • Navigate to the Default Package under the Custom Commands section. Press "Cmd+N" or click the "+New" button and select "Script".

*Enter "MIDI Faders" into the Name box and hit OK.


You should now have a command selected in your Default Package named "MIDI Faders".

b. Assigning the MIDI trigger

Now let's assign your MIDI device to this command so that the command gets run every time SoundFlow receives a MIDI message from the device.

  • Make sure the "MIDI Faders" command is selected, then click the "New Trigger" button in the "Command Triggers" section.

  • Select “Midi Trigger” from the dropdown menu.

  • In the popup window, Set when these apps are focused to “All apps”

  • By having “When these apps are focused” set to "All apps" we make sure that we can still control the faders even if Pro Tools is not in the foreground.

  • Select the Midi Device you would like to use by clicking on "Select Midi Device".

*Click "RECORD" Then move a fader on your MIDI device and it should register.

Your Trigger settings will look similar to this;

c. Adding code to the script.

Now that you've created your command and assigned a trigger, paste the following code into the script editor (ie the bottom right section of the SoundFlow app):

const firstFaderCC = 7;
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,
   });
}

You'll notice two important numbers in the first two lines.

  1. The first is variable const firstFaderCC = 7;, which specifies the CC number for the first fader in your MIDI device.
  2. The second is const numberOfFaders = 8;, which specifies the number of available faders.
  • So here we are assuming that the faders on your MIDI device all send CC messages from #7=Fader1, #8=Fader2, #9=Fader3, etc. all the way up to #14=Fader8.

  • If the faders on your MIDI device sends from different ranges of CC, then you can simply change the mapping by changing the number 7

That's it, we have now pasted the code. You don't need to hit Save or anything, the code is automatically saved and available.

Testing our new command

We're now ready to switch over to Pro Tools.

  • In the Pro Tools Edit window, select the first track that you want to map our 8 faders to, by "Ctrl+Shift clicking" the track's title with your mouse. Pro Tools will then display blue borders on the mapped tracks to signal that the HUI device is now controlling those faders.

Now when you move the faders on your MIDI device you should be able to see the track's volume go up and down accordingly.