Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Feature Requests

Reply
 
Thread Tools Display Modes
Old 06-08-2024, 03:49 PM   #1
panicaftermath
Human being with feelings
 
Join Date: Dec 2014
Posts: 563
Default Realtime BPM indication when adjusting playrate

Hello devs and Feature Requests readers!

For your consideration:

It would be really great if Reaper could indicate what the effective BPM is for the current playback rate, without needing to first apply the playrate, only to undo it, perhaps repeating this process multiple times while playing with playrate and BPM possibilities. As best I can tell this is not possible.

I won't offer suggestions for how this might be implemented. But there has been some recent discussion of it here:
https://forum.cockos.com/showthread.php?t=291627.

It seems like it would be a fairly simply and definitely minor enhancement, but with a lot of usability bang for the buck. I know I'd be using it right now if only it where there.

Please consider!

Thank you for making such great software!
panicaftermath is offline   Reply With Quote
Old 06-09-2024, 02:35 PM   #2
Daodan
Human being with feelings
 
Join Date: Jan 2011
Posts: 1,226
Default +1

+1.
Also useful when you learn peace on drums and slow down by rate but also want to know what bpm it is.
Daodan is online now   Reply With Quote
Old 06-09-2024, 03:27 PM   #3
The-Zeronaut
Human being with feelings
 
Join Date: Mar 2009
Posts: 310
Default

+1 useful feature
The-Zeronaut is offline   Reply With Quote
Old 06-10-2024, 03:44 AM   #4
smandrap
Human being with feelings
 
smandrap's Avatar
 
Join Date: Feb 2021
Location: Right here
Posts: 1,761
Default

Can't see a reason not to +1 this.

In the meanwhile, here's a crutch until it's implemented

Requires ReaImGui



Code:
local r = reaper
local script_name = "Playrate Boi"

if not r.ImGui_GetVersion then
  local ok = reaper.MB('Install now?', 'ReaImGui Missing', 1)
  if ok == 1 then reaper.ReaPack_BrowsePackages("ReaImGui API") end
  return
end

package.path = reaper.ImGui_GetBuiltinPath() .. '/?.lua'
local ImGui = require 'imgui' '0.9'


-- GUI

local settings = {
  title_font_size = 12,
  font_size = 20,
}

local proj_change_cnt = r.GetProjectStateChangeCount(0)
local first_frame = true

local ctx = ImGui.CreateContext(script_name)
local visible, open
local window_flags =
    ImGui.WindowFlags_None
-- | ImGui.WindowFlags_AlwaysAutoResize

local getinfo = debug.getinfo(1, 'S');
local script_path = getinfo.source:match [[^@?(.*[\/])[^\/]-$]];
package.path = script_path .. "?.lua;" .. package.path -- GET DIRECTORY FOR REQUIRE

local os = r.GetOS():match('^Win') and 0 or 1
local os_sep = package.config:sub(1, 1)


local font = ImGui.CreateFont('sans-serif', settings.font_size)
local title_font = ImGui.CreateFont('sans-serif', settings.title_font_size)
ImGui.Attach(ctx, font)
ImGui.Attach(ctx, title_font)

local cur_bpm = 0

local function IsProjectChanged()
  local n = r.GetProjectStateChangeCount(0)
  if n ~= proj_change_cnt then
    proj_change_cnt = n
    return true
  end
  return false
end

local function CalcPlayrateShit()
  local t = r.GetPlayPosition()
  return r.TimeMap_GetDividedBpmAtTime(t) * r.Master_GetPlayRateAtTime(t, 0)
end

local function frame()
  --if IsProjectChanged() then cur_bpm = CalcPlayrateShit() end
  cur_bpm = CalcPlayrateShit()
  ImGui.Text(ctx, cur_bpm)
end

local function PrepWindow()
  ImGui.SetNextWindowSize(ctx, 300, 400, ImGui.Cond_FirstUseEver)
  ImGui.PushFont(ctx, title_font)
  ImGui.PushStyleVar(ctx, ImGui.StyleVar_WindowRounding, 5)
end

local function guiloop()
  PrepWindow()
  visible, open = ImGui.Begin(ctx, script_name, true, window_flags)
  ImGui.PopStyleVar(ctx)
  ImGui.PopFont(ctx)

  if visible then
    ImGui.PushFont(ctx, font)
    frame()
    ImGui.End(ctx)
  ImGui.PopFont(ctx)
  end

  if open then
    reaper.defer(guiloop)
  end
end

local function init()
  cur_bpm = CalcPlayrateShit()
end

local function Exit()
  return
end

init()
reaper.atexit(Exit)
reaper.defer(guiloop)
__________________
My Scripts
smandrap is offline   Reply With Quote
Old 06-10-2024, 10:17 AM   #5
juan_r
Human being with feelings
 
juan_r's Avatar
 
Join Date: Oct 2019
Posts: 1,109
Default

How cool @smandrap! Should be ReaPacked as "Show equivalent BPM when changing playrate" ;-)

In just a few months, I've seen you grow from "I'm not a coder at all" to an instant solution cook. Kudos!
__________________
My ReaPack repository: https://github.com/juanriccio/Reaper...ster/index.xml
juan_r is offline   Reply With Quote
Old 06-10-2024, 01:01 PM   #6
smandrap
Human being with feelings
 
smandrap's Avatar
 
Join Date: Feb 2021
Location: Right here
Posts: 1,761
Default

I’ve grown from “I’m not a coder at all” to “I’m definitely not a coder at all”
__________________
My Scripts
smandrap is offline   Reply With Quote
Old Yesterday, 06:18 AM   #7
juan_r
Human being with feelings
 
juan_r's Avatar
 
Join Date: Oct 2019
Posts: 1,109
Default

Quote:
Originally Posted by smandrap View Post
I’ve grown from “I’m not a coder at all” to “I’m definitely not a coder at all”
I wish there were more definitely-not-coders-at-all round here

But the main hint was about ReaPacking your valuable stuff...
__________________
My ReaPack repository: https://github.com/juanriccio/Reaper...ster/index.xml
juan_r is offline   Reply With Quote
Old Yesterday, 06:24 AM   #8
smandrap
Human being with feelings
 
smandrap's Avatar
 
Join Date: Feb 2021
Location: Right here
Posts: 1,761
Default

Lol I committed to the local repo and forgot to push the changes to reapack. I’ll upload soon uploaded
__________________
My Scripts

Last edited by smandrap; Yesterday at 06:50 AM.
smandrap is offline   Reply With Quote
Old Yesterday, 07:08 AM   #9
juan_r
Human being with feelings
 
juan_r's Avatar
 
Join Date: Oct 2019
Posts: 1,109
Default

🙏
__________________
My ReaPack repository: https://github.com/juanriccio/Reaper...ster/index.xml
juan_r 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 02:27 PM.


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