OpenWareLaboratory
VoiceAllocator< SynthVoice, VOICES > Class Template Reference
Inheritance diagram for VoiceAllocator< SynthVoice, VOICES >:
Collaboration diagram for VoiceAllocator< SynthVoice, VOICES >:

Public Member Functions

void allNotesOff ()
 
void allNotesOn ()
 
virtual void channelPressure (MidiMessage msg)
 
void controlChange (MidiMessage msg)
 
float getPitchBendRange ()
 
bool getSustain ()
 
float getTuning ()
 
SynthVoice * getVoice (size_t index)
 
virtual void modulate (MidiMessage msg)
 
virtual void noteOff (MidiMessage msg)
 
virtual void noteOn (MidiMessage msg)
 
virtual void pitchbend (MidiMessage msg)
 
virtual void polyKeyPressure (MidiMessage msg)
 
virtual void process (MidiMessage msg)
 
void rpn (uint16_t id, uint8_t msb, uint8_t lsb, MidiMessage msg)
 
void setDynamicRange (float range)
 Set the MIDI velocity dynamic range in dB, default 72dB. More...
 
void setModulationDepthRange (float range)
 Set modulation depth range, from 0 to 1.0. More...
 
void setParameter (uint8_t parameter_id, float value)
 
void setPitchBendRange (float range)
 Set pitch bend range in semitones. More...
 
void setSustain (bool value)
 
void setTuning (float frequency)
 
void setVoice (size_t index, SynthVoice *obj)
 
void sustain (MidiMessage msg)
 
virtual void sustainOff ()
 

Static Protected Member Functions

static float frequencyToNote (float freq)
 
static float noteToFrequency (float note)
 

Protected Attributes

bool dosustain = false
 
float mod_range = 0.5/127.0f
 
float pb_range = 2/8192.0f
 
uint16_t rpn_id = 0
 
uint8_t rpn_msb = 0
 
uint8_t tuning_semitones = 69
 
SynthVoice * voice [VOICES]
 

Detailed Description

template<class SynthVoice, int VOICES>
class VoiceAllocator< SynthVoice, VOICES >

Definition at line 5 of file VoiceAllocator.h.

Member Function Documentation

◆ allNotesOff()

template<class SynthVoice , int VOICES>
void VoiceAllocator< SynthVoice, VOICES >::allNotesOff ( )
inline

◆ allNotesOn()

template<class SynthVoice , int VOICES>
void VoiceAllocator< SynthVoice, VOICES >::allNotesOn ( )
inline

Definition at line 58 of file VoiceAllocator.h.

References VoiceAllocator< SynthVoice, VOICES >::voice.

◆ channelPressure()

virtual void MidiProcessor::channelPressure ( MidiMessage  msg)
inlinevirtualinherited

◆ controlChange()

◆ frequencyToNote()

template<class SynthVoice , int VOICES>
static float VoiceAllocator< SynthVoice, VOICES >::frequencyToNote ( float  freq)
inlinestaticprotected

Definition at line 17 of file VoiceAllocator.h.

◆ getPitchBendRange()

template<class SynthVoice , int VOICES>
float VoiceAllocator< SynthVoice, VOICES >::getPitchBendRange ( )
inline

◆ getSustain()

template<class SynthVoice , int VOICES>
bool VoiceAllocator< SynthVoice, VOICES >::getSustain ( )
inline

Definition at line 78 of file VoiceAllocator.h.

References VoiceAllocator< SynthVoice, VOICES >::dosustain.

◆ getTuning()

template<class SynthVoice , int VOICES>
float VoiceAllocator< SynthVoice, VOICES >::getTuning ( )
inline

Definition at line 46 of file VoiceAllocator.h.

References VoiceAllocator< SynthVoice, VOICES >::voice.

◆ getVoice()

template<class SynthVoice , int VOICES>
SynthVoice* VoiceAllocator< SynthVoice, VOICES >::getVoice ( size_t  index)
inline

Definition at line 66 of file VoiceAllocator.h.

References VoiceAllocator< SynthVoice, VOICES >::voice.

◆ modulate()

virtual void MidiProcessor::modulate ( MidiMessage  msg)
inlinevirtualinherited

◆ noteOff()

virtual void MidiProcessor::noteOff ( MidiMessage  msg)
inlinevirtualinherited

◆ noteOn()

virtual void MidiProcessor::noteOn ( MidiMessage  msg)
inlinevirtualinherited

◆ noteToFrequency()

template<class SynthVoice , int VOICES>
static float VoiceAllocator< SynthVoice, VOICES >::noteToFrequency ( float  note)
inlinestaticprotected

Definition at line 14 of file VoiceAllocator.h.

Referenced by VoiceAllocator< SynthVoice, VOICES >::rpn().

◆ pitchbend()

virtual void MidiProcessor::pitchbend ( MidiMessage  msg)
inlinevirtualinherited

◆ polyKeyPressure()

virtual void MidiProcessor::polyKeyPressure ( MidiMessage  msg)
inlinevirtualinherited

◆ process()

◆ rpn()

◆ setDynamicRange()

template<class SynthVoice , int VOICES>
void VoiceAllocator< SynthVoice, VOICES >::setDynamicRange ( float  range)
inline

Set the MIDI velocity dynamic range in dB, default 72dB.

Definition at line 42 of file VoiceAllocator.h.

References VoiceAllocator< SynthVoice, VOICES >::voice.

◆ setModulationDepthRange()

template<class SynthVoice , int VOICES>
void VoiceAllocator< SynthVoice, VOICES >::setModulationDepthRange ( float  range)
inline

Set modulation depth range, from 0 to 1.0.

Definition at line 35 of file VoiceAllocator.h.

References VoiceAllocator< SynthVoice, VOICES >::voice.

Referenced by VoiceAllocator< SynthVoice, VOICES >::rpn().

◆ setParameter()

template<class SynthVoice , int VOICES>
void VoiceAllocator< SynthVoice, VOICES >::setParameter ( uint8_t  parameter_id,
float  value 
)
inline

Definition at line 71 of file VoiceAllocator.h.

References VoiceAllocator< SynthVoice, VOICES >::voice.

◆ setPitchBendRange()

template<class SynthVoice , int VOICES>
void VoiceAllocator< SynthVoice, VOICES >::setPitchBendRange ( float  range)
inline

Set pitch bend range in semitones.

Does not update the frequency; effective from next pitch bend change

Definition at line 28 of file VoiceAllocator.h.

References VoiceAllocator< SynthVoice, VOICES >::voice.

Referenced by MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::rpn(), and VoiceAllocator< SynthVoice, VOICES >::rpn().

◆ setSustain()

template<class SynthVoice , int VOICES>
void VoiceAllocator< SynthVoice, VOICES >::setSustain ( bool  value)
inline

◆ setTuning()

template<class SynthVoice , int VOICES>
void VoiceAllocator< SynthVoice, VOICES >::setTuning ( float  frequency)
inline

◆ setVoice()

template<class SynthVoice , int VOICES>
void VoiceAllocator< SynthVoice, VOICES >::setVoice ( size_t  index,
SynthVoice *  obj 
)
inline

Definition at line 62 of file VoiceAllocator.h.

References VoiceAllocator< SynthVoice, VOICES >::voice.

◆ sustain()

template<class SynthVoice , int VOICES>
void VoiceAllocator< SynthVoice, VOICES >::sustain ( MidiMessage  msg)
inlinevirtual

◆ sustainOff()

template<class SynthVoice , int VOICES>
virtual void VoiceAllocator< SynthVoice, VOICES >::sustainOff ( )
inlinevirtual

Field Documentation

◆ dosustain

◆ mod_range

template<class SynthVoice , int VOICES>
float VoiceAllocator< SynthVoice, VOICES >::mod_range = 0.5/127.0f
protected

◆ pb_range

template<class SynthVoice , int VOICES>
float VoiceAllocator< SynthVoice, VOICES >::pb_range = 2/8192.0f
protected

Definition at line 8 of file VoiceAllocator.h.

◆ rpn_id

template<class SynthVoice , int VOICES>
uint16_t VoiceAllocator< SynthVoice, VOICES >::rpn_id = 0
protected

◆ rpn_msb

template<class SynthVoice , int VOICES>
uint8_t VoiceAllocator< SynthVoice, VOICES >::rpn_msb = 0
protected

◆ tuning_semitones

template<class SynthVoice , int VOICES>
uint8_t VoiceAllocator< SynthVoice, VOICES >::tuning_semitones = 69
protected

Definition at line 13 of file VoiceAllocator.h.

Referenced by VoiceAllocator< SynthVoice, VOICES >::rpn().

◆ voice

template<class SynthVoice , int VOICES>
SynthVoice* VoiceAllocator< SynthVoice, VOICES >::voice[VOICES]
protected

Definition at line 7 of file VoiceAllocator.h.

Referenced by VoiceAllocator< SynthVoice, VOICES >::allNotesOff(), VoiceAllocator< SynthVoice, VOICES >::allNotesOn(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::channelPressure(), PolyphonicProcessor< SynthVoice, VOICES >::channelPressure(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::controlChange(), VoiceAllocator< SynthVoice, VOICES >::getPitchBendRange(), VoiceAllocator< SynthVoice, VOICES >::getTuning(), VoiceAllocator< SynthVoice, VOICES >::getVoice(), PolyphonicProcessor< SynthVoice, VOICES >::modulate(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::pitchbend(), PolyphonicProcessor< SynthVoice, VOICES >::pitchbend(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::polyKeyPressure(), PolyphonicProcessor< SynthVoice, VOICES >::polyKeyPressure(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::release(), PolyphonicProcessor< SynthVoice, VOICES >::release(), VoiceAllocator< SynthVoice, VOICES >::setDynamicRange(), VoiceAllocator< SynthVoice, VOICES >::setModulationDepthRange(), VoiceAllocator< SynthVoice, VOICES >::setParameter(), VoiceAllocator< SynthVoice, VOICES >::setPitchBendRange(), VoiceAllocator< SynthVoice, VOICES >::setTuning(), VoiceAllocator< SynthVoice, VOICES >::setVoice(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::sustainOff(), PolyphonicProcessor< SynthVoice, VOICES >::sustainOff(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::take(), and PolyphonicProcessor< SynthVoice, VOICES >::take().


The documentation for this class was generated from the following file: