MEAP The Library

MOZZI
MEAP The Class
C++ tips
Mozzi Reworks
mOscil
mSample
Generators
mDust
mNoise
mOperator
mSineLFO
mEnvSection
Effects
mBitcrusher
mChorus
mDigitalDelay
mFlanger
mPlateReverb
mSchroederReverb
DSP
mDelayLine
mFeedbackComb
mFeedforwardComb
mFIR
mIIR
mNaturalComb
mOnePoleLPF
mResonz
mRingz
mSchroederAllpass
mInstruments
mDrumRack
mFM4Instrument
mMarimbaInstrument
mPopInstrument
mRompler
mStringInstrument
mStringSynthInstrument
Composition
mMML
mTransitionTable
Utilities
mEventDelayMicros
mRandomDistribution

class: mMML


Music Macro Language for basic sequencing

Description

Music Macro Language is a family of string based languages for describing the notation of music. It was originally created for computers running Basic for writing simple audio alerts and soundtracking video games. It has a simple syntax for quickly notating melodies. There are several different implementations of MML-like languages out there all with slighty different syntax. MEAP’s MML syntax is described below.

An mMML string consists of a series of commands, specified using a letter. Each command may be followed by one or more modifiers. Spaces are allowed between commands but not between a command and its modifier (ie. “cd ef” is valid but “cd 8ef” is not)


Command: “a,b,c,d,e,f,g”

play the specified note

Modifiers:


Command: o

Set octave. Following notes will be played in the specified octave until another “o” command is encountered

Modifier:


Command: v

Set velocity. Following notes will be played with the specified volume until another “v” command is encountered

Modifier:


Command: t

Set tempo. Stays at this tempo until another “t” command is encountered.

Modifier:


Command: r Rest.

Modifiers:


Command: l

Set note length. Following notes will be played with the specified length until another “v” command is encountered

Modifier:


Class Methods

Constructor

mMML(void(*noteOn_)(uint16_t note uint16_t vel), void (*noteOff_)(uint16_t note), String mml_string;

noteOn_: Function pointer to user-provided note on function. Whenever the MML string wants to turn on a note, it will call this function. The function can do/be named whatever you want but MUST be in the specified format (ie two uint16_t arguments and a void return type). The first argument specifies the MIDI note number to turn on and the second specifies the MIDI velocity (0-127) of that note.

noteOff_: Function pointer to user-provided note off function. Whenever the MML string wants to turn off a note, it will call this function. The function can do/be named whatever you want but MUST be in the specified format (ie one uint16_t argument which specifies the MIDI note number to turn off and a void return type)

mml_string: a string describing your musical sequence in the MML format specified above.


void next()

Polls the MML string and moves through it if needed. Called in either updateAudio or updateControl depending on your timing requirements

Example

Relevant Tutorials