5#ifndef LS_VIRTUALMIDIDEVICE_H
6#define LS_VIRTUALMIDIDEVICE_H
8#include "../../common/global.h"
Wraps as a kind of pointer class some data object shared with other threads, to protect / synchronize...
Light-weight MIDI interface (for MIDI in & out) intended to be used by pure software MIDI "devices",...
bool SendCCToSampler(uint8_t Controller, uint8_t Value)
Sends a MIDI Control Change event to the sampler.
bool SendNoteOffToSampler(uint8_t Key, uint8_t Velocity)
Sends a MIDI note off event to the sampler.
uint8_t NoteOnVelocity(uint8_t Key)
Returns the velocity of the last note on event.
bool ControllersChanged()
Can be called by the virtual MIDI device to check whether a Control Change MIDI event arrived to the ...
void Reset()
Intended to be called on "panic" / all notes off situations.
void SendCCToDevice(uint8_t Controller, uint8_t Value)
Informs the virtual MIDI device that a Control Change event occured (e.g.
bool SendPitchBendToSampler(int Pitch)
Sends a MIDI Pitch Bend event to the sampler.
void SendNoteOnToDevice(uint8_t Key, uint8_t Velocity)
Informs the virtual MIDI device that a note on event occured (e.g.
VirtualMidiDevice()
Constructor.
uint8_t ControllerValue(uint8_t Controller)
Returns the value of the last Control Change event.
virtual ~VirtualMidiDevice()
Destructor.
void SetMaxEvents(int n)
Adjusts the internal event buffer to cover at least the given amount of MIDI events.
uint8_t NoteOffVelocity(uint8_t Key)
Returns the velocity of the last note off event.
bool ControllerChanged(uint8_t Controller)
Can be called by the virtual MIDI device to check whether a Control Change MIDI event arrived to the ...
void SendNoteOffToDevice(uint8_t Key, uint8_t Velocity)
Informs the virtual MIDI device that a note off event occured (e.g.
bool SendChannelPressureToSampler(uint8_t Pressure)
Sends a MIDI Channel Pressure (aftertouch) event to the sampler.
bool NotesChanged()
Can be called by the virtual MIDI device to check whether a new note on or note off MIDI event arrive...
bool NoteChanged(uint8_t Key)
Can be called by the virtual MIDI device to check whether a new note on or note off MIDI event arrive...
bool NoteIsActive(uint8_t Key)
Can be called by the virtual MIDI device to check which key / note is currently active by the sampler...
bool SendProgramChangeToSampler(uint8_t Program)
Sends a MIDI Program Change event to the sampler.
bool GetMidiEventFromDevice(event_t &Event)
Gets the next pending MIDI event from the virtual MIDI device by using a lockfree FIFO.
bool SendNoteOnToSampler(uint8_t Key, uint8_t Velocity)
Sends a MIDI note on event to the sampler.
uint8_t Arg1
Depends on Type (e.g. key number for note on/off events).
uint8_t Arg2
Depends on Type (e.g. velocity for note on/off events).