Useful Mozzi Modules - masonandrewmann/MEAP GitHub Wiki
The following are a list of some of the more useful objects in the Mozzi library, including the module you need to include at the top of your code if you want to use that object. If you click on the name of each object it will take you to a more thorough documentation page in the Mozzi API.
A wavetable oscillator to generate an audio or control signal.
#include <Osc.h>
A simple ADSR envelope generator.
This implementation has separate update() and next() methods, where next() interpolates values between each update(). The "normal" way to use this would be with update() in updateControl(), where it calculates a new internal state each control step, and then next() is in updateAudio(), called much more often, where it interpolates between the control values. This also allows the ADSR updates to be made even more sparsely if desired, eg. every 3rd control update.
#include <ADSR.H>
Audio delay line for comb filter, flange, chorus or short echo effects.
#include <AudioDelay.h>
Audio delay line with feedback for comb filter, flange, chorus and short echo effects.
#include <AudioDelayFeedback.h>
Control-rate delay line for delaying control signals.
For example, this could be used to produce echo-like effects using multiple instances of the same voice, when AudioDelay would be too short for an actual audio echo. This is in fact just a wrapper of the AudioDelay code.
#include <ControlDelay.h>
A non-blocking replacement for Arduino's delay() function.
EventDelay can be set() to a number of milliseconds, then after calling start(), ready() will return true when the time is up. Alternatively, start(milliseconds) will call set() and start() together.
#include <EventDelay.h>
This produces a natural sounding envelope. It calculates a new value each time next() is called, which can be mapped to other parameters to change the amplitude or timbre of a sound. (Note: currently does not work at audio rate, only control rate)
#include <Ead.h>
For linear changes with a minimum of calculation at each step.
For instance, you can use Line to make an oscillator glide from one frequency to another, pre-calculating the required phase increments for each end and then letting your Line change the phase increment with only a simple addition at each step.
#include <Line.h>
A generic filter for audio signals that can produce lowpass, highpass, bandpass and notch outputs at runtime.
Behaves like ResonantFilter for setting the resonance and cutoff frequency. Like ResonantFilter, it can be used on different sample sizes: MultiResonantFilter<uint8_t> and MultiResonantFilter<uint16_t> have been tested. For the former, both cutoff and resonance are uint8_t, hence between 0-255. For the later, both cutoff and resonance are uint16_t, hence between 0-65535.
#include <ResonantFilter.h>
Sample is like Oscil, it plays a wavetable.
However, Sample can be set to play once through only, with variable start and end points, or can loop, also with variable start and end points. It defaults to playing once through the whole sound table, from start to finish.
#include <Sample.h>
A simple infinite impulse response low pass filter for smoothing control or audio signals.
#include <Smooth.h>
A simple wavefolder.
#include <WaveFolder.h>
Fast random number generator functions.
These replace Arduino random() which is so slow it can stop your audio. They can even be used to generate audio noise.
#include <mozzi_rand.h>