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 MidiSkiptool. Keep doin what you do!
‘ipairs’ still confuses the hell out of me! That and ‘self’ which I have seen used in quite a few tools. I need to set some serious time aside to figure those out!
Haha me too cause I never used self / object oriented lua.
ipairs is easy, gives a iterator over tuples (index, obj)
all you need to know is how to use it, e.g.
for i,tr in ipairs(renoise.song().tracks) do
print("Track# "..i..": "..tr.name)
end
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…
Seems like it will not be as straightforward as I hoped, it will need some kind of GUI to do it effectively, I’ll have a go when I have some free time.
Thank you for looking at the possibility of selecting multiple instruments.
If you get the time to do it, I would be grateful. I’m still playing around with your tool. It’s fantastic.
This is fantastic! Thanks very much! We all know trackers are great for micro-timing, great to see (and hear!) micro-tuning. I’m off to try it, but will it work to send MIDI too?
I hope more tools such as this, that allow you to get creative with harmony, melody, and so on, are integrated into future development.
Thanks dude, its more of an instrument hack so won’t work with midi, I’m not sure how you would do that anyway as you can’t send finetune via midi… maybe it could use pitch bend values?
Anyway, I agree it would be great to see this kind of stuff built in or made easier to code in future versions, being able to trigger samples from the api would be ace!
hi… is there some way of enabling configuration settings, so that after each re-scale, the “Preserve Loop Points” is run after the “Apply Scala Tuning” function?
Cos I’d definitely love to have access to that, feels like an extra click to accomplish something that could be set as default…
p.s. wonderful tool. i just tried my first scala file from the big archive and this is really refreshing.
Unfortunately not because this button cannot be accessed by the API:
This is enabled by default, and when that is the case the API doesn’t see any samples in slots beyond the first one. Once it is disabled then the samples slots can be accessed and loop points set.
What we really need are proper sample aliases and then this tool could be made a whole lot more elegant. For now its a minor annoyance but worth it for all those exotic tunings
Maybe this tool can help, it takes different approach so might work better for this kind of thing:
I use Renoise 3.0.1 with scl_to_xrni V1.60. I only get empty slices after applying scl_to_xrni to a sample. The tuning for the keys seems to work. What am I doing wrong?
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?