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


FM instrument capable of soft and harsh tones

Description

Clone of fors Pop Max for Live device. FM sine oscillator with two modulators. Can be configured to a variety of modulation ratio schemes and amounts of modulation/feedback. 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

mPopInstrument(uint8_t *midi_table_name = NULL)

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()


void setADSR(uint32_t attack_time, uint32_t decay_time, int16_t sustain_level, int32_t release_time)

Configures amplitude envelope. Times in milliseconds. Sustain level from silence to unity gain (0 to 255)


void setReleaseTime(uint32_t release_time)

Sets release time of amplitude envelope in ms.


void setModAttack(uint32_t attack_time)

Sets attack time of modulation oscillators’ amplitude envelope in ms.


void setModDecay(uint32_t decay_time)

Sets decay time of modulation oscillators’ amplitude envelope in ms.


void setModSustain(uint16_t sustain_level)

Sets sustain level of modulation oscillators’ amplitude envelope (0 to 255).


void setModAmount(float modulation_amount)

Sets amount that modulation oscillators will modulate carrier oscillator (0 to 1.0)


void setFeedback(float feedback)

Sets how much the modulation oscillators will modulate themselvesself (0 to 1.0)


void setTimbre(float timbre)

Sets both mod amount and feedback amount according to the curve used in original Pop M4L device. As timbre is increased, the sound will become brighter and ultimately harsh and noisy. (0 to 1.0)


void setSpectraList(MEAP_pop_spectra_labels)

Choose collection of ratios that modulation oscillors will choose from among the following:

View mPopVoice.h for full documentation


void setSpectra(int32_t index)

Chooses ratios of the two modulation oscillators from the list chosen in setSpectraList. (0 to 15)

Low numbers will choose ratios from beginning of list (generally low frequencies resulting in warmer tones) while high numbers will choose ratios from end of list (generally high frequencies resultint in bright, harsh, noisy tones)

The two modulation oscillators will choose adjacent entries in list. For example, if index is 0, the first modulation oscillator will choose index 0 and the second will choose index 1.

Example

Relevant Tutorials