class: mMarimbaInstrument
modal synthesis based marimba-like instrument
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();