local number = (table.count(si.samples))
for i=2,number do
--Set Loop_mode Forward & On
--Set Loop_start to Loop_end - Loop_end/10 (Probably doesnt work as well as it should.
si.samples[i].loop_start = (si.samples[i].loop_end - si.samples[i].loop_end /10)
--Announce an informative Blöö.
I don’t think the loop_start_setting is exactly where you want it to be, but this should at least show you the technique used. I can tweak this for you, but you’ll have to give more instructions regards how you want the start_loop to be placed.
edited code slightly for the sake of brevity. … It wouldn’t be that hard to set the loop_start to be the sample_length-aspecific_amount_maybe_even_a_percentage_count…
local sample = renoise.song().selected_sample
if (not sample.sample_buffer.has_sample_data) then
renoise.app():show_warning('No sample data!')
local samples_per_beat = nil
if (sample.beat_sync_enabled) then
local lpb = renoise.song().transport.lpb
local beats_in_sample = sample.beat_sync_lines / lpb
local frames_in_sample = sample.sample_buffer.number_of_frames
samples_per_beat = frames_in_sample / beats_in_sample
local seconds_per_beat = 60 / renoise.song().transport.bpm
samples_per_beat = sample.sample_buffer.sample_rate * seconds_per_beat
local samples_per_128th_note = samples_per_beat / 32
local samples_per_64th_note = samples_per_beat / 16
local samples_per_32nd_note = samples_per_beat / 8
local samples_per_16th_note = samples_per_beat / 4
local samples_per_8th_note = samples_per_beat / 2