mirror of
https://github.com/wader/fq.git
synced 2024-11-22 15:45:45 +03:00
midi: mapped SysEx event types
This commit is contained in:
parent
3ed98897bb
commit
54a0cf1284
@ -42,10 +42,8 @@
|
||||
- [x] end of track
|
||||
- [x] tempo
|
||||
- [x] SMPTE offset
|
||||
- [x] map frame rates
|
||||
- [x] key signature
|
||||
- [x] time signature
|
||||
- [x] cleanup denominator
|
||||
- [x] sequencer specific event
|
||||
- [x] map manufacturer
|
||||
- [x] check key mappings
|
||||
@ -69,6 +67,6 @@
|
||||
- [x] escape
|
||||
- [x] use context struct for casio
|
||||
- [x] map manufacturer ID
|
||||
- [ ] Decode status as 'sysex'
|
||||
- [x] Decode status as 'sysex'
|
||||
|
||||
|
||||
|
@ -4,8 +4,14 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/wader/fq/pkg/decode"
|
||||
"github.com/wader/fq/pkg/scalar"
|
||||
)
|
||||
|
||||
var sysex = scalar.UintMapSymStr{
|
||||
0xf0: "F0",
|
||||
0xf7: "F7",
|
||||
}
|
||||
|
||||
func decodeSysExEvent(d *decode.D, status uint8, ctx *context) {
|
||||
ctx.running = 0x00
|
||||
|
||||
@ -35,7 +41,7 @@ func decodeSysExEvent(d *decode.D, status uint8, ctx *context) {
|
||||
|
||||
func decodeSysExMessage(d *decode.D, ctx *context) {
|
||||
d.FieldUintFn("delta", vlq)
|
||||
d.FieldU8("status")
|
||||
d.FieldU8("sysex", sysex)
|
||||
|
||||
var bytes []uint8
|
||||
d.FieldStrFn("bytes", func(d *decode.D) string {
|
||||
@ -72,7 +78,7 @@ func decodeSysExMessage(d *decode.D, ctx *context) {
|
||||
|
||||
func decodeSysExContinuation(d *decode.D, ctx *context) {
|
||||
d.FieldUintFn("delta", vlq)
|
||||
d.FieldU8("status")
|
||||
d.FieldU8("sysex", sysex)
|
||||
d.FieldStrFn("data", func(d *decode.D) string {
|
||||
data := vlf(d)
|
||||
|
||||
@ -92,7 +98,7 @@ func decodeSysExContinuation(d *decode.D, ctx *context) {
|
||||
|
||||
func decodeSysExEscape(d *decode.D, ctx *context) {
|
||||
d.FieldUintFn("delta", vlq)
|
||||
d.FieldU8("status")
|
||||
d.FieldU8("sysex", sysex)
|
||||
d.FieldStrFn("data", func(d *decode.D) string {
|
||||
data := vlf(d)
|
||||
|
||||
|
2
format/midi/testdata/test.fqtest
vendored
2
format/midi/testdata/test.fqtest
vendored
@ -29,7 +29,7 @@ $ ./fq -d midi dv test.mid
|
||||
0x20| 04 04 02| ...| bytes: "[4 2 24 8]" 0x2d-0x32 (5)
|
||||
0x30|18 08 |.. |
|
||||
| | | numerator: 4
|
||||
| | | denominator: 4 0x32-0x32 (0)
|
||||
| | | denominator: 4
|
||||
| | | ticksPerClick: 24
|
||||
| | | thirtySecondsPerQuarter: 8
|
||||
| | | [3]{}: EndOfTrack 0x32-0x36 (4)
|
||||
|
Loading…
Reference in New Issue
Block a user