Old 05-26-2016, 10:03 AM   #1
pcartwright
Human being with feelings
 
Join Date: Jan 2009
Posts: 1,030
Default ReaScript tempo in PPQ

I'm working on a script that, in theory, would let users record a tempo using a MIDI track as a guide. It would be similar (though not exactly like) Notion's nTempo ability.

Does anyone have a function (preferably in Lua) to convert tempo measures and beats (from GetTempoTimeSigMarker) into PPQ? it would be easy if the project kept the same time signature throughout, but I need the conversion to work for projects with varying and irregular time signatures.
pcartwright is offline   Reply With Quote
Old 05-26-2016, 10:41 AM   #2
pcartwright
Human being with feelings
 
Join Date: Jan 2009
Posts: 1,030
Default

Or, conversely, converting PPQ from MIDI note on to measures/beats would work, too.
pcartwright is offline   Reply With Quote
Old 05-26-2016, 03:05 PM   #3
snooks
Banned
 
Join Date: Sep 2015
Posts: 1,650
Default

You can get time pos from GetTempoTimeSigMarker then...
Code:
proj_QN=TimeMap2_timeToQN(0, time_pos)

ppq=reaper.MIDI_GetPPQPosFromProjQN(take,proj_QN)
Is this sort of what you want?
snooks is offline   Reply With Quote
Old 05-28-2016, 09:29 AM   #4
pcartwright
Human being with feelings
 
Join Date: Jan 2009
Posts: 1,030
Default

Sorta. Ideally I'd be able to convert both ways, from measures/beats to PPQ and vice versa. But I think I have an idea on how to accomplish this.
pcartwright is offline   Reply With Quote
Old 05-28-2016, 09:35 AM   #5
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

Maybe this helps (convert cubase .smt tempo map in ppq (acually same data as midi tempo map) to reaper tempo envelope):

https://github.com/MichaelPilyavskiy...empo%20map.lua
mpl 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 08:06 PM.


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