Midifile View on GitHub

MidiEvent class

home   »   documentation   »   classes

The MidiEvent class is a MidiMessage plus an added timestamp public variable, .tick. The MidiEvent class also adds other support variables such as .track which store the track number in the MIDI file that the MidiEvent occurs in.

 

Public functions

getDurationInSeconds — Get the duration of a note in seconds.
getLinkedEvent — Returns a linked event (such as for note-on/note-off pair).
getTickDuration — Get the duration of a note in terms of MIDI ticks.
isLinked — Returns true of the message is linked to another event.
linkEvent — Links one event with another (such as note-ons/note-offs).
operatorEQUALS — Copy the contents of another MidiEvent or MidiMessage.
unlinkEvent — Disassociates any MidiEvents linked to this one.

 

Functions inherited from MidiMessage

isNoteOff — Return true if MIDI message is a note off message.
isNoteOn — Returns true if MIDI message is a note-on message.
isAftertouch — Returns true if MIDI message is an aftertouch message.
isController — Returns true if MIDI message is an controller message.
isTimbre — Returns true if MIDI message is a patch change.
isPressure — Returns true if MIDI message is an channel pressure message.
isPitchbend — Returns true if MIDI message is an pitch-bend message.
getChannelNibble — Return channel number of the MIDI command byte (offset from 0).
setChannelNibble — Set the channel nibble in a MIDI message command byte.
setCommand — Set the command byte and any parameters for a message.
getCommandByte — Return the command byte of the MIDI message.
setCommandByte — Set the command byte of a MIDI message.
getCommandNibble — Return the command nibble of the MIDI message.
setCommandNibble — Set the command nibble of a command byte.
setParameters — Set the message bytes after the command byte.
setSizeToCommand — Set the number of parameters given the stored command byte.
getSize — Returns the number of bytes in the MIDI message.
setSize — Change the size of the message byte list.
operatorEQUALS — Copy the contents of another MidiMessage.
isMeta — Returns true if MIDI message is a meta message.
setMetaTempo — Create a tempo meta message from a tempo.
isTempo — Returns true if MIDI message is a tempo meta message.
getTempoBPM — Return the tempo in terms of quarter notes per minute.
getTempoMicro — Return the number of microseconds per quarter note.
getTempoSPT — Return the tempo in terms of seconds per tick.
getTempoSeconds — Return the number of seconds per quarter note.
getTempoTPS — Return the tempo in terms of ticks per second.

 

Keyboard shortcuts for this page:

  • ctrl++/= to open all function documentation entries.
  • ctrl+ to close all documentation.
  • ctrl+eto toggle display of all code examples.
  • shft+click will open documentation for a single method and close all other entries.