Skip to content
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

I believe I found a fix for when songs loop, but get turned to Tempo 1 and potentially similar problems #65

Open
Den1604 opened this issue Jul 9, 2023 · 1 comment

Comments

@Den1604
Copy link

Den1604 commented Jul 9, 2023

I tested out the exact same midi in both the newer mamar and the older version, upon investigating them i realized that newer Mamar has multiple Delay(x) in the first track, while old mamar compiles them into one big Delay of (presumably) all of them combined
my best guess is that this is what causes the issue, either way this shouldn't hurt changing (and i assume it would not be too hard to fix, even if it does not end up fixing the problem)
grafik
grafik

@bates64
Copy link
Owner

bates64 commented Jul 9, 2023

The reason for this difference is that decoding contiguous delays into a single, long Delay is lossy. Consider the following input situation:

Delay(200)
Delay(200)
Delay(200)

Under the old system, this would get turned into Delay(600). When encoding, Delay(600) is valid to output (600 < 2032), which would then make the output not match the input. Matching input/output is a hard requirement - there are tests for it - so the decision was made to not combine contiguous delays when decoding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants