20#include "definitions_cxx.hpp"
21#include "model/global_effectable/global_effectable.h"
22#include "modulation/params/param.h"
23#include "storage/storage_manager.h"
24#include "util/containers.h"
35enum class MIDIMatchType;
39class MidiFollow final {
46 Clip* clip, int32_t soundParamId, int32_t globalParamId,
47 bool displayError =
true);
49 bool* doingMidiThru,
bool shouldRecordNotesNowNow,
ModelStack* modelStack);
50 Output* sendNoteToClip(
MIDICable& cable,
Clip* clip, MIDIMatchType match,
bool on, int32_t channel, int32_t note,
51 int32_t velocity,
bool* doingMidiThru,
bool shouldRecordNotesNowNow,
ModelStack* modelStack,
52 bool updateClipForLastNoteReceived =
true);
67 std::array<uint8_t, kMaxMIDIValue + 1> ccToSoundParam;
68 std::array<uint8_t, kMaxMIDIValue + 1> ccToGlobalParam;
69 std::array<uint8_t, params::UNPATCHED_START + params::UNPATCHED_SOUND_MAX_NUM> soundParamToCC;
70 std::array<uint8_t, params::UNPATCHED_GLOBAL_MAX_NUM> globalParamToCC;
72 int32_t previousKnobPos[kMaxMIDIValue + 1];
73 uint32_t timeLastCCSent[kMaxMIDIValue + 1];
74 uint32_t timeAutomationFeedbackLastSent;
77 MIDIFollowChannelType getChannelTypeForFeedback();
89 void initDefaultMappings();
93 int32_t velocity,
bool* doingMidiThru,
94 bool shouldRecordNotesNowNow,
ModelStack* modelStack);
96 bool* doingMidiThru,
bool shouldRecordNotesNowNow,
ModelStack* modelStack,
97 Output* specific_track, int32_t specific_track_index);
103 int32_t specific_track_index);
110 int32_t specific_track_index);
114 int32_t noteCode,
bool* doingMidiThru,
ModelStack* modelStack);
117 int32_t specific_track_index);
127 int32_t soundParamId, int32_t globalParamId);
129 Clip* clip, int32_t soundParamId, int32_t globalParamId);
132 int32_t soundParamId, int32_t globalParamId);
135 int32_t soundParamId, int32_t globalParamId);
138 int32_t soundParamId, int32_t globalParamId);
139 void displayParamControlError(int32_t soundParamId, int32_t globalParamId);
143 bool isFeedbackEnabled();
159 bool successfullyReadDefaultsFromFile;
174 MIDIFollowChannelType getChannelTypeFromName(
char const* name);
176 char const* getNameFromFeedbackAutomationMode(MIDIFollowFeedbackAutomationMode mode);
177 MIDIFollowFeedbackAutomationMode getFeedbackAutomationModeFromName(
char const* name);
179 char const* getNameFromBool(
bool value);
180 bool getBoolFromName(
char const* name);
Definition audio_clip.h:35
Definition storage_manager.h:185
Definition instrument_clip.h:48
A MIDI cable connection. Stores all state specific to a given cable and its contained ports and chann...
Definition midi_device.h:96
Definition midi_follow.h:39
void writeFeedbackSettingsToFile(Serializer &writer)
Write Feedback settings to XML.
Definition midi_follow.cpp:1635
Clip * getSelectedClip()
Definition midi_follow.cpp:392
void writeDefaultsToFile()
Definition midi_follow.cpp:1480
int32_t getCCFromParam(deluge::modulation::params::Kind paramKind, int32_t paramID)
Definition midi_follow.cpp:643
void writeKitRootNoteSettingToFile(Serializer &writer)
Write Kit Root Note setting to XML.
Definition midi_follow.cpp:1628
const size_t getTrackCount() const
used to forward midi messages to specific tracks
Definition midi_follow.cpp:447
void noteMessageReceivedForSpecificTrack(MIDICable &cable, bool on, int32_t channel, int32_t note, int32_t velocity, bool *doingMidiThru, bool shouldRecordNotesNowNow, ModelStack *modelStack, Output *specific_track, int32_t specific_track_index)
Definition midi_follow.cpp:776
void writeSpecificChannelSettingsToFile(Serializer &writer, MIDIFollowChannelType type)
Write Specific Channel settings to XML.
Definition midi_follow.cpp:1608
MIDIMatchType checkMidiFollowMatch(MIDICable &cable, uint8_t channel)
Definition midi_follow.cpp:1440
Clip * getSelectedOrActiveClip()
Definition midi_follow.cpp:368
Clip * getActiveClip(ModelStack *modelStack)
Definition midi_follow.cpp:432
void writeChannelSettingsToFile(Serializer &writer)
Write Channel settings to XML.
Definition midi_follow.cpp:1585
void aftertouchReceivedForSpecificTrack(MIDICable &cable, int32_t channel, int32_t value, int32_t noteCode, bool *doingMidiThru, ModelStack *modelStack, Output *specific_track, int32_t specific_track_index)
Definition midi_follow.cpp:1411
void writeDefaultMappingsToFile(Serializer &writer)
convert paramID to a paramName to write to XML
Definition midi_follow.cpp:1510
void readDefaultSettingsFromFile(Deserializer &reader)
read default settings (channels, kit root note, feedback, display param) from XML
Definition midi_follow.cpp:1743
void removeClip(Clip *clip)
Definition midi_follow.cpp:698
void readDefaultsFromFile()
read defaults from XML
Definition midi_follow.cpp:1649
Output * pitchBendReceivedForSelectedOrActiveClip(MIDICable &cable, uint8_t channel, uint8_t data1, uint8_t data2, bool *doingMidiThru, ModelStack *modelStack)
Definition midi_follow.cpp:1285
ModelStackWithAutoParam * getModelStackWithParam(ModelStackWithTimelineCounter *modelStackWithTimelineCounter, Clip *clip, int32_t soundParamId, int32_t globalParamId, bool displayError=true)
Definition midi_follow.cpp:481
void midiCCReceivedForSpecificTrack(MIDICable &cable, uint8_t channel, uint8_t ccNumber, uint8_t ccValue, bool *doingMidiThru, ModelStack *modelStack, Output *specific_track, int32_t specific_track_index)
Definition midi_follow.cpp:943
void pitchBendReceived(MIDICable &cable, uint8_t channel, uint8_t data1, uint8_t data2, bool *doingMidiThru, ModelStack *modelStack)
Definition midi_follow.cpp:1254
void pitchBendReceivedForSpecificTrack(MIDICable &cable, uint8_t channel, uint8_t data1, uint8_t data2, bool *doingMidiThru, ModelStack *modelStack, Output *specific_track, int32_t specific_track_index)
Definition midi_follow.cpp:1318
Output * midiCCReceivedForSelectedOrActiveClip(MIDICable &cable, uint8_t channel, uint8_t ccNumber, uint8_t ccValue, bool *doingMidiThru, ModelStack *modelStack)
Definition midi_follow.cpp:873
Output * noteMessageReceivedForSelectedOrActiveClip(MIDICable &cable, bool on, int32_t channel, int32_t note, int32_t velocity, bool *doingMidiThru, bool shouldRecordNotesNowNow, ModelStack *modelStack)
Definition midi_follow.cpp:740
void handleReceivedCC(MIDICable &cable, ModelStackWithTimelineCounter &modelStack, Clip *clip, int32_t ccNumber, int32_t ccValue)
Definition midi_follow.cpp:1021
void sendCCWithoutModelStackForMidiFollowFeedback(int32_t channel, bool isAutomation=false)
Definition midi_follow.cpp:1161
void midiCCReceived(MIDICable &cable, uint8_t channel, uint8_t ccNumber, uint8_t ccValue, bool *doingMidiThru, ModelStack *modelStack)
Definition midi_follow.cpp:843
char const * getNameFromChannelType(MIDIFollowChannelType type)
enum / string lookup functions
Definition midi_follow.cpp:1862
void noteMessageReceived(MIDICable &cable, bool on, int32_t channel, int32_t note, int32_t velocity, bool *doingMidiThru, bool shouldRecordNotesNowNow, ModelStack *modelStack)
Definition midi_follow.cpp:709
void readDefaultMappingsFromFile(Deserializer &reader)
Definition midi_follow.cpp:1701
void readChannelSettingsFromFile(Deserializer &reader)
Read Channel settings from XML.
Definition midi_follow.cpp:1767
void clearStoredClips()
Definition midi_follow.cpp:689
void readKitRootNoteSettingFromFile(Deserializer &reader)
Read Kit Root Note setting from XML.
Definition midi_follow.cpp:1801
void aftertouchReceived(MIDICable &cable, int32_t channel, int32_t value, int32_t noteCode, bool *doingMidiThru, ModelStack *modelStack)
Definition midi_follow.cpp:1347
bool isGlobalEffectableContext()
Definition midi_follow.cpp:664
MIDIMatchType checkMidiFollowMatchForSpecificTrack(MIDICable &cable, uint8_t channel, int32_t specific_track_index)
Definition midi_follow.cpp:1454
Output * getTrackFromIndex(uint32_t trackIndex, uint32_t maxTrack)
used to forward midi messages to specific tracks
Definition midi_follow.cpp:461
void readDisplayParamSettingFromFile(Deserializer &reader)
Read Display Param setting from XML.
Definition midi_follow.cpp:1847
void readSpecificChannelSettingsFromFile(Deserializer &reader, MIDIFollowChannelType type)
Read Specific Channel settings from XML.
Definition midi_follow.cpp:1781
void readFeedbackSettingsFromFile(Deserializer &reader)
Read Feedback settings from XML.
Definition midi_follow.cpp:1817
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 soundEdi...
Definition midi_follow.cpp:1234
void writeDisplayParamSettingToFile(Serializer &writer)
Write Display Param setting to XML.
Definition midi_follow.cpp:1644
void writeDefaultSettingsToFile(Serializer &writer)
write default settings (channels, kit root note, feedback, display param) to XML
Definition midi_follow.cpp:1550
Output * aftertouchReceivedForSelectedOrActiveClip(MIDICable &cable, int32_t channel, int32_t value, int32_t noteCode, bool *doingMidiThru, ModelStack *modelStack)
Definition midi_follow.cpp:1378
Definition model_stack.h:269
Definition model_stack.h:231
Definition model_stack.h:129
Definition model_stack.h:123
Definition storage_manager.h:119
Kind
Definition param.h:42