MidiMessage Class Reference
juce_audio_basics » midi

Encapsulates a MIDI message. More...

## Public Types

enum | SmpteTimecodeType { fps24 = 0, fps25 = 1, fps30drop = 2, fps30 = 3 }
| SMPTE timecode types. More...
enum | MidiMachineControlCommand { mmc_stop = 1, mmc_play = 2, mmc_deferredplay = 3, mmc_fastforward = 4, mmc_rewind = 5, mmc_recordStart = 6, mmc_recordStop = 7, mmc_pause = 9 }
| Types of MMC command. More...

## Public Member Functions

| MidiMessage (int byte1, int byte2, int byte3, double timeStamp=0) noexcept
| Creates a 3-byte short midi message. More...
| MidiMessage (int byte1, int byte2, double timeStamp=0) noexcept
| Creates a 2-byte short midi message. More...
| MidiMessage (int byte1, double timeStamp=0) noexcept
| Creates a 1-byte short midi message. More...
template<typename... Data>
| MidiMessage (int byte1, int byte2, int byte3, Data... otherBytes)
| Creates a midi message from a list of bytes. More...
| MidiMessage (const void *data, int numBytes, double timeStamp=0)
| Creates a midi message from a block of data. More...
| MidiMessage (const void *data, int maxBytesToUse, int &numBytesUsed, uint8 lastStatusByte, double timeStamp=0, bool sysexHasEmbeddedLength=true)
| Reads the next midi message from some data. More...
| MidiMessage () noexcept
| Creates an active-sense message. More...
| MidiMessage (const MidiMessage &)
| Creates a copy of another midi message. More...
| MidiMessage (const MidiMessage &, double newTimeStamp)
| Creates a copy of another midi message, with a different timestamp. More...
| ~MidiMessage () noexcept
| Destructor. More...
MidiMessage & | operator= (const MidiMessage &other)
| Copies this message from another one. More...
| MidiMessage (MidiMessage &&) noexcept
| Move constructor. More...
MidiMessage & | operator= (MidiMessage &&) noexcept
| Move assignment operator. More...
const uint8 * | getRawData () const noexcept
| Returns a pointer to the raw midi data. More...
int | getRawDataSize () const noexcept
| Returns the number of bytes of data in the message. More...
String | getDescription () const
| Returns a human-readable description of the midi message as a string, for example "Note On C#3 Velocity 120 Channel 1". More...
double | getTimeStamp () const noexcept
| Returns the timestamp associated with this message. More...
void | setTimeStamp (double newTimestamp) noexcept
| Changes the message's associated timestamp. More...
void | addToTimeStamp (double delta) noexcept
| Adds a value to the message's timestamp. More...
MidiMessage | withTimeStamp (double newTimestamp) const
| Return a copy of this message with a new timestamp. More...
int | getChannel () const noexcept
| Returns the midi channel associated with the message. More...
bool | isForChannel (int channelNumber) const noexcept
| Returns true if the message applies to the given midi channel. More...
void | setChannel (int newChannelNumber) noexcept
| Changes the message's midi channel. More...
bool | isSysEx () const noexcept
| Returns true if this is a system-exclusive message. More...
const uint8 * | getSysExData () const noexcept
| Returns a pointer to the sysex data inside the message. More...
int | getSysExDataSize () const noexcept
| Returns the size of the sysex data. More...
bool | isNoteOn (bool returnTrueForVelocity0=false) const noexcept
| Returns true if this message is a 'key-down' event. More...
bool | isNoteOff (bool returnTrueForNoteOnVelocity0=true) const noexcept
| Returns true if this message is a 'key-up' event. More...
bool | isNoteOnOrOff () const noexcept
| Returns true if this message is a 'key-down' or 'key-up' event. More...
int | getNoteNumber () const noexcept
| Returns the midi note number for note-on and note-off messages. More...
void | setNoteNumber (int newNoteNumber) noexcept
| Changes the midi note number of a note-on or note-off message. More...
uint8 | getVelocity () const noexcept
| Returns the velocity of a note-on or note-off message. More...
float | getFloatVelocity () const noexcept
| Returns the velocity of a note-on or note-off message. More...
void | setVelocity (float newVelocity) noexcept
| Changes the velocity of a note-on or note-off message. More...
void | multiplyVelocity (float scaleFactor) noexcept
| Multiplies the velocity of a note-on or note-off message by a given amount. More...
bool | isSustainPedalOn () const noexcept
| Returns true if this message is a 'sustain pedal down' controller message. More...
bool | isSustainPedalOff () const noexcept
| Returns true if this message is a 'sustain pedal up' controller message. More...
bool | isSostenutoPedalOn () const noexcept
| Returns true if this message is a 'sostenuto pedal down' controller message. More...
bool | isSostenutoPedalOff () const noexcept
| Returns true if this message is a 'sostenuto pedal up' controller message. More...
bool | isSoftPedalOn () const noexcept
| Returns true if this message is a 'soft pedal down' controller message. More...
bool | isSoftPedalOff () const noexcept
| Returns true if this message is a 'soft pedal up' controller message. More...
bool | isProgramChange () const noexcept
| Returns true if the message is a program (patch) change message. More...
int | getProgramChangeNumber () const noexcept
| Returns the new program number of a program change message. More...
bool | isPitchWheel () const noexcept
| Returns true if the message is a pitch-wheel move. More...
int | getPitchWheelValue () const noexcept
| Returns the pitch wheel position from a pitch-wheel move message. More...
bool | isAftertouch () const noexcept
| Returns true if the message is an aftertouch event. More...
int | getAfterTouchValue () const noexcept
| Returns the amount of aftertouch from an aftertouch messages. More...
bool | isChannelPressure () const noexcept
| Returns true if the message is a channel-pressure change event. More...
int | getChannelPressureValue () const noexcept
| Returns the pressure from a channel pressure change message. More...
bool | isController () const noexcept
| Returns true if this is a midi controller message. More...
int | getControllerNumber () const noexcept
| Returns the controller number of a controller message. More...
int | getControllerValue () const noexcept
| Returns the controller value from a controller message. More...
bool | isControllerOfType (int controllerType) const noexcept
| Returns true if this message is a controller message and if it has the specified controller type. More...
bool | isAllNotesOff () const noexcept
| Checks whether this message is an all-notes-off message. More...
bool | isAllSoundOff () const noexcept
| Checks whether this message is an all-sound-off message. More...
bool | isResetAllControllers () const noexcept
| Checks whether this message is a reset all controllers message. More...
bool | isMetaEvent () const noexcept
| Returns true if this event is a meta-event. More...
int | getMetaEventType () const noexcept
| Returns a meta-event's type number. More...
const uint8 * | getMetaEventData () const noexcept
| Returns a pointer to the data in a meta-event. More...
int | getMetaEventLength () const noexcept
| Returns the length of the data for a meta-event. More...
bool | isTrackMetaEvent () const noexcept
| Returns true if this is a 'track' meta-event. More...
bool | isEndOfTrackMetaEvent () const noexcept
| Returns true if this is an 'end-of-track' meta-event. More...
bool | isTrackNameEvent () const noexcept
| Returns true if this is an 'track name' meta-event. More...
bool | isTextMetaEvent () const noexcept
| Returns true if this is a 'text' meta-event. More...
String | getTextFromTextMetaEvent () const
| Returns the text from a text meta-event. More...
bool | isTempoMetaEvent () const noexcept
| Returns true if this is a 'tempo' meta-event. More...
double | getTempoMetaEventTickLength (short timeFormat) const noexcept
| Returns the tick length from a tempo meta-event. More...
double | getTempoSecondsPerQuarterNote () const noexcept
| Calculates the seconds-per-quarter-note from a tempo meta-event. More...
bool | isTimeSignatureMetaEvent () const noexcept
| Returns true if this is a 'time-signature' meta-event. More...
void | getTimeSignatureInfo (int &numerator, int &denominator) const noexcept
| Returns the time-signature values from a time-signature meta-event. More...
bool | isKeySignatureMetaEvent () const noexcept
| Returns true if this is a 'key-signature' meta-event. More...
int | getKeySignatureNumberOfSharpsOrFlats () const noexcept
| Returns the key from a key-signature meta-event. More...
bool | isKeySignatureMajorKey () const noexcept
| Returns true if this key-signature event is major, or false if it's minor. More...
bool | isMidiChannelMetaEvent () const noexcept
| Returns true if this is a 'channel' meta-event. More...
int | getMidiChannelMetaEventChannel () const noexcept
| Returns the channel number from a channel meta-event. More...
bool | isActiveSense () const noexcept
| Returns true if this is an active-sense message. More...
bool | isMidiStart () const noexcept
| Returns true if this is a midi start event. More...
bool | isMidiContinue () const noexcept
| Returns true if this is a midi continue event. More...
bool | isMidiStop () const noexcept
| Returns true if this is a midi stop event. More...
bool | isMidiClock () const noexcept
| Returns true if this is a midi clock event. More...
bool | isSongPositionPointer () const noexcept
| Returns true if this is a song-position-pointer message. More...
int | getSongPositionPointerMidiBeat () const noexcept
| Returns the midi beat-number of a song-position-pointer message. More...
bool | isQuarterFrame () const noexcept
| Returns true if this is a quarter-frame midi timecode message. More...
int | getQuarterFrameSequenceNumber () const noexcept
| Returns the sequence number of a quarter-frame midi timecode message. More...
int | getQuarterFrameValue () const noexcept
| Returns the value from a quarter-frame message. More...
bool | isFullFrame () const noexcept
| Returns true if this is a full-frame midi timecode message. More...
void | getFullFrameParameters (int &hours, int &minutes, int &seconds, int &frames, SmpteTimecodeType &timecodeType) const noexcept
| Extracts the timecode information from a full-frame midi timecode message. More...
bool | isMidiMachineControlMessage () const noexcept
| Checks whether this is an MMC message. More...
MidiMachineControlCommand | getMidiMachineControlCommand () const noexcept
| For an MMC message, this returns its type. More...
bool | isMidiMachineControlGoto (int &hours, int &minutes, int &seconds, int &frames) const noexcept
| Checks whether this is an MMC "goto" message. More...

## Static Public Member Functions

static MidiMessage | noteOn (int channel, int noteNumber, float velocity) noexcept
| Creates a key-down message (using a floating-point velocity). More...
static MidiMessage | noteOn (int channel, int noteNumber, uint8 velocity) noexcept
| Creates a key-down message (using an integer velocity). More...
static MidiMessage | noteOff (int channel, int noteNumber, float velocity) noexcept
| Creates a key-up message. More...
static MidiMessage | noteOff (int channel, int noteNumber, uint8 velocity) noexcept
| Creates a key-up message. More...
static MidiMessage | noteOff (int channel, int noteNumber) noexcept
| Creates a key-up message. More...
static MidiMessage | programChange (int channel, int programNumber) noexcept
| Creates a program-change message. More...
static MidiMessage | pitchWheel (int channel, int position) noexcept
| Creates a pitch-wheel move message. More...
static MidiMessage | aftertouchChange (int channel, int noteNumber, int aftertouchAmount) noexcept
| Creates an aftertouch message. More...
static MidiMessage | channelPressureChange (int channel, int pressure) noexcept
| Creates a channel-pressure change event. More...
static MidiMessage | controllerEvent (int channel, int controllerType, int value) noexcept
| Creates a controller message. More...
static MidiMessage | allNotesOff (int channel) noexcept
| Creates an all-notes-off message. More...
static MidiMessage | allSoundOff (int channel) noexcept
| Creates an all-sound-off message. More...
static MidiMessage | allControllersOff (int channel) noexcept
| Creates an all-controllers-off message. More...
static MidiMessage | endOfTrack () noexcept
| Creates an end-of-track meta-event. More...
static MidiMessage | textMetaEvent (int type, StringRef text)
| Creates a text meta-event. More...
static MidiMessage | tempoMetaEvent (int microsecondsPerQuarterNote) noexcept
| Creates a tempo meta-event. More...
static MidiMessage | timeSignatureMetaEvent (int numerator, int denominator)
| Creates a time-signature meta-event. More...
static MidiMessage | keySignatureMetaEvent (int numberOfSharpsOrFlats, bool isMinorKey)
| Creates a key-signature meta-event. More...
static MidiMessage | midiChannelMetaEvent (int channel) noexcept
| Creates a midi channel meta-event. More...
static MidiMessage | midiStart () noexcept
| Creates a midi start event. More...
static MidiMessage | midiContinue () noexcept
| Creates a midi continue event. More...
static MidiMessage | midiStop () noexcept
| Creates a midi stop event. More...
static MidiMessage | midiClock () noexcept
| Creates a midi clock event. More...
static MidiMessage | songPositionPointer (int positionInMidiBeats) noexcept
| Creates a song-position-pointer message. More...
static MidiMessage | quarterFrame (int sequenceNumber, int value) noexcept
| Creates a quarter-frame MTC message. More...
static MidiMessage | fullFrame (int hours, int minutes, int seconds, int frames, SmpteTimecodeType timecodeType)
| Creates a full-frame MTC message. More...
static MidiMessage | midiMachineControlCommand (MidiMachineControlCommand command)
| Creates an MMC message. More...
static MidiMessage | midiMachineControlGoto (int hours, int minutes, int seconds, int frames)
| Creates an MMC "goto" message. More...
static MidiMessage | masterVolume (float volume)
| Creates a master-volume change message. More...
static MidiMessage | createSysExMessage (const void *sysexData, int dataSize)
| Creates a system-exclusive message. More...
static int | readVariableLengthVal (const uint8 *data, int &numBytesUsed) noexcept
| Reads a midi variable-length integer. More...
static int | getMessageLengthFromFirstByte (uint8 firstByte) noexcept
| Based on the first byte of a short midi message, this uses a lookup table to return the message length (either 1, 2, or 3 bytes). More...
static String | getMidiNoteName (int noteNumber, bool useSharps, bool includeOctaveNumber, int octaveNumForMiddleC)
| Returns the name of a midi note number. More...
static double | getMidiNoteInHertz (int noteNumber, double frequencyOfA=440.0) noexcept
| Returns the frequency of a midi note number. More...
static bool | isMidiNoteBlack (int noteNumber) noexcept
| Returns true if the given midi note number is a black key. More...
static const char * | getGMInstrumentName (int midiInstrumentNumber)
| Returns the standard name of a GM instrument, or nullptr if unknown for this index. More...
static const char * | getGMInstrumentBankName (int midiBankNumber)
| Returns the name of a bank of GM instruments, or nullptr if unknown for this bank number. More...
static const char * | getRhythmInstrumentName (int midiNoteNumber)
| Returns the standard name of a channel 10 percussion sound, or nullptr if unknown for this note number. More...
static const char * | getControllerName (int controllerNumber)
| Returns the name of a controller type number, or nullptr if unknown for this controller number. More...
static uint8 | floatValueToMidiByte (float valueBetween0and1) noexcept
| Converts a floating-point value between 0 and 1 to a MIDI 7-bit value between 0 and 127. More...
static uint16 | pitchbendToPitchwheelPos (float pitchbendInSemitones, float pitchbendRangeInSemitones) noexcept
| Converts a pitchbend value in semitones to a MIDI 14-bit pitchwheel position value. More...

## Detailed Description

Encapsulates a MIDI message.

See also
  MidiMessageSequence, MidiOutput, MidiInput

## Member Enumeration Documentation

## SmpteTimecodeType

enum MidiMessage::SmpteTimecodeType

SMPTE timecode types.

Used by the getFullFrameParameters() and fullFrame() methods.

Enumerator
fps24 |
fps25 |
fps30drop |
fps30 |

## MidiMachineControlCommand

enum MidiMessage::MidiMachineControlCommand

Types of MMC command.

See also
  isMidiMachineControlMessage, getMidiMachineControlCommand, midiMachineControlCommand

Enumerator
mmc_stop |
mmc_play |
mmc_deferredplay |
mmc_fastforward |
mmc_rewind |
mmc_recordStart |
mmc_recordStop |
mmc_pause |

## Constructor & Destructor Documentation

## MidiMessage() [1/10]

MidiMessage::MidiMessage | ( | int | byte1,
|  | int | byte2,
|  | int | byte3,
|  | double | timeStamp = `0`
| ) |  |

noexcept

Creates a 3-byte short midi message.

Parameters

  byte1 | message byte 1
  byte2 | message byte 2
  byte3 | message byte 3
  timeStamp | the time to give the midi message - this value doesn't use any particular units, so will be application-specific

## MidiMessage() [2/10]

MidiMessage::MidiMessage | ( | int | byte1,
|  | int | byte2,
|  | double | timeStamp = `0`
| ) |  |

noexcept

Creates a 2-byte short midi message.

Parameters

  byte1 | message byte 1
  byte2 | message byte 2
  timeStamp | the time to give the midi message - this value doesn't use any particular units, so will be application-specific

## MidiMessage() [3/10]

MidiMessage::MidiMessage | ( | int | byte1,
|  | double | timeStamp = `0`
| ) |  |

noexcept

Creates a 1-byte short midi message.

Parameters

  byte1 | message byte 1
  timeStamp | the time to give the midi message - this value doesn't use any particular units, so will be application-specific

## MidiMessage() [4/10]

template<typename... Data>

MidiMessage::MidiMessage | ( | int | byte1,
|  | int | byte2,
|  | int | byte3,
|  | Data... | otherBytes
| ) |  |

Creates a midi message from a list of bytes.

References jassert.

## MidiMessage() [5/10]

MidiMessage::MidiMessage | ( | const void * | data,
|  | int | numBytes,
|  | double | timeStamp = `0`
| ) |  |

Creates a midi message from a block of data.

## MidiMessage() [6/10]

MidiMessage::MidiMessage | ( | const void * | data,
|  | int | maxBytesToUse,
|  | int & | numBytesUsed,
|  | uint8 | lastStatusByte,
|  | double | timeStamp = `0`,
|  | bool | sysexHasEmbeddedLength = `true`
| ) |  |

Reads the next midi message from some data.

This will read as many bytes from a data stream as it needs to make a complete message, and will return the number of bytes it used. This lets you read a sequence of midi messages from a file or stream.

Parameters

  data | the data to read from
  maxBytesToUse | the maximum number of bytes it's allowed to read
  numBytesUsed | returns the number of bytes that were actually needed
  lastStatusByte | in a sequence of midi messages, the initial byte can be dropped from a message if it's the same as the first byte of the previous message, so this lets you supply the byte to use if the first byte of the message has in fact been dropped.
  timeStamp | the time to give the midi message - this value doesn't use any particular units, so will be application-specific
  sysexHasEmbeddedLength | when reading sysexes, this flag indicates whether to expect the data to begin with a variable-length field indicating its size

## MidiMessage() [7/10]

MidiMessage::MidiMessage | ( |  | ) |

noexcept

Creates an active-sense message.

Since the MidiMessage has to contain a valid message, this default constructor just initialises it with an empty sysex message.

## MidiMessage() [8/10]

MidiMessage::MidiMessage | ( | const MidiMessage & |  | ) |

Creates a copy of another midi message.

## MidiMessage() [9/10]

MidiMessage::MidiMessage | ( | const MidiMessage & | ,
|  | double | newTimeStamp
| ) |  |

Creates a copy of another midi message, with a different timestamp.

## ~MidiMessage()

MidiMessage::~MidiMessage | ( |  | ) |

noexcept

Destructor.

## MidiMessage() [10/10]

MidiMessage::MidiMessage | ( | MidiMessage && |  | ) |

noexcept

Move constructor.

## Member Function Documentation

## operator=() [1/2]

MidiMessage& MidiMessage::operator= | ( | const MidiMessage & | other | ) |

Copies this message from another one.

## operator=() [2/2]

MidiMessage& MidiMessage::operator= | ( | MidiMessage && |  | ) |

noexcept

Move assignment operator.

## getRawData()

const uint8* MidiMessage::getRawData | ( |  | ) | const

noexcept

Returns a pointer to the raw midi data.

See also
  getRawDataSize

## getRawDataSize()

int MidiMessage::getRawDataSize | ( |  | ) | const

noexcept

Returns the number of bytes of data in the message.

See also
  getRawData

## getDescription()

String MidiMessage::getDescription | ( |  | ) | const

Returns a human-readable description of the midi message as a string, for example "Note On C#3 Velocity 120 Channel 1".

## getTimeStamp()

double MidiMessage::getTimeStamp | ( |  | ) | const

noexcept

Returns the timestamp associated with this message.

The exact meaning of this time and its units will vary, as messages are used in a variety of different contexts.

If you're getting the message from a midi file, this could be a time in seconds, or a number of ticks - see MidiFile::convertTimestampTicksToSeconds().

If the message is being used in a MidiBuffer, it might indicate the number of audio samples from the start of the buffer.

If the message was created by a MidiInput, see MidiInputCallback::handleIncomingMidiMessage() for details of the way that it initialises this value.

See also
  setTimeStamp, addToTimeStamp

## setTimeStamp()

void MidiMessage::setTimeStamp | ( | double | newTimestamp | ) |

noexcept

Changes the message's associated timestamp.

The units for the timestamp will be application-specific - see the notes for getTimeStamp().

See also
  addToTimeStamp, getTimeStamp

## addToTimeStamp()

void MidiMessage::addToTimeStamp | ( | double | delta | ) |

noexcept

Adds a value to the message's timestamp.

The units for the timestamp will be application-specific.

## withTimeStamp()

MidiMessage MidiMessage::withTimeStamp | ( | double | newTimestamp | ) | const

Return a copy of this message with a new timestamp.

The units for the timestamp will be application-specific - see the notes for getTimeStamp().

## getChannel()

int MidiMessage::getChannel | ( |  | ) | const

noexcept

Returns the midi channel associated with the message.

Returns
  a value 1 to 16 if the message has a channel, or 0 if it hasn't (e.g. if it's a sysex)

See also
  isForChannel, setChannel

## isForChannel()

bool MidiMessage::isForChannel | ( | int | channelNumber | ) | const

noexcept

Returns true if the message applies to the given midi channel.

Parameters

  channelNumber | the channel number to look for, in the range 1 to 16

See also
  getChannel, setChannel

## setChannel()

void MidiMessage::setChannel | ( | int | newChannelNumber | ) |

noexcept

Changes the message's midi channel.

This won't do anything for non-channel messages like sysexes.

Parameters

  newChannelNumber | the channel number to change it to, in the range 1 to 16

## isSysEx()

bool MidiMessage::isSysEx | ( |  | ) | const

noexcept

Returns true if this is a system-exclusive message.

## getSysExData()

const uint8* MidiMessage::getSysExData | ( |  | ) | const

noexcept

Returns a pointer to the sysex data inside the message.

If this event isn't a sysex event, it'll return 0.

See also
  getSysExDataSize

## getSysExDataSize()

int MidiMessage::getSysExDataSize | ( |  | ) | const

noexcept

Returns the size of the sysex data.

This value excludes the 0xf0 header byte and the 0xf7 at the end.

See also
  getSysExData

## isNoteOn()

bool MidiMessage::isNoteOn | ( | bool | returnTrueForVelocity0 = `false` | ) | const

noexcept

Returns true if this message is a 'key-down' event.

Parameters

  returnTrueForVelocity0 | if true, then if this event is a note-on with velocity 0, it will still be considered to be a note-on and the method will return true. If returnTrueForVelocity0 is false, then if this is a note-on event with velocity 0, it'll be regarded as a note-off, and the method will return false

See also
  isNoteOff, getNoteNumber, getVelocity, noteOn

## noteOn() [1/2]

static MidiMessage MidiMessage::noteOn | ( | int | channel,
|  | int | noteNumber,
|  | float | velocity
| ) |  |

static noexcept

Creates a key-down message (using a floating-point velocity).

Parameters

  channel | the midi channel, in the range 1 to 16
  noteNumber | the key number, 0 to 127
  velocity | in the range 0 to 1.0

See also
  isNoteOn

## noteOn() [2/2]

static MidiMessage MidiMessage::noteOn | ( | int | channel,
|  | int | noteNumber,
|  | uint8 | velocity
| ) |  |

static noexcept

Creates a key-down message (using an integer velocity).

Parameters

  channel | the midi channel, in the range 1 to 16
  noteNumber | the key number, 0 to 127
  velocity | in the range 0 to 127

See also
  isNoteOn

## isNoteOff()

bool MidiMessage::isNoteOff | ( | bool | returnTrueForNoteOnVelocity0 = `true` | ) | const

noexcept

Returns true if this message is a 'key-up' event.

If returnTrueForNoteOnVelocity0 is true, then his will also return true for a note-on event with a velocity of 0.

See also
  isNoteOn, getNoteNumber, getVelocity, noteOff

## noteOff() [1/3]

static MidiMessage MidiMessage::noteOff | ( | int | channel,
|  | int | noteNumber,
|  | float | velocity
| ) |  |

static noexcept

Creates a key-up message.

Parameters

  channel | the midi channel, in the range 1 to 16
  noteNumber | the key number, 0 to 127
  velocity | in the range 0 to 1.0

See also
  isNoteOff

## noteOff() [2/3]

static MidiMessage MidiMessage::noteOff | ( | int | channel,
|  | int | noteNumber,
|  | uint8 | velocity
| ) |  |

static noexcept

Creates a key-up message.

Parameters

  channel | the midi channel, in the range 1 to 16
  noteNumber | the key number, 0 to 127
  velocity | in the range 0 to 127

See also
  isNoteOff

## noteOff() [3/3]

static MidiMessage MidiMessage::noteOff | ( | int | channel,
|  | int | noteNumber
| ) |  |

static noexcept

Creates a key-up message.

Parameters

  channel | the midi channel, in the range 1 to 16
  noteNumber | the key number, 0 to 127

See also
  isNoteOff

## isNoteOnOrOff()

bool MidiMessage::isNoteOnOrOff | ( |  | ) | const

noexcept

Returns true if this message is a 'key-down' or 'key-up' event.

See also
  isNoteOn, isNoteOff

## getNoteNumber()

int MidiMessage::getNoteNumber | ( |  | ) | const

noexcept

Returns the midi note number for note-on and note-off messages.

If the message isn't a note-on or off, the value returned is undefined.

See also
  isNoteOff, getMidiNoteName, getMidiNoteInHertz, setNoteNumber

## setNoteNumber()

void MidiMessage::setNoteNumber | ( | int | newNoteNumber | ) |

noexcept

Changes the midi note number of a note-on or note-off message.

If the message isn't a note on or off, this will do nothing.

## getVelocity()

uint8 MidiMessage::getVelocity | ( |  | ) | const

noexcept

Returns the velocity of a note-on or note-off message.

The value returned will be in the range 0 to 127. If the message isn't a note-on or off event, it will return 0.

See also
  getFloatVelocity

## getFloatVelocity()

float MidiMessage::getFloatVelocity | ( |  | ) | const

noexcept

Returns the velocity of a note-on or note-off message.

The value returned will be in the range 0 to 1.0 If the message isn't a note-on or off event, it will return 0.

See also
  getVelocity, setVelocity

## setVelocity()

void MidiMessage::setVelocity | ( | float | newVelocity | ) |

noexcept

Changes the velocity of a note-on or note-off message.

If the message isn't a note on or off, this will do nothing.

Parameters

  newVelocity | the new velocity, in the range 0 to 1.0

See also
  getFloatVelocity, multiplyVelocity

## multiplyVelocity()

void MidiMessage::multiplyVelocity | ( | float | scaleFactor | ) |

noexcept

Multiplies the velocity of a note-on or note-off message by a given amount.

If the message isn't a note on or off, this will do nothing.

Parameters

  scaleFactor | the value by which to multiply the velocity

See also
  setVelocity

## isSustainPedalOn()

bool MidiMessage::isSustainPedalOn | ( |  | ) | const

noexcept

Returns true if this message is a 'sustain pedal down' controller message.

## isSustainPedalOff()

bool MidiMessage::isSustainPedalOff | ( |  | ) | const

noexcept

Returns true if this message is a 'sustain pedal up' controller message.

## isSostenutoPedalOn()

bool MidiMessage::isSostenutoPedalOn | ( |  | ) | const

noexcept

Returns true if this message is a 'sostenuto pedal down' controller message.

## isSostenutoPedalOff()

bool MidiMessage::isSostenutoPedalOff | ( |  | ) | const

noexcept

Returns true if this message is a 'sostenuto pedal up' controller message.

## isSoftPedalOn()

bool MidiMessage::isSoftPedalOn | ( |  | ) | const

noexcept

Returns true if this message is a 'soft pedal down' controller message.

## isSoftPedalOff()

bool MidiMessage::isSoftPedalOff | ( |  | ) | const

noexcept

Returns true if this message is a 'soft pedal up' controller message.

## isProgramChange()

bool MidiMessage::isProgramChange | ( |  | ) | const

noexcept

Returns true if the message is a program (patch) change message.

See also
  getProgramChangeNumber, getGMInstrumentName

## getProgramChangeNumber()

int MidiMessage::getProgramChangeNumber | ( |  | ) | const

noexcept

Returns the new program number of a program change message.

If the message isn't a program change, the value returned is undefined.

See also
  isProgramChange, getGMInstrumentName

## programChange()

static MidiMessage MidiMessage::programChange | ( | int | channel,
|  | int | programNumber
| ) |  |

static noexcept

Creates a program-change message.

Parameters

  channel | the midi channel, in the range 1 to 16
  programNumber | the midi program number, 0 to 127

See also
  isProgramChange, getGMInstrumentName

## isPitchWheel()

bool MidiMessage::isPitchWheel | ( |  | ) | const

noexcept

Returns true if the message is a pitch-wheel move.

See also
  getPitchWheelValue, pitchWheel

## getPitchWheelValue()

int MidiMessage::getPitchWheelValue | ( |  | ) | const

noexcept

Returns the pitch wheel position from a pitch-wheel move message.

The value returned is a 14-bit number from 0 to 0x3fff, indicating the wheel position. If called for messages which aren't pitch wheel events, the number returned will be nonsense.

See also
  isPitchWheel

## pitchWheel()

static MidiMessage MidiMessage::pitchWheel | ( | int | channel,
|  | int | position
| ) |  |

static noexcept

Creates a pitch-wheel move message.

Parameters

  channel | the midi channel, in the range 1 to 16
  position | the wheel position, in the range 0 to 16383

See also
  isPitchWheel

## isAftertouch()

bool MidiMessage::isAftertouch | ( |  | ) | const

noexcept

Returns true if the message is an aftertouch event.

For aftertouch events, use the getNoteNumber() method to find out the key that it applies to, and getAftertouchValue() to find out the amount. Use getChannel() to find out the channel.

See also
  getAftertouchValue, getNoteNumber

## getAfterTouchValue()

int MidiMessage::getAfterTouchValue | ( |  | ) | const

noexcept

Returns the amount of aftertouch from an aftertouch messages.

The value returned is in the range 0 to 127, and will be nonsense for messages other than aftertouch messages.

See also
  isAftertouch

## aftertouchChange()

static MidiMessage MidiMessage::aftertouchChange | ( | int | channel,
|  | int | noteNumber,
|  | int | aftertouchAmount
| ) |  |

static noexcept

Creates an aftertouch message.

Parameters

  channel | the midi channel, in the range 1 to 16
  noteNumber | the key number, 0 to 127
  aftertouchAmount | the amount of aftertouch, 0 to 127

See also
  isAftertouch

## isChannelPressure()

bool MidiMessage::isChannelPressure | ( |  | ) | const

noexcept

Returns true if the message is a channel-pressure change event.

This is like aftertouch, but common to the whole channel rather than a specific note. Use getChannelPressureValue() to find out the pressure, and getChannel() to find out the channel.

See also
  channelPressureChange

## getChannelPressureValue()

int MidiMessage::getChannelPressureValue | ( |  | ) | const

noexcept

Returns the pressure from a channel pressure change message.

Returns
  the pressure, in the range 0 to 127

See also
  isChannelPressure, channelPressureChange

## channelPressureChange()

static MidiMessage MidiMessage::channelPressureChange | ( | int | channel,
|  | int | pressure
| ) |  |

static noexcept

Creates a channel-pressure change event.

Parameters

  channel | the midi channel: 1 to 16
  pressure | the pressure, 0 to 127

See also
  isChannelPressure

## isController()

bool MidiMessage::isController | ( |  | ) | const

noexcept

Returns true if this is a midi controller message.

See also
  getControllerNumber, getControllerValue, controllerEvent

## getControllerNumber()

int MidiMessage::getControllerNumber | ( |  | ) | const

noexcept

Returns the controller number of a controller message.

The name of the controller can be looked up using the getControllerName() method. Note that the value returned is invalid for messages that aren't controller changes.

See also
  isController, getControllerName, getControllerValue

## getControllerValue()

int MidiMessage::getControllerValue | ( |  | ) | const

noexcept

Returns the controller value from a controller message.

A value 0 to 127 is returned to indicate the new controller position. Note that the value returned is invalid for messages that aren't controller changes.

See also
  isController, getControllerNumber

## isControllerOfType()

bool MidiMessage::isControllerOfType | ( | int | controllerType | ) | const

noexcept

Returns true if this message is a controller message and if it has the specified controller type.

## controllerEvent()

static MidiMessage MidiMessage::controllerEvent | ( | int | channel,
|  | int | controllerType,
|  | int | value
| ) |  |

static noexcept

Creates a controller message.

Parameters

  channel | the midi channel, in the range 1 to 16
  controllerType | the type of controller
  value | the controller value

See also
  isController

## isAllNotesOff()

bool MidiMessage::isAllNotesOff | ( |  | ) | const

noexcept

Checks whether this message is an all-notes-off message.

See also
  allNotesOff

## isAllSoundOff()

bool MidiMessage::isAllSoundOff | ( |  | ) | const

noexcept

Checks whether this message is an all-sound-off message.

See also
  allSoundOff

## isResetAllControllers()

bool MidiMessage::isResetAllControllers | ( |  | ) | const

noexcept

Checks whether this message is a reset all controllers message.

See also
  allControllerOff

## allNotesOff()

static MidiMessage MidiMessage::allNotesOff | ( | int | channel | ) |

static noexcept

Creates an all-notes-off message.

Parameters

  channel | the midi channel, in the range 1 to 16

See also
  isAllNotesOff

## allSoundOff()

static MidiMessage MidiMessage::allSoundOff | ( | int | channel | ) |

static noexcept

Creates an all-sound-off message.

Parameters

  channel | the midi channel, in the range 1 to 16

See also
  isAllSoundOff

## allControllersOff()

static MidiMessage MidiMessage::allControllersOff | ( | int | channel | ) |

static noexcept

Creates an all-controllers-off message.

Parameters

  channel | the midi channel, in the range 1 to 16

## isMetaEvent()

bool MidiMessage::isMetaEvent | ( |  | ) | const

noexcept

Returns true if this event is a meta-event.

Meta-events are things like tempo changes, track names, etc.

See also
  getMetaEventType, isTrackMetaEvent, isEndOfTrackMetaEvent, isTextMetaEvent, isTrackNameEvent, isTempoMetaEvent, isTimeSignatureMetaEvent, isKeySignatureMetaEvent, isMidiChannelMetaEvent

## getMetaEventType()

int MidiMessage::getMetaEventType | ( |  | ) | const

noexcept

Returns a meta-event's type number.

If the message isn't a meta-event, this will return -1.

See also
  isMetaEvent, isTrackMetaEvent, isEndOfTrackMetaEvent, isTextMetaEvent, isTrackNameEvent, isTempoMetaEvent, isTimeSignatureMetaEvent, isKeySignatureMetaEvent, isMidiChannelMetaEvent

## getMetaEventData()

const uint8* MidiMessage::getMetaEventData | ( |  | ) | const

noexcept

Returns a pointer to the data in a meta-event.

See also
  isMetaEvent, getMetaEventLength

## getMetaEventLength()

int MidiMessage::getMetaEventLength | ( |  | ) | const

noexcept

Returns the length of the data for a meta-event.

See also
  isMetaEvent, getMetaEventData

## isTrackMetaEvent()

bool MidiMessage::isTrackMetaEvent | ( |  | ) | const

noexcept

Returns true if this is a 'track' meta-event.

## isEndOfTrackMetaEvent()

bool MidiMessage::isEndOfTrackMetaEvent | ( |  | ) | const

noexcept

Returns true if this is an 'end-of-track' meta-event.

## endOfTrack()

static MidiMessage MidiMessage::endOfTrack | ( |  | ) |

static noexcept

Creates an end-of-track meta-event.

See also
  isEndOfTrackMetaEvent

## isTrackNameEvent()

bool MidiMessage::isTrackNameEvent | ( |  | ) | const

noexcept

Returns true if this is an 'track name' meta-event.

You can use the getTextFromTextMetaEvent() method to get the track's name.

## isTextMetaEvent()

bool MidiMessage::isTextMetaEvent | ( |  | ) | const

noexcept

Returns true if this is a 'text' meta-event.

See also
  getTextFromTextMetaEvent

## getTextFromTextMetaEvent()

String MidiMessage::getTextFromTextMetaEvent | ( |  | ) | const

Returns the text from a text meta-event.

See also
  isTextMetaEvent

## textMetaEvent()

static MidiMessage MidiMessage::textMetaEvent | ( | int | type,
|  | StringRef | text
| ) |  |

static

Creates a text meta-event.

## isTempoMetaEvent()

bool MidiMessage::isTempoMetaEvent | ( |  | ) | const

noexcept

Returns true if this is a 'tempo' meta-event.

See also
  getTempoMetaEventTickLength, getTempoSecondsPerQuarterNote

## getTempoMetaEventTickLength()

double MidiMessage::getTempoMetaEventTickLength | ( | short | timeFormat | ) | const

noexcept

Returns the tick length from a tempo meta-event.

Parameters

  timeFormat | the 16-bit time format value from the midi file's header.

Returns
  the tick length (in seconds).

See also
  isTempoMetaEvent

## getTempoSecondsPerQuarterNote()

double MidiMessage::getTempoSecondsPerQuarterNote | ( |  | ) | const

noexcept

Calculates the seconds-per-quarter-note from a tempo meta-event.

See also
  isTempoMetaEvent, getTempoMetaEventTickLength

## tempoMetaEvent()

static MidiMessage MidiMessage::tempoMetaEvent | ( | int | microsecondsPerQuarterNote | ) |

static noexcept

Creates a tempo meta-event.

See also
  isTempoMetaEvent

## isTimeSignatureMetaEvent()

bool MidiMessage::isTimeSignatureMetaEvent | ( |  | ) | const

noexcept

Returns true if this is a 'time-signature' meta-event.

See also
  getTimeSignatureInfo

## getTimeSignatureInfo()

void MidiMessage::getTimeSignatureInfo | ( | int & | numerator,
|  | int & | denominator
| ) |  | const

noexcept

Returns the time-signature values from a time-signature meta-event.

See also
  isTimeSignatureMetaEvent

## timeSignatureMetaEvent()

static MidiMessage MidiMessage::timeSignatureMetaEvent | ( | int | numerator,
|  | int | denominator
| ) |  |

static

Creates a time-signature meta-event.

See also
  isTimeSignatureMetaEvent

## isKeySignatureMetaEvent()

bool MidiMessage::isKeySignatureMetaEvent | ( |  | ) | const

noexcept

Returns true if this is a 'key-signature' meta-event.

See also
  getKeySignatureNumberOfSharpsOrFlats, isKeySignatureMajorKey

## getKeySignatureNumberOfSharpsOrFlats()

int MidiMessage::getKeySignatureNumberOfSharpsOrFlats | ( |  | ) | const

noexcept

Returns the key from a key-signature meta-event.

This method must only be called if isKeySignatureMetaEvent() is true. A positive number here indicates the number of sharps in the key signature, and a negative number indicates a number of flats. So e.g. 3 = F# + C# + G#, -2 = Bb + Eb

See also
  isKeySignatureMetaEvent, isKeySignatureMajorKey

## isKeySignatureMajorKey()

bool MidiMessage::isKeySignatureMajorKey | ( |  | ) | const

noexcept

Returns true if this key-signature event is major, or false if it's minor.

This method must only be called if isKeySignatureMetaEvent() is true.

## keySignatureMetaEvent()

static MidiMessage MidiMessage::keySignatureMetaEvent | ( | int | numberOfSharpsOrFlats,
|  | bool | isMinorKey
| ) |  |

static

Creates a key-signature meta-event.

Parameters

  numberOfSharpsOrFlats | if positive, this indicates the number of sharps in the key; if negative, the number of flats
  isMinorKey | if true, the key is minor; if false, it is major

See also
  isKeySignatureMetaEvent

## isMidiChannelMetaEvent()

bool MidiMessage::isMidiChannelMetaEvent | ( |  | ) | const

noexcept

Returns true if this is a 'channel' meta-event.

A channel meta-event specifies the midi channel that should be used for subsequent meta-events.

See also
  getMidiChannelMetaEventChannel

## getMidiChannelMetaEventChannel()

int MidiMessage::getMidiChannelMetaEventChannel | ( |  | ) | const

noexcept

Returns the channel number from a channel meta-event.

Returns
  the channel, in the range 1 to 16.

See also
  isMidiChannelMetaEvent

## midiChannelMetaEvent()

static MidiMessage MidiMessage::midiChannelMetaEvent | ( | int | channel | ) |

static noexcept

Creates a midi channel meta-event.

Parameters

  channel | the midi channel, in the range 1 to 16

See also
  isMidiChannelMetaEvent

## isActiveSense()

bool MidiMessage::isActiveSense | ( |  | ) | const

noexcept

Returns true if this is an active-sense message.

## isMidiStart()

bool MidiMessage::isMidiStart | ( |  | ) | const

noexcept

Returns true if this is a midi start event.

See also
  midiStart

## midiStart()

static MidiMessage MidiMessage::midiStart | ( |  | ) |

static noexcept

Creates a midi start event.

## isMidiContinue()

bool MidiMessage::isMidiContinue | ( |  | ) | const

noexcept

Returns true if this is a midi continue event.

See also
  midiContinue

## midiContinue()

static MidiMessage MidiMessage::midiContinue | ( |  | ) |

static noexcept

Creates a midi continue event.

## isMidiStop()

bool MidiMessage::isMidiStop | ( |  | ) | const

noexcept

Returns true if this is a midi stop event.

See also
  midiStop

## midiStop()

static MidiMessage MidiMessage::midiStop | ( |  | ) |

static noexcept

Creates a midi stop event.

## isMidiClock()

bool MidiMessage::isMidiClock | ( |  | ) | const

noexcept

Returns true if this is a midi clock event.

See also
  midiClock, songPositionPointer

## midiClock()

static MidiMessage MidiMessage::midiClock | ( |  | ) |

static noexcept

Creates a midi clock event.

## isSongPositionPointer()

bool MidiMessage::isSongPositionPointer | ( |  | ) | const

noexcept

Returns true if this is a song-position-pointer message.

See also
  getSongPositionPointerMidiBeat, songPositionPointer

## getSongPositionPointerMidiBeat()

int MidiMessage::getSongPositionPointerMidiBeat | ( |  | ) | const

noexcept

Returns the midi beat-number of a song-position-pointer message.

See also
  isSongPositionPointer, songPositionPointer

## songPositionPointer()

static MidiMessage MidiMessage::songPositionPointer | ( | int | positionInMidiBeats | ) |

static noexcept

Creates a song-position-pointer message.

The position is a number of midi beats from the start of the song, where 1 midi beat is 6 midi clocks, and there are 24 midi clocks in a quarter-note. So there are 4 midi beats in a quarter-note.

See also
  isSongPositionPointer, getSongPositionPointerMidiBeat

## isQuarterFrame()

bool MidiMessage::isQuarterFrame | ( |  | ) | const

noexcept

Returns true if this is a quarter-frame midi timecode message.

See also
  quarterFrame, getQuarterFrameSequenceNumber, getQuarterFrameValue

## getQuarterFrameSequenceNumber()

int MidiMessage::getQuarterFrameSequenceNumber | ( |  | ) | const

noexcept

Returns the sequence number of a quarter-frame midi timecode message.

This will be a value between 0 and 7.

See also
  isQuarterFrame, getQuarterFrameValue, quarterFrame

## getQuarterFrameValue()

int MidiMessage::getQuarterFrameValue | ( |  | ) | const

noexcept

Returns the value from a quarter-frame message.

This will be the lower nybble of the message's data-byte, a value between 0 and 15

## quarterFrame()

static MidiMessage MidiMessage::quarterFrame | ( | int | sequenceNumber,
|  | int | value
| ) |  |

static noexcept

Creates a quarter-frame MTC message.

Parameters

  sequenceNumber | a value 0 to 7 for the upper nybble of the message's data byte
  value | a value 0 to 15 for the lower nybble of the message's data byte

## isFullFrame()

bool MidiMessage::isFullFrame | ( |  | ) | const

noexcept

Returns true if this is a full-frame midi timecode message.

## getFullFrameParameters()

void MidiMessage::getFullFrameParameters | ( | int & | hours,
|  | int & | minutes,
|  | int & | seconds,
|  | int & | frames,
|  | SmpteTimecodeType & | timecodeType
| ) |  | const

noexcept

Extracts the timecode information from a full-frame midi timecode message.

You should only call this on messages where you've used isFullFrame() to check that they're the right kind.

## fullFrame()

static MidiMessage MidiMessage::fullFrame | ( | int | hours,
|  | int | minutes,
|  | int | seconds,
|  | int | frames,
|  | SmpteTimecodeType | timecodeType
| ) |  |

static

Creates a full-frame MTC message.

## isMidiMachineControlMessage()

bool MidiMessage::isMidiMachineControlMessage | ( |  | ) | const

noexcept

Checks whether this is an MMC message.

If it is, you can use the getMidiMachineControlCommand() to find out its type.

## getMidiMachineControlCommand()

MidiMachineControlCommand MidiMessage::getMidiMachineControlCommand | ( |  | ) | const

noexcept

For an MMC message, this returns its type.

Make sure it's actually an MMC message with isMidiMachineControlMessage() before calling this method.

## midiMachineControlCommand()

static MidiMessage MidiMessage::midiMachineControlCommand | ( | MidiMachineControlCommand | command | ) |

static

Creates an MMC message.

## isMidiMachineControlGoto()

bool MidiMessage::isMidiMachineControlGoto | ( | int & | hours,
|  | int & | minutes,
|  | int & | seconds,
|  | int & | frames
| ) |  | const

noexcept

Checks whether this is an MMC "goto" message.

If it is, the parameters passed-in are set to the time that the message contains.

See also
  midiMachineControlGoto

## midiMachineControlGoto()

static MidiMessage MidiMessage::midiMachineControlGoto | ( | int | hours,
|  | int | minutes,
|  | int | seconds,
|  | int | frames
| ) |  |

static

Creates an MMC "goto" message.

This messages tells the device to go to a specific frame.

See also
  isMidiMachineControlGoto

## masterVolume()

static MidiMessage MidiMessage::masterVolume | ( | float | volume | ) |

static

Creates a master-volume change message.

Parameters

  volume | the volume, 0 to 1.0

## createSysExMessage()

static MidiMessage MidiMessage::createSysExMessage | ( | const void * | sysexData,
|  | int | dataSize
| ) |  |

static

Creates a system-exclusive message.

The data passed in is wrapped with header and tail bytes of 0xf0 and 0xf7.

## readVariableLengthVal()

static int MidiMessage::readVariableLengthVal | ( | const uint8 * | data,
|  | int & | numBytesUsed
| ) |  |

static noexcept

Reads a midi variable-length integer.

Parameters

  data | the data to read the number from
  numBytesUsed | on return, this will be set to the number of bytes that were read

## getMessageLengthFromFirstByte()

static int MidiMessage::getMessageLengthFromFirstByte | ( | uint8 | firstByte | ) |

static noexcept

Based on the first byte of a short midi message, this uses a lookup table to return the message length (either 1, 2, or 3 bytes).

The value passed in must be 0x80 or higher.

## getMidiNoteName()

static String MidiMessage::getMidiNoteName | ( | int | noteNumber,
|  | bool | useSharps,
|  | bool | includeOctaveNumber,
|  | int | octaveNumForMiddleC
| ) |  |

static

Returns the name of a midi note number.

E.g "C", "D#", etc.

Parameters

  noteNumber | the midi note number, 0 to 127
  useSharps | if true, sharpened notes are used, e.g. "C#", otherwise they'll be flattened, e.g. "Db"
  includeOctaveNumber | if true, the octave number will be appended to the string, e.g. "C#4"
  octaveNumForMiddleC | if an octave number is being appended, this indicates the number that will be used for middle C's octave

See also
  getMidiNoteInHertz

## getMidiNoteInHertz()

static double MidiMessage::getMidiNoteInHertz | ( | int | noteNumber,
|  | double | frequencyOfA = `440.0`
| ) |  |

static noexcept

Returns the frequency of a midi note number.

The frequencyOfA parameter is an optional frequency for 'A', normally 440-444Hz for concert pitch.

See also
  getMidiNoteName

## isMidiNoteBlack()

static bool MidiMessage::isMidiNoteBlack | ( | int | noteNumber | ) |

static noexcept

Returns true if the given midi note number is a black key.

## getGMInstrumentName()

static const char* MidiMessage::getGMInstrumentName | ( | int | midiInstrumentNumber | ) |

static

Returns the standard name of a GM instrument, or nullptr if unknown for this index.

Parameters

  midiInstrumentNumber | the program number 0 to 127

See also
  getProgramChangeNumber

## getGMInstrumentBankName()

static const char* MidiMessage::getGMInstrumentBankName | ( | int | midiBankNumber | ) |

static

Returns the name of a bank of GM instruments, or nullptr if unknown for this bank number.

Parameters

  midiBankNumber | the bank, 0 to 15

## getRhythmInstrumentName()

static const char* MidiMessage::getRhythmInstrumentName | ( | int | midiNoteNumber | ) |

static

Returns the standard name of a channel 10 percussion sound, or nullptr if unknown for this note number.

Parameters

  midiNoteNumber | the key number, 35 to 81

## getControllerName()

static const char* MidiMessage::getControllerName | ( | int | controllerNumber | ) |

static

Returns the name of a controller type number, or nullptr if unknown for this controller number.

See also
  getControllerNumber

## floatValueToMidiByte()

static uint8 MidiMessage::floatValueToMidiByte | ( | float | valueBetween0and1 | ) |

static noexcept

Converts a floating-point value between 0 and 1 to a MIDI 7-bit value between 0 and 127.

## pitchbendToPitchwheelPos()

static uint16 MidiMessage::pitchbendToPitchwheelPos | ( | float | pitchbendInSemitones,
|  | float | pitchbendRangeInSemitones
| ) |  |

static noexcept

Converts a pitchbend value in semitones to a MIDI 14-bit pitchwheel position value.

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

- juce_MidiMessage.h