Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 05-04-2019, 08:08 AM   #1
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,109
Default API: TimeMap2_beatsToTime() vs. swing grid? (SOLVED BY SCRIPT)

edit:
Justin posted a script which does this, thanks so much.

https://forum.cockos.com/showpost.ph...7&postcount=10


=== original post ===

from here (since I got no reply there):

This

Code:
_nextGridPos = reaper.TimeMap2_beatsToTime(0, 0.25, 0)
should, to my understanding, give the position (in time) of the first visible grid line in my project.
It seems to work correctly for non swing grid:




However, when I set a swing grid, and run the script again, the same position is returned and not the actual position of the grid line.


Last edited by nofish; 05-08-2019 at 03:32 AM.
nofish is offline   Reply With Quote
Old 05-04-2019, 03:45 PM   #2
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,746
Default

The swing grid does not affect that function, the swing grid is purely for guidance. You could do your own swing calculation though I suppose...
Justin is offline   Reply With Quote
Old 05-04-2019, 04:57 PM   #3
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,109
Default

Thanks.
Hm..I'm a bit surprised to be honest.
Setting swing affects beats positions (edit: or rather sub-beats positions) which I'm evaluating with this function, no? Hence I'd have expected this function respects a swing grid.

Anyway, the actual issue is that some SWS API functions which use this (e.g. BR_GetNextGridDivision() are broken with a swing grid set currently because of this.
https://github.com/reaper-oss/sws/issues/1137

Any suggestion for a fix by chance?
(I guess that's better asked in the scripters/extension forum though.)

edit2:
Alternatively, since Reaper has the actual grid positions present/stored anyway I suppose, couldn't there be an additional API function to get them rather having to do our own swing calculation?

Last edited by nofish; 05-05-2019 at 04:54 AM.
nofish is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:51 PM.


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