AudioDataLib
A C++ library of classes supporting a variety of audio-data tasks.
Loading...
Searching...
No Matches
AudioDataLib::SubtractiveSynth Class Reference

#include <SubtractiveSynth.h>

Inheritance diagram for AudioDataLib::SubtractiveSynth:
AudioDataLib::MidiSynth AudioDataLib::MidiMsgDestination

Public Member Functions

 SubtractiveSynth ()
 
virtual ~SubtractiveSynth ()
 
virtual bool ReceiveMessage (double deltaTimeSeconds, const uint8_t *message, uint64_t messageSize, Error &error) override
 
virtual SynthModuleGetRootModule (uint16_t channel) override
 
- Public Member Functions inherited from AudioDataLib::MidiSynth
 MidiSynth ()
 
virtual ~MidiSynth ()
 
virtual bool Process (Error &error) override
 
void SetAudioStream (std::shared_ptr< AudioStream > audioStream)
 
std::shared_ptr< AudioStreamGetAudioStream ()
 
void SetMinMaxLatency (double minLatencySeconds, double maxLatencySeconds)
 
void GetMinMaxLatency (double &minLatencySeconds, double &maxLatencySeconds) const
 
- Public Member Functions inherited from AudioDataLib::MidiMsgDestination
 MidiMsgDestination ()
 
virtual ~MidiMsgDestination ()
 
virtual bool Initialize (Error &error)
 
virtual bool Finalize (Error &error)
 

Additional Inherited Members

- Static Public Member Functions inherited from AudioDataLib::MidiSynth
static double MidiPitchToFrequency (uint8_t pitchValue)
 
static double MidiVelocityToAmplitude (uint8_t velocityValue)
 
- Protected Attributes inherited from AudioDataLib::MidiSynth
std::shared_ptr< AudioStream > * audioStream
 
double minLatencySeconds
 This is the minimum amount of audio (measured in seconds) that should always be buffered at any given time.
 
double maxLatencySeconds
 This is the maximum amount of audio (measured in seconds) that should always be buffered at any given time.
 

Constructor & Destructor Documentation

◆ SubtractiveSynth()

SubtractiveSynth::SubtractiveSynth ( )

◆ ~SubtractiveSynth()

SubtractiveSynth::~SubtractiveSynth ( )
virtual

Member Function Documentation

◆ GetRootModule()

SynthModule * SubtractiveSynth::GetRootModule ( uint16_t channel)
overridevirtual

A derived class must impliment this method to provide a SynthModule that can feed the given channel. Note that the term "channel" is overloaded. It can refer to a channel in a stream of audio (e.g., left, right, mono, etc.), as is the case here, or it can mean a MIDI channel, of which there are 16, so don't get them confused. Context usually makes it clear.

Implements AudioDataLib::MidiSynth.

◆ ReceiveMessage()

bool SubtractiveSynth::ReceiveMessage ( double deltaTimeSeconds,
const uint8_t * message,
uint64_t messageSize,
Error & error )
overridevirtual

This method will be called when this destination is to receive the given MIDI message. Note that it's important that no heavy processing be done in this method (such as is the mentality when writing an audio callback), because the timing of MIDI message reception and processing can effect the quality of audio playback.

Parameters
[in]deltaTimeSecondsThis is typically, but not always, set to the amount of time (in seconds) between now and the last time the function was called.
[in]messageThis is the payload of the message, which can be decoded using a derivative of the MidiData::Event class.
[in]messageSizeThis is the size of the payload in bytes.
[out]errorThis should be populated with error information if false is returned.
Returns
True should be returned on success; false otherwise.

Reimplemented from AudioDataLib::MidiMsgDestination.


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