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

OSARA incorrectly reports ticks if the time signature denominator isn't 4 #1084

Closed
jcsteh opened this issue May 22, 2024 · 1 comment · Fixed by #1093
Closed

OSARA incorrectly reports ticks if the time signature denominator isn't 4 #1084

jcsteh opened this issue May 22, 2024 · 1 comment · Fixed by #1093

Comments

@jcsteh
Copy link
Owner

jcsteh commented May 22, 2024

This confused the hell out of me until I figured out what was going on.

STR:

  1. Open a new project.
  2. In Project Settings, set the time signature to 6/8.
  3. Insert a MIDI item.
  4. Set the grid to 16th and insertion length to grid.
  5. Insert a note.
  6. Press left arrow then down arrow to get OSARA to report the note.
    • Expected: The length should be 240 ticks.
    • Actual: The length is 480 ticks.
  7. Press control+f2 to open properties.
  8. Check the length. Observe that it is 0.0.240.
  9. Press alt+shift+rightArrow to move right by grid.
    • Expected: OSARA should report 240 ticks.
    • Actual: OSARA reports 480 ticks.

I think the problem is that we assume that ppq is ticks per beat, but it's actually ticks per quarter. We need to take the time signature denominator into account. TimeMap2_timeToBeats does provide this info; we just don't use it. We'll probably need to pass this into various time reporting functions.

@jcsteh
Copy link
Owner Author

jcsteh commented May 22, 2024

As a side note, strictly speaking, we're using the term "beats" incorrectly with respect to 6/8. In 6/8, there are two beats per bar, with a beat being a dotted quarter note. The 6 eighth notes per measure are called pulses. But I think REAPER also gets this wrong and goes a step further in that BPM seems to actually be quarter notes per minute, rather than beats per minute. I think most other DAWs have a similarly incorrect definition. Gotta love the fact that DAWs don't follow music theory.

jcsteh added a commit that referenced this issue May 27, 2024
…gnature denominator is something other than 4; e.g. 6/8.

Previously, for example, if the time signature was 6/8, we would incorrectly report a 16th note as 480 ticks instead of 240 ticks.
To fix this, correctly take the time signature denominator into account when using MIDI PPQ (which is per quarter note, not per beat).
Fixes #1084.
jcsteh added a commit that referenced this issue May 27, 2024
…gnature denominator is something other than 4; e.g. 6/8. (issue #1084, PR #1093)

Previously, for example, if the time signature was 6/8, we would incorrectly report a 16th note as 480 ticks instead of 240 ticks.
To fix this, correctly take the time signature denominator into account when using MIDI PPQ (which is per quarter note, not per beat).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant