Downloading and Installing
Download the zip or tar file from the buttons at the top of the page and unpack and type make in the base directory of the midifile package.
Or if you use git, download on the terminal with these commands and compile with these commands:
git clone https://github.com/craigsapp/midifile
cd midifile
make
To update the souce code if you already have cloned previously, go into the midifile directory and type:
git pull
make
Features
- Event timestamps can be converted between absolute or delta tick values with the MidiFile::deltaTicks and MidiFile::absoluteTicks functions.
- In absolute tick mode, messages can be inserted into tracks in any order and later sorted by timestamp with the MidiFile::sortTracks function.
- Multi-track files can be converted to a single track in a reversible process.
- Event performance times in seconds can be calculated from tick times and tempo meta messages with the MidiFile::doTimeAnalysis function.
- Durations of notes can be extracted using the
MidiFile::linkNotePairs
function.
</ol>
</details>
Tutorials
fixsize — Fix Standard MIDI File track chunk byte counts. offswitch — Switch note-offs between 0x90 w/ 0 velocity and 0x80 styles. noteattacks — Print a list of note attacks in a MIDI file reverse — Reverse the order of notes in a MIDI file. mirror — Mirror a MIDI file in time and/or pitch. Class documentation
MidiFile:: Main interface for reading/writing Standard MIDI Files
- absoluteTicks
- addEvent
- addMetaEvent
- addTrack
- allocateEvents
- clear
- deleteTrack
- deltaTicks
- doTimeAnalysis
- extractVlvTime
- getAbsoluteTickTime
- getEvent
- getEventCount
- getFilename
- getSplitTrack
- getTicksPerQuarterNote
- getTimeInSeconds
- getTrackCount
- hasJoinedTracks
- hasSplitTracks
- isAbsoluteTime
- isDeltaTime
- joinTracks
- linkNotePairs
- mergeTracks
- operator[]
- read
- setFilename
- setMillisecondTicks
- setTicksPerQuarterNote
- size
- sortTrack
- sortTracks
- splitTracks
- status
- write
- writeBinasc
- writeHex
MidiEventList:: MidiFile track storage for MidiEvent lists
MidiEvent:: (also inherits from MidiMessage) MidiMessage + timestamp
MidiMessage:: (also inherits from vector<uchar>)
- getChannelNibble
- getCommandByte
- getCommandNibble
- getKeyNumber
- getSize
- getTempoBPM
- getTempoMicro
- getTempoSPT
- getTempoSeconds
- getTempoTPS
- isAftertouch
- isController
- isMeta
- isNoteOff
- isNoteOn
- isPitchbend
- isPressure
- isTempo
- isTimbre
- operator=
- operator[]
- setChannelNibble
- setCommand
- setCommandByte
- setCommandNibble
- setKeyNumber
- setMetaTempo
- setParameters
- setSize
- setSizeToCommand
Options:: Auxiliary class for command-line option parsing
- appendOptions
- argc
- argv
- define
- getArg
- getArgCount
- getArgList
- getBoolean
- getChar
- getCommand
- getCommandLine
- getDouble
- getFlag
- getFloat
- getInt
- getRegIndex
- getString
- isDefined
- optionsArg
- printOptionBooleanState
- printOptionList
- printRegister
- process
- setFlag
- setOptions
- storeOption
- xverify
Binasc:: Helper class for ASCII MIDI file parsing