Extend MIDI parser and model to keep the meta-event in the tracks#1087
Extend MIDI parser and model to keep the meta-event in the tracks#1087keryell wants to merge 8 commits intoArdour:masterfrom
Conversation
Support the meta-event described in: - Standard MIDI Files 1.0, In 'The Complete MIDI 1.0 Detailed Specification, Document Version 96.1.' The MIDI Manufacturers Association, Los Angeles, CA, USA. - Recommended Practice (RP-019) SMF Device Name and Program Name Meta Events. 1999, MIDI Manufacturers Association Incorporated Add a LUA script to dump the non-note content of MIDI regions and file.
Also extend _display_midi_meta_events.lua to display the meta-events from the MIDI model along the content of the files.
Do not skip it when the SMF file does not exist. Print a message about the fact that the session has to be saved to display up-to-date SMF file information.
afc919a to
7af1262
Compare
|
Was this written using an LLM ? Parts of it appear useful and reasonable. It isn't clear to me that meta-events belong in our Sequence object, but I'll give it some thought. |
There was a problem hiding this comment.
It seems incorrect to me that the return 0 statements here are deleted. This value is used by the caller to indicate the specific condition of an Ardour-specific sequencer-specific event.
There was a problem hiding this comment.
Isn't it the idea, if we want the meta-event to be returned so it is in the track, by copying it on line 377?
memcpy(*buf, event->midi_buffer, size_t(event_size));There is still later on line 386:
if (is_meta) {
return 0;
}left for the caller interpretation.
Actually, looking at the change you made in 1ee76f4 shows that it is actually the size == 0 which is used to discard the meta-event, not the the return value.
Your comment made be look at Type 0 track and there the meta-event was not kept. I have updated it a new commit.
Yes, most of it.
The goal of this PR is to get some thoughts. |
The Type 0 import path (write_midi_type0_data_to_one_file) was skipping all meta events with if (ret == 0) continue. Now it writes text meta events through with allow_meta=true, matching what the Type 1 path already does. The append_event_delta() → is_meta() filter will only let recognized types (0x01-0x09) through.
Support the meta-event described in:
Standard MIDI Files 1.0, In 'The Complete MIDI 1.0 Detailed Specification,
Document Version 96.1.' The MIDI Manufacturers Association, Los Angeles, CA,
USA.
Recommended Practice (RP-019) SMF Device Name and Program Name Meta
Events. 1999, MIDI Manufacturers Association Incorporated
The meta-events are included only if the "Import MIDI markers" are selected on the "Add Existing Media" import window.
Add a LUA script to dump the non-note content of MIDI regions and file.
This is supposed to address https://discourse.ardour.org/t/importing-midi-files-with-most-metadata/113061