VCV Rack API v2
Loading...
Searching...
No Matches
rack::dsp::MidiParser< MAX_CHANNELS > Struct Template Reference

Converts MIDI note and transport messages to gates, CV, and other states. More...

#include <midi.hpp>

Collaboration diagram for rack::dsp::MidiParser< MAX_CHANNELS >:
[legend]

Public Types

enum  PolyMode {
  ROTATE_MODE , REUSE_MODE , RESET_MODE , MPE_MODE ,
  NUM_POLY_MODES
}
 Method for assigning notes to polyphony channels. More...
 

Public Member Functions

 MidiParser ()
 
void reset ()
 Resets settings and performance state.
 
void panic ()
 Resets performance state.
 
void processFilters (float deltaTime)
 
void processPulses (float deltaTime)
 
void processMessage (const midi::Message &msg)
 
void processCC (const midi::Message &msg)
 
void processSystem (const midi::Message &msg)
 
uint8_t assignChannel (uint8_t note)
 
uint8_t pressNote (uint8_t note, uint8_t channel)
 Returns actual assigned channel.
 
void releaseNote (uint8_t note)
 
void pressPedal ()
 
void releasePedal ()
 
uint8_t getChannels ()
 
void setChannels (uint8_t channels)
 
void setPolyMode (PolyMode polyMode)
 
float getPitchVoltage (uint8_t channel)
 
void setFilterLambda (float lambda)
 Sets exponential smoothing filter lambda speed.
 
float getPw (uint8_t channel)
 Returns pitch wheel value, from -1 to 1.
 
float getMod (uint8_t channel)
 Returns mod wheel value, from 0 to 1.
 
uint8_t getWheelChannels ()
 Returns number of polyphonic channels for pitch and mod wheels.
 
json_t * toJson ()
 
void fromJson (json_t *rootJ)
 

Public Attributes

float pwRange
 Number of semitones to bend up/down by pitch wheel.
 
bool smooth
 Enables pitch-wheel and mod-wheel exponential smoothing.
 
uint32_t clockDivision
 Number of 24 PPQN clocks between clock divider pulses.
 
uint8_t channels
 Actual number of polyphonic channels.
 
PolyMode polyMode
 
int64_t clock
 Clock index from song start.
 
bool pedal
 Whether sustain pedal is held.
 
uint8_t notes [MAX_CHANNELS]
 
bool gates [MAX_CHANNELS]
 
uint8_t velocities [MAX_CHANNELS]
 
uint8_t aftertouches [MAX_CHANNELS]
 
std::vector< uint8_t > heldNotes
 
int8_t rotateIndex
 
int16_t pws [MAX_CHANNELS]
 Pitch wheel values, from -8192 to 8191.
 
uint8_t mods [MAX_CHANNELS]
 Mod wheel values, from 0 to 127.
 
dsp::ExponentialFilter pwFilters [MAX_CHANNELS]
 Smoothing filters for wheel values.
 
dsp::ExponentialFilter modFilters [MAX_CHANNELS]
 
dsp::PulseGenerator clockPulse
 
dsp::PulseGenerator clockDividerPulse
 
dsp::PulseGenerator retriggerPulses [MAX_CHANNELS]
 
dsp::PulseGenerator startPulse
 
dsp::PulseGenerator stopPulse
 
dsp::PulseGenerator continuePulse
 

Detailed Description

template<uint8_t MAX_CHANNELS>
struct rack::dsp::MidiParser< MAX_CHANNELS >

Converts MIDI note and transport messages to gates, CV, and other states.

MAX_CHANNELS is the maximum number of polyphonic channels.

Member Enumeration Documentation

◆ PolyMode

template<uint8_t MAX_CHANNELS>
enum rack::dsp::MidiParser::PolyMode

Method for assigning notes to polyphony channels.

Enumerator
ROTATE_MODE 
REUSE_MODE 
RESET_MODE 
MPE_MODE 
NUM_POLY_MODES 

Constructor & Destructor Documentation

◆ MidiParser()

template<uint8_t MAX_CHANNELS>
rack::dsp::MidiParser< MAX_CHANNELS >::MidiParser ( )
inline

Member Function Documentation

◆ reset()

template<uint8_t MAX_CHANNELS>
void rack::dsp::MidiParser< MAX_CHANNELS >::reset ( )
inline

Resets settings and performance state.

◆ panic()

template<uint8_t MAX_CHANNELS>
void rack::dsp::MidiParser< MAX_CHANNELS >::panic ( )
inline

Resets performance state.

◆ processFilters()

template<uint8_t MAX_CHANNELS>
void rack::dsp::MidiParser< MAX_CHANNELS >::processFilters ( float deltaTime)
inline

◆ processPulses()

template<uint8_t MAX_CHANNELS>
void rack::dsp::MidiParser< MAX_CHANNELS >::processPulses ( float deltaTime)
inline

◆ processMessage()

template<uint8_t MAX_CHANNELS>
void rack::dsp::MidiParser< MAX_CHANNELS >::processMessage ( const midi::Message & msg)
inline

◆ processCC()

template<uint8_t MAX_CHANNELS>
void rack::dsp::MidiParser< MAX_CHANNELS >::processCC ( const midi::Message & msg)
inline

◆ processSystem()

template<uint8_t MAX_CHANNELS>
void rack::dsp::MidiParser< MAX_CHANNELS >::processSystem ( const midi::Message & msg)
inline

◆ assignChannel()

template<uint8_t MAX_CHANNELS>
uint8_t rack::dsp::MidiParser< MAX_CHANNELS >::assignChannel ( uint8_t note)
inline

◆ pressNote()

template<uint8_t MAX_CHANNELS>
uint8_t rack::dsp::MidiParser< MAX_CHANNELS >::pressNote ( uint8_t note,
uint8_t channel )
inline

Returns actual assigned channel.

◆ releaseNote()

template<uint8_t MAX_CHANNELS>
void rack::dsp::MidiParser< MAX_CHANNELS >::releaseNote ( uint8_t note)
inline

◆ pressPedal()

template<uint8_t MAX_CHANNELS>
void rack::dsp::MidiParser< MAX_CHANNELS >::pressPedal ( )
inline

◆ releasePedal()

template<uint8_t MAX_CHANNELS>
void rack::dsp::MidiParser< MAX_CHANNELS >::releasePedal ( )
inline

◆ getChannels()

template<uint8_t MAX_CHANNELS>
uint8_t rack::dsp::MidiParser< MAX_CHANNELS >::getChannels ( )
inline

◆ setChannels()

template<uint8_t MAX_CHANNELS>
void rack::dsp::MidiParser< MAX_CHANNELS >::setChannels ( uint8_t channels)
inline

◆ setPolyMode()

template<uint8_t MAX_CHANNELS>
void rack::dsp::MidiParser< MAX_CHANNELS >::setPolyMode ( PolyMode polyMode)
inline

◆ getPitchVoltage()

template<uint8_t MAX_CHANNELS>
float rack::dsp::MidiParser< MAX_CHANNELS >::getPitchVoltage ( uint8_t channel)
inline

◆ setFilterLambda()

template<uint8_t MAX_CHANNELS>
void rack::dsp::MidiParser< MAX_CHANNELS >::setFilterLambda ( float lambda)
inline

Sets exponential smoothing filter lambda speed.

◆ getPw()

template<uint8_t MAX_CHANNELS>
float rack::dsp::MidiParser< MAX_CHANNELS >::getPw ( uint8_t channel)
inline

Returns pitch wheel value, from -1 to 1.

◆ getMod()

template<uint8_t MAX_CHANNELS>
float rack::dsp::MidiParser< MAX_CHANNELS >::getMod ( uint8_t channel)
inline

Returns mod wheel value, from 0 to 1.

◆ getWheelChannels()

template<uint8_t MAX_CHANNELS>
uint8_t rack::dsp::MidiParser< MAX_CHANNELS >::getWheelChannels ( )
inline

Returns number of polyphonic channels for pitch and mod wheels.

◆ toJson()

template<uint8_t MAX_CHANNELS>
json_t * rack::dsp::MidiParser< MAX_CHANNELS >::toJson ( )
inline

◆ fromJson()

template<uint8_t MAX_CHANNELS>
void rack::dsp::MidiParser< MAX_CHANNELS >::fromJson ( json_t * rootJ)
inline

Member Data Documentation

◆ pwRange

template<uint8_t MAX_CHANNELS>
float rack::dsp::MidiParser< MAX_CHANNELS >::pwRange

Number of semitones to bend up/down by pitch wheel.

◆ smooth

template<uint8_t MAX_CHANNELS>
bool rack::dsp::MidiParser< MAX_CHANNELS >::smooth

Enables pitch-wheel and mod-wheel exponential smoothing.

◆ clockDivision

template<uint8_t MAX_CHANNELS>
uint32_t rack::dsp::MidiParser< MAX_CHANNELS >::clockDivision

Number of 24 PPQN clocks between clock divider pulses.

◆ channels

template<uint8_t MAX_CHANNELS>
uint8_t rack::dsp::MidiParser< MAX_CHANNELS >::channels

Actual number of polyphonic channels.

◆ polyMode

template<uint8_t MAX_CHANNELS>
PolyMode rack::dsp::MidiParser< MAX_CHANNELS >::polyMode

◆ clock

template<uint8_t MAX_CHANNELS>
int64_t rack::dsp::MidiParser< MAX_CHANNELS >::clock

Clock index from song start.

◆ pedal

template<uint8_t MAX_CHANNELS>
bool rack::dsp::MidiParser< MAX_CHANNELS >::pedal

Whether sustain pedal is held.

◆ notes

template<uint8_t MAX_CHANNELS>
uint8_t rack::dsp::MidiParser< MAX_CHANNELS >::notes[MAX_CHANNELS]

◆ gates

template<uint8_t MAX_CHANNELS>
bool rack::dsp::MidiParser< MAX_CHANNELS >::gates[MAX_CHANNELS]

◆ velocities

template<uint8_t MAX_CHANNELS>
uint8_t rack::dsp::MidiParser< MAX_CHANNELS >::velocities[MAX_CHANNELS]

◆ aftertouches

template<uint8_t MAX_CHANNELS>
uint8_t rack::dsp::MidiParser< MAX_CHANNELS >::aftertouches[MAX_CHANNELS]

◆ heldNotes

template<uint8_t MAX_CHANNELS>
std::vector<uint8_t> rack::dsp::MidiParser< MAX_CHANNELS >::heldNotes

◆ rotateIndex

template<uint8_t MAX_CHANNELS>
int8_t rack::dsp::MidiParser< MAX_CHANNELS >::rotateIndex

◆ pws

template<uint8_t MAX_CHANNELS>
int16_t rack::dsp::MidiParser< MAX_CHANNELS >::pws[MAX_CHANNELS]

Pitch wheel values, from -8192 to 8191.

When MPE is disabled, only the first channel is used.

◆ mods

template<uint8_t MAX_CHANNELS>
uint8_t rack::dsp::MidiParser< MAX_CHANNELS >::mods[MAX_CHANNELS]

Mod wheel values, from 0 to 127.

◆ pwFilters

template<uint8_t MAX_CHANNELS>
dsp::ExponentialFilter rack::dsp::MidiParser< MAX_CHANNELS >::pwFilters[MAX_CHANNELS]

Smoothing filters for wheel values.

◆ modFilters

template<uint8_t MAX_CHANNELS>
dsp::ExponentialFilter rack::dsp::MidiParser< MAX_CHANNELS >::modFilters[MAX_CHANNELS]

◆ clockPulse

template<uint8_t MAX_CHANNELS>
dsp::PulseGenerator rack::dsp::MidiParser< MAX_CHANNELS >::clockPulse

◆ clockDividerPulse

template<uint8_t MAX_CHANNELS>
dsp::PulseGenerator rack::dsp::MidiParser< MAX_CHANNELS >::clockDividerPulse

◆ retriggerPulses

template<uint8_t MAX_CHANNELS>
dsp::PulseGenerator rack::dsp::MidiParser< MAX_CHANNELS >::retriggerPulses[MAX_CHANNELS]

◆ startPulse

template<uint8_t MAX_CHANNELS>
dsp::PulseGenerator rack::dsp::MidiParser< MAX_CHANNELS >::startPulse

◆ stopPulse

template<uint8_t MAX_CHANNELS>
dsp::PulseGenerator rack::dsp::MidiParser< MAX_CHANNELS >::stopPulse

◆ continuePulse

template<uint8_t MAX_CHANNELS>
dsp::PulseGenerator rack::dsp::MidiParser< MAX_CHANNELS >::continuePulse

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