25 #ifndef JUCE_MIDIMESSAGE_H_INCLUDED
26 #define JUCE_MIDIMESSAGE_H_INCLUDED
67 MidiMessage (
const void* data,
int numBytes,
double timeStamp = 0);
90 int& numBytesUsed,
uint8 lastStatusByte,
92 bool sysexHasEmbeddedLength =
true);
112 #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
121 const uint8*
getRawData() const
noexcept {
return allocatedData !=
nullptr ? allocatedData.getData() : preallocatedData.asBytes; }
172 bool isForChannel (
int channelNumber) const
noexcept;
178 void setChannel (
int newChannelNumber)
noexcept;
195 int getSysExDataSize() const
noexcept;
208 bool isNoteOn (
bool returnTrueForVelocity0 = false) const
noexcept;
235 bool isNoteOff (
bool returnTrueForNoteOnVelocity0 = true) const
noexcept;
250 bool isNoteOnOrOff() const
noexcept;
261 void setNoteNumber (
int newNoteNumber)
noexcept;
280 float getFloatVelocity() const
noexcept;
289 void setVelocity (
float newVelocity)
noexcept;
298 void multiplyVelocity (
float scaleFactor)
noexcept;
302 bool isSustainPedalOn() const
noexcept;
304 bool isSustainPedalOff() const
noexcept;
307 bool isSostenutoPedalOn() const
noexcept;
309 bool isSostenutoPedalOff() const
noexcept;
312 bool isSoftPedalOn() const
noexcept;
314 bool isSoftPedalOff() const
noexcept;
320 bool isProgramChange() const
noexcept;
326 int getProgramChangeNumber() const
noexcept;
350 int getPitchWheelValue() const
noexcept;
378 int getAfterTouchValue() const
noexcept;
399 bool isChannelPressure() const
noexcept;
406 int getChannelPressureValue() const
noexcept;
430 int getControllerNumber() const
noexcept;
439 int getControllerValue() const
noexcept;
444 bool isControllerOfType (
int controllerType) const
noexcept;
460 bool isAllNotesOff() const
noexcept;
465 bool isAllSoundOff() const
noexcept;
506 int getMetaEventType() const
noexcept;
516 int getMetaEventLength() const
noexcept;
520 bool isTrackMetaEvent() const
noexcept;
523 bool isEndOfTrackMetaEvent() const
noexcept;
533 bool isTrackNameEvent() const
noexcept;
538 bool isTextMetaEvent() const
noexcept;
543 String getTextFromTextMetaEvent() const;
552 bool isTempoMetaEvent() const
noexcept;
560 double getTempoMetaEventTickLength (
short timeFormat) const
noexcept;
565 double getTempoSecondsPerQuarterNote() const
noexcept;
576 bool isTimeSignatureMetaEvent() const
noexcept;
581 void getTimeSignatureInfo (
int& numerator,
int& denominator) const
noexcept;
586 static
MidiMessage timeSignatureMetaEvent (
int numerator,
int denominator);
592 bool isKeySignatureMetaEvent() const
noexcept;
601 int getKeySignatureNumberOfSharpsOrFlats() const
noexcept;
606 bool isKeySignatureMajorKey() const
noexcept;
614 static
MidiMessage keySignatureMetaEvent (
int numberOfSharpsOrFlats,
bool isMinorKey);
624 bool isMidiChannelMetaEvent() const
noexcept;
631 int getMidiChannelMetaEventChannel() const
noexcept;
642 bool isActiveSense() const
noexcept;
656 bool isMidiContinue() const
noexcept;
680 bool isSongPositionPointer() const
noexcept;
685 int getSongPositionPointerMidiBeat() const
noexcept;
701 bool isQuarterFrame() const
noexcept;
707 int getQuarterFrameSequenceNumber() const
noexcept;
712 int getQuarterFrameValue() const
noexcept;
740 void getFullFrameParameters (
int& hours,
744 SmpteTimecodeType& timecodeType) const
noexcept;
751 SmpteTimecodeType timecodeType);
762 mmc_deferredplay = 3,
773 bool isMidiMachineControlMessage() const
noexcept;
780 MidiMachineControlCommand getMidiMachineControlCommand() const
noexcept;
783 static
MidiMessage midiMachineControlCommand (MidiMachineControlCommand command);
789 bool isMidiMachineControlGoto (
int& hours,
798 static
MidiMessage midiMachineControlGoto (
int hours,
813 static
MidiMessage createSysExMessage (const
void* sysexData,
823 static
int readVariableLengthVal (const
uint8* data,
831 static
int getMessageLengthFromFirstByte (const
uint8 firstByte)
noexcept;
848 static
String getMidiNoteName (
int noteNumber,
850 bool includeOctaveNumber,
851 int octaveNumForMiddleC);
858 static
double getMidiNoteInHertz (
int noteNumber, const
double frequencyOfA = 440.0)
noexcept;
861 static
bool isMidiNoteBlack (
int noteNumber)
noexcept;
868 static const
char* getGMInstrumentName (
int midiInstrumentNumber);
873 static const
char* getGMInstrumentBankName (
int midiBankNumber);
878 static const
char* getRhythmInstrumentName (
int midiNoteNumber);
883 static const
char* getControllerName (
int controllerNumber);
899 inline uint8* getData()
noexcept {
return allocatedData !=
nullptr ? allocatedData.getData() : preallocatedData.asBytes; }
900 uint8* allocateSpace (
int);
903 #endif // JUCE_MIDIMESSAGE_H_INCLUDED