Experiments with Mozzi, mostly on SAMD21- and RP2040-based boards
-
eighties_dystopia - A swirling ominous wub that evolves over time
-
eighties_dystopia_rp2040 - Same thing, but on a Raspberry Pi Pico w/ PWM audio
-
eighties_dystopia_rp2040_i2s - Same thing, but on a Raspberry Pi Pico w/ I2S DAC
-
eighties_arp - An arpeggio explorer for non-musicians and test bed for my "Arpy" arpeggio library
-
eighties_drums - simple 4-channel drum machine w/ sequencer
-
derpnote2 - Tries to recreate THX "Deep Note" sound
-
and others in the repo
-
"derpnote2" - demo on youtube
-
"eighties_drums" - demo on youtube
-
"eighties_dystopia" - See this Twitter thread or this blog post on Adafruit or this video below
eighties_dystopia_clip720p_nohdr.mp4
-
"eighties_arp" - click for youtube video
Mozzi 2 is now in the Arduino Library Manager! And it's much easier to configure. To install Mozzi, find it in the Arduino Library Manager and install it and its dependencies.
You can now configure Mozzi in your sketch intead of editing Mozzi library files.
The hardware configuration section of the Mozzi docs is very helpful.
The pattern is that you put this at the top of your sketch:
#include "MozziConfigValues.h" // for named option values
// your system-specific configuration defines, including MOZZI_CONTROL_RATE
#include "Mozzi.h"
The configs I've used so far. Some of these configs are the defaults but I like to be explicit.
-
SAMD21 boards using DAC on A0 as output:
#include "MozziConfigValues.h" // for named option values #define MOZZI_ANALOG_READ MOZZI_ANALOG_READ_NONE #define MOZZI_CONTROL_RATE 128 // mozzi rate for updateControl() #include "Mozzi.h"
-
RP2040 boards (including Raspberry Pi Pico) using PWM audio out:
#include "MozziConfigValues.h" // for named option values #define MOZZI_OUTPUT_MODE MOZZI_OUTPUT_PWM #define MOZZI_ANALOG_READ MOZZI_ANALOG_READ_NONE #define MOZZI_AUDIO_PIN_1 0 // GPIO pin number, can be any pin #define MOZZI_AUDIO_RATE 32768 #define MOZZI_CONTROL_RATE 128 // mozzi rate for updateControl() #include "Mozzi.h"
-
RP2040 boards using I2S DAC audio out:
#include "MozziConfigValues.h" // for named option values #define MOZZI_AUDIO_MODE MOZZI_OUTPUT_I2S_DAC #define MOZZI_AUDIO_CHANNELS MOZZI_STEREO #define MOZZI_AUDIO_BITS 16 #define MOZZI_AUDIO_RATE 32768 #define MOZZI_I2S_PIN_BCK 20 #define MOZZI_I2S_PIN_WS (MOZZI_I2S_PIN_BCK+1) // HAS TO BE NEXT TO pBCLK, i.e. default is 21 #define MOZZI_I2S_PIN_DATA 22 #define MOZZI_CONTROL_RATE 128 // mozzi rate for updateControl() #include "Mozzi.h"
- Mozzi is very particular about what is in
loop()
. Do not put anything else in there. Instead put it in thevoid updateControl()
function. See the sketches for examples.
Open up an issue on this repo or contact me on @todbot@mastodon.social!