From 3125b5abdb48f9b05ed0c7da5b65eb88de82fcd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E9=95=9C=E5=AE=87?= <35807048+P-J-Y@users.noreply.github.com> Date: Sat, 7 Aug 2021 21:57:16 +0800 Subject: [PATCH] add a midi meta event 0x21: midi port (#147) * add a midi meta event 0x21: midi port The meta event 0x21 was missing in the dict: MIDI_EVENTS_DEFS. For some midi files with this meta event, there would be a load error. So, I add 0x21 into it. * increment the patch version --- Project.toml | 2 +- src/events.jl | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index c1d5c81..3cae0e4 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MIDI" uuid = "f57c4921-e30c-5f49-b073-3f2f2ada663e" repo = "https://github.com/JuliaMusic/MIDI.jl.git" -version = "2.0.1" +version = "2.0.2" [deps] FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" diff --git a/src/events.jl b/src/events.jl index 7d350dd..e6a8cc1 100644 --- a/src/events.jl +++ b/src/events.jl @@ -24,6 +24,12 @@ const MIDI_EVENTS_DEFS = Dict( decode = :(Int.(data)), encode = :(UInt8(event.channel)) ), + 0x21 => ( + type = :MIDIPort, + fields = ["channel::Int"], + decode = :(Int.(data)), + encode = :(UInt8(event.channel)) + ), 0x2F => ( type = :EndOfTrackEvent, fields = [], @@ -395,4 +401,4 @@ The `PitchBendEvent` informs a MIDI device to modify the pitch in a specific cha * `status::UInt8` : The status byte of the event. * `pitch::Int` : Value of the pitch bend. """ -PitchBendEvent \ No newline at end of file +PitchBendEvent