Switching off samples


what is the easiest way to switch off samples/zones/waves in a programm by code, so that they do not need any performance during playback?

I have 3 samples on each key, representing different levels of details in the produced sound.
To save some voices on performance side, I want to make the 2nd and 3d sample to be switched on and off by a button on the macro page.

Simply muting the samples still plays them, it has the same effect as putting the output buss to -infinity. I was hoping for something like SampleOSC.PlaybackMode = “OFF”

Is there any other parameter I could use for that purpose?

Thanks and best regards,

Hi Stefan,

Each layer has a parameter called LayerMidiMute. You could use this to “mute” all zones within a layer. You can also connect this parameter to a macro page button directly without any code unless you want a button that handles several layers at the same time.

This works in terms of switching off already loaded samples.
I want to find a way to…

  • initially load a programm say, with 50 samples loaded on 50 keys.
  • When I press a button A, I want additional 50 samples to be loaded on the same keys (so 2 samples are triggered and played when I press a key)
  • When I press a button B, I want additional 50 samples to be loaded, but the 50 samples from Button A should be “unloaded”.

With LayerMidiMute, I can mimic the behaviour in terms of what is played and what is not, but after pressing button B still all 150 samples (the initial 50, the 50 from Button A and the 50 from Button B) are loaded and in memory.

Is there any way to really unload samples, meaning the ram is freed from the underlying data? And if so, is there a way to load a programm with no samples loaded and then load and unload them on demand?

I played around with storing the filenames in a table and setting the Parameter “SampleOsc.Filename”) to an empty string and then back to the stored filename, but I don’t know if this is the right way to do it, and I also do not know how to initially load the program without the files loading into RAM in the first place.

Thanks for any help and best regards,

Well, if you really want to load and remove samples I would create layer presets with samples already mapped. Then just load the layer preset and append it to your program. Remove the layer from the program to unload the samples.