Old 07-07-2015, 12:06 PM   #1
Breeder
Human being with feelings
 
Breeder's Avatar
 
Join Date: Nov 2010
Location: Croatia
Posts: 2,112
Default Lua: Load JS BPM Calculator with action (toolbar or shortcut)

Description:

The idea is quite simple. I've created JS plugin BPM Calculator, but the problem is that we usually don't want to think of it as a separate plugin loaded on some track, but as an independent tool on its own.
So I've created a simple Lua script which will load BPM Calculator on the Master track and unload it as soon as the FX window is closed (or the script is terminated):






What you will need and a few details on usage:

My JS BPM Calculator: https://stash.reaper.fm/v/7838/BPM%20Calculator
Special Lua script: https://stash.reaper.fm/v/24512/Util...e%20cursor.lua

Simply follow installation procedure for JS BPM Calculator and then import supplied Lua script into REAPER. After that, put it on your toolbar (or assign it a shortcut) and calculate away
To use this Lua scripts in REAPER, you will also need the to install SWS extension

When you try to turn off the BPM calculator by re-running the script for the first time, you will get prompted if you want to terminate or load new instance of the script. Simply terminate it and remember your answer. Like this:



Note that script depends on the name of JS BPM Calculator plugin. If by any chance you plan on renaming the plugin, script will no longer work. You can quickly fix that by chancing this line in the script so it's the same as your renamed JS BPM Calculator:
Code:
local g_fxName      = "BPM Calculator"



Change the position where BPM calculator gets loaded

If you don't like the fact that BPM Calculator is moved to mouse cursor, simply comment out (by prefixing the line with --) or delete this line from the script:
Code:
reaper.Main_OnCommand(reaper.NamedCommandLookup("_BR_MOVE_WINDOW_TO_MOUSE_H_M_V_T"), 0)
On the other hand, if you want for BPM Calculator to get loaded at different position from mouse cursor, change that line to some other SWS/BR action that moves window to mouse cursor. Like this:




A lot of effort has been invested in this. If you seriously use it, please consider supporting the developer. Thanks!

I don't mind if someone puts these in ReaPack, but please include my donation link, forum nickname and link to this thread and thread for a specific script in the description if you do so.

__________________
My contributions

Last edited by Breeder; 07-04-2019 at 11:12 AM.
Breeder is offline   Reply With Quote
Old 07-07-2015, 04:36 PM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,919
Default

Nic ! and thanks for the detailed infos about it
X-Raym is offline   Reply With Quote
Old 07-07-2015, 05:46 PM   #3
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 1,928
Default

Wonderful
__________________
Dax Liniere
London's newest premium studio complex! (Facebook)
[i7-4790K, 12Gb RAM, Win8.1x64, NVidia GT710, UAD2-OCTO, FireFaceUFX, REAPER x64]
daxliniere is offline   Reply With Quote
Old 11-02-2015, 12:38 PM   #4
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,486
Default

Thank you Breeder!

Win7 x64, Reaper 5.04, SWS 2.8.1 : the toggle does not work here. Have a look:



Any ideas why?
amagalma is offline   Reply With Quote
Old 11-04-2015, 11:51 AM   #5
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,486
Default

I tried it on a fresh portable install of Reaper and it does not work there either. Is it some bug of v5.04?
amagalma is offline   Reply With Quote
Old 11-04-2015, 06:03 PM   #6
ericzang
Human being with feelings
 
ericzang's Avatar
 
Join Date: Mar 2014
Location: Phoenix, AZ
Posts: 348
Default

So cool Breeder, thanks again! It is so simple to customize this for any plugin, such as a frequency analyzer. In the script I simply replaced BPM Calc with another uniquely named plugin (as would work when adding an effect with the Console command "x").

PS Amagalma, seems to be working properly for me. Same specs as you.

Curiously the action with a shortcut via MIDI message can only open the plugin, but not toggle it closed. Keyboard shortcut works no problem.

Last edited by ericzang; 11-04-2015 at 06:57 PM.
ericzang is offline   Reply With Quote
Old 11-05-2015, 04:20 AM   #7
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,486
Default

I tried it in all ways: via a toolbar button, via "run" in the action list and by assigning a key to it.. no luck! :/
And all this in a clean portable install of R5..
amagalma 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 03:47 AM.


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