falkTX wrote:I think that is a completely different matter.ubuntuuser wrote:The other thing is disk streaming, and there are some Juce classes already around for it but I havn't gone into depth with them.
Implementing disk streaming is not an easy task. Specially when you have realtime audio and multiple voices, that can play randomly..
A proper implementation takes time, specially the final polishing. You can try to just throw a class at it, but you might end up worse than before...
On a different note, please please try to learn how to use git commits.
Deleting everything and re-uploading files via github is very ugly.
Not to mention impossible to see what actually changed... it takes out the whole point of using git in the first place.
Thanks.
From what I can pick up
For a Midi note
Synthesiser::noteOn is called then juice::Synthesiser assigns one of the Synth Voice objects to play the note and calls that object's StartNote
SFZero has a noteOn routine that the author thinks can be used to start full sample loading via a background thread.
The Juce streaming classes seem to use StartNote to start full sample loading via a background thread.
Seeing that NoteOn and StartNote seem to be connected, I don't think it's that hard to integrate the Juce disk streaming classes.
It seems that all of the samples are partially loaded at startup, and then StartNote starts a particular samples full load.
There are multiple SFZero and Juce streaming classes renderNextBlock routines that would need to be integrated somehow.
From the comments section
readSamples() - limit loading to first blocksize number of samples
Something needs to trigger the reading of the full sample. I suppose this should be in sfzero::Synth::noteOn() where we could submit an asynchronous loading of the full sample into a temporary buffer. Then when sfzero::Voice::renderNextBlock() (where I understand the bulk of the rendering is done) reaches the end of it's pre-cached block, it could look at the temporary full-sample buffer.
Does this sound the best way?
There isn't currently an appropriate thread to do the background reading; you'll have to add one. noteOn() would send it a message of some kind to initiate the loading. Once the thread has read it, it would install it in the SFZSound (with appropriate mutex locking).
------
That seems to be very similar to what the Juce disk streaming classes are doing.
But what I'm saying could be totaly wrong because I havn't gone into it with any depth.
Github was a mess and I think I've sorted it out and will be maintaining it in a more orderly way.