parse-meta ( type bytes -- name value )


Vocabulary
midi.private

Inputs
typean object
bytesan object


Outputs
namean object
valuean object


Definition


: parse-meta ( type bytes -- name value )
swap {
{ 0 [ 2 head be> "sequence-number" ] }
{ 1 [ utf8 decode "text" ] }
{ 2 [ utf8 decode "copyright" ] }
{ 3 [ utf8 decode "track-name" ] }
{ 4 [ utf8 decode "instrument-name" ] }
{ 5 [ utf8 decode "lyrics" ] }
{ 6 [ utf8 decode "marker" ] }
{ 7 [ utf8 decode "cue-point" ] }
{ 9 [ utf8 decode "device-name" ] }
{ 32 [ first "channel-prefix" ] }
{ 33 [ first "midi-port" ] }
{ 47 [ drop t "end-of-track" ] }
{ 81 [ 3 head be> "set-tempo" ] }
{
84
[
[
5 firstn {
~quotation~
~quotation~
~quotation~
~quotation~
~quotation~
} spread
] H{ } make "smpte-offset"
]
}
{
88
[
[
first4 {
~quotation~
~quotation~
~quotation~
~quotation~
} spread
] H{ } make "time-signature"
]
}
{ 89 [ key-signatures at "key-signature" ] }
{ 127 [ "sequencer-specific" ] }
} case swap ;