I’ve tried using the renoise.app():load_instrument_sample() function for programmatically loading a generated sample from my custom Renoise Tool.
I haven’t been able to get this function to do anything besides return false, with no further errors. Nothing else seems to happen.
Simplest test case that fails:
Open the Scripting Terminal & Editor
In the terminal, run
Observe no sample is being loaded, also if you print the return value it’s always
I tested with various .flac samples that come bundled with Renoise, as well as .wav samples. Neither worked for me.
Tested on both macOS and Linux.
Did anyone have any luck using this function?
I have never used it but I think I understand what is necessary here, because in other sections of Renoise it is very similar:
- It is necessary for the tool to first order a free sample slot inside the selected instrument.Make sure there is a sample slot.When you load Renoise for the first time, no instrument has any sample slots loaded: Renoise: Sampler: Sample Box (left), " Insert a new sample" (slot empty) (the API will have something equivalent to do it).
- Ok, once you have resolved point 1,make sure that the FLAC file address exists. "/path/to/test/sample.flac"is not a subfolder inside the main folder of your tool?
In summary, first you prepare a place where to place the sample, and then you load it. In theory,**renoise.app():load_instrument_sample()**should previously create a sample slot to load.
I hope this helps…