New Tool (2.8): scl to xrni

Don’t forget the boundary sanity checks (max/min transpose levels etc.)

Thanks, I have a clamping function that sorts that out.

Updated to 1.5 - Now preserves the base note setting of the initial sample, this also works on repeated re-tunings as the base note is stored in the beat sync setting.

Also added the ability to preserve/apply the loop start and end points of the initial sample to all slices, however due to API limitations this needs to be applied manually after the ‘stop playing at start of next slice’ option has been disabled in the Sample Editor. Once the loop setting has been applied it doesn’t need to be done again for further retunings.

Awesome

IIRC this already worked, without any work or extra code

it’s a shame the “Toggle Single Slice Trigger” bool is not accessible through the API… would make the process a hell of a lot more streamlined

Nope, try it yourself run this code on a looped sample:

  
for n = 1, 10, 1 do   
 renoise.song().instruments[1].samples[1]:insert_slice_marker(1)  
end  

The slices lose the loop points so you then have to set them again, however running this code straight after:

  
for n = 1, 10, 1 do  
 renoise.song().instruments[1].samples[n].loop_start = 1  
 renoise.song().instruments[1].samples[n].loop_end = 5000  
end  

Doesn’t work either until you have manually disabled the “stop at slice end” setting in the sample editor. You can’t access that via scripting…

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

  
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 :D with MidiSkip tool. Keep doin what you do!

Thanks dude, some useful tips there :)

‘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!

I’m really looking forward to trying out this tool. Sounds like a great idea.

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  
  

What a wonderful tool.

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”?

Thanks for the feedback :)

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…

Thanks for your reply.

+1

Great! If it’s not too much trouble to implement that, it would be really useful to me.
Try out different tuning schemes for whole songs …

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:

post-4451-0-89198200-1360383141.png

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 :wink:

Maybe this tool can help, it takes different approach so might work better for this kind of thing:

https://forum.renoise.com/t/microtuning-tool-for-3-0/41384

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?

I found it! After aplying the scl-file you have to press [Ctrl]+[Shift]+[H] … :yeah: