Hey Julian, any interest in using Accelerate Framework on the mac? I’ll probably patch it myself at some point and see what improvements it makes…
[code]
void FloatFunctions::clear(float input,int blockCount)
{
#if JUCE_MAC
vDSP_vclr(input,1,blockCount);
#else
memset(input,0,blockCountsizeof(float));
#endif
}
void FloatFunctions::copy(float *input,float output,int blockCount)
{
#if JUCE_MAC
vDSP_mmov(input,output,blockCount,1,blockCount,blockCount);
#else
memcpy(output,input,blockCountsizeof(float));
#endif
}
void FloatFunctions::sum(float *input1, float *input2, float *dest, int blockCount)
{
#if JUCE_MAC
vDSP_vadd(input1,1,input2,1,dest,1,blockCount);
etc[/code]
I’ve been playing around with the AudioProcessor class and have made an AudioReader that works with that. Now I was going to make a sample rate converter class(also as an AudioProcessor), but as the ProcessorGraph seems to process blocks of data(as opposed to pulling data through the processor objects) i’m stuck thinking i’ll need to make my samplerate converter hold the AudioReaderProcessor itself, and throw that object(only that object) into the graph. (So that when the graph asks for 512 samples, but I need to pull 1078 samples from the soundfile buffer to samplerate convert down to 512, that this is possible)
The other option would be to add “node’s” to an AudioProcessor subclass that would call through to connected processors to acquire data. (Sort of the AudioUnit approach) (You put a sample rate converter, a mixer into a graph, connect the nods of the audio units, tell the graph to start, it renders the top object who asks its connected audiounit for data, who asks its connected audio for data, and so on, and so…so the last item on the chain is the provider, and he’ll be asked to satisfy the frames needed to keep everyone above him happy)
Does either of this sound like the right approach? (I’m leaning towards the second approach, but that would pooch me if you came up with cool AudioProcessors, as I’d only be able to chain up node’s from MY derivative class!) (I hope I explained all that ok!)