Reply To: Bug when sending audio data to arduino

Home Forums Products NS1nanosynth Bug when sending audio data to arduino Reply To: Bug when sending audio data to arduino



No problem. Just some pratical testing.

First question, better sound quality:

I tried to get better quality. AUDIO_MODE STANDARD_PLUS will give you 8 bit effect.
You could try to edit Mozzi/mozzi_config.h to use AUDIO_MODE HIFI and higher AUDIO_RATE.
I tried it but like I wrote I didn’t get any sound then. Did not investigate if arduino hanged or if the problem was in the Mozzi lib.

Your second question is maybe about longer delay:

The problem with delay and reverb is that it demands dynamic memory.
Let us say that you want to have CD quality (44.1 kHz 16 bits) and at least one second delay.
Then you need one array…

uint16_t echo[44100];

… to store the incoming audio.

And I have done a little experiment with a small scetch, skipped Mozzi lib totally and used the DAC in combination with timer4… and the dynamic memory was not enought in leornardo. I had to put in down to something like 16 kHz, 12 bit for it to work.

Now look at Mozzi smallest AUDIO_RATE 16384. Then see that a small scetch with USE_AUDIO_INPUT true takes at least 55% of dynamic memory (that is probably for the audiobuffer)!
And then add a longer delayline on top of that, not a good idea if you ask me.

Maybe you can hack the Mozzi lib, do something with the audiobuffer or simular.
There are ways… But it will take allot your time.