bogus MIDI time signature and/or tempo imports
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- audio-video-rtc
Research direction
Start with modules/tracktion_engine/midi/tracktion_MidiList.cpp around line 1528, where simultaneous tempo and time-signature meta events are mishandled. Read the surrounding MIDI import loop and the pseudo event list in the issue (Section C) to reproduce the overlap. Build a minimal MIDI file or test that triggers a tempo and time-signature change at the same timestamp, then check the imported tempo and signature are both applied. Done means the importer no longer drops either event.
Written by the indexing model from the issue text.
Description
I am trying to import some MIDI file into Waveform 9 (tried 10beta too), but the imported data is corrupt around where time signature changes. I suspect that tracktion_engine fails to deal with them.
I can't share my song in production, but my pseudo MIDI event list for my master track (0) is like this:
BEAT4,4 r1
MARKER "Section A"
t110 [r1]2 t112[r1]2 t114[r1]2 t115[r1]2
[r1]8
MARKER "Section B"
[ r1 BEAT7,8r2..BEAT4,4 ]3 r1 BEAT3,4r2.BEAT4,4
[ r1 BEAT7,8r2..BEAT4,4 r1 BEAT3,4r2.BEAT4,4 ]2
MARKER "Section C"
t120
[ BEAT3,4r2.r2. BEAT4,4r1BEAT7,8r2..]2
BEAT3,4r2.r2. BEAT4,4r1BEAT7,8r2..
(t is tempo, r is rest, BEAT is for time signature, and MARKER is marker meta text. Edit: and '[' to ']'n means "repeat n times".)
Starting Section B, Waveform fails to generate valid tempo/timesig changes, I can't really logically explain the actual behavior. It would be reproducible but changes them at many points.
Tracking the MIDI importer sources, this code smells:
if (msg2.getTimeStamp() == msg.getTimeStamp())
{
++i;
if (msg2.isTempoMetaEvent())
secsPerQuarterNote = msg2.getTempoSecondsPerQuarterNote();
else if (msg2.isTimeSignatureMetaEvent())
msg2.getTimeSignatureInfo (numer, denom);
}
I guess this assumes that they are either "both time signature" or "both tempo" and thus ignores the other. But my song contains a time signature change and a tempo change at the same time at Section C.
- Dominant language
- C++
- Stars
- 1.5k
- Forks
- 222
- Avg merge
- 15h 44m
- Merged PRs (30d)
- 33
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Tracktion/tracktion_engine
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Tracktion/tracktion_engine#475 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Tracktion/tracktion_engine#476 · 5 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 22/100
Tracktion/tracktion_engine#474 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
Tracktion/tracktion_engine#473 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 56/100
Tracktion/tracktion_engine#460 ·
Maintainers usually reply within 1 day
All issues in Tracktion/tracktion_engine
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
category:port-update
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
(S1 - Need confirmation)
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
CleverRaven/Cataclysm-DDA#89194 ·
Maintainers usually reply within 1 day
-
reproduced
Difficulty 1/5 Under an hour Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day