Well me too, I just got advice from either It-Alien or taktik a long time ago that the renoise.song():instrument(x) function works faster than the renoise.song().instruments array index (So, the effect is the same, just the function is more cpu efficient). The : thing is a lua thing, instrument is a method of the song object, with actually two arguments, a Song and a Number. By using : lua already gives the logical song object . So as soon as you need to get a specific pattern, track, instrument, sample… use the function. When you iterate over all instruments, use a for loop over ipairs(instruments). Also notice that the array is called instruments and the function is called instrument, without s. It’s all pretty logical when you get used to it. And you can always find most info you need live from the Scripting terminal using the oprint and rprint! I usually type something like
rs=renoise.song()
and then explore from there, what are device parameter min/max values? Just
rprint(rs.tracks)
oprint(rs.selected_track)
rprint(rs.selected_track.devices)
oprint(rs.selected_device)
oprint(rs.selected_track:device(1))
rprint(rs.selected_track:device(1).parameters)
for i,pn in ipairs(rs.selected_track:device(1).parameters) do print(i,pn.name) end
print(rs.selected_track:device(1):parameter(2).value_max)
print(rs.selected_track:device(1):parameter(2).value_min)
print(rs.selected_track:device(1):parameter(2).value)
etc
btw I started out exactly the same with MidiSkip tool. Keep doin what you do!