46 MidiMessage (
int byte1,
int byte2,
int byte3,
double timeStamp = 0) noexcept;
55 MidiMessage (
int byte1,
int byte2,
double timeStamp = 0) noexcept;
63 MidiMessage (
int byte1,
double timeStamp = 0) noexcept;
66 template <
typename... Data>
67 MidiMessage (
int byte1,
int byte2,
int byte3, Data... otherBytes) : size (3 + sizeof... (otherBytes))
70 jassert (size > 3 || byte1 >= 0xf0 || getMessageLengthFromFirstByte ((uint8) byte1) == size);
72 const uint8 data[] = { (uint8) byte1, (uint8) byte2, (uint8) byte3, static_cast<uint8> (otherBytes)... };
73 memcpy (allocateSpace (size), data, (
size_t) size);
78 MidiMessage (
const void* data,
int numBytes,
double timeStamp = 0);
101 int& numBytesUsed, uint8 lastStatusByte,
102 double timeStamp = 0,
103 bool sysexHasEmbeddedLength =
true);
133 const uint8*
getRawData() const noexcept {
return getData(); }
144 String getDescription()
const;
169 void setTimeStamp (
double newTimestamp) noexcept { timeStamp = newTimestamp; }
179 MidiMessage withTimeStamp (
double newTimestamp)
const;
188 int getChannel()
const noexcept;
195 bool isForChannel (
int channelNumber)
const noexcept;
201 void setChannel (
int newChannelNumber) noexcept;
206 bool isSysEx()
const noexcept;
212 const uint8* getSysExData()
const noexcept;
218 int getSysExDataSize()
const noexcept;
231 bool isNoteOn (
bool returnTrueForVelocity0 =
false)
const noexcept;
240 static MidiMessage noteOn (
int channel,
int noteNumber,
float velocity) noexcept;
249 static MidiMessage noteOn (
int channel,
int noteNumber, uint8 velocity) noexcept;
258 bool isNoteOff (
bool returnTrueForNoteOnVelocity0 =
true)
const noexcept;
267 static MidiMessage noteOff (
int channel,
int noteNumber,
float velocity) noexcept;
276 static MidiMessage noteOff (
int channel,
int noteNumber, uint8 velocity) noexcept;
284 static MidiMessage noteOff (
int channel,
int noteNumber) noexcept;
290 bool isNoteOnOrOff()
const noexcept;
296 int getNoteNumber()
const noexcept;
301 void setNoteNumber (
int newNoteNumber) noexcept;
311 uint8 getVelocity()
const noexcept;
320 float getFloatVelocity()
const noexcept;
329 void setVelocity (
float newVelocity) noexcept;
338 void multiplyVelocity (
float scaleFactor) noexcept;
342 bool isSustainPedalOn()
const noexcept;
344 bool isSustainPedalOff()
const noexcept;
347 bool isSostenutoPedalOn()
const noexcept;
349 bool isSostenutoPedalOff()
const noexcept;
352 bool isSoftPedalOn()
const noexcept;
354 bool isSoftPedalOff()
const noexcept;
360 bool isProgramChange()
const noexcept;
366 int getProgramChangeNumber()
const noexcept;
374 static MidiMessage programChange (
int channel,
int programNumber) noexcept;
380 bool isPitchWheel()
const noexcept;
390 int getPitchWheelValue()
const noexcept;
398 static MidiMessage pitchWheel (
int channel,
int position) noexcept;
409 bool isAftertouch()
const noexcept;
418 int getAfterTouchValue()
const noexcept;
429 int aftertouchAmount) noexcept;
439 bool isChannelPressure()
const noexcept;
446 int getChannelPressureValue()
const noexcept;
454 static MidiMessage channelPressureChange (
int channel,
int pressure) noexcept;
461 bool isController()
const noexcept;
470 int getControllerNumber()
const noexcept;
479 int getControllerValue()
const noexcept;
484 bool isControllerOfType (
int controllerType)
const noexcept;
499 bool isAllNotesOff()
const noexcept;
504 bool isAllSoundOff()
const noexcept;
509 bool isResetAllControllers()
const noexcept;
515 static MidiMessage allNotesOff (
int channel) noexcept;
521 static MidiMessage allSoundOff (
int channel) noexcept;
526 static MidiMessage allControllersOff (
int channel) noexcept;
537 bool isMetaEvent()
const noexcept;
547 int getMetaEventType()
const noexcept;
552 const uint8* getMetaEventData()
const noexcept;
557 int getMetaEventLength()
const noexcept;
561 bool isTrackMetaEvent()
const noexcept;
564 bool isEndOfTrackMetaEvent()
const noexcept;
574 bool isTrackNameEvent()
const noexcept;
579 bool isTextMetaEvent()
const noexcept;
584 String getTextFromTextMetaEvent()
const;
593 bool isTempoMetaEvent()
const noexcept;
601 double getTempoMetaEventTickLength (
short timeFormat)
const noexcept;
606 double getTempoSecondsPerQuarterNote()
const noexcept;
611 static MidiMessage tempoMetaEvent (
int microsecondsPerQuarterNote) noexcept;
617 bool isTimeSignatureMetaEvent()
const noexcept;
622 void getTimeSignatureInfo (
int& numerator,
int& denominator)
const noexcept;
627 static MidiMessage timeSignatureMetaEvent (
int numerator,
int denominator);
633 bool isKeySignatureMetaEvent()
const noexcept;
642 int getKeySignatureNumberOfSharpsOrFlats()
const noexcept;
647 bool isKeySignatureMajorKey()
const noexcept;
655 static MidiMessage keySignatureMetaEvent (
int numberOfSharpsOrFlats,
bool isMinorKey);
665 bool isMidiChannelMetaEvent()
const noexcept;
672 int getMidiChannelMetaEventChannel()
const noexcept;
679 static MidiMessage midiChannelMetaEvent (
int channel) noexcept;
683 bool isActiveSense()
const noexcept;
689 bool isMidiStart()
const noexcept;
697 bool isMidiContinue()
const noexcept;
705 bool isMidiStop()
const noexcept;
713 bool isMidiClock()
const noexcept;
721 bool isSongPositionPointer()
const noexcept;
726 int getSongPositionPointerMidiBeat()
const noexcept;
736 static MidiMessage songPositionPointer (
int positionInMidiBeats) noexcept;
742 bool isQuarterFrame()
const noexcept;
748 int getQuarterFrameSequenceNumber()
const noexcept;
753 int getQuarterFrameValue()
const noexcept;
760 static MidiMessage quarterFrame (
int sequenceNumber,
int value) noexcept;
774 bool isFullFrame()
const noexcept;
781 void getFullFrameParameters (
int& hours,
803 mmc_deferredplay = 3,
814 bool isMidiMachineControlMessage()
const noexcept;
830 bool isMidiMachineControlGoto (
int& hours,
833 int& frames)
const noexcept;
839 static MidiMessage midiMachineControlGoto (
int hours,
854 static MidiMessage createSysExMessage (
const void* sysexData,
864 static int readVariableLengthVal (
const uint8* data,
865 int& numBytesUsed) noexcept;
872 static int getMessageLengthFromFirstByte (uint8 firstByte) noexcept;
889 static String getMidiNoteName (
int noteNumber,
891 bool includeOctaveNumber,
892 int octaveNumForMiddleC);
899 static double getMidiNoteInHertz (
int noteNumber,
double frequencyOfA = 440.0) noexcept;
902 static bool isMidiNoteBlack (
int noteNumber) noexcept;
909 static const char* getGMInstrumentName (
int midiInstrumentNumber);
914 static const char* getGMInstrumentBankName (
int midiBankNumber);
919 static const char* getRhythmInstrumentName (
int midiNoteNumber);
924 static const char* getControllerName (
int controllerNumber);
927 static uint8 floatValueToMidiByte (
float valueBetween0and1) noexcept;
930 static uint16 pitchbendToPitchwheelPos (
float pitchbendInSemitones,
931 float pitchbendRangeInSemitones) noexcept;
938 uint8* allocatedData;
939 uint8 asBytes[
sizeof (uint8*)];
942 PackedData packedData;
943 double timeStamp = 0;
947 inline bool isHeapAllocated()
const noexcept {
return size > (int)
sizeof (packedData); }
948 inline uint8* getData()
const noexcept {
return isHeapAllocated() ? packedData.allocatedData : (uint8*) packedData.asBytes; }
949 uint8* allocateSpace (
int);
void setTimeStamp(double newTimestamp) noexcept
int getRawDataSize() const noexcept
void addToTimeStamp(double delta) noexcept
MidiMessage(int byte1, int byte2, int byte3, Data... otherBytes)
MidiMachineControlCommand
const uint8 * getRawData() const noexcept
double getTimeStamp() const noexcept