1. Everything sounds glitchy, including the examples.
2. Everything sounds too quiet.
3. My patch was working and now it sounds horrible!
4. How can I optimise my code to get the most out of Mozzi?
5. How can I extend Mozzi?
6. Can I contribute developments? How?
Everything sounds glitchy, including the examples.
Maybe you’re listening to a
STANDARD_PLUS sketch, but
AUDIO_MODE is set to
Check the file Mozzi/mozzi_config.h. Look for:
//#define AUDIO_MODE STANDARD #define AUDIO_MODE STANDARD_PLUS //#define AUDIO_MODE HIFI
STANDARD_PLUS mode, the lines should appear as above,
HIFI lines commented out. Most of the examples work in
STANDARD_PLUS mode, unless they say otherwise.
Everything sounds too quiet.
Check if you’re listening to a
HIFI sketch in
STANDARD_PLUS mode. See the previous answer.
My patch was working and now it sounds horrible!
- Has the
AUDIO_MODEchanged in Mozzi/mozzi_config.h?
- Is the processor having trouble keeping up with the amount of calculations it’s doing?
- Has a signed or unsigned variable been cast to the wrong sign?
- Is there a data type overflowing somewhere?
- Are there
Serial.print()statements slowing things down?
How can I optimise my code to get the most out of Mozzi?
Read this: Atmel AVR4027: Tips and Tricks to Optimize. Your C Code for 8-bit AVR Microcontrollers.
And there are a few hints here on the Mozzi site.
Also, to make your compiled code run slightly faster, Arduino versions above 1.5 can be tweaked to optimise for speed instead of small size.
Find Arduino’s platform.txt (on OSX you can find it by searching in Users/your_name/Library/Arduino15). Search and replace -Os with -O2. Save.
It’s explained more thoroughly (for Windows) here.
If you still need more speed, Arduino 1.0.5 compiles code that runs slightly faster.
How can I extend Mozzi?
It’s easy! I usually copy the simplest class.h file I can find in the Mozzi folder and base the next thing on that.
Usually it’ll have a
next() method, maybe a couple of
set() methods and whetever else you decide on.
It might make use of
It seems self-explanatory to me, but then I haven’t ever explained it to anyone.
Can I contribute developments? How?
To be continued…