Hiya. I was doing some random grepping along the documentation, and got these;
Am I to understand that the loop_mode of a sample can be changed via LUA? or that one can LUA script sample loop_start & end lengths, etc? Or?
Okay, I got this going now:
renoise.song().selected_sample.loop_mode = renoise.Sample.LOOP_MODE_OFF
renoise.song().selected_sample.loop_mode = renoise.Sample.LOOP_MODE_REVERSE
renoise.song().selected_sample.loop_mode = renoise.Sample.LOOP_MODE_PING_PONG
For some reason, loop_mode_forward just doesn’t want to work, which is weird!
This switches between sample loop mode “off” and “forward”
local loop_mode = renoise.song().selected_sample.loop_mode
if loop_mode == 1 then
loop_mode = 1
renoise.song().selected_sample.loop_mode = loop_mode
Ok, made a little keybind which tries to think in mathematical terms. LoopTest
local selsamp = renoise.song().selected_sample
if selsamp.loop_end <200 then
selsamp.loop_end = renoise.song().selected_sample.sample_buffer.number_of_frames
if selsamp.loop_end >3000 then
selsamp.loop_end = selsamp.loop_end - 1000
else selsamp.loop_end = selsamp.loop_end -100
If anyone has any suggestions as to how to handle samples of different sizes mathematically so that this kind of loop-setting and re-setting and “closer to sample_start starts increasing resolution” makes more sense, please suggest.
edit: Well, added one more thing, every second press on the keybind will switch from pingpong to forward loop. Just mucking about, really. (didn’t add it to the code, cos why?)
edit: v0.39 Impulsecomplex has cycle off-forward-backward-pingpong and pingpong-backward-forward-off shortcuts and set-off, set-forward, set-backward, set-pingpong shortcuts.