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[x] 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
and then explore from there, what are device parameter min/max values? Just
for i,pn in ipairs(rs.selected_track:device(1).parameters) do print(i,pn.name) end
btw I started out exactly the same with MidiSkiptool. Keep doin what you do!
It’s a pity that you have manually change sample settings to make it work properly. Make those settings scriptable, please (devs)!
Maybe “preserve initial loop start and end point” as default?
It would be absolutely lovely if one could apply a scl tuning to “all instruments” or “marked instruments”. Of course, to work properly, that requires that the script can change the sample editor/keyzones settings…
But would be possible to apply the tunings to “marked instruments”?
Unfortunately you can’t have preserve the sample start and end as a default. When you slice a sample the loop points are discarded and this makes perfect sense if you are slicing a drum loop. However this tool is using the slicing feature for something it wasn’t really intended for so these manual steps are needed to overcome that. Being able to script those settings would help but IMO a better solution would be to have independent finetune settings for keyzones, then you wouldn’t need to use slicing. So this tool is essentially a hack until a better way of doing it comes along, hopefully this will be in the next version of Renoise, but we just have to wait and see.
Applying the tuning to all marked instruments should be easy to do, renaming instruments does seem a bit cumbersome though. You can multiple select instruments so maybe there is a way to use that, I’ll look into it…
interesting detail: the script doesn’t generate slices lower than D-4, regardless on the base-note I set. so the slices 0x46 to 0x77 are out of the midi note range (above 127). I tried to fix that in the script by changing the variables base_note and instr_basenote to lower values than 48 but that didn’t work. Is there a working solution for that?