Getting Tracks Mute State

Hi,

I have made this code, it adds notifiers to all the sequencer tracks and when a track is muted or unmuted, the status of all tracks is printed:

  
function track_mute_changed()   
 for i = 1, #renoise.song().tracks do   
 if (renoise.song().tracks[i].type == renoise.Track.TRACK_TYPE_SEQUENCER) then   
 if (renoise.song().tracks[i].mute_state == renoise.Track.MUTE_STATE_ACTIVE) then   
 print("track " .. i .. " is unmuted")  
 else  
 print("track " .. i .. " is muted")  
 end   
 end  
 end   
 print("---")  
end  
  
for i = 1, #renoise.song().tracks do   
 if (renoise.song().tracks[i].type == renoise.Track.TRACK_TYPE_SEQUENCER) then  
 renoise.song().tracks[i].mute_state_observable:add_notifier(track_mute_changed)   
 end  
end   
  

My question: Is it possible to get the mute state for only the changed track, without creating
16 notifiers for 16 tracks? I also get a lot (16 for 16 tracks) printed lines if I solo a track.

Thanks!
Bas

Solo and mute don’t seem to change the currently selected track, so the only way to find out the source track is by keeping an own table. Copy all solo and mute states into it, when a notifier triggers check old table against new table and compare the changes. There can only be one soloed track, the rest will have the mute state. You will need both, solo and mute to properly compare in the notifier. When the track is identified, update your internal table.