Previewing segments of the same sample
I am currently implementing a sample slicer (aka sample chop) and I want to let the user preview each slice individually.
What would be the most straightforward approach for this purpose:
- Map a
ModulatorSamplerSoundreferencing the same sample over a range of MIDI notes (1 per slice), each sound having a specific
- Simply set the
SampleEndright before triggering the portion of the sample
I believe all methods would work but some might have advantages over others.
Thanks in advance for any help,
- Map a
Alright for those interested, the most straightforward solution (in my case) was to map one
ModulatorSamplerSoundper MIDI note and set the Sample start/end accordingly.
It would be really cool to be able to synchronously set the sample start/end positions without killing the voices when the sample is loaded entirely in memory (no streaming).
Note that I had to disable the pool "search mode" when loading the same sample over a range of MIDI notes, otherwise updating the start/end positions would be mirrored on every sample.
auto pool = sampler->getSampleMap()->getCurrentSamplePool(); jassert(pool); pool->setDeactivatePoolSearch(true);
I believe this is why this pool mode exists, @Christoph-Hart, i.e.: to allow each duplicate sample entry to have its own properties?