1
1
mirror of https://github.com/wader/fq.git synced 2024-11-26 10:33:53 +03:00
fq/format/midi/midi.md
2024-08-25 20:46:42 -07:00

849 B

Notes

  1. Only supports the MIDI 1.0 specification.
  2. Does only basic validation on the MIDI data.

Sample queries

  1. Extract the track names from a MIDI file
fq -d midi -d midi '.. | select(.event=="track name")? | "\(.name)"' twinkle.mid 
  1. Extract the tempo changes from a MIDI file
fq -d midi '.. | select(.event=="tempo")?.tempo' twinkle.mid
  1. Extract the key changes from a MIDI file
fq -d midi '.. | select(.event=="key signature")?.key' key-signatures.mid
  1. Extract NoteOn and NoteOff events:
fq -d midi 'grep_by(.event=="note on" or .event=="note off") | "\(.event)  \(.time.tick)  \(.note)"' twinkle.mid

Authors

References

  1. The Complete MIDI 1.0 Detailed Specification