Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
MidiFollow Class Referencefinal

Public Member Functions

void readDefaultsFromFile ()
 read defaults from XML
 
ModelStackWithAutoParamgetModelStackWithParam (ModelStackWithTimelineCounter *modelStackWithTimelineCounter, Clip *clip, int32_t soundParamId, int32_t globalParamId, bool displayError=true)
 
void noteMessageReceived (MIDICable &cable, bool on, int32_t channel, int32_t note, int32_t velocity, bool *doingMidiThru, bool shouldRecordNotesNowNow, ModelStack *modelStack)
 
void sendNoteToClip (MIDICable &cable, Clip *clip, MIDIMatchType match, bool on, int32_t channel, int32_t note, int32_t velocity, bool *doingMidiThru, bool shouldRecordNotesNowNow, ModelStack *modelStack)
 
void midiCCReceived (MIDICable &cable, uint8_t channel, uint8_t ccNumber, uint8_t ccValue, bool *doingMidiThru, ModelStack *modelStack)
 
void pitchBendReceived (MIDICable &cable, uint8_t channel, uint8_t data1, uint8_t data2, bool *doingMidiThru, ModelStack *modelStack)
 
void aftertouchReceived (MIDICable &cable, int32_t channel, int32_t value, int32_t noteCode, bool *doingMidiThru, ModelStack *modelStack)
 
void clearStoredClips ()
 
void removeClip (Clip *clip)
 
int32_t getCCFromParam (deluge::modulation::params::Kind paramKind, int32_t paramID)
 
bool isGlobalEffectableContext ()
 
void sendCCWithoutModelStackForMidiFollowFeedback (int32_t channel, bool isAutomation=false)
 
void sendCCForMidiFollowFeedback (int32_t channel, int32_t ccNumber, int32_t knobPos)
 called when updating parameter values using mod (gold) encoders or the select encoder in the soundEditor menu
 
void handleReceivedCC (ModelStackWithTimelineCounter &modelStack, Clip *clip, int32_t ccNumber, int32_t ccValue)
 

Public Attributes

std::array< uint8_t, kMaxMIDIValue+1 > ccToSoundParam
 
std::array< uint8_t, kMaxMIDIValue+1 > ccToGlobalParam
 
std::array< uint8_t, params::UNPATCHED_START+params::UNPATCHED_SOUND_MAX_NUM > soundParamToCC
 
std::array< uint8_t, params::UNPATCHED_GLOBAL_MAX_NUM > globalParamToCC
 
int32_t previousKnobPos [kMaxMIDIValue+1]
 
uint32_t timeLastCCSent [kMaxMIDIValue+1]
 
uint32_t timeAutomationFeedbackLastSent
 

Private Member Functions

void init ()
 
void initState ()
 
void clearMappings ()
 
void initDefaultMappings ()
 
ClipgetSelectedOrActiveClip ()
 
ClipgetSelectedClip ()
 
ClipgetActiveClip (ModelStack *modelStack)
 
ModelStackWithAutoParamgetModelStackWithParamForSong (ModelStackWithThreeMainThings *modelStackWithThreeMainThings, int32_t soundParamId, int32_t globalParamId)
 
ModelStackWithAutoParamgetModelStackWithParamForClip (ModelStackWithTimelineCounter *modelStackWithTimelineCounter, Clip *clip, int32_t soundParamId, int32_t globalParamId)
 
ModelStackWithAutoParamgetModelStackWithParamForSynthClip (ModelStackWithTimelineCounter *modelStackWithTimelineCounter, Clip *clip, int32_t soundParamId, int32_t globalParamId)
 
ModelStackWithAutoParamgetModelStackWithParamForKitClip (ModelStackWithTimelineCounter *modelStackWithTimelineCounter, Clip *clip, int32_t soundParamId, int32_t globalParamId)
 
ModelStackWithAutoParamgetModelStackWithParamForAudioClip (ModelStackWithTimelineCounter *modelStackWithTimelineCounter, Clip *clip, int32_t soundParamId, int32_t globalParamId)
 
void displayParamControlError (int32_t soundParamId, int32_t globalParamId)
 
MIDIMatchType checkMidiFollowMatch (MIDICable &cable, uint8_t channel)
 
bool isFeedbackEnabled ()
 
void writeDefaultsToFile ()
 
void writeDefaultMappingsToFile ()
 convert paramID to a paramName to write to XML
 
void readDefaultMappingsFromFile (Deserializer &reader)
 

Private Attributes

bool successfullyReadDefaultsFromFile
 

Member Function Documentation

◆ aftertouchReceived()

void MidiFollow::aftertouchReceived ( MIDICable & cable,
int32_t channel,
int32_t value,
int32_t noteCode,
bool * doingMidiThru,
ModelStack * modelStack )

called from playback handler determines whether aftertouch received is midi follow relevant and should be routed to the active context for further processing

◆ checkMidiFollowMatch()

MIDIMatchType MidiFollow::checkMidiFollowMatch ( MIDICable & cable,
uint8_t channel )
private

obtain match to check if device is compatible with the midi follow channel a valid match is passed through to the instruments for further evaluation

◆ clearStoredClips()

void MidiFollow::clearStoredClips ( )

initializes the clipForLastNoteReceived array called when swapping songs to make sure that you aren't using clips from the old song

◆ getCCFromParam()

int32_t MidiFollow::getCCFromParam ( deluge::modulation::params::Kind paramKind,
int32_t paramID )

a parameter can be learned to one cc at a time for a given parameter, find and return the cc that has been learned (if any) for the current midi follow controllable context if no cc is found, then MIDI_CC_NONE (255) is returned

◆ getModelStackWithParam()

ModelStackWithAutoParam * MidiFollow::getModelStackWithParam ( ModelStackWithTimelineCounter * modelStackWithTimelineCounter,
Clip * clip,
int32_t soundParamId,
int32_t globalParamId,
bool displayError = true )

based on the current context, as determined by clip returned from the getSelectedClip function obtain the modelStackWithParam for that context and return it so it can be used by midi follow

◆ getSelectedClip()

Clip * MidiFollow::getSelectedClip ( )
private

see if you are pressing and holding a clip in arranger view, song row view, song grid view see if you are pressing and holding audition pad in arranger view, arranger perf view, or arranger automation view if you're in a clip, this will return that clip

◆ getSelectedOrActiveClip()

Clip * MidiFollow::getSelectedOrActiveClip ( )
private

checks to see if there is an active clip for the current context cases where there is an active clip: 1) pressing and holding a clip pad in arranger view, song row view, song grid view 2) pressing and holding the audition pad of a row in arranger view and in arranger performance view, arranger automation view 3) entering a clip or previousy held a clip

◆ handleReceivedCC()

void MidiFollow::handleReceivedCC ( ModelStackWithTimelineCounter & modelStackWithTimelineCounter,
Clip * clip,
int32_t ccNumber,
int32_t ccValue )

checks if the ccNumber received has been learned to any parameters in midi learning view if the cc has been learned, it sets the new value for that parameter this function works by first checking the active context to see if there is an active clip to determine if the cc intends to control a song level or clip level parameter

◆ midiCCReceived()

void MidiFollow::midiCCReceived ( MIDICable & cable,
uint8_t channel,
uint8_t ccNumber,
uint8_t ccValue,
bool * doingMidiThru,
ModelStack * modelStack )

called from playback handler determines whether a midi cc received is midi follow relevant and should be routed to the active context for further processing

◆ noteMessageReceived()

void MidiFollow::noteMessageReceived ( MIDICable & cable,
bool on,
int32_t channel,
int32_t note,
int32_t velocity,
bool * doingMidiThru,
bool shouldRecordNotesNowNow,
ModelStack * modelStack )

called from playback handler determines whether a note message received is midi follow relevant and should be routed to the active context for further processing

◆ pitchBendReceived()

void MidiFollow::pitchBendReceived ( MIDICable & cable,
uint8_t channel,
uint8_t data1,
uint8_t data2,
bool * doingMidiThru,
ModelStack * modelStack )

called from playback handler determines whether a pitch bend received is midi follow relevant and should be routed to the active context for further processing

◆ readDefaultMappingsFromFile()

void MidiFollow::readDefaultMappingsFromFile ( Deserializer & reader)
private

compares param name tag to the list of params available are midi controllable if param is found, it loads the CC mapping info for that param into the view

◆ removeClip()

void MidiFollow::removeClip ( Clip * clip)

removes a specific clip pointer from the clipForLastNoteReceived array if a clip is deleted, it should be removed from this array to ensure note off's don't get sent to delete clips

◆ sendCCWithoutModelStackForMidiFollowFeedback()

void MidiFollow::sendCCWithoutModelStackForMidiFollowFeedback ( int32_t channel,
bool isAutomation = false )

called when updating the context, e.g. switching from song to clip, changing instruments presets, peeking a clip in song view this function: 1) checks the active context 2) sets up the model stack for that context 3) checks what parameters have been learned and obtains the model stack for those params 4) sends midi feedback of the current parameter value to the cc numbers learned to those parameters

◆ writeDefaultsToFile()

void MidiFollow::writeDefaultsToFile ( )
private

create default XML file and write defaults I should check if file exists before creating one


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