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

Derivatives of this class are those that do something (anything) with MIDI messages. More...

#include <MidiMsgDestination.h>

Inheritance diagram for AudioDataLib::MidiMsgDestination:
AudioDataLib::MidiMsgLogDestination AudioDataLib::MidiMsgRecorderDestination AudioDataLib::MidiSynth AudioDataLib::SampleBasedSynth AudioDataLib::SimpleSynth AudioDataLib::SubtractiveSynth

Public Member Functions

 MidiMsgDestination ()
 
virtual ~MidiMsgDestination ()
 
virtual bool ReceiveMessage (double deltaTimeSeconds, const uint8_t *message, uint64_t messageSize, Error &error)
 
virtual bool Initialize (Error &error)
 
virtual bool Finalize (Error &error)
 
virtual bool Process (Error &error)
 

Detailed Description

Derivatives of this class are those that do something (anything) with MIDI messages.

For example, the user might provide a derivative of this class that sends the given messages to a MIDI port for synthesis.

Constructor & Destructor Documentation

◆ MidiMsgDestination()

MidiMsgDestination::MidiMsgDestination ( )

◆ ~MidiMsgDestination()

MidiMsgDestination::~MidiMsgDestination ( )
virtual

Member Function Documentation

◆ Finalize()

bool MidiMsgDestination::Finalize ( Error & error)
virtual

This method will get called by the MidiMsgSource class during its own finalization.

Parameters
[out]errorThis should be populated with error information if false is returned.
Returns
True should be returned on success; false otherwise.

Reimplemented in AudioDataLib::MidiMsgRecorderDestination.

◆ Initialize()

bool MidiMsgDestination::Initialize ( Error & error)
virtual

This method will get called by the MidiMsgSource class during its own initialization.

Parameters
[out]errorThis should be populated with error information if false is returned.
Returns
True should be returned on success; false otherwise.

Reimplemented in AudioDataLib::SampleBasedSynth.

◆ Process()

bool MidiMsgDestination::Process ( Error & error)
virtual

This method will get called by the MidiMsgSource class during it's own processing, which should get get periodically a program's main loop, or perhaps a thread.

Parameters
[out]errorThis should be populated with error information if false is returned.
Returns
True should be returned on success; false otherwise.

Reimplemented in AudioDataLib::MidiSynth, and AudioDataLib::SampleBasedSynth.

◆ ReceiveMessage()

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

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 in AudioDataLib::MidiMsgLogDestination, AudioDataLib::MidiMsgRecorderDestination, AudioDataLib::SampleBasedSynth, AudioDataLib::SimpleSynth, and AudioDataLib::SubtractiveSynth.


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