Hi There, I do not know java at all and trying to create scripts for ADR style recording. I tried to find something similar and make it my own but just need a little help. I just want a script that can mute/unmute tracks when transport goes into record and or playback.
Thanks
- Ddanielkassulke @danielkassulke
Hi Aaron,
Here's a script that does what you want, with a big caveat: the script will keep running forever because it has to constantly evaluate whether pro tools is recording or stopped, which might inhibit your ability to use trigger other soundflow actions at the same time:
sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.invalidate(); while (true) { sf.ui.proTools.invalidate(); const allTrackNames = sf.ui.proTools.trackNames; // track name to unmute in line below const matchingTrackNames = allTrackNames.filter(name => name === "your track name here"); if (matchingTrackNames.length > 0) { if (sf.ui.proTools.isPlaying) { sf.app.proTools.setTrackMuteState({ trackNames: matchingTrackNames, enabled: true }); } else { sf.app.proTools.setTrackMuteState({ trackNames: matchingTrackNames, enabled: false }); } } sf.wait({ intervalMs: 100 }); }I've happily used a surface/deck button as a latching talkback mute/unmute toggle, which frees up soundflow:
sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.invalidate(); // track to unmute here const trackName = "your track name here"; if (sf.ui.proTools.trackNames.includes(trackName)) { const track = sf.ui.proTools.trackGetByName({ name: trackName, makeVisible: true }).track; const muteButton = track.buttons.getByTitle("Mute"); const muteStateValue = muteButton.invalidate().value.value; const isMuted = muteStateValue === "on state"; sf.app.proTools.setTrackMuteState({ trackNames: [trackName], enabled: !isMuted }); }- AAaron Hasson @Aaron_Hasson
This is awesome thank you. Can I ask one more thing? How can I have it so the track mutes on Record?
- Ddanielkassulke @danielkassulke
Hi Aaron,
Within the first script on line 8, you need to add the track name that you want to mute. The second script asks the same on line 5. As I mentioned, the first script will do that for you, with a big functional caveat for soundflow usage. Using a script that is always listening to a track's record enabled state means that soundflow is constantly running that script, and must be manually stopped by you. During that runforever script, any other soundflow scripts you attempt to run may not work, or may be unreliable.
- AAaron Hasson @Aaron_Hasson
Yes Your second script is really how I want the script to behave; when PT goes into record sound flow sends a mute command to a track. So on your second script how can I change the mute state uppon record and not play?
Thank you very much
- AIn reply toAaron_Hasson⬆:Aaron Hasson @Aaron_Hasson
Hi Daniel,
Actually, if I use your second script and hit the button twice the mute is now off; so that will not work.
Is there is a way to:
If Transport is in record certain tracks mute and if the transport is in play certain tracks mute.