Loading a sample bank into memory
Hey all,
So I posted on this forum ages ago about a work-in-progress Max for Live vocal synthesizer (posting it in the Max forum anyway because this particular question isn't really Live-dependent). I ended up getting it capstone-ready, which is wonderful, but as it stands it is nowhere near releasable yet.
One major problem with it currently is the several milliseconds of latency between when a key is pressed and when the note is sung. Part of this is just that the nature of real-time vocal synthesizers requires playing ahead of the beat to make room for starting/ending consonants, but I've benchmarked it against Plogue Alter/Ego (as far as I can tell the only other player in this field currently) and even compared to that, the rendered audio lags several milliseconds behind the MIDI input.
I'm thinking that part of this might have to do with how I programmed it: there are three buffers containing the start, middle vowel, and end of a syllable, and after a syllable is played, the program retrieves the audio files needed for the next syllable from a folder that I've pointed it to with dropfile. (Like I said, it was a school project.) The more I think about it, the more I think a good portion of the latency comes from the program loading three audio files from disk upon every MIDI note. I know that Kontakt has the ability to load samples from disk, is there any way Max can do something similar?
TL;DR, is it possible to load an entire folder's worth of audio files into memory in Max so that it doesn't have to constantly disk search when new samples are needed?
Loading samples on midi input is not a good idea for live playback.
As long as You have enough of RAM everything can be loaded into
buffers, but it all depends on what is used for playback etc.
Even separation of "start, middle vowel, and end of a syllable"
could be maybe avoided, by setting playback instructions
for attack, sustain and release of midi note