By Alex E @Alex_E
Hi all,
I would like to be able to select specific MIDI inputs for MIDI tracks via stream deck buttons.
The soundflow inbuilt action "Select Input Routing" does what I want but doesn't seem to work for MIDI tracks. Any help or advice on how to modify this to work with MIDI tracks would be much appreciated. Thank you

- Chris Shaw @Chris_Shaw2024-04-18 19:05:43.359Z2024-04-18 20:30:00.752Z
This script should do it.
Just change themidiInputPath
for your desired MIDI Input:const midiInputPath = ["Predefined", "SoundFlow Custom Midi Output 1", "channel-1"]; /** * @param {String[]} midiInputMenuPath */ function setMidiTrackInput(midiInputMenuPath) { const tracks = sf.app.proTools.tracks.invalidate().allItems; const firstSelectedTrack = tracks.filter(track => track.isSelected)[0]; //Check if selected track is a MIDI track if (firstSelectedTrack.type !== "Midi") { sf.interaction.notify({ title: "Selected track is not a MIDI track" }); throw 0 }; //Ensure track I/O is visible sf.ui.proTools.menuClick({ menuPath: ["View", "Edit Window Views", "I/O"], targetValue: "Enable" }) //Ensure track is visible in Edit window sf.ui.proTools.trackGetByName({ name: firstSelectedTrack.name }).track.trackScrollToView() // Define MIDI input popup menu button const midiIo = sf.ui.proTools.selectedTrack.groups.whoseTitle.is("MIDI IO").first; const midiInputBtn = midiIo.buttons.whoseTitle.startsWith("MIDI Input selector").first; // Select MIDI input midiInputBtn.popupMenuSelect({ menuPath: midiInputPath }) } setMidiTrackInput(midiInputPath)
Chris Shaw @Chris_Shaw2024-04-18 19:20:50.456Z
This script will throw an error if the track I/O column isn't visible.
Chris Shaw @Chris_Shaw2024-04-18 19:23:41.055Z
Never mind, I added some code to ensure the I/O is visible
- AAlex E @Alex_E
Thanks so much Chris! Works great