Hello! I would like to share a really useful project logical editor script which helps you to hide/unhide all muted tracks in a projec. I hope it will be useful to one’s workflow.
Here’s How It Works:
Mute tracks you don’t want to see
Press “A” button to hide those tracks.
Compose some music and mute some more tracks you don’t wanna see anymore again.
Press “A” button to hide newrly muted tracks again
Finally press “B” to reveal all the muted tracks you’ve hidden with “A” button all at once.
Well, it’s not really a “toggle”, just 2 separate “Show” and “Hide” buttons. But if someone more experienced knows how to make (1)“Hide Muted Tracks” + (2)“If there are more muted visible tracks - hide them” + (3)“If there’re no muted tracks visible - reveal the muted hidden ones” to be toggled with one button, please let me know!
Cheers!!
You can go this way obviously, but then you can’t show/hide in “installments” as you like. (which is hide some muted tracks, then work some more, mute some more, hide them etc)
Second best would be (for me), to have to separate commands, Show Muted Tracks and Hide Muted Tracks to do just that, alternating between them whenever you like, exactly as you’re doing right now.
To have a button do what you like, I think there would need to be a way to specify the condition “If there are muted tracks already hidden, and muted tracks still showing, hide the ones that are still showing”, so that the command could work as a toggle.
(Because now, with the toggle command on the beginning of the post, you mute and hide 4 tracks, perfect. Give the command, they show, perfect. Hide them again, perfect. Now mute some other tracks and give the command, uh-oh. The newly muted ones hide, the old ones show up.)
If you can remember to show them all before muting new ones, it’s one way to go. Otherwise, you need separate Show and Hide commands, in my opinion.
2 hours later, I still can’t think of an “on demand” visibility flip that keeps this a single toggle command. Good thing I’m not a programmer or I’d be really disappointed in myself right now.
I’m wondering if we could emulate the “if” by first passing through a PLE filter, and then execute a macro. I suppose that when the filter fails to return true then the macro part is not executed either?
So:
First command, a PLE script. “Check if visible muted tracks exist and select them”. No action in the PLE, just a macro to hide those selected tracks.
Then a second command, toggle visibility of hidden and muted tracks.
When the first command fails (because PLE can’t find any visible muted tracks), it would jump right to the visibility toggle command. (I hope, IF macros fired through the PLE are dependent on the Filter Conditions)
The disadvantage of this is, you would need to unselected all tracks before this check. And you would need to unselected all tracks even after the whole macro. Or you would need to create one more before and after step, something like:
If track is select, append “selected” to the track name.
And after the whole macro:
Is track name contains “selected”, select the track and delete the “selected” from the track name.
But in general, if the Project Logical Editor doesn’t return True, the process is not executed. Be aware, the PLE doesn’t apply for the tracks as the whole. It takes tracks one by one, test it and if the condition returns true, then the action is executed on the track.