It seems that all the documentation concerning the sample_mapping[] is incomplete.
Within sample_mapping[] there is another table that does not appear in the documentation, and which refers to the sample index
.
For example, to access the note_range
rprint(renoise.song().selected_instrument.sample_mappings[1][1].note_range)
In the documentation it should be something like this, I guess:
-- Note range the mapping is triggered for.
renoise.song().instruments[].sample_mappings[].samples[].note_range, _observable
--and
renoise.song().instruments[].sample_mappings[]:sample().note_range, _observable
-> [table with two numbers (0-119, c-4=48)]
.samples[]
maybe? The same with the rest of properties…
Related documentation:
Renoise.Song.API.lua
--------------------------------------------------------------------------------
-- renoise.SampleMapping
--------------------------------------------------------------------------------
-- General remarks: Sample mappings of sliced samples are read-only: can not be
-- modified. See `sample_mappings[].read_only`
-------- Properties
-- True for sliced instruments. No sample mapping properties are allowed to
-- be modified, but can be read.
renoise.song().instruments[].sample_mappings[].read_only
-> [read-only, boolean]
-- Linked sample.
renoise.song().instruments[].sample_mappings[].sample
-> [renoise.Sample object]
-- Mapping's layer (triggered via Note-Ons or Note-Offs?).
renoise.song().instruments[].sample_mappings[].layer, _observable
-> [enum = renoise.Instrument.LAYER]
-- Mappings velocity->volume and key->pitch options.
renoise.song().instruments[].sample_mappings[].map_velocity_to_volume, _observable
-> [boolean]
renoise.song().instruments[].sample_mappings[].map_key_to_pitch, _observable
-> [boolean]
-- Mappings base-note. Final pitch of the played sample is:
-- played_note - mapping.base_note + sample.transpose + sample.finetune
renoise.song().instruments[].sample_mappings[].base_note, _observable
-> [number (0-119, c-4=48)]
-- Note range the mapping is triggered for.
renoise.song().instruments[].sample_mappings[].note_range, _observable
-> [table with two numbers (0-119, c-4=48)]
-- Velocity range the mapping is triggered for.
renoise.song().instruments[].sample_mappings[].velocity_range, _observable
-> [table with two numbers (0-127)]
Am I doing something wrong or is the documentation really incomplete?
Can anyone verify this? Please!