local ci = renoise.song().selected_instrument
for i = 1, #ci.samples do
print( i )
ci.sample_mappings[renoise.Instrument.LAYER_NOTE_ON][i].note_range[1]=0
rprint( ci.sample_mappings[renoise.Instrument.LAYER_NOTE_ON][i].note_range[1] )
end
which prints
1
19
2
19
3
19
4
19
5
19
for five samples. But I expected it to set all the note ranges minimum value to 0. I already checked the read_only variable, but it is always set to false. Am I missing something?
Side question, what is the syntax to set the full table to new values? Something like note_range = [0,119] ?
I’m not sure catchphrase but you could try setting the two note_range low/high values table in one go, like:
local ci = renoise.song().selected_instrument
for i = 1, #ci.samples do
print( i )
ci.sample_mappings[renoise.Instrument.LAYER_NOTE_ON][i].note_range = {0,119}
rprint( ci.sample_mappings[renoise.Instrument.LAYER_NOTE_ON][i].note_range[1] )
end
Yes, thanks a lot, exactly, what I wanted to do, set all table values at once. But I did not know the correct syntax, just reactivating/learning some long forgotten LUA.
On the other hand, is it possible to set just one of the values? (just curious).
Good question catchphrase, but I’m not myself a lua expert and to be honest with you I would’ve thought you could of set the values in the table individually, but apparently RenoiseLua doesn’t respond [Edit: Ah, looks as though note_range is wired as a list so it expects two values in a table.] Danoise would probably be better to answer this though. But at least you can read and set the values…luckily