OpenWareLaboratory
AbstractSynth Class Referenceabstract
Inheritance diagram for AbstractSynth:
Collaboration diagram for AbstractSynth:

Public Member Functions

virtual void allNotesOff ()
 
virtual void channelPressure (MidiMessage msg)
 
virtual void controlChange (MidiMessage msg)
 
float frequencyToNote (float freq)
 
virtual void gate (bool state)=0
 
uint8_t getNote ()
 Set note in whole semitones. More...
 
float getPitchBend ()
 Get pitch bend amount in semitones. More...
 
float getPitchBendRange ()
 Get pitch bend range in semitones. More...
 
float getTuning ()
 
virtual void modulate (MidiMessage msg)
 
virtual void noteOff (MidiMessage msg)
 
virtual void noteOn (MidiMessage msg)
 
float noteToFrequency (float note)
 
virtual void pitchbend (MidiMessage msg)
 
virtual void polyKeyPressure (MidiMessage msg)
 
virtual void process (MidiMessage msg)
 
void setDynamicRange (float db)
 
virtual void setFrequency (float freq)=0
 
virtual void setGain (float gain)=0
 
virtual void setModulation (float modulation)
 
void setModulationDepthRange (float range)
 Set modulation depth range, from 0 to 1.0. More...
 
virtual void setNote (uint8_t note)
 Set note in whole semitones and update frequency. More...
 
virtual void setParameter (uint8_t parameter_id, float value)
 Set a Synth parameter. More...
 
virtual void setPitchBend (float pb)
 Set pitch bend amount in semitones and update frequency. More...
 
void setPitchBendRange (float range)
 Set pitch bend range in semitones. More...
 
virtual void setPressure (float pressure)
 
void setTuning (float value)
 Set frequency in Hertz for middle A (defaults to Stuttgart pitch, A440, 440 Hz) More...
 
virtual void sustain (MidiMessage msg)
 
virtual void trigger ()=0
 
float velocityToGain (float v)
 
virtual ~AbstractSynth ()
 

Protected Attributes

float mod_range = 0.5/127.0f
 
uint8_t note = 60
 
float pb = 0
 
float pb_range = 2/8192.0f
 
float tuning = 440
 

Detailed Description

Definition at line 9 of file AbstractSynth.h.

Constructor & Destructor Documentation

◆ ~AbstractSynth()

virtual AbstractSynth::~AbstractSynth ( )
inlinevirtual

Definition at line 17 of file AbstractSynth.h.

Member Function Documentation

◆ allNotesOff()

virtual void AbstractSynth::allNotesOff ( )
inlinevirtual

Definition at line 100 of file AbstractSynth.h.

References Synth::gate().

Referenced by controlChange().

◆ channelPressure()

virtual void AbstractSynth::channelPressure ( MidiMessage  msg)
inlinevirtual

Reimplemented from MidiProcessor.

Definition at line 88 of file AbstractSynth.h.

References MidiMessage::getChannelPressure(), and setPressure().

◆ controlChange()

virtual void AbstractSynth::controlChange ( MidiMessage  msg)
inlinevirtual

◆ frequencyToNote()

float AbstractSynth::frequencyToNote ( float  freq)
inline

Definition at line 107 of file AbstractSynth.h.

References tuning.

◆ gate()

virtual void Synth::gate ( bool  state)
pure virtualinherited

Referenced by allNotesOff(), noteOff(), and noteOn().

◆ getNote()

uint8_t AbstractSynth::getNote ( )
inline

Set note in whole semitones.

Definition at line 30 of file AbstractSynth.h.

References note.

◆ getPitchBend()

float AbstractSynth::getPitchBend ( )
inline

Get pitch bend amount in semitones.

Definition at line 43 of file AbstractSynth.h.

References pb.

◆ getPitchBendRange()

float AbstractSynth::getPitchBendRange ( )
inline

Get pitch bend range in semitones.

Definition at line 56 of file AbstractSynth.h.

References pb_range.

◆ getTuning()

float AbstractSynth::getTuning ( )
inline

Definition at line 24 of file AbstractSynth.h.

References tuning.

◆ modulate()

virtual void AbstractSynth::modulate ( MidiMessage  msg)
inlinevirtual

Reimplemented from MidiProcessor.

Definition at line 94 of file AbstractSynth.h.

References MidiMessage::getControllerValue(), mod_range, and setModulation().

◆ noteOff()

virtual void AbstractSynth::noteOff ( MidiMessage  msg)
inlinevirtual

Reimplemented from MidiProcessor.

Definition at line 79 of file AbstractSynth.h.

References Synth::gate().

◆ noteOn()

virtual void AbstractSynth::noteOn ( MidiMessage  msg)
inlinevirtual

◆ noteToFrequency()

float AbstractSynth::noteToFrequency ( float  note)
inline

Definition at line 110 of file AbstractSynth.h.

References note, and tuning.

Referenced by noteOn(), setNote(), and setPitchBend().

◆ pitchbend()

virtual void AbstractSynth::pitchbend ( MidiMessage  msg)
inlinevirtual

Reimplemented from MidiProcessor.

Definition at line 97 of file AbstractSynth.h.

References MidiMessage::getPitchBend(), pb_range, and setPitchBend().

◆ polyKeyPressure()

virtual void AbstractSynth::polyKeyPressure ( MidiMessage  msg)
inlinevirtual

Reimplemented from MidiProcessor.

Definition at line 91 of file AbstractSynth.h.

References MidiMessage::getPolyKeyPressure(), and setPressure().

◆ process()

◆ setDynamicRange()

void VelocityCurve::setDynamicRange ( float  db)
inlineinherited

Definition at line 20 of file VelocityCurve.h.

◆ setFrequency()

virtual void Synth::setFrequency ( float  freq)
pure virtualinherited

Referenced by noteOn(), setNote(), and setPitchBend().

◆ setGain()

virtual void Synth::setGain ( float  gain)
pure virtualinherited

Referenced by noteOn().

◆ setModulation()

virtual void AbstractSynth::setModulation ( float  modulation)
inlinevirtual

Definition at line 104 of file AbstractSynth.h.

Referenced by controlChange(), and modulate().

◆ setModulationDepthRange()

void AbstractSynth::setModulationDepthRange ( float  range)
inline

Set modulation depth range, from 0 to 1.0.

Definition at line 69 of file AbstractSynth.h.

References mod_range.

◆ setNote()

virtual void AbstractSynth::setNote ( uint8_t  note)
inlinevirtual

Set note in whole semitones and update frequency.

Definition at line 36 of file AbstractSynth.h.

References note, noteToFrequency(), pb, and Synth::setFrequency().

Referenced by noteOn().

◆ setParameter()

virtual void Synth::setParameter ( uint8_t  parameter_id,
float  value 
)
inlinevirtualinherited

Set a Synth parameter.

The definition of each parameter is determined by the Synth.

Definition at line 16 of file Synth.h.

◆ setPitchBend()

virtual void AbstractSynth::setPitchBend ( float  pb)
inlinevirtual

Set pitch bend amount in semitones and update frequency.

Definition at line 49 of file AbstractSynth.h.

References note, noteToFrequency(), pb, and Synth::setFrequency().

Referenced by pitchbend().

◆ setPitchBendRange()

void AbstractSynth::setPitchBendRange ( float  range)
inline

Set pitch bend range in semitones.

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

Definition at line 63 of file AbstractSynth.h.

◆ setPressure()

virtual void AbstractSynth::setPressure ( float  pressure)
inlinevirtual

Definition at line 105 of file AbstractSynth.h.

Referenced by channelPressure(), and polyKeyPressure().

◆ setTuning()

void AbstractSynth::setTuning ( float  value)
inline

Set frequency in Hertz for middle A (defaults to Stuttgart pitch, A440, 440 Hz)

Definition at line 21 of file AbstractSynth.h.

References tuning.

◆ sustain()

virtual void MidiProcessor::sustain ( MidiMessage  msg)
inlinevirtualinherited

Reimplemented in VoiceAllocator< SynthVoice, VOICES >, and VoiceAllocator< SynthVoice, 1 >.

Definition at line 16 of file MidiProcessor.h.

◆ trigger()

virtual void Synth::trigger ( )
pure virtualinherited

◆ velocityToGain()

float VelocityCurve::velocityToGain ( float  v)
inlineinherited

Definition at line 25 of file VelocityCurve.h.

Referenced by noteOn().

Field Documentation

◆ mod_range

float AbstractSynth::mod_range = 0.5/127.0f
protected

Definition at line 14 of file AbstractSynth.h.

Referenced by modulate(), and setModulationDepthRange().

◆ note

uint8_t AbstractSynth::note = 60
protected

Definition at line 11 of file AbstractSynth.h.

Referenced by getNote(), noteOn(), noteToFrequency(), setNote(), and setPitchBend().

◆ pb

float AbstractSynth::pb = 0
protected

Definition at line 12 of file AbstractSynth.h.

Referenced by getPitchBend(), noteOn(), setNote(), and setPitchBend().

◆ pb_range

float AbstractSynth::pb_range = 2/8192.0f
protected

Definition at line 13 of file AbstractSynth.h.

Referenced by getPitchBendRange(), and pitchbend().

◆ tuning

float AbstractSynth::tuning = 440
protected

Definition at line 15 of file AbstractSynth.h.

Referenced by frequencyToNote(), getTuning(), noteToFrequency(), and setTuning().


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