-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for SequencerSpecific Meta Event. #172
Comments
What do you mean? MIDI.jl already has the infrastructure to read variable length events, we already do it in the source code for some events. What stops you from using the same code for this new event? |
It's a bit complicated, but I'll try to explain the problem clearly. Since we don't have to decode the data in Sequencer Specific Event raw data (vendor-proprietary data), we just want to move the data intact to the So the fields of
And if we define (store raw data so no encode and decode, just same): 0x7f => (
type = :SequencerSpecificEvent,
fields = ["ssdata::Vector{UInt8}"],
decode = :(data), # raw data here
encode = :(event.ssdata)
), We wiil use these codes to generate the Types and Constrctors: Lines 120 to 142 in 3868e9e
Okay, so when we construct Lines 131 to 133 in 3868e9e
then the invoke: Lines 139 to 142 in 3868e9e
Since it's variable length events so |
Yes Text is also variable length but it doesn't have this problem, because after decode it will turn to Lines 110 to 114 in 3868e9e
What if we decode 0x7f => (
type = :SequencerSpecificEvent,
fields = ["ssdata::Vector{UInt8}"],
decode = :([data]), # decode to Vector{Vector{UInt8}}
encode = :(event.ssdata)
), It's a infinity loop and cause Lines 131 to 133 in 3868e9e
|
I have a ugly but work solution: 0x7f => (
type = :SequencerSpecificEvent,
fields = ["ssdata::Vector{Vector{UInt8}}"],
decode = :([[data]]),
encode = :(event.ssdata)
), And |
What do you think? I can make a PR to temporarily support |
Okay I have a better solution and I will post tomorrow. |
Is your feature request related to a problem? Please describe.
If MIDI file is recorded by a physical device, it will include Sequencer Specific Event.
Currently, MIDI.jl has not defined this event in
MIDI_EVENTS_DEFS
, so any MIDI file opening that contains a Sequencer Specific Event will throw an exception.Describe the solution you'd like
Since the data of this event is variable length, to be honest, I don't know how to define this meta event.
The text was updated successfully, but these errors were encountered: