By Andrew Scheps @Andrew_Scheps
I feel like I've seen this somewhere in the forums but I can't find it now. Is there a way to get the current status of an insert and send (bypass, mute, active etc.)?
- Christian Scheuer @chrscheuer2020-04-22 15:23:39.322Z
You can get the states like this:
/** * @param {1|2|3|4|5|6|7|8|9|10} insertNumber */ function getInsertState(insertNumber) { var val = sf.ui.proTools.selectedTrack.insertSelectorButtons[insertNumber - 1].value.invalidate().value; return { isBypassed: val.indexOf('bypassed') >= 0, isInactive: val.indexOf('inactive') >= 0, }; } /** * @param {1|2|3|4|5|6|7|8|9|10} sendNumber */ function getSendState(sendNumber) { var val = sf.ui.proTools.selectedTrack.sendSelectorButtons[sendNumber - 1].value.invalidate().value; return { isMuted: val.indexOf('muted') >= 0, isInactive: val.indexOf('inactive') >= 0, }; } log(JSON.stringify(getInsertState(1), null, 4)); log(JSON.stringify(getSendState(1), null, 4));
Christian Scheuer @chrscheuer2020-04-22 15:24:37.743Z
And if you want to pass in the track it should look for, do like this:
/** * @param {AxPtTrackHeader} track * @param {1|2|3|4|5|6|7|8|9|10} insertNumber */ function getInsertState(track, insertNumber) { var val = track.insertSelectorButtons[insertNumber - 1].value.invalidate().value; return { isBypassed: val.indexOf('bypassed') >= 0, isInactive: val.indexOf('inactive') >= 0, }; } /** * @param {AxPtTrackHeader} track * @param {1|2|3|4|5|6|7|8|9|10} sendNumber */ function getSendState(track, sendNumber) { var val = track.sendSelectorButtons[sendNumber - 1].value.invalidate().value; return { isMuted: val.indexOf('muted') >= 0, isInactive: val.indexOf('inactive') >= 0, }; } log(JSON.stringify(getInsertState(sf.ui.proTools.selectedTrack, 1), null, 4)); log(JSON.stringify(getSendState(sf.ui.proTools.selectedTrack, 1), null, 4));
Andrew Scheps @Andrew_Scheps
Brilliant, thanks!
- In reply tochrscheuer⬆:TTristan Hoogland @Tristan
Hey @chrscheuer
This is really helpful - I think because both insert + sends have two arrays
(track, insertNumber)
I'm having a bit of trouble returning the true/false info so I can fire off another function.What I'm trying to accomplish is, on a LEAD VOCAL - find out:
- Are there sends on the selected track, and if so are they active?
- If yes, select the corresponding aux tracks those sends are returning to
- Commit those tracks and the source LEAD VOCAL track
an example result then would be :
LEAD VOCAL DRY
LV PITCH SHIFT
LV REVERB #1
LV REVERB #2
LV DELAY #1Thanks!