Set modifier as selected track number???
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.
As metioned earlier, here’s a couple of Reactions that should allow you to change the Track Volume of Visible Tracks, with Faders, based on the position of the current Selected Track.
In the Reaction named “Control Track Volume with Faders” you’ll need to do some setup with your Listeners. I added explanation inside the Notes of the Reaction.
The Action Blocks of both Reactions also contain a description of what’s happening if you want to know a bit more.
If set up correctly, moving faders should show a message in Live’s Status Bar.
Here are some examples:
I made an error in the 3rd line of code. Volume value doesn’t work in steps from 0 to 127 but is a number between 0.0 and 1.0. To account for this, we need to use the “get value from ranges” feature:
This converts the 128 steps into values between 0.0 and 1.0.
I’ve added the .json for this version. Aside of the fader_num and Listener, you’ll also need to change the Controller you use as displayed in the red box in the image above.
This still won’t solve your is_visible problem but I’m working on an entirely new Reaction for that. I’m guessing it will be ready by tomorrow. I’m going to implement the use of modifiers, like you were trying to set up. I’m only wondering if I’m not making it overly complex but we’ll see. Here’s a sneak peek of the code:
OK i got it figured out.
It seems like your first command worked but I had to seperate the “set track” part into a seperate action before applying the volume part with the gui as range.
It somehow doesn’t let me add files here like you seem to be able to but the content of the actions are as following
Action 1:
fader_num = 2
track_to_control = self.get_selected_track_num() + fader_num – 1
Action 2:
self.song().tracks[track_to_control].mixer_device.volume.value = self.get_value_from_ranges(False, 128, False, self.midi_cc_ch_0_val_103.cur_val, 0, 127, 0, 0, 0.85, 2, False)
There should really be a way to just indicate this directly.
It seems it only seems to have the bugged offset if the value gets stored to a modulator m1-m20 (i tried some above 8 randomly to make sure it was consistent behaviour)
This is pretty much identical to what I had before but the first action was just done in a ranges by adjusting the output range or current value range by adding a whole integer equal to the track offset i intended and then storing it before recalling it in a track volume module instead of a reaction.
Either way. It seems fixed now! The simple solution was the best one it seems.
Thank you a ton for going out of your way trying a lot of things.
I don’t fully understand the last json you sent. but I’ve learned a lot about CSS in the past 2 days because of it!
No problem, glad it worked out.
About that json file, in that first action I only meant to leave the first 2 lines of code but accidentally left some other code in (that I was experimenting with) when I uploaded the json.
I am still going to try and make the Reaction that only lets you adjust volumes of visible tracks, just to see if I can pull it off.
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.
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
The devs have created some user-friendly mappings that can help you out:
1. Session Box Mapping
Keeps track of its own offset which can then be used inside a Track Volume Mapping. I can’t find a tutorial about this mapping but most of the features seem easy to understand. I think you don’t even have to assign buttons to clip slots, you can just use the session box for its offset data, if that’s what you need.
2. Session Box Navigation Mapping
Using this mapping, you can set up a knob to scroll through tracks. For this question (see my second answer) I made a few Reactions so that you could use buttons to navigate left and right through the tracks (if you’d rather do it with button presses than with a scroll knob).
3. Track Volume Mapping
As you can see in the picture, there’s an option to make the Track relative to the Session Box. With this set to yes, Track 1 = the first track inside the session box. If Session Box is positioned starting at Track 3, then Track 3’s volume would be adjustable using these settings.
Sign up
User registration is currently not allowed.
Actually, I might’ve just thought of a better way than what I’m doing in the sneak peek code, by making a custom list that only contains visible tracks.
EDIT: Better yet, there already is a list like that:
self.song().visible_tracks
EDIT 2: the problem with using the visible_tracks list is that you can only get the selected track’s index num by comparing track names, meaning that you’d need to have unique names for each track. So, maybe this is not a valid way to go.