I've been trying to hack the symmetrical waveform code by user toblerpone into pasting a reverse on to the end of a sample.
local function make_symm() -- Sample properties. local buffer = renoise.song().selected_sample.sample_buffer local smp_len = buffer.number_of_frames -- sample length odd or even local smp_mid = smp_len local sel_channel = buffer.selected_channel -- Determine which channel(s) to process. local first_channel = sel_channel local last_channel = sel_channel if sel_channel == renoise.SampleBuffer.CHANNEL_LEFT_AND_RIGHT then first_channel = 1 last_channel = buffer.number_of_channels end -- Process. buffer:prepare_sample_data_changes() for f = 1, smp_mid do for c = first_channel, last_channel do buffer:set_sample_data(c, smp_len - f+1, buffer:sample_data(c, f)) end end buffer:finalize_sample_data_changes() end
This code nearly does what I'm after, but it overwrites the second half of the sample. I'm struggling to double the amount of frames in a sample.
I tried to use part of It-alien's 'add silence' code, but I couldn't work it out.
Ultimately, I'm trying to create a tool which goes through every sample in an instrument, adds a reversed tail, fades out the tail and then sets note-off properties to 'continue'. This would save me loads of time when chopping up my breaks!
I know there's sample slicers which kind of do this, but I prefer using individual samples rather than pingpong-looped slices.
Thanks for any help!