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 or STANDARD_PLUS sketch, but AUDIO_MODE is set to HIFI. Check the file Mozzi/mozzi_config.h. Look for:

//#define AUDIO_MODE STANDARD
#define AUDIO_MODE STANDARD_PLUS
//#define AUDIO_MODE HIFI

For STANDARD_PLUS mode, the lines should appear as above, with the STANDARD and HIFI lines commented out. Most of the examples work in STANDARD_PLUS mode, unless they say otherwise.

(go to top)


Everything sounds too quiet.

Check if you’re listening to a HIFI sketch in STANDARD or STANDARD_PLUS mode. See the previous answer.

(go to top)


My patch was working and now it sounds horrible!

  • Has the AUDIO_MODE changed 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?

(go to top)


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.

(go to top)


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 AUDIO_RATE or CONTROL_RATE. It seems self-explanatory to me, but then I haven’t ever explained it to anyone.

(go to top)


Can I contribute developments? How?

Fork Mozzi on GitHub, and your changes will become part of the “development graph”, or just post to the users’ list.

(go to top)


To be continued…