1
1
mirror of https://github.com/wader/fq.git synced 2024-12-01 19:12:34 +03:00
fq/format/midi/testdata/help_midi.fqtest
twystd a7d0cde9f6 midi: cleaned up and simplied event decoding logic
- delineated NoteOn and NoteOff events
- simplified MIDI event decoding with function map
- decoded MIDI event and channel as nibbles
- reworked system exclusive event decoding
- fixed peekEvent to correctly decode end of file events
2024-09-01 16:41:38 -07:00

43 lines
1.1 KiB
Plaintext

$ fq -h midi
midi: Standard MIDI file decoder
Decode examples
===============
# Decode file as midi
$ fq -d midi . file
# Decode value as midi
... | midi
Notes
=====
* Only supports the MIDI 1.0 specification.
* Does only basic validation on the MIDI data.
Sample queries
==============
* Extract the track names from a MIDI file
fq -d midi -d midi '.. | select(.event=="track_name")? | "\(.track_name)"' midi/twinkle.mid
* Extract the tempo changes from a MIDI file
fq -d midi '.. | select(.event=="tempo")?.tempo' midi/twinkle.mid
* Extract the key changes from a MIDI file
fq -d midi '.. | select(.event=="key_signature")?.key_signature' midi/key-signatures.mid
* Extract NoteOn events:
fq -d midi 'grep_by(.event=="note_on") | [.time.tick, .note_on.note] | join(" ")' midi/twinkle.mid
Authors
=======
- transcriptaze.development@gmail.com
References
==========
* The Complete MIDI 1.0 Detailed Specification (https://www.midi.org/specifications/item/the-midi-1-0-specification)
* The MIDI Specification (http://midi.teragonaudio.com/tech/midispec.htm)