Tracktion / tracktion_engine

Tracktion Engine module
Other
1.16k stars 148 forks source link

Tracktion engine seems to be parsing miditicks incorrectly #113

Closed adamnemecek closed 2 years ago

adamnemecek commented 2 years ago

Hello, It appears that tracktion engine parses midi ticks incorrectly, namely all ticks are actually 2x of what they should be when compared with e.g. midicsv or AudioToolbox.

I created a fork of tracktion engine https://github.com/adamnemecek/tracktion_engine2. I added an example called MidiFileParser. Repro steps:

1.) cd examples/MidiFileParser 1.) run cmake -B build 2.) run make 3.) cd MidiFileParser_artefacts/MidiFileParser.app/Contents/MacOS/ 4.) run ./MidiFileParser.

You will get some output saying ticks <xyz>. Compare the output with the output of say midicsv and you will see that the ticks are twice of what they should be.

Currently the example parses a short midi file created from darude sandstorm.

drowaudio commented 2 years ago

I think this was discussed on Discord. There isn't a problem with the beat positions of the resulting files, it's just not "ticks" as you're assuming. You kind of need to ignore any notion of "ticks" after a file has been imported.