A simple, functional-based midi parsing library
parses given array of unsigned 8-bit integers into Midi data type
Kind: inner method of midiParser
Param | Type | Description |
---|---|---|
midiBytes | array |
array of unsinged 8-bit integers representing raw midi data |
- MidiConstants
- ~BYTE_MASK :
number
- ~HIGHBIT_MASK :
number
- ~SYSEX_EVENT_MASK :
number
- ~NOTE_ON_MASK :
number
- ~NOTE_OFF_MASK :
number
- ~PROGRAM_MASK :
number
- ~CHANNEL_MASK :
number
- ~CONTROL_MASK :
number
- ~META_EVENT :
number
- ~SEQUENCE_META_EVENT :
number
- ~TEXT_META_EVENT :
number
- ~COPYRIGHT_META_EVENT :
number
- ~TRACK_NAME_META_EVENT :
number
- ~INST_NAME_META_EVENT :
number
- ~LYRIC_TEXT_META_EVENT :
number
- ~MARKER_TEXT_META_EVENT :
number
- ~CUE_POINT_META_EVENT :
number
- ~CHANNEL_PREFIX_ASSIGNMENT_META_EVENT :
number
- ~END_OF_TRACK_META_EVENT :
number
- ~TEMPO_META_EVENT :
number
- ~SMPTE_OFFSET_META_EVENT :
number
- ~TIME_SIG_META_EVENT :
number
- ~KEY_SIGNATURE_META_EVENT :
number
- ~SEQUENCER_SPECIFIC_META_EVENT :
number
- ~BYTE_MASK :
Kind: inner constant of MidiConstants
Default: 128
Kind: inner constant of MidiConstants
Default: 127
Kind: inner constant of MidiConstants
Default: 240
Kind: inner constant of MidiConstants
Default: 144
Kind: inner constant of MidiConstants
Default: 128
Kind: inner constant of MidiConstants
Default: 192
Kind: inner constant of MidiConstants
Default: 208
Kind: inner constant of MidiConstants
Default: 176
Kind: inner constant of MidiConstants
Default: 255
Kind: inner constant of MidiConstants
Default: 0
Kind: inner constant of MidiConstants
Default: 1
Kind: inner constant of MidiConstants
Default: 2
Kind: inner constant of MidiConstants
Default: 3
Kind: inner constant of MidiConstants
Default: 4
Kind: inner constant of MidiConstants
Default: 5
Kind: inner constant of MidiConstants
Default: 6
Kind: inner constant of MidiConstants
Default: 7
Kind: inner constant of MidiConstants
Default: 32
Kind: inner constant of MidiConstants
Default: 47
Kind: inner constant of MidiConstants
Default: 81
Kind: inner constant of MidiConstants
Default: 84
Kind: inner constant of MidiConstants
Default: 88
Kind: inner constant of MidiConstants
Default: 89
Kind: inner constant of MidiConstants
Default: 127
- MidiTypes
- ~Midi
- ~MidiHeader
- ~MidiTrack
- ~MidiEvent
- ~MidiMetaEvent
- ~MidiMetaTempoEvent
- ~MidiMetaTimeSignatureEvent
- ~MidiMetaInstrumentNameEvent
- ~MidiMetaKeySignatureEvent
- ~MidiMetaSmptOffsetEvent
- ~MidiMetaTrackNameEvent
- ~MidiMetaEndOfTrack
- ~MidiSystemEvent
- ~MidiChannelEvent
- ~MidiPolyphonicAftertouchEvent
- ~MidiControlChangeEvent
- ~MidiProgramChangeEvent
- ~MidiChannelAftertouchEvent
- ~MidiPitchWheelEvent
- ~MidiNoteEvent
- ~MidiNoteOnEvent
- ~MidiNoteOffEvent
Kind: inner class of MidiTypes
top-level data type representing entire Midi song
Returns: Midi
Param | Type | Description |
---|---|---|
params | object |
properties to set |
params.header | MidiHeader |
header data |
params.tracks | Array.<MidiTrack> |
array of MidiTracks |
Kind: inner class of MidiTypes
header information for Midi song
Returns: MidiHeader
Param | Type | Description |
---|---|---|
params | object |
properties to set |
params.format | number |
(0: single-track, 1: multi-track, simultaneous, 2: multi-track, independent) |
params.trackCount | number |
number of tracks (if multi-track) |
params.timeDivision | timeDivision |
the default unit of delta-time for this MIDI file |
Kind: inner class of MidiTypes
information for a given track
Returns: MidiTrack
Param | Type | Default | Description |
---|---|---|---|
params | object |
properties to set | |
[params.name] | string |
"''" |
label for the track |
[params.events] | Array.<MidiEvent> |
[] |
array of MidiEvents |
Kind: inner class of MidiTypes
Abstract midi event class
Returns: MidiEvent
Param | Type | Default | Description |
---|---|---|---|
params | object |
properties to set | |
params.code | number |
0x80-0xFF code for the event | |
params.type | string |
string label for the top-level "type" of event | |
params.subtype | string |
string label for the second-level "type" of event | |
params.track | number |
the index for the track this event belongs to | |
[params.delta] | number |
0 |
delta offset in ??? (microseconds or milliseconds) from previous event |
Kind: inner class of MidiTypes
Abstract Midi meta event
Returns: MidiMetaEvent
Param | Type | Description |
---|---|---|
params | object |
properties to set |
params.subtype | string |
the type of meta event (i.e. "tempo", "time_signature", etc.) |
Kind: inner class of MidiTypes
Meta tempo event
Returns: MidiMetaTempoEvent
Param | Type | Description |
---|---|---|
params | object |
properties to set |
params.microsecPerQn | number |
microseconds per quarter note |
Kind: inner class of MidiTypes
Meta time signature event. Expects time signature to be represented by two numbers that take the form: nn/2^dd
Returns: MidiMetaTimeSignature
Param | Type | Description |
---|---|---|
params | object |
properties to set |
params.numerator | number |
numerator for time signature |
params.denominator | number |
exponent for denominator of time signature |
params.metronomeClicksPerTick | number |
number of metronome clicks per midi tick |
params.thirtySecondNotesPerBeat | number |
number of 1/32 notes per beat |
Kind: inner class of MidiTypes
Midi meta instrument name event
Returns: MidiMetaInstrumentNameEvent
Param | Type | Description |
---|---|---|
params | object |
proprties to set |
params.name | string |
name of instrument used |
Kind: inner class of MidiTypes
Midi meta key signature event
Returns: MidiMetaKeySignatureEvent
Param | Type | Description |
---|---|---|
params | object |
properties to set |
params.sf | number |
number of sharps/flats (-7 <= sf <= 7) |
params.mi | number |
major (0) or minor (1) |
Kind: inner class of MidiTypes
Midi meta smpte offset event
Returns: MidiMeatSmpteOffsetEvent
Param | Type | Description |
---|---|---|
params | object |
properties to set |
params.frameRate | number |
top two bits define the frame rate in frames per second. If those bits are "00" (0 decimal), the frame rate is 24 frames per second. If those bits are "01" (1 decimal), the frame rate is 25 frames per second. If the bits are "10" (2 decimal), the frame rate is "drop 30" or 29.97 frames per second. If the top two bits are "11", then the frame rate is 30 frames per second. The six remaining bits define the hours of the SMPTE time (0-23). |
params.min | number |
minutes in offset (0-59) |
params.sec | number |
seconds in offset (0-59) |
params.frames | number |
depends upon framerate |
params.subframes | number |
0-99 |
Kind: inner class of MidiTypes
Midi meta track name event
Returns: MidiMetaTrackNameEvent
Param | Type | Description |
---|---|---|
params | object |
properties to set |
params.name | string |
name of the track |
Kind: inner class of MidiTypes
Midi meta end of track event
Returns: MidiMetaEndOfTrackEvent
Kind: inner class of MidiTypes
Abstract Midi system event
Kind: inner class of MidiTypes
Abstract Midi channel event
Returns: MidiChannelEvent
Param | Type | Description |
---|---|---|
params | object |
properties to set |
params.eventCode | number |
hex value for the event code (0x80-0xEF) |
Kind: inner class of MidiTypes
polyphonic aftertouch event
Returns: MidiPolyphonicAftertouchEvent
Param | Type | Description |
---|---|---|
params | object |
proprties to set |
Kind: inner class of MidiTypes
control change event
Returns: MidiControlChangeEvent
Param | Type | Description |
---|---|---|
params | object |
proprties to set |
Kind: inner class of MidiTypes
NOT YET IMPLEMENTED
Returns: MidiProgramChangeEvent
Param | Type | Description |
---|---|---|
params | object |
proprties to set |
Kind: inner class of MidiTypes
NOT YET IMPLEMENTED
Returns: MidiChannelAftertouchEvent
Param | Type | Description |
---|---|---|
params | object |
proprties to set |
Kind: inner class of MidiTypes
NOT YET IMPLEMENTED
Returns: MidiPitchWheelEvent
Param | Type | Description |
---|---|---|
params | object |
proprties to set |
Kind: inner class of MidiTypes
Abstract note event
Returns: MidiNoteEvent
Param | Type | Description |
---|---|---|
params | object |
proprties to set |
params.note | number |
note (0-255) |
params.velocity | number |
velocity (0-127) |
params.length | number |
length in ms |
Kind: inner class of MidiTypes
note on event
Kind: inner class of MidiTypes
note off event
Returns: MidiNoteOffEvent