Something Which Print Lists As [Number] Via Rprint - How To Access [Nu

Hi!
renoise.song().selected_track.devices gives a list of devices if you do rprint.
[1] => userdata: 0x0x22c9c674 (TrackDevice object)
[2] => userdata: 0x0x22c9c6d4 (TrackDevice object)
[3] => userdata: 0x0x22c9c734 (TrackDevice object)
[4] => userdata: 0x0x22c9c794 (TrackDevice object)
[5] => userdata: 0x0x22c9c7f4 (TrackDevice object)

For instance, like this. i see numbers, and then I somehow thought that

local number=renoise.song().selected_track.devices  
for i=1,number do  
oprint (renoise.song().selected_track.devices)  
oprint (renoise.song().selected_track.devices[i].is_active)  

but what I end up is an error, because this isn’t how it works. If there’s now _index that can be used to get the numbers out, how do I just extract the number from that output? Like can lua be used to read the output of rprint and extract a number out of the amount of lines output, or…?

I’m not sure what you are asking. Use table.count() ?

  
local number = table.count(renoise.song().selected_track.devices)  
for i=1,number do  
 oprint(renoise.song().selected_track.devices[i])  
end  
  

table.count seems to work, got a table out as a number and thus was able to do a “mute all” “unmute all” track dsps :)