Skip to content

Commit

Permalink
add a midi meta event 0x21: midi port (#147)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
P-J-Y authored Aug 7, 2021
1 parent 3464239 commit 3125b5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
8 changes: 7 additions & 1 deletion src/events.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [],
Expand Down Expand Up @@ -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
PitchBendEvent

0 comments on commit 3125b5a

Please sign in to comment.