Hi, I’m wondering how to load a specific (or random) multi-sample-preset or sample-preset using LUA API?
Concentrate attention only on “a sample”.
- To load a sample, you must first create a “sample slot”.
- Then, deposit the sample in that sample slot.
- If you want to do this operation several times (points 1 & 2), iterate (for a = b, c do … end)
The code:
- renoise.song().instruments[]:insert_sample_at(index)
- renoise.app():load_instrument_sample(filename).
2.1 you must define somewhere the path of each “filename” (will define the maximum number in the iteration).
2.2. renoise.app():prompt_for_multiple_filenames_to_read({file_extensions}, dialog_title)
inside the iteration, use the code like this:
local song = renoise.song
song().selected_instrument:insert_sample_at(index)
or
local ins=renoise.song().selected_instrument
for a=b,c do
ins:insert_sample_at(index)
--continue code
end
…
i get what you’re saying. however. i’m talking about this stuff:
i was thinking of using these two libraries of sounds and randomizing whichever thing is loaded. kinda like “load 20 random samples from the “Sample Presets” library” and then start doing something fun with them.
Ah, you mean libraries. I think the API does not give access to this data.
For example, a Multi-Sample for Keyzones (Digital) is an audio file folder (Digital Samples) and a text sfz file (Digital.sfz):
// Created with Renoise - https://www.renoise.com
<region>
sample=Digital Samples/WaveDigital_C-2.flac
pitch_keycenter=24
lokey=0 hikey=35
<region>
sample=Digital Samples/WaveDigital_C-3.flac
pitch_keycenter=36
lokey=36 hikey=47
<region>
sample=Digital Samples/WaveDigital_C-4.flac
pitch_keycenter=48
lokey=48 hikey=59
<region>
sample=Digital Samples/WaveDigital_C-5.flac
lokey=60 hikey=71
<region>
sample=Digital Samples/WaveDigital_C-6.flac
pitch_keycenter=72
lokey=72 hikey=83
<region>
sample=Digital Samples/WaveDigital_C-7.flac
pitch_keycenter=84
lokey=84 hikey=95
<region>
sample=Digital Samples/WaveDigital_C-8.flac
pitch_keycenter=96
lokey=96 hikey=107
<region>
sample=Digital Samples/WaveDigital_C-9.flac
pitch_keycenter=108
lokey=108 hikey=119
Do you want to fight with all this data?
perchance not. i was hoping the api would allow for it, would have been cool
This of the libraries was added in version 3.1, but the issue of extending the API to manipulate this data was not addressed.
Anyway, libraries are not widely used. No one shares this type of content. It takes time to create them, and people are not wasting time with these things.