Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 08-14-2017, 07:35 AM   #1
mehmethan
Human being with feelings
 
mehmethan's Avatar
 
Join Date: Jun 2011
Posts: 603
Default REQ: A simple fader or a knob to control the metronom volume

Hi,
I need a dockable script which has a simple fader or a knob to control the main metronom volume. I hope this is easy and possible.I want to donate the scripter for some beers.
mehmethan is offline   Reply With Quote
Old 08-15-2017, 04:34 PM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Just create the click track and use track fader :P
(we don't have any function to control metronome volume anyway as far as I know)
X-Raym is offline   Reply With Quote
Old 08-16-2017, 02:49 PM   #3
mehmethan
Human being with feelings
 
mehmethan's Avatar
 
Join Date: Jun 2011
Posts: 603
Default

There is an action to control metronome volume but it is midi/osc only. I thought maybe a script guru knows a way to bind this action to a fader.
mehmethan is offline   Reply With Quote
Old 08-17-2017, 01:52 AM   #4
me2beats
Human being with feelings
 
me2beats's Avatar
 
Join Date: Jul 2015
Location: Yekaterinburg, Russia
Posts: 400
Default

Hi!
Script: Adjust metronome volume.lua
(added to my repo)

it sets Metronome primary beat volume from -17 db to 12 db
I made it using SWS.
The main question in this case is how to get current metronome volume (I have no ideas)
__________________
My Reapack Repo
Donation
me2beats is offline   Reply With Quote
Old 08-17-2017, 02:30 AM   #5
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,596
Default

It is stored within RPP file:
Code:
<METRONOME 6 2
    VOL 0 0
    FREQ 800 1600 1
    BEATLEN 4
    SAMPLES "" ""
    PATTERN 2863311530 2863311529
  >
but updated only after save
Sexan is offline   Reply With Quote
Old 08-17-2017, 11:58 AM   #6
mehmethan
Human being with feelings
 
mehmethan's Avatar
 
Join Date: Jun 2011
Posts: 603
Default

Quote:
Originally Posted by me2beats View Post
Hi!
Script: Adjust metronome volume.lua
(added to my repo)

it sets Metronome primary beat volume from -17 db to 12 db
I made it using SWS.
The main question in this case is how to get current metronome volume (I have no ideas)
Thank you so much, I'm at vacation and dont have any pc with me. I will test it at weekend.
mehmethan is offline   Reply With Quote
Old 08-22-2017, 08:56 AM   #7
mehmethan
Human being with feelings
 
mehmethan's Avatar
 
Join Date: Jun 2011
Posts: 603
Default

Me2beats thank you so muchI checked the script it is working fine for me. Is it possible to make the script dockable when you have time?
mehmethan is offline   Reply With Quote
Old 02-01-2018, 02:33 PM   #8
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Quote:
Originally Posted by me2beats View Post
The main question in this case is how to get current metronome volume (I have no ideas)
Action (might've been added after your comment):
SWS/S&M: Decrease metronome volume _S&M_METRO_VOL_DOWN
SWS/S&M: Increase metronome volume _S&M_METRO_VOL_DOWN

Source code for actions (_ct -1/1):
Code:
void ChangeMetronomeVolume(COMMAND_T* _ct) {
    KBD_OnMainActionEx(999, 0x40+(int)_ct->user, -1, 2, GetMainHwnd(), NULL);
}
fundorin is offline   Reply With Quote
Old 02-01-2018, 07:33 PM   #9
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

Alternatively

Lua:
Code:
primaryBeatVol = reaper.SNM_GetDoubleConfigVar("projmetrov1", -666)
secondaryBeatVol = reaper.SNM_GetDoubleConfigVar("projmetrov2", -666)
(returns as double, would need conversion to dB)

Last edited by nofish; 02-01-2018 at 08:04 PM.
nofish is offline   Reply With Quote
Old 07-05-2021, 03:56 PM   #10
eliyahillel
Human being with feelings
 
Join Date: May 2019
Location: Israel
Posts: 11
Default

Quote:
Originally Posted by me2beats View Post
Hi!
Script: Adjust metronome volume.lua
(added to my repo)
Thanks! you, SWS, and reaPack are such 'nice to have's. one day I'll learn to script myself...
eliyahillel is offline   Reply With Quote
Old 05-11-2022, 03:52 PM   #11
grandfougue
Human being with feelings
 
grandfougue's Avatar
 
Join Date: Sep 2016
Posts: 513
Default

[QUOTE=me2beats;1877053]Hi!
Script: Adjust metronome volume.lua

Hello I discovered that I could assign this button to other actions. Is it possible to add several buttons in the same script?
grandfougue is offline   Reply With Quote
Old 07-11-2022, 01:53 PM   #12
Navelpluisje
Human being with feelings
 
Navelpluisje's Avatar
 
Join Date: Mar 2020
Location: IJsselstein, Netherlands
Posts: 435
Default

Quote:
Originally Posted by nofish View Post
Alternatively

Lua:
Code:
primaryBeatVol = reaper.SNM_GetDoubleConfigVar("projmetrov1", -666)
secondaryBeatVol = reaper.SNM_GetDoubleConfigVar("projmetrov2", -666)
(returns as double, would need conversion to dB)
Thanx, this is working as I expected and hoped.
__________________
Created ReaSonus FaderPort: Documentation and Download from Github. Report Issues
Created Reapinger BCF2000: Documentation and Download from Reaper Stash
Donations: Buy me a coffee or beer or buy one of my shirts in Europe or North America
Navelpluisje 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:23 PM.


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