quarterturn
Well-known member
I'd like to translate my Arduino Due 'string ensemble chorus' effect to an Audio Library-compatible library, but I could use a few pointers.
First, my Due code deals with samples as they come in via a 44.1 KHz interrupt, but in the Audio Library it's the 'update' method getting called somehow. Does that happen at the samplerate? I'll need to know that also since I'm targeting a Teensy 3.6 and will probably calculate my LFO on the fly (should be fast enough) and that depends on samples per second, or however often 'update' gets called. I need three phases of LFO separated by 2/3*pi radians, each a sum of two sine functions, will that be too much math per update?
Second, on the Due I process a sample at a time, but in the Audio Library it's blocks. What size are blocks? Is it 'AUDIO_BLOCK_SAMPLES'? I need a certain amount of buffer space to wiggle around my delay tap pointers, and I suppose it should be calculated based on the samplerate used.
Finally, I'd like to make the effect stereo, so I need to figure out how that's handled in the Audio Library. I guess it'd be stereo based on a phase adjustment of the LFO for one of the channels, to give a fake stereo spread.
If anyone skilled in the writing on Audio Library libraries finds the trivial and wants to take it on, that'd be awesome. I'd frankly just love to get going on using it to code my 'string machine' synth.
My Due code is here: https://github.com/quarterturn/due_ensenble_chorus
The root of the repo has the python code to generate the LFO wavetable.
First, my Due code deals with samples as they come in via a 44.1 KHz interrupt, but in the Audio Library it's the 'update' method getting called somehow. Does that happen at the samplerate? I'll need to know that also since I'm targeting a Teensy 3.6 and will probably calculate my LFO on the fly (should be fast enough) and that depends on samples per second, or however often 'update' gets called. I need three phases of LFO separated by 2/3*pi radians, each a sum of two sine functions, will that be too much math per update?
Second, on the Due I process a sample at a time, but in the Audio Library it's blocks. What size are blocks? Is it 'AUDIO_BLOCK_SAMPLES'? I need a certain amount of buffer space to wiggle around my delay tap pointers, and I suppose it should be calculated based on the samplerate used.
Finally, I'd like to make the effect stereo, so I need to figure out how that's handled in the Audio Library. I guess it'd be stereo based on a phase adjustment of the LFO for one of the channels, to give a fake stereo spread.
If anyone skilled in the writing on Audio Library libraries finds the trivial and wants to take it on, that'd be awesome. I'd frankly just love to get going on using it to code my 'string machine' synth.
My Due code is here: https://github.com/quarterturn/due_ensenble_chorus
The root of the repo has the python code to generate the LFO wavetable.