Add -PMAR option to emit MIDI marker meta-events for P: part labels (#16)

* Add -PMAR option to output `P:` information as MIDI part meta-event

* Update man page and comments

* Add the instance number of a part like `Part T-4`

This allows better tracking of parts played more than once with complex `P:`
header.

* Updated CHANGES file and added author change comments in the code
This commit is contained in:
Ronan Keryell
2026-04-01 04:12:55 -07:00
committed by GitHub
parent 41264221f4
commit c7f4015945
4 changed files with 65 additions and 12 deletions

View File

@@ -15675,3 +15675,16 @@ February 24 2026
midistats: the summary includes ntimesig, triplets, unquantized when appropriate.
March 30 2026 [RK]
abc2midi: added -PMAR option to emit MIDI marker meta-events (0x06) for
P: part labels. When a header P: field specifies a play order (e.g.
P:(AB)3), a marker is emitted each time a section begins during the
expanded playback, with an instance number (e.g. "Part A-1", "Part B-2").
When no header P: field is present, inline P: labels in the body are
emitted as simple section markers (e.g. "Part A"). The existing code at
genmidi.c:3187 that was meant to write markers was unreachable dead code;
it has been restructured. Changes in genmidi.c (PART case in writetrack,
partmarkers global) and store.c (event_part, event_init for -PMAR flag).
Man page updated in doc/abc2midi.1.

View File

@@ -2,7 +2,7 @@
.SH NAME
\fBabc2midi\fP \- converts abc file to MIDI file(s)
.SH SYNOPSIS
abc2midi \fIinfile\fP [\fIrefnum\fP] [\-c] [\-v] [\-ver] [\-t] [\-n limit] [\-CS] [\-quiet] [\-silent] [\-Q tempo] [\-NFNP] [\-NFER] [\-NGRA] [\-NGUI] [\-STFW] [\-OCC] [\-NCOM] [\-HARP] [\-BF] [\-TT] [\-o outfile] \-CSM [filename]
abc2midi \fIinfile\fP [\fIrefnum\fP] [\-c] [\-v] [\-ver] [\-t] [\-n limit] [\-CS] [\-quiet] [\-silent] [\-Q tempo] [\-NFNP] [\-NFER] [\-NGRA] [\-NGUI] [\-STFW] [\-OCC] [\-NCOM] [\-PMAR] [\-HARP] [\-BF] [\-TT] [\-o outfile] \-CSM [filename]
.SH DESCRIPTION
The default action is to write a MIDI file for each abc tune
with the filename <stem>N.mid, where <stem> is the filestem
@@ -61,6 +61,14 @@ Place lyric text in separate MIDI tracks.
.B -NCOM
Suppress some comments in the output MIDI file.
.TP
.B -PMAR
Emit MIDI marker meta-events for P: part labels. When a header P: field
specifies a play order (e.g. P:(AB)3), a marker is emitted each time a
section begins during the expanded playback, with an instance number
appended (e.g. "Part A-1", "Part B-1", "Part A-2", "Part B-2").
When no header P: field is present, inline P: labels in the body are
emitted as simple section markers (e.g. "Part A", "Part B").
.TP
.B -OCC
Accept old chord convention (eg +D2G2+ instead of [DG]2).
.TP