Hello SF Community!
Question for @Kitch and/or @samuel_henriques: I'm wondering how to select the options in this lesser-used menu found in midi tracks (please see below screenshot)
I'd like to select X number of MIDI tracks and have them cascade their single-note views across selected tracks, ideally starting at the first track that's already assigned.
I've tried implementing this action: https://soundflow.org/store/pkg/pick-path-from-popup-menu
and attempted to modify this script: Cascade outputs on Master Faders but I haven't been successful just yet.
Thanks so much for the help!

- samuel henriques @samuel_henriques
Hello Curtis,
Try this
function setSelectedMidiTracksHeightSingleNote() { const track = sf.ui.proTools.selectedTrackHeaders; track.forEach(track => { if (track.title.value.endsWith("- MIDI Track ") || track.title.value.endsWith("- Inst Track ")) { track.trackScrollToView(); let trackHeightPos = { x: track.frame.w - 10, y: 5 }; const popupMenu = track.popupMenuOpenFromElement({ relativePosition: trackHeightPos, isRightClick: true, }).popupMenu; popupMenu.menuClickPopupMenu({ useWildcards: true, menuPath: ["single note", "*"] }); }; }); }; setSelectedMidiTracksHeightSingleNote();
Curtis Macdonald @Curtis_Macdonald
Thanks Samuel! I can see the script selecting the "single note" menu on a MIDI track, but it doesn't select a single MIDI note, like A-2 for example, like in the photo above. Is it possible to incrementally select each midi note when running a script like this?
Thanks again, so much.
samuel henriques @samuel_henriques
I might be misunderstanding what you need.
On mine it will go to each track and select the first from the single note menu.
I just made an update to work with inst tracks as well.
Check out this screen capture I made:
https://youtu.be/PiVTXQkANEoLet me know what i'm missing
Curtis Macdonald @Curtis_Macdonald
Thanks Samuel, when I run this script, I see the view change to single note, but it doesn't actually select a specific midi note in that single-note view. I've made a GIF that shows what I'm trying to do. It's basically a workaround for the "Select/Split Notes" to "A New Track Per Pitch" in the Event Operations Window that rarely works as you'd expect it to.
I really appreciate all your support and help, as always! Thanks again.
Curtissamuel henriques @samuel_henriques
Would that mean the script would have to figure out what notes exist in the track, and then create a new track foe each and set visibility for the note?
I tried the Event operations copy to new track and works if "all notes" is selected in "pitch criteria" and I need to make sure the track is selected but no note is selected.
I could try a script to handle these steps.Curtis Macdonald @Curtis_Macdonald
That would be more than necessary!
I’m more interested in a script that automatically increments single note views to help aid in template creation, it doesn’t need to detect the notes :)
Good observation in the behavior of the event operation, I’ll keep playing with it, seems like at best it only splits up to 12 notes onto separate tracks…
samuel henriques @samuel_henriques
How would you know what notes are on a track without manually selecting them?
Should it just select all in the octave 1 menu and then octave 2?
Or Start by octave 8, then 7?Curtis Macdonald @Curtis_Macdonald
Yes! A ascending sequential selection starting at octave -2 would be ideal! Bonus if the tracks names reflected the midi note or perhaps inserted in the track comments?
samuel henriques @samuel_henriques
Here you go, let me know how it works.
const octaveMenuPaths = [ [ "single note", "Octave -2", "C-2" ], [ "single note", "Octave -2", "C#-2" ], [ "single note", "Octave -2", "D-2" ], [ "single note", "Octave -2", "Eb-2" ], [ "single note", "Octave -2", "E-2" ], [ "single note", "Octave -2", "F-2" ], [ "single note", "Octave -2", "F#-2" ], [ "single note", "Octave -2", "G-2" ], [ "single note", "Octave -2", "G#-2" ], [ "single note", "Octave -2", "A-2" ], [ "single note", "Octave -2", "Bb-2" ], [ "single note", "Octave -2", "B-2" ], [ "single note", "Octave -1", "C-1" ], [ "single note", "Octave -1", "C#-1" ], [ "single note", "Octave -1", "D-1" ], [ "single note", "Octave -1", "Eb-1" ], [ "single note", "Octave -1", "E-1" ], [ "single note", "Octave -1", "F-1" ], [ "single note", "Octave -1", "F#-1" ], [ "single note", "Octave -1", "G-1" ], [ "single note", "Octave -1", "G#-1" ], [ "single note", "Octave -1", "A-1" ], [ "single note", "Octave -1", "Bb-1" ], [ "single note", "Octave -1", "B-1" ], [ "single note", "Octave 0", "C0" ], [ "single note", "Octave 0", "C#0" ], [ "single note", "Octave 0", "D0" ], [ "single note", "Octave 0", "Eb0" ], [ "single note", "Octave 0", "E0" ], [ "single note", "Octave 0", "F0" ], [ "single note", "Octave 0", "F#0" ], [ "single note", "Octave 0", "G0" ], [ "single note", "Octave 0", "G#0" ], [ "single note", "Octave 0", "A0" ], [ "single note", "Octave 0", "Bb0" ], [ "single note", "Octave 0", "B0" ], [ "single note", "Octave 1", "C1" ], [ "single note", "Octave 1", "C#1" ], [ "single note", "Octave 1", "D1" ], [ "single note", "Octave 1", "Eb1" ], [ "single note", "Octave 1", "E1" ], [ "single note", "Octave 1", "F1" ], [ "single note", "Octave 1", "F#1" ], [ "single note", "Octave 1", "G1" ], [ "single note", "Octave 1", "G#1" ], [ "single note", "Octave 1", "A1" ], [ "single note", "Octave 1", "Bb1" ], [ "single note", "Octave 1", "B1" ], [ "single note", "Octave 2", "C2" ], [ "single note", "Octave 2", "C#2" ], [ "single note", "Octave 2", "D2" ], [ "single note", "Octave 2", "Eb2" ], [ "single note", "Octave 2", "E2" ], [ "single note", "Octave 2", "F2" ], [ "single note", "Octave 2", "F#2" ], [ "single note", "Octave 2", "G2" ], [ "single note", "Octave 2", "G#2" ], [ "single note", "Octave 2", "A2" ], [ "single note", "Octave 2", "Bb2" ], [ "single note", "Octave 2", "B2" ], [ "single note", "Octave 3", "C3" ], [ "single note", "Octave 3", "C#3" ], [ "single note", "Octave 3", "D3" ], [ "single note", "Octave 3", "Eb3" ], [ "single note", "Octave 3", "E3" ], [ "single note", "Octave 3", "F3" ], [ "single note", "Octave 3", "F#3" ], [ "single note", "Octave 3", "G3" ], [ "single note", "Octave 3", "G#3" ], [ "single note", "Octave 3", "A3" ], [ "single note", "Octave 3", "Bb3" ], [ "single note", "Octave 3", "B3" ], [ "single note", "Octave 4", "C4" ], [ "single note", "Octave 4", "C#4" ], [ "single note", "Octave 4", "D4" ], [ "single note", "Octave 4", "Eb4" ], [ "single note", "Octave 4", "E4" ], [ "single note", "Octave 4", "F4" ], [ "single note", "Octave 4", "F#4" ], [ "single note", "Octave 4", "G4" ], [ "single note", "Octave 4", "G#4" ], [ "single note", "Octave 4", "A4" ], [ "single note", "Octave 4", "Bb4" ], [ "single note", "Octave 4", "B4" ], [ "single note", "Octave 5", "C5" ], [ "single note", "Octave 5", "C#5" ], [ "single note", "Octave 5", "D5" ], [ "single note", "Octave 5", "Eb5" ], [ "single note", "Octave 5", "E5" ], [ "single note", "Octave 5", "F5" ], [ "single note", "Octave 5", "F#5" ], [ "single note", "Octave 5", "G5" ], [ "single note", "Octave 5", "G#5" ], [ "single note", "Octave 5", "A5" ], [ "single note", "Octave 5", "Bb5" ], [ "single note", "Octave 5", "B5" ], [ "single note", "Octave 6", "C6" ], [ "single note", "Octave 6", "C#6" ], [ "single note", "Octave 6", "D6" ], [ "single note", "Octave 6", "Eb6" ], [ "single note", "Octave 6", "E6" ], [ "single note", "Octave 6", "F6" ], [ "single note", "Octave 6", "F#6" ], [ "single note", "Octave 6", "G6" ], [ "single note", "Octave 6", "G#6" ], [ "single note", "Octave 6", "A6" ], [ "single note", "Octave 6", "Bb6" ], [ "single note", "Octave 6", "B6" ], [ "single note", "Octave 7", "C7" ], [ "single note", "Octave 7", "C#7" ], [ "single note", "Octave 7", "D7" ], [ "single note", "Octave 7", "Eb7" ], [ "single note", "Octave 7", "E7" ], [ "single note", "Octave 7", "F7" ], [ "single note", "Octave 7", "F#7" ], [ "single note", "Octave 7", "G7" ], [ "single note", "Octave 7", "G#7" ], [ "single note", "Octave 7", "A7" ], [ "single note", "Octave 7", "Bb7" ], [ "single note", "Octave 7", "B7" ], [ "single note", "Octave 8", "C8" ], [ "single note", "Octave 8", "C#8" ], [ "single note", "Octave 8", "D8" ], [ "single note", "Octave 8", "Eb8" ], [ "single note", "Octave 8", "E8" ], [ "single note", "Octave 8", "F8" ], [ "single note", "Octave 8", "F#8" ], [ "single note", "Octave 8", "G8" ] ]; function promptStartingNote() { return sf.interaction.popupSearch({ items: octaveMenuPaths.map((name, index) => ({ name: `${name[1]} ${name[2]}`, index: index })), columns: [ { name: 'Note', key: 'name', width: 100 } ], title: "Select Starting note..." }).item; }; function setCommentsView() { const commentsView = sf.ui.proTools.getMenuItem("View", "Edit Window Views", "Comments").isMenuChecked; if (!commentsView) { sf.ui.proTools.menuClick({ menuPath: ["View", "Edit Window Views", "Comments"], targetValue: "Enable" }) }; }; function setComment(trackHeader, text) { setCommentsView(); var commentsField = trackHeader.textFields.whoseTitle.startsWith('Comments').first; commentsField.mouseClickElement({}, "Failed to set comments."); sf.keyboard.press({ keys: 'cmd+a' }); sf.keyboard.type({ text: text }); sf.keyboard.press({ keys: 'return' }); }; function setSelectedMidiTracksHeightSingleNote() { const startNoteIndex = promptStartingNote().index; sf.ui.proTools.appActivateMainWindow(); const midiTracks = sf.ui.proTools.selectedTrackHeaders.filter(trackType => trackType.title.value.endsWith("- MIDI Track ") || trackType.title.value.endsWith("- Inst Track ") ); for (let i = 0; i < midiTracks.length; i++) { const menuPath = octaveMenuPaths[startNoteIndex + i] midiTracks[i].trackScrollToView(); let trackHeightPos = { x: midiTracks[i].frame.w - 10, y: 5 }; const popupMenu = midiTracks[i].popupMenuOpenFromElement({ relativePosition: trackHeightPos, isRightClick: true, }).popupMenu; popupMenu.menuClickPopupMenu({ menuPath: menuPath, }); // Set cmments setComment(midiTracks[i], `${menuPath[1].split(" ")[1]} ${menuPath[2]}`) }; // Select originaly selected midi/inst tracks sf.ui.proTools.trackSelectByName({ names: midiTracks.map(n => n.normalizedTrackName) }) }; sf.ui.proTools.invalidate(); setSelectedMidiTracksHeightSingleNote();
samuel henriques @samuel_henriques
UPDATED just now. Forgot the set oct + note in comments.
Curtis Macdonald @Curtis_Macdonald
Yes that's it! Wow you just saved me thousands of clicks—THANK YOU!
Question: Is it possible to configure the script to have two basic options? a) begin at 'X' MIDI note, and b) choose between ascending/descending?
I of course understand if this is asking too much, you've already saved me a lot of time and I appreciate this script as-is. Thank you again Samuel!
samuel henriques @samuel_henriques
Great its working.
Just made an update so you'll get a prompt to choose which note you want to start from.Hope this is it.
Curtis Macdonald @Curtis_Macdonald
Works like a charm, this is so very helpful. Thank you again Samuel! Really appreciate it :)