Go Back   Cockos Incorporated Forums > Projects > Deprecated REAPER issue tracker > Closed Issue

Bug in RPR_TimeMap2_beatsToTime Issue Tools
issueid=5408 10-27-2014 11:44 PM
Human being with feelings
Bug in RPR_TimeMap2_beatsToTime

It seems

RPR_TimeMap2_beatsToTime does not convert beats past a certain point.

E.g., if you call RPR_TimeMap2_beatsToTime(0, x, 0) then as x increases, the result eventually stops increasing(I guess at the end of the project?).

This makes it hard to compute the proper time based on beats for adding things such as envelope points.

Also, RPR_TimeMap2_beatsToTime(0, x, y)[3] always returns y instead of the measure actual measure.
This issue is closed. No more replies may be made.
Issue Details
Issue Type Closed Issue
Project Deprecated REAPER issue tracker
Category Plugins
Status Duplicate
Priority 5 - Medium
Affected Version 4.73
Closed Version (none)
Yes votes 0
No votes 0
Assigned Users (none)
Tags (none)

11-09-2014 06:45 PM
Human being with feelings
 
Please look into this. It is really annoying.

It seems that if one gets the zero index then it is invalid, but the 2nd index is ok. Doesn't really jive with the documentation though and seems to work fine in some circumstances.

Test code:
Code:
def msg(m):
    RPR_ShowConsoleMsg(m)

time = 124.32;
beat = RPR_TimeMap2_timeToBeats(0, time, 0, 0, 0, 0)[5];

l1 = str(RPR_TimeMap2_beatsToTime(0, beat - 1, 0)[0]);			
r1 = str(RPR_TimeMap2_beatsToTime(0, beat + 1, 0)[0]);

l2 = str(RPR_TimeMap2_beatsToTime(0, beat - 1, 0)[2]);			
r2 = str(RPR_TimeMap2_beatsToTime(0, beat + 1, 0)[2]);

msg("Time: " + str(time) + "s\n");
msg(str(beat) + " beats\n");
msg(str(l1) + "\n");
msg(str(r1) + "\n");
msg(str(l2) + "\n");
msg(str(r2) + "\n");
Code:
Output:
Time: 124.32s
171.9752986626151
3.793400735597    // WRONG
3.793400735597    // WRONG
156.472
158.472

Other times:

Time: 124.32s
157.472 beats
123.53052631578947
125.10947368421053
156.472   // Right
158.472   // Right

Time: 96.40257126s
131.99790072290386 beats
3.793400735597 beats   // Wrong
3.793400735597 beats   // Wrong
130.99790072290386 beats
132.99790072290386 beats

Time: 120s
175.64959008727925 beats
4.7368421052631575 beats
4.7368421052631575 beats
174.64959008727925 beats
176.64959008727925 beats

Whats strange it is that seems to work ok sometimes. It seems that if there is a tempo change then it fails!!!! Works fine when no tempo changes!
11-10-2014 01:21 AM
Mortal
 
Closed

Issue Tools
Subscribe to this issue

All times are GMT -7. The time now is 10:03 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.