🔥 Lifetime deal! Get Control Surface Studio for Just £67 👉 Click Here To Get It
Time left... mailtimers.com
⚠️ Lifetime licenses are ending soon, get yours before they're gone ⚠️
Your shopping cart is empty.

Track numbering

Submitted by Christian Björklund on Sat, 12/25/2021 - 21:21
Christian Björklund
Control Surface Studio User

Hello!

I'm wondering if there is a way to ignore tracks inside groups completely when numbering them, no matter if they are folded or not? See the included image for example.

It seems that I can either get numbering that changes when tracks are unfolded, or just count every single track ("Include folded tracks") but I wanted to count just the main group tracks and any track that's at "root" level. At the moment I'm doing this at initialization:

self.set_modifier_value("m1", 0)
self.set_modifier_value("m2", 4)
self.set_modifier_value("m3", 8)
self.set_modifier_value("m4", 12)
self.set_modifier_value("m5", 16)
self.set_modifier_value("m6", 17)
self.set_modifier_value("m7", 18)
etc...

..and this works fine for my current project, starting with four groups and then a few single tracks, but if I would add or remove a track inside any of these groups it would be all wrong.

upload files: 
Topic Category: 

5 Responses

Comments

Christian Björklund
Control Surface Studio User
#1

This has to be possible! I just managed to make a Reaction that loops through and folds all tracks at initialization. (Apparently this required an "only continue if track is foldable"-check otherwise it gets stuck, but then that worked.

So now I had some idea that I should be able to loop through all channels and kind of set the modifiers every time a channel is visible or something.. but my brain hurts and I'm starting to think this is a dead end.

(I did manage to set up a Reaction that loops through all channels and matches modifiers to channel names, so If I just name my channels accordingly, that works, but it's slightly less elegant)

Christian Björklund
Control Surface Studio User
#2

I just realized, even if I get this counting thing to work, it won't be pretty since the script would have to run any time a track is added/removed/moved and that would mean that it would fold any unfolded group as soon as you do that. I guess it's alright but not ideal.

Ideal would be to be able to just check if a channel is inside a group or not, but I can't see any way to know that.

Christian Björklund
Control Surface Studio User
#3

Got it! After checking out the list/loop tutorial on youtube again I realized how this can be done. It took a while to get it right though so I uploaded a script with just the Reaction. (Reactions can be moved between scripts in the editor)

To clarify, for live situations I always wanted my Launch Control XL to represent the first eight tracks, no matter if I unfold a group, and always ignore tracks inside groups. This to me makes the most sense when using classic knobs and faders.

1. Listeners are when script is initialized and when the song's track value changed. (add/remove/move channel)
2. Clear custom list 1 and 2
3. Loop through all tracks, check if tracks are unfolded and store the loop number (which represents the track number) in list 1, then set fold state to 1 so all of the are folded
4. Loop through all track, check if tracks are visible and store the loop number in list 2.
5. Store each list item in separate modifiers.
self.set_modifier_value("m1", self.get_list_item("list2", 1))
self.set_modifier_value("m2", self.get_list_item("list2", 2))
self.set_modifier_value("m3", self.get_list_item("list2", 3))
etc. until m8 in my case. This could be a for loop if we want to get fancy. (I tried to just loop through list 2 but don't seem to be possible to choose modifier number based on loop number.)
6. Loop through List 1 and do this to re-unfold the tracks that wasn't folded from the beginning.
self.song().tracks[self.get_list_item("list1", loop_number)].fold_state = 0

upload files: 
xoni2
Control Surface Studio User
#4

This was incredibly helpful. Thank you for sharing.

halbander
Pro User
#5

Appreciate it, really helpful, thanks!