Lets you create equal power crossfade loops - This means you don’t get the volume dip you normally do with the native crossfade function.
It’s not the best for every kind of sample but it can result in much smoother sounding loops than the native option.
Note that there is a risk of clipping if your source is fully normalized, it’s best to leave a bit of headroom.
The slider sets the start point of the loop. The loop end is fixed at the end of the sample (for now).
added this code so it can work over all sample in an instrument :
--yla
local function xfadepow_all(loop_size)
local smps = renoise.song().selected_instrument.samples
for i = 1,#smps do
local smp = smps[i]
local smp_buffer = smp.sample_buffer
local sample_size = smp_buffer.number_of_frames
-- Get loop start position (frames)
local loop_start = math.floor((sample_size*loop_size)+0.5)
-- Setup loop
smp.loop_mode = 2
smp.loop_start = loop_start
smp.loop_end = sample_size
-- Do crossfade
smp_buffer:prepare_sample_data_changes()
do_crossfade(smp, loop_start, sample_size)
smp_buffer:finalize_sample_data_changes()
end
end
-- and within the "Process button" section (don't forget
-- to add a comma ',' after the first button definition...)
vb:button {
text = "XFade All Samples",
height = 25,
width = 55,
notifier = function()
xfadepow_all(loop_size)
end
}