Set modifier as selected track number???

0

Ok im trying to set a fader to control the volume of a selected track, but then offset it.
So lets say I have 8 faders and I select track #3. I want to control track 3-11 with my 8 faders incrementally.

The way I imagine to do this is with using modifiers to make the track number the faders control.
But I need to get the track number from a reaction.

So in my volume control it controls track m1,m2 etc etc for each of the faders up to m8. that way the track number controlled is the modifier. which im going to try to make “Selected track number+1”, “Selected track number+2” etc etc.

My listener right now is:
self.song().view.add_selected_track_listener

So it triggers whenever i select a new track.

then in the action I have “self.set_modifier_value(“m1″, [….])” as modifier to set the m1
This way im setting the modifier… i hope. I’m starting to get lost here.

And then I am kind of stuck on the output on the action to set the value to be equal to the track number. Especially since it seems to only output a range based on observation.
I’m looking around all over but there seems to be no track number.

It probably looks something like self.song().view.track_number. But I do not see that command in there anywhere.

Glenn V. Answered question
0

I made a little Reaction that may be more in line with your request. You’ll still have to adjust it a bit.

The Listener

For each fader you’ll need to make a copy of this Reaction, so the Listener for each = the fader you want to use it with.

The Action

The Reaction contains one Action with the following lines of code:

fader_num = 1
track_to_control = self.get_selected_track_num() + fader_num - 1

self.song().tracks[track_to_control].mixer_device.volume.value = self.midi_cc_ch_0_val_0.cur_val

  • fader_num: needs to be changed to the number of the fader you’re programming. The first fader = 1, second fader = 2, etc.
  • track_to_control: adds fader_num to the number of the selected track.
  • Third line sets the Track Volume of track_to_control to the value of the fader’s position. Here you’ll need to change the code to the right of the equal sign (=). In other words, self.midi_cc_ch_0_val_0.cur_val needs to point to your fader. I’ll now explain how to get this.

How to get code that points to current value of a fader:

First, temporarily add a Condition:

Then select the element that points to Current Value of the Fader you’re Listening to in this Reaction. Image below shows the path to get there.

After selecting the Fader, you’ll see a line of code under the dropdown menus that contains what you need. Select the part (like I highlighted in the image below) and copy that into the third line of the Action’s code (replacing everything after the equal sign).

After you’ve done this, delete the temporary condition and save the Reaction.

How the Reaction works

Each time the Reaction is called, i.e. whenever the assigned fader is moved, it will check what the number of the current Selected Track is and add the fader_num to it.

It will then use this sum to make the Relative Track’s Volume Value equal to the Fader’s Current Value.

mitchel heijdel Edited comment

Going to be trying this later.
I currently went with a method that has a volume track thing that just uses m1 as track target and then use some total number of tracks as number of steps and then use selected track as current input and I offset the range output by 1-7 based on what m1-m7 its for.

It works… until you start nesting tracks in groups. and for some reason after you have 2 groups inside each other it just seems to not count tracks inside the 2nd group… but it changes when you minimize it. It’s really odd behaviour that I haven’t really figured out. I’m hoping your method will fix those issues.

Will report back in later to let the community know what ended up working best or if I will just have to abandon nested groups.

I haven’t messed around with grouped tracks before. If I want to understand how a Remote Script reacts with Ableton, I set up a little experimentation script.

Maybe you could make a little script that loops through all tracks and logs the name + the number of each track, then in Ableton make a set with all kinds of grouped tracks and give each an identifiable name.

There is a Condition that checks if a Track is foldable (i.e. if it’s a group track) which might help you point to certain Tracks.

I just tried what you suggested and for some reason the 3rd line of the code seems to be malfunctioning. It only seems to pass through 0 and 127 values. but on any other function it seems to work perfectly fine with my controller.

So for now I’m conluding that the “self.song().tracks[track_to_control].mixer_device.volume.value = self.midi_cc_ch_0_val_0.cur_val” part does not function or needs some way to indicate it has 128 steps in it somewhere.

EDIT: I did not proceed with testing far enough to dictate if the group offset is a thing. Will do that now just for the sake of science

EDIT2: It seems like your formula does target the right tracks regardless of nested folders.
HMMMMMMMMMMMMM….

ok so after some testing i’ve found that:

x = offset of amt of tracks with my method = the amt of tracks that are minimized inside group tracks (incl group tracks, but not counting the top level group.)

So lets say you have
0 = group
1 = track inside group
3 = group inside 1, with 2 audio tracks in them
4 = audio track inside 3
5 = audio track inside 3
6 = group track with 2 audio tracks
7 = audio track inside 6, which is inside 3, which is inside 1
8 = audio track inside 6, which is inside 3, which is inside 1

when you select track 9. when you minimize 6, it will offset the selected tracks by +2
But when you minimize 3, regardless of minimized state of 6, it will offset by 5. Despite only housing 4 audio tracks.
I assume the nested group track will end up counting.

I’m just extremely puzzled. As it would imply that the track location gets calculated for m1-m7 at a different point in time or something. But the fact the reaction to update m1-m7 is every time the fader is moved makes me very confused why it would offset when using m1-m7 compared to just doing it inside the formula.
Even more confusing is that when i do it with your formula it somehow magically rejects 1-126 velocity values for the fader input.

I’m just really confused. This should be a lot easier than it is.

ok so there’s a “self.song().tracks[0].is_visible”
Now I just have to figure out how to get it to look through all tracks and count them.
I assume it’s a loop of some kind.

But it’ll end up in action somewhat like this probably maybe.

visible_tracks_count = ?????? self.song().tracks[?????].is_visible ????????
actual_track_m1 = self.get_selected_track_num() – visible_tracks_count

self.set_modifier_value(“m1”, actual_track_m1)

EDIT:
Thinking turning on a loop for self.song().tracks and then running the following action;

visible_tracks_count = self.song().tracks[loop_number].is_visible
actual_track_mod1 = self.get_selected_track_num() – visible_tracks_count

self.set_modifier_value(“m1”, actual_track_mod1)

I just feel like I’m probably just going over if there’s a visible track instead of saving them and adding them up together into 1 number.

EDIT: Ye those ones definitely break. I’m giving up for the day

EDIT 2: I forgot that my solution doesnt even measure if the hidden tracks are located before the selection or not… oh god

You are viewing 1 out of 4 answers, click here to view all answers.