Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Tonejs/Midi
/ functions
Functions
74 in github.com/Tonejs/Midi
⨍
Functions
74
◇
Types & classes
33
↓ 16 callers
Method
addNote
* Add a note to the notes array. * @param props The note properties to add.
src/Track.ts:158
↓ 8 callers
Method
toJSON
* Convert the MIDI object to JSON.
src/Midi.ts:136
↓ 7 callers
Method
addTrack
* Add a track to the MIDI file.
src/Midi.ts:119
↓ 7 callers
Method
update
* This must be invoked after any changes are made to the tempo array * or the timeSignature array for the updated values to be reflected.
src/Header.ts:169
↓ 6 callers
Method
ticksToMeasures
* Convert ticks into measures based off of the time signatures.
src/Header.ts:227
↓ 5 callers
Method
ticksToSeconds
* Convert ticks into seconds based on the tempo changes.
src/Header.ts:207
↓ 4 callers
Function
search
(array: any[], value: any, prop = "ticks")
src/BinarySearch.ts:5
↓ 4 callers
Method
secondsToTicks
* Convert seconds to ticks based on the tempo events.
src/Header.ts:253
↓ 3 callers
Method
addCC
* Add a control change to the track. * @param props
src/Track.ts:182
↓ 3 callers
Method
addPitchBend
* Add a control change to the track.
src/Track.ts:206
↓ 3 callers
Method
fromJSON
* Parse a JSON representation of the object. Will overwrite the current * tracks and header.
src/Midi.ts:147
↓ 3 callers
Function
insert
(array: any[], event: object, prop = "ticks")
src/BinarySearch.ts:44
↓ 2 callers
Function
beatsToMeasures
(beats: number, timeSignature: number[])
src/Header.ts:326
↓ 2 callers
Method
clone
* Clone the entire object MIDI object.
src/Midi.ts:161
↓ 2 callers
Method
fromUrl
* Download and parse the MIDI file. Returns a promise * which resolves to the generated MIDI file. * @param url The URL to fetch.
src/Midi.ts:22
↓ 2 callers
Function
midiToPitchClass
* Convert a MIDI note to a pitch class (just the pitch no octave).
src/Note.ts:14
↓ 2 callers
Method
toArray
* Encode the MIDI as a Uint8Array.
src/Midi.ts:129
↓ 1 callers
Function
createControlChanges
()
src/ControlChanges.ts:18
↓ 1 callers
Function
encode
(midi: Midi)
src/Encode.ts:169
↓ 1 callers
Function
encodeControlChange
( cc: ControlChange, channel: number )
src/Encode.ts:49
↓ 1 callers
Function
encodeControlChanges
(track: Track)
src/Encode.ts:63
↓ 1 callers
Function
encodeInstrument
(track: Track)
src/Encode.ts:96
↓ 1 callers
Function
encodeKeySignature
(keySig: KeySignatureEvent)
src/Encode.ts:141
↓ 1 callers
Function
encodeNote
(note: Note, channel: number)
src/Encode.ts:23
↓ 1 callers
Function
encodeNotes
(track: Track)
src/Encode.ts:45
↓ 1 callers
Function
encodePitchBend
( pb: PitchBend, channel: number )
src/Encode.ts:75
↓ 1 callers
Function
encodePitchBends
(track: Track)
src/Encode.ts:88
↓ 1 callers
Function
encodeTempo
(tempo: TempoEvent)
src/Encode.ts:116
↓ 1 callers
Function
encodeText
( textEvent: (MetaEvent & { ticks: number; }) )
src/Encode.ts:154
↓ 1 callers
Function
encodeTimeSignature
(timeSig: TimeSignatureEvent)
src/Encode.ts:126
↓ 1 callers
Function
encodeTrackName
(name: string)
src/Encode.ts:106
↓ 1 callers
Method
fromJSON
* Assign the JSON values to this track.
src/Track.ts:264
↓ 1 callers
Function
midiToPitch
* Convert a MIDI note into a pitch.
src/Note.ts:6
↓ 1 callers
Function
parseGroundTruth
(path)
test/Compare.ts:8
↓ 1 callers
Function
parse_file
(filename)
test/midi/parse_midi.py:9
↓ 1 callers
Function
pitchClassToMidi
* Convert a pitch class to a MIDI note.
src/Note.ts:23
↓ 1 callers
Method
setTempo
* Update the tempo of the midi to a single tempo. Will remove and replace * any other tempos currently set and update all of the event timing. * @
src/Header.ts:315
↓ 1 callers
Function
splitTracks
* Given a list of MIDI tracks, make sure that each channel corresponds to at * most one channel and at most one instrument. This means splitting up t
src/Midi.ts:185
Method
bars
* The number of measures (and partial measures) to this beat. * Takes into account time signature changes. * @readonly
src/Note.ts:166
Method
constructor
* @param event * @param header
src/ControlChange.ts:76
Method
constructor
(midiData?: MidiData)
src/Header.ts:99
Method
constructor
* @param trackData * @param track
src/Instrument.ts:28
Method
constructor
* Parse the midi data
src/Midi.ts:45
Method
constructor
(trackData: MidiEvent[], header: Header)
src/Track.ts:63
Method
constructor
(noteOn: NoteOnEvent, noteOff: NoteOffEvent, header: Header)
src/Note.ts:86
Method
constructor
* @param event * @param header
src/PitchBend.ts:25
Method
duration
* The total length of the file in seconds.
src/Midi.ts:101
Method
duration
* The end time of the last event in the track.
src/Track.ts:221
Method
duration
* The duration of the segment in seconds.
src/Note.ts:137
Method
durationTicks
* The total length of the file in ticks.
src/Midi.ts:110
Method
durationTicks
* The end time of the last event in the track in ticks.
src/Track.ts:243
Method
family
* The instrument family, e.g. "piano".
src/Instrument.ts:65
Method
fromJSON
* Parse a header json object.
src/Header.ts:293
Method
fromJSON
* Convert from JSON form.
src/Instrument.ts:95
Function
get
(target, handler)
src/ControlChanges.ts:21
Method
name
* return the common name of the control number if it exists
src/ControlChange.ts:94
Method
name
* The common name of the instrument.
src/Instrument.ts:47
Method
name
* The name of the midi file, taken from the first track.
src/Midi.ts:90
Method
name
* The note name and octave in scientific pitch notation, e.g. "C4".
src/Note.ts:103
Method
number
* The controller number
src/ControlChange.ts:87
Method
octave
* The notes octave number.
src/Note.ts:114
Method
percussion
* If the instrument is a percussion instrument.
src/Instrument.ts:76
Method
pitch
* The pitch class name. e.g. "A".
src/Note.ts:126
Method
ppq
* The number of ticks per quarter note.
src/Header.ts:246
Function
set
(target, handler, value)
src/ControlChanges.ts:29
Method
time
* The time of the event in seconds
src/ControlChange.ts:105
Method
time
* The time of the event in seconds.
src/Note.ts:151
Method
time
* The time of the event in seconds
src/PitchBend.ts:35
Method
toJSON
()
src/ControlChange.ts:115
Method
toJSON
* Convert the header into an object.
src/Header.ts:274
Method
toJSON
* Convert it to JSON form.
src/Instrument.ts:84
Method
toJSON
* Convert the track into a JSON format.
src/Track.ts:306
Method
toJSON
()
src/Note.ts:171
Method
toJSON
()
src/PitchBend.ts:45