Normalizing samples isn’t hard. Here is a snippet you can paste into the scripting console and run
-- Normalize selected sample to 100% volume
local sample = renoise.song().selected_sample
local sbuf = sample.sample_buffer
if (sbuf.has_sample_data) then
-- collect the highest peak value
local highest_detected = 0
for frame_idx = 1, sbuf.number_of_frames do
if (sbuf.number_of_channels == 2) then
highest_detected = math.max(math.abs(sbuf:sample_data(1,frame_idx)),highest_detected)
highest_detected = math.max(math.abs(sbuf:sample_data(2,frame_idx)),highest_detected)
else
highest_detected = math.max(math.abs(sbuf:sample_data(1,frame_idx)),highest_detected)
end
end
--print("highest_detected",highest_detected)
sbuf:prepare_sample_data_changes()
-- apply the peak value to the data
for frame_idx = 1, sbuf.number_of_frames do
if (sbuf.number_of_channels == 2) then
local normalized_sdata = sbuf:sample_data(1,frame_idx) / highest_detected
sbuf:set_sample_data(1,frame_idx,normalized_sdata)
local normalized_sdata = sbuf:sample_data(2,frame_idx) / highest_detected
sbuf:set_sample_data(2,frame_idx,normalized_sdata)
else
local normalized_sdata = sbuf:sample_data(1,frame_idx) / highest_detected
sbuf:set_sample_data(1,frame_idx,normalized_sdata)
end
end
sbuf:finalize_sample_data_changes()
end
Hi, someone can create a tool that make these operations on a sample:
maximize volume, set loop to forward, adjust sample to 16 bit, and then open “save sample…” dialog!
I’m going to sample many many one shot wave from my keyboards, virus ti, motif es, nord stage…
once I’ve finished, I’ll put these samples on my web!
Thanks very much!
Hey Ballacr,
at least for saving I have a tip for you: I simply render samples using keyboard shortcut (ctrl-shift-r : render selection). Each time a new sample is created inside Renoise and I rename it. Afterwards I export all samples to disk in flac format using the tool “Export all samples to disk” from vvois.
Regarding normalization: I’m not sure if it makes much sense to maximize samples to zero headroom, because then they are pretty loud when inserted. Though, may be interesting in those cases where a sample uses the the full 16 bit dynamic range. That’s the reason why I prefer 24 bit samples with some headroom.