MostlyHarmless 0.0.1
 
Loading...
Searching...
No Matches
mostly_harmless::core::IEngine Class Referenceabstract

Interface for the plugin's audio processing functionality. More...

#include <mostlyharmless_IEngine.h>

Public Member Functions

virtual ~IEngine () noexcept=default
 
virtual void initialise (InitContext context) noexcept=0
 
virtual void process (ProcessContext context) noexcept=0
 
virtual void reset () noexcept=0
 
virtual void handleNoteOn (std::uint16_t portIndex, std::uint8_t channel, std::uint8_t note, double velocity)
 
virtual void handleNoteOff (std::uint16_t portIndex, std::uint8_t channel, std::uint8_t note, double velocity)
 

Detailed Description

Interface for the plugin's audio processing functionality.

As detailed in the FX Plugin tutorial, users must implement this, ISharedState, IPluginEntry, and optionally IEditor, and register their subclasses with the framework to create an audio plugin. These will also be created if using the provided create.py script.

Encapsulates all things audio-thread related, and all functions either run on the audio thread, or are guaranteed not to be called while the audio thread is running.

You probably want your subclass to take a pointer to your subclass of ISharedState, for access to parameters, and the procToGui / guiToProc queues.

Constructor & Destructor Documentation

◆ ~IEngine()

virtual mostly_harmless::core::IEngine::~IEngine ( )
virtualdefaultnoexcept

Virtual destructor.

Member Function Documentation

◆ handleNoteOff()

virtual void mostly_harmless::core::IEngine::handleNoteOff ( std::uint16_t portIndex,
std::uint8_t channel,
std::uint8_t note,
double velocity )
inlinevirtual

Called if the plugin receives a midi (or clap) note off event - not pure virtual, as this function isn't relevant if you haven't requested midi functionality. Called on the audio thread, in response to a noteOff event.

Parameters
portIndexThe clap port index the event originated from.
channelThe midi channel the event was passed to
noteThe 0-127 midi note that was turned off.
velocityThe 0-1 velocity of the note event

◆ handleNoteOn()

virtual void mostly_harmless::core::IEngine::handleNoteOn ( std::uint16_t portIndex,
std::uint8_t channel,
std::uint8_t note,
double velocity )
inlinevirtual

Called if the plugin receives a midi (or clap) note on event - not pure virtual, as this function isn't relevant if you haven't requested midi functionality. Called on the audio thread, in response to a noteOn event.

Parameters
portIndexThe clap port index the event originated from.
channelThe midi channel the event was passed to
noteThe 0-127 midi note that was turned on.
velocityThe 0-1 velocity of the note event

◆ initialise()

virtual void mostly_harmless::core::IEngine::initialise ( InitContext context)
pure virtualnoexcept

Called when the host is preparing to play. Any sample-rate-dependent resizing etc should be done here. Will probably not be called on the audio thread, but is guaranteed to not be called concurrently with the audio thread.

Parameters
contextAn InitContext containing various settings provided by the host.

◆ process()

virtual void mostly_harmless::core::IEngine::process ( ProcessContext context)
pure virtualnoexcept

The main audio callback function - any DSP processing should stem from this function. Called on the audio thread.

Parameters
contextA ProcessContext containing a non-owning view into the current buffer region, and an optional for transport info.

◆ reset()

virtual void mostly_harmless::core::IEngine::reset ( )
pure virtualnoexcept

Called to cleanup any resources that require cleaning up - use this to clear delay lines / temp buffers, etc etc.


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