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: mMarimbaInstrument


Description

Basic physical model of a marimba created by pinging an array of resonant filters tuned to resonant frequencies of a wooden bar. Inherits all functions from mInstrument parent class and adds the following functionality.

Template Parameters

template <uint16_t mPOLYPHONY = 4>

mPOLYPHONY: number of voices the instrument can play simultaneously

Class Methods

Constructor

mMarimbaInstrument(uint8_t *midi_table_name)

midi_table_name: (OPTIONAL) table of MIDI data for the instrument to play.


int32_t next()

Calculates a sample of output. Nominally a 16-bit signal level. MUST BE CALLED IN updateAudio()

Example

// ===== Global variables =====
#include "midi_sequence.h" // optional MIDI sequence converted with MIDI converter script. If you aren't using one, leave the constructor argument below empty

mMarimbaInstrument<4> my_marimba(midi_sequence_data);

// ===== in updateAudio =====
int64_t out_sample = my_marimba.next();

Relevant Tutorials