Dynamically loading samples (Sampler, AudioLoopPlayer)
-
Hey there!
I'm trying to load some small generated samples over the network into different players. I've already got them loaded into the AudioLoopPlayer, but I'd love to have even more options for players. I'm thinking the sampler could be perfect for this, but I'm not sure if I can load .wav files on the fly.
So my questions are:
- Is it possible to have multiple AudioLoopPlayers, with each one being played by a different note?
- Can I dynamically load .wav files into the Sampler? I don't need fast disk streaming.
- Will I need to create a sample map to load into the sampler dynamically?
Thanks for any help you can give me!
-
I think you might find this useful - https://github.com/christophhart/hise_tutorial/tree/master/CustomSampleImport
-
Thanks for sharing your knowledge! I've gone through the code snippets and while it seems complex, it definitely gets the job done. I did want to mention that when loading the sample from the file path using
local s = [Sampler1.parseSampleFile(filePath)];
, it gives you a JSON sample map.To create the correct mapping, I used
s[0]['LoKey']
ands[0]['HiKey']
to alter the JSON sample map. You can also set other common sample map parameters here.
Since I'm able to predict that I'll always have the exact same mapping, this method works perfectly for me!Thanks again for your help!