Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
MIDIInstrument Class Referencefinal
Inheritance diagram for MIDIInstrument:
Collaboration diagram for MIDIInstrument:

Public Member Functions

void ccReceivedFromInputMIDIChannel (int32_t cc, int32_t value, ModelStackWithTimelineCounter *modelStack) override
 
void allNotesOff ()
 
bool setActiveClip (ModelStackWithTimelineCounter *modelStack, PgmChangeSend maySendMIDIPGMs) override
 
bool writeDataToFile (Serializer &writer, Clip *clipForSavingOutputOnly, Song *song) override
 
bool readTagFromFile (Deserializer &reader, char const *tagName) override
 
Error readModKnobAssignmentsFromFile (int32_t readAutomationUpToPos, ParamManagerForTimeline *paramManager=nullptr)
 
Error readDeviceDefinitionFile (Deserializer &reader, bool readFromPresetOrSong)
 reading
 
void readDeviceDefinitionFileNameFromPresetOrSong (Deserializer &reader)
 
Error readCCLabelsFromFile (Deserializer &reader)
 
void writeDeviceDefinitionFile (Serializer &writer, bool writeFileNameToPresetOrSong)
 writing
 
void writeDeviceDefinitionFileNameToPresetOrSong (Serializer &writer)
 
void writeCCLabelsToFile (Serializer &writer)
 
std::string_view getNameFromCC (int32_t cc)
 getting / updating cc labels
 
void setNameForCC (int32_t cc, std::string_view name)
 
void sendMIDIPGM () override
 
void sendNoteToInternal (bool on, int32_t note, uint8_t velocity, uint8_t channel)
 
int32_t changeControlNumberForModKnob (int32_t offset, int32_t whichModEncoder, int32_t modKnobMode)
 
int32_t getFirstUnusedCC (ModelStackWithThreeMainThings *modelStack, int32_t direction, int32_t startAt, int32_t stopAt)
 
Error moveAutomationToDifferentCC (int32_t oldCC, int32_t newCC, ModelStackWithThreeMainThings *modelStack)
 
int32_t moveAutomationToDifferentCC (int32_t offset, int32_t whichModEncoder, int32_t modKnobMode, ModelStackWithThreeMainThings *modelStack)
 
void offerReceivedNote (ModelStackWithTimelineCounter *modelStackWithTimelineCounter, MIDICable &cable, bool on, int32_t channel, int32_t note, int32_t velocity, bool shouldRecordNotes, bool *doingMidiThru) override
 
bool modEncoderButtonAction (uint8_t whichModEncoder, bool on, ModelStackWithThreeMainThings *modelStack) override
 
void modButtonAction (uint8_t whichModButton, bool on, ParamManagerForTimeline *paramManager) override
 
ModelStackWithAutoParamgetParamFromModEncoder (int32_t whichModEncoder, ModelStackWithThreeMainThings *modelStack, bool allowCreation=true) override
 
uint8_t * getModKnobMode () override
 
int32_t getKnobPosForNonExistentParam (int32_t whichModEncoder, ModelStackWithAutoParam *modelStack) override
 
ModelStackWithAutoParamgetParamToControlFromInputMIDIChannel (int32_t cc, ModelStackWithThreeMainThings *modelStack) override
 
bool doesAutomationExistOnMIDIParam (ModelStackWithThreeMainThings *modelStack, int32_t cc)
 
int32_t getOutputMasterChannel ()
 
bool sendsToMPE ()
 
bool sendsToInternal ()
 
bool matchesPreset (OutputType otherType, int32_t otherChannel, int32_t otherSuffix, char const *otherName, char const *otherPath) override
 
char const * getXMLTag () override
 
char const * getSlotXMLTag () override
 
char const * getSubSlotXMLTag () override
 
ModelStackWithAutoParamgetModelStackWithParam (ModelStackWithTimelineCounter *modelStack, Clip *clip, int32_t paramID, deluge::modulation::params::Kind paramKind, bool affectEntire, bool useMenuStack) override
 
bool valueChangedEnoughToMatter (int32_t old_value, int32_t new_value, deluge::modulation::params::Kind kind, uint32_t paramID) override
 
- Public Member Functions inherited from NonAudioInstrument
 NonAudioInstrument (OutputType newType)
 
void renderOutput (ModelStack *modelStack, std::span< StereoSample > buffer, int32_t *reverbBuffer, int32_t reverbAmountAdjust, int32_t sideChainHitPending, bool shouldLimitDelayFeedback, bool isClipActive) override
 
void sendNote (ModelStackWithThreeMainThings *modelStack, bool isOn, int32_t noteCode, int16_t const *mpeValues, int32_t fromMIDIChannel=16, uint8_t velocity=64, uint32_t sampleSyncLength=0, int32_t ticksLate=0, uint32_t samplesLate=0) override
 
int32_t doTickForwardForArp (ModelStack *modelStack, int32_t currentPos) final
 
ParamManagergetParamManager (Song *song) final
 
void polyphonicExpressionEventOnChannelOrNote (int32_t newValue, int32_t expressionDimension, int32_t channelOrNote, MIDICharacteristic whichCharacteristic) final
 
void beenEdited (bool shouldMoveToEmptySlot) override
 
char const * getSlotXMLTag () override
 
char const * getSubSlotXMLTag () override
 
bool readTagFromFile (Deserializer &reader, char const *tagName) override
 
ModControllabletoModControllable () override
 
virtual void setChannel (int newChannel)
 
int32_t getChannel () const
 
bool needsEarlyPlayback () const override
 
- Public Member Functions inherited from MelodicInstrument
 MelodicInstrument (OutputType newType)
 
bool writeMelodicInstrumentAttributesToFile (Serializer &writer, Clip *clipForSavingOutputOnly, Song *song)
 
void writeMelodicInstrumentTagsToFile (Serializer &writer, Clip *clipForSavingOutputOnly, Song *song)
 
void receivedNote (ModelStackWithTimelineCounter *modelStack, MIDICable &cable, bool on, int32_t midiChannel, MIDIMatchType match, int32_t note, int32_t velocity, bool shouldRecordNotes, bool *doingMidiThru)
 
void offerReceivedPitchBend (ModelStackWithTimelineCounter *modelStackWithTimelineCounter, MIDICable &cable, uint8_t channel, uint8_t data1, uint8_t data2, bool *doingMidiThru) override
 
void receivedPitchBend (ModelStackWithTimelineCounter *modelStackWithTimelineCounter, MIDICable &cable, MIDIMatchType match, uint8_t channel, uint8_t data1, uint8_t data2, bool *doingMidiThru)
 
void offerReceivedCC (ModelStackWithTimelineCounter *modelStackWithTimelineCounter, MIDICable &cable, uint8_t channel, uint8_t ccNumber, uint8_t value, bool *doingMidiThru) override
 
void receivedCC (ModelStackWithTimelineCounter *modelStackWithTimelineCounter, MIDICable &cable, MIDIMatchType match, uint8_t channel, uint8_t ccNumber, uint8_t value, bool *doingMidiThru)
 
void offerReceivedAftertouch (ModelStackWithTimelineCounter *modelStackWithTimelineCounter, MIDICable &cable, int32_t channel, int32_t value, int32_t noteCode, bool *doingMidiThru) override
 
void receivedAftertouch (ModelStackWithTimelineCounter *modelStackWithTimelineCounter, MIDICable &cable, MIDIMatchType match, int32_t channel, int32_t value, int32_t noteCode, bool *doingMidiThru)
 
bool isNoteRowStillAuditioningAsLinearRecordingEnded (NoteRow *noteRow) final
 
void stopAnyAuditioning (ModelStack *modelStack) final
 
bool isNoteAuditioning (int32_t noteCode)
 
bool isAnyAuditioningHappening () final
 
void beginAuditioningForNote (ModelStack *modelStack, int32_t note, int32_t velocity, int16_t const *mpeValues, int32_t fromMIDIChannel=MIDI_CHANNEL_NONE, uint32_t sampleSyncLength=0)
 
void endAuditioningForNote (ModelStack *modelStack, int32_t note, int32_t velocity=kDefaultLiftValue)
 
void processParamFromInputMIDIChannel (int32_t cc, int32_t newValue, ModelStackWithTimelineCounter *modelStack) override
 
void polyphonicExpressionEventPossiblyToRecord (ModelStackWithTimelineCounter *modelStack, int32_t newValue, int32_t expressionDimension, int32_t channelOrNoteNumber, MIDICharacteristic whichCharacteristic)
 
ArpeggiatorSettingsgetArpSettings (InstrumentClip *clip=nullptr)
 
void offerBendRangeUpdate (ModelStack *modelStack, MIDICable &cable, int32_t channelOrZone, int32_t whichBendRange, int32_t bendSemitones) override
 
- Public Member Functions inherited from Instrument
 Instrument (OutputType newType)
 
virtual bool doAnySoundsUseCC (uint8_t channel, uint8_t ccNumber, uint8_t value)
 
virtual void setupPatching (ModelStackWithTimelineCounter *modelStack)
 
void deleteAnyInstancesOfClip (InstrumentClip *clip)
 
virtual void compensateInstrumentVolumeForResonance (ModelStackWithThreeMainThings *modelStack)
 
char const * getNameXMLTag () override
 
- Public Member Functions inherited from Output
 Output (OutputType newType)
 
ClipgetActiveClip () const
 
virtual void setupWithoutActiveClip (ModelStack *modelStack)
 
void pickAnActiveClipForArrangementPos (ModelStack *modelStack, int32_t arrangementPos, PgmChangeSend maySendMIDIPGMs)
 
void pickAnActiveClipIfPossible (ModelStack *modelStack, bool searchSessionClipsIfNeeded=true, PgmChangeSend maySendMIDIPGMs=PgmChangeSend::ONCE, bool setupWithoutActiveClipIfNeeded=true)
 
void detachActiveClip (Song *currentSong)
 
virtual bool isSkippingRendering ()
 
bool clipHasInstance (Clip *clip)
 
bool isEmpty (bool displayPopup=true)
 
void clipLengthChanged (Clip *clip, int32_t oldLength)
 
virtual void cutAllSound ()
 
virtual void getThingWithMostReverb (Sound **soundWithMostReverb, ParamManager **paramManagerWithMostReverb, GlobalEffectableForClip **globalEffectableWithMostReverb, int32_t *highestReverbAmountFound)
 
ClipgetClipFromName (String *name)
 If there's a clip matching the name on this output, returns it.
 
virtual bool offerReceivedPitchBendToLearnedParams (MIDICable &cable, uint8_t channel, uint8_t data1, uint8_t data2, ModelStackWithTimelineCounter *modelStack)
 Pitch bend is available in the mod matrix as X and shouldn't be learned to params anymore (post 4.0)
 
virtual void offerReceivedCCToLearnedParams (MIDICable &cable, uint8_t channel, uint8_t ccNumber, uint8_t value, ModelStackWithTimelineCounter *modelStack)
 
void endAnyArrangementRecording (Song *song, int32_t actualEndPos, uint32_t timeRemainder)
 
virtual bool wantsToBeginArrangementRecording ()
 
virtual Error readFromFile (Deserializer &reader, Song *song, Clip *clip, int32_t readAutomationUpToPos)
 
void writeToFile (Clip *clipForSavingOutputOnly, Song *song)
 
virtual Error loadAllAudioFiles (bool mayActuallyReadFiles)
 
virtual void loadCrucialAudioFilesOnly ()
 
virtual void resyncLFOs ()
 
virtual void deleteBackedUpParamManagers (Song *song)
 
virtual void prepareForHibernationOrDeletion ()
 
Error possiblyBeginArrangementRecording (Song *song, int32_t newPos)
 
void endArrangementPlayback (Song *song, int32_t actualEndPos, uint32_t timeRemainder)
 
bool hasRecorder ()
 
bool shouldRenderInSong ()
 
void setRenderingToAudioOutput (bool monitoring, Output *output)
 disable rendering to the song buffer if this clip is the input to an audio output that's monitoring
 
bool addRecorder (SampleRecorder *newRecorder)
 
bool removeRecorder ()
 
OutputgetOutputRecordingThis ()
 
- Public Member Functions inherited from ModControllable
virtual ModelStackWithAutoParamgetParamFromMIDIKnob (MIDIKnob &knob, ModelStackWithThreeMainThings *modelStack)
 Check that autoParam isn't NULL, after calling this.
 
virtual bool isKit ()
 
virtual bool isSong ()
 
virtual bool isEditingComp ()
 
virtual ActionResult modEncoderActionForNonExistentParam (int32_t offset, int32_t whichModEncoder, ModelStackWithAutoParam *modelStack)
 
virtual bool allowNoteTails (ModelStackWithSoundFlags *modelStack, bool disregardSampleLoop=false)
 

Public Attributes

String deviceDefinitionFileName
 definition file
 
bool loadDeviceDefinitionFile = false
 
int32_t channelSuffix {-1}
 
int32_t lastNoteCode {32767}
 
bool collapseAftertouch {false}
 
bool collapseMPE {true}
 
CCNumber outputMPEY {CC_EXTERNAL_MPE_Y}
 
float ratio
 
std::array< int8_t, kNumModButtons *kNumPhysicalModKnobs > modKnobCCAssignments
 
MPEOutputMemberChannel mpeOutputMemberChannels [16]
 
- Public Attributes inherited from NonAudioInstrument
uint8_t cachedBendRanges [2]
 
- Public Attributes inherited from MelodicInstrument
Arpeggiator arpeggiator
 
deluge::fast_map< int16_t, EarlyNoteInfoearlyNotes
 
deluge::fast_map< int16_t, EarlyNoteInfonotesAuditioned
 
- Public Attributes inherited from Instrument
String dirPath
 
bool editedByUser = false
 
bool existsOnCard = false
 
bool shouldHibernate {true}
 
uint8_t defaultVelocity = FlashStorage::defaultVelocity
 
LearnedMIDI midiInput
 
- Public Attributes inherited from Output
ClipInstanceVector clipInstances
 
String name
 
Outputnext
 
const OutputType type
 
bool mutedInArrangementMode
 
bool mutedInArrangementModeBeforeStemExport
 
bool exportStem
 
bool soloingInArrangementMode
 
bool inValidState
 
bool wasCreatedForAutoOverdub
 
bool armedForRecording
 
int16_t colour {0}
 
uint8_t modKnobMode
 
bool alreadyGotItsNewClip
 
bool isGettingSoloingClip
 
bool nextClipFoundShouldGetArmed
 
bool recordingInArrangement
 

Protected Member Functions

void polyphonicExpressionEventPostArpeggiator (int32_t newValue, int32_t noteCodeAfterArpeggiation, int32_t expressionDimension, ArpNote *arpNote, int32_t noteIndex) override
 
void noteOnPostArp (int32_t noteCodePostArp, ArpNote *arpNote, int32_t noteIndex) override
 
void noteOffPostArp (int32_t noteCodePostArp, int32_t oldMIDIChannel, int32_t velocity, int32_t noteIndex) override
 
void monophonicExpressionEvent (int32_t newValue, int32_t expressionDimension) override
 
- Protected Member Functions inherited from Instrument
ClipcreateNewClipForArrangementRecording (ModelStack *modelStack) final
 
Error setupDefaultAudioFileDir ()
 
- Protected Member Functions inherited from Output
virtual void clearRecordingFrom ()
 

Private Member Functions

void sendMonophonicExpressionEvent (int32_t expressionDimension)
 
void combineMPEtoMono (int32_t value32, int32_t expressionDimension)
 
void outputAllMPEValuesOnMemberChannel (int16_t const *mpeValuesToUse, int32_t outputMemberChannel)
 
Error readMIDIParamFromFile (Deserializer &reader, int32_t readAutomationUpToPos, MIDIParamCollection *midiParamCollection, int8_t *getCC=nullptr)
 

Private Attributes

deluge::fast_map< uint8_t, std::string > labels
 

Additional Inherited Members

- Protected Attributes inherited from NonAudioInstrument
int32_t lastMonoExpression [3] {0}
 
int32_t lastCombinedPolyExpression [3] {0}
 
int16_t lastOutputMonoExpression [3] {0}
 
- Protected Attributes inherited from Output
bool recorderIsEchoing {false}
 
OutputoutputRecordingThisOutput {nullptr}
 
ClipactiveClip {nullptr}
 
SampleRecorderrecorder {nullptr}
 
- Protected Attributes inherited from ModControllable
deluge::modulation::params::Kind unpatchedParamKind_
 

Member Function Documentation

◆ ccReceivedFromInputMIDIChannel()

void MIDIInstrument::ccReceivedFromInputMIDIChannel ( int32_t cc,
int32_t value,
ModelStackWithTimelineCounter * modelStack )
overridevirtual

Reimplemented from MelodicInstrument.

◆ getKnobPosForNonExistentParam()

int32_t MIDIInstrument::getKnobPosForNonExistentParam ( int32_t whichModEncoder,
ModelStackWithAutoParam * modelStack )
overridevirtual

Reimplemented from ModControllable.

◆ getModelStackWithParam()

ModelStackWithAutoParam * MIDIInstrument::getModelStackWithParam ( ModelStackWithTimelineCounter * modelStack,
Clip * clip,
int32_t paramID,
deluge::modulation::params::Kind paramKind,
bool affectEntire,
bool useMenuStack )
overridevirtual

Reimplemented from MelodicInstrument.

◆ getModKnobMode()

uint8_t * MIDIInstrument::getModKnobMode ( )
inlineoverridevirtual

Reimplemented from ModControllable.

◆ getParamFromModEncoder()

ModelStackWithAutoParam * MIDIInstrument::getParamFromModEncoder ( int32_t whichModEncoder,
ModelStackWithThreeMainThings * modelStack,
bool allowCreation = true )
overridevirtual

Reimplemented from ModControllable.

◆ getParamToControlFromInputMIDIChannel()

ModelStackWithAutoParam * MIDIInstrument::getParamToControlFromInputMIDIChannel ( int32_t cc,
ModelStackWithThreeMainThings * modelStack )
overridevirtual

Reimplemented from MelodicInstrument.

◆ getSlotXMLTag()

char const * MIDIInstrument::getSlotXMLTag ( )
inlineoverridevirtual

Reimplemented from Instrument.

◆ getSubSlotXMLTag()

char const * MIDIInstrument::getSubSlotXMLTag ( )
inlineoverridevirtual

Reimplemented from Instrument.

◆ getXMLTag()

char const * MIDIInstrument::getXMLTag ( )
inlineoverridevirtual

Implements Output.

◆ matchesPreset()

bool MIDIInstrument::matchesPreset ( OutputType otherType,
int32_t otherChannel,
int32_t otherSuffix,
char const * otherName,
char const * otherPath )
inlineoverridevirtual

Reimplemented from Instrument.

◆ modButtonAction()

void MIDIInstrument::modButtonAction ( uint8_t whichModButton,
bool on,
ParamManagerForTimeline * paramManager )
overridevirtual

Reimplemented from ModControllable.

◆ modEncoderButtonAction()

bool MIDIInstrument::modEncoderButtonAction ( uint8_t whichModEncoder,
bool on,
ModelStackWithThreeMainThings * modelStack )
overridevirtual

Reimplemented from ModControllable.

◆ monophonicExpressionEvent()

void MIDIInstrument::monophonicExpressionEvent ( int32_t newValue,
int32_t expressionDimension )
overrideprotectedvirtual

Reimplemented from ModControllable.

◆ noteOffPostArp()

void MIDIInstrument::noteOffPostArp ( int32_t noteCodePostArp,
int32_t oldMIDIChannel,
int32_t velocity,
int32_t noteIndex )
overrideprotectedvirtual

Implements NonAudioInstrument.

◆ noteOnPostArp()

void MIDIInstrument::noteOnPostArp ( int32_t noteCodePostArp,
ArpNote * arpNote,
int32_t noteIndex )
overrideprotectedvirtual

Implements NonAudioInstrument.

◆ offerReceivedNote()

void MIDIInstrument::offerReceivedNote ( ModelStackWithTimelineCounter * modelStackWithTimelineCounter,
MIDICable & cable,
bool on,
int32_t channel,
int32_t note,
int32_t velocity,
bool shouldRecordNotes,
bool * doingMidiThru )
overridevirtual

Reimplemented from MelodicInstrument.

◆ polyphonicExpressionEventPostArpeggiator()

void MIDIInstrument::polyphonicExpressionEventPostArpeggiator ( int32_t newValue,
int32_t noteCodeAfterArpeggiation,
int32_t expressionDimension,
ArpNote * arpNote,
int32_t noteIndex )
overrideprotectedvirtual

Implements NonAudioInstrument.

◆ readTagFromFile()

bool MIDIInstrument::readTagFromFile ( Deserializer & reader,
char const * tagName )
overridevirtual

Reimplemented from MelodicInstrument.

◆ sendMIDIPGM()

void MIDIInstrument::sendMIDIPGM ( )
overridevirtual

Reimplemented from Output.

◆ setActiveClip()

bool MIDIInstrument::setActiveClip ( ModelStackWithTimelineCounter * modelStack,
PgmChangeSend maySendMIDIPGMs )
overridevirtual

Reimplemented from MelodicInstrument.

◆ valueChangedEnoughToMatter()

bool MIDIInstrument::valueChangedEnoughToMatter ( int32_t old_value,
int32_t new_value,
deluge::modulation::params::Kind kind,
uint32_t paramID )
inlineoverridevirtual

Reimplemented from ModControllable.

◆ writeDataToFile()

bool MIDIInstrument::writeDataToFile ( Serializer & writer,
Clip * clipForSavingOutputOnly,
Song * song )
overridevirtual

Reimplemented from Instrument.


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