I want to figure out how automate the size of keyzones of a bunch of samples so I can automate the areas.
So far I found this:
new_mapping = selected_instrument:insert_sample_mapping(
LAYER_NOTE_ON, 3, 49, {49,49}, {0,32})
and from that I was able to find some more of it in TestSamples.lua
so this is what I have so far:
-- add your test snippets and other code here, that you want to quickly
-- try out without writing a full blown 'tool'...
do
----------------------------------------------------------------------------
-- tools
local function assert_error(statement)
assert(pcall(statement) == false, "expected function error")
end
function float_cmp(f1, f2)
return math.abs(f1 - f2) < 0.0001
end
----------------------------------------------------------------------------
-- insert/delete/swap
local song = renoise.song()
local selected_instrument = song.selected_instrument
local LAYER_NOTE_ON = renoise.Instrument.LAYER_NOTE_ON
-- new_mapping = selected_instrument:insert_sample_mapping(
-- LAYER_NOTE_ON, 1, 36, {0,48})
new_mapping = selected_instrument:insert_sample_mapping(
LAYER_NOTE_ON, 2, 49, {49,59}, {4,127})
-- dummy: recursively prints all available functions and classes
-- rprint(_G)
end
this works, but I’m unsure what this part is completely referring to:
“2, 49, {49,59}, {4,127}”
I gather what this “{49, 59}” is doing.
49 is the beginning of the keyzone and 59 is the end of the keyzone.
but the rest of it is giving me trouble telling me what it’s for.
the “2” only accepts 1 or 2, but don’t understand it.
the “49” I can’t figure out really at all.
“{49, 59}” should be the table for the keyzone, the main thing I want to mess with.
and “{4,127}” is a table for key/velocity, but if I change “4” it doesn’t seem to do anything
somewhere is the sample index.
either way this is fuckin awesome.