- implement running status (ugh)
a bytes parser for MIDI (.mid
) files.
Some ideas on what you can use this for:
- creating an animations for a song
- creating a rhythm game
- analyzing a song
- visualizing a song, e.g. in guitar tabs
- transforming a song to instructions that produce certain sounds. Watch this: https://www.youtube.com/watch/4rcnu8j1Xqk
- playing a song 🧠
- ...
A basic example for parsing a selected file using
update event =
case event of
MidiFileSelectClicked ->
\state ->
( state
, File.Select.file [ "audio/midi" ] MidiFileSelected
)
MidiFileSelected midiFile ->
\state ->
( state
, midiFile |> File.toBytes |> Task.perform SelectedMidiFileBytesReceived
)
SelectedMidiFileBytesReceived midiFileBytes ->
\state ->
( { state
| midi =
midiFileBytes
|> Bytes.Parser.run Midi.file
}
, Cmd.none
)
- encoding
- this summary sheet
- this wonderful wiki
- this spec for all messages and this spec for general info about the format and some details
- these (old) midi.org reference tables
- this blog for a few message explanations
- the german wikipedia page for context and all events (for some reason the English version omits the specific events)
sample midi files for testing