Purging samples from one RR group or a whole sampler
-
Purging samples from one RR group or a whole sampler
I want to control the purging of samples, either via a whole sampler, samplemaps, RR groups or individual samples.
Some prerequisites:
- I am not using the HLAC or the multimic addition to the sampler.
- I have to use wav audio files cause my instrument has other formats as well that comes with my product and are all in the main instrument folder.
Info I found - previous issues / blog posts
Previous issue 1:
https://forum.hise.audio/topic/26/how-do-you-purge-samples/ - Christoph hart answered that with this:
@Christoph-Hart said in How do you purge samples?:
To purge a whole sampler is pretty simple (but impossible to know until there is some documentation):
Sampler = Synth.getChildSynth("Sampler"); Sampler.setAttribute(12, 1); // 12 is the index for purging attribute and '1' is purged ('0' is normal and '2' is disabled)
I wouldn't call this in a MIDI callback because it blocks the audio processing, but for control callbacks it is perfectly fine.
You can also purge selected samples within a sampler. This procedure is a bit more complicated and I'll decide the next blog tutorial to it (you can also automap the samples with these API calls).
Previous issue 2:
https://forum.hise.audio/topic/129/purging-all-samplers/2 - Christoph hart answered the question on how to purge everyghing in all samplers while creating a new function that is not in the documentation still in 2020, that was 4 years ago. Is the documentation in production?
Blog posts on the topic:
https://forum.hise.audio/topic/64/fun-with-regex - a very nice walkthrough of something waaaya to complex for explaining the basics of purging samples. Powerful, but not on point and certainly not something I would consider clicking on for purging, as the name is "Fun with regex", ... what? why would I click on that for this question? Please change the title to: "Fun with regex - purging samples with custom automapper functions".
Lacking property IDS that are essential
The posts above have property index references, meaning the index of the property attribute index (I might be saying that wrong) of the thing we want to change, like the sampler´s purging state etc. But as Christoph hart mentions in the "previous issue 2", there is no way of knowing that if it´s not in the documentation.
Where is the list of all devices´s index numbers and what attributes they refer to?? There is one in the post "Fun with regex", https://forum.hise.audio/topic/64/fun-with-regex, which is fantastic in that post, but it´s nowhere in the docs. Please for the love of god, place that on a page. Perhaps a section inside the modules themselves with all index numbers so it´s easy to refer to. Or a dedicated section before the "scripting API". That´s where I would look for it.
UPDATE here: found the list of modules and their property IDs, right-clicking on the modules in the "module browser" in hise, would like to see it in hise docs.
Questions that remain:
How do I purge and load the samples from a whole sampler?
(this was basically answered above in the quote with saying
Sampler.setAttribute(12, 1);
But I´d like some more context if anyone has it. Like with async complete callback etc.)How do I purge and load RR groups from one sampler?
I found no info on "purge" in the docs, only the functions included in the multi-mic feature, that I for the reasons at the top (Some prerequisites) will not use.
- I am not using the HLAC or the multimic addition to the sampler.
-
A way I see to a purge individual samples, mentioned in the https://forum.hise.audio/topic/64/fun-with-regex --> under "DYNAMICALLY PURGE INDIVIDUAL SAMPLES", is to use this method:
// Select samples Sampler.selectSounds(your_selections); // Unpurge the samples (22 = 'SampleState', 1 = Purged, 0 = Normal) Sampler.setSoundPropertyForSelection(22, 0);
That purges the samples, but how to select things based on groups? (RRgroups)
The only thing I can find on RRgroups is the
setSortByRRGroup
. But that one seems to perform an internal task for performance, not for me to retrieve the data for selecting. Hmm.