Is there a keyboard shortcut to toggle the metronome on/off?

Post Reply
MusikMan74
Posts: 34
Joined: 06 Jan 2018 23:03

Is there a keyboard shortcut to toggle the metronome on/off?

Post by MusikMan74 »

Title says it all...
kjetil
Site Admin
Posts: 582
Joined: 20 Jul 2017 20:45

Re: Is there a keyboard shortcut to toggle the metronome on/off?

Post by kjetil »

There isn't. Unfortunately, there isn't a function to check whether the metronome is enabled either, so instead of adding it like this:

Code: Select all

CTRL_L SHIFT_L M: ra.evalScheme "(ra.enable-metronome (not (ra.metrone-enabled)))"
you have to add it like this (which sometimes doesn't work so you have to press the keybinding two times):

Code: Select all

*
metronome_enabled = False
def switch_metronome():
  global metronome_enabled
  metronome_enabled = not metronome_enabled
  ra.enableMetronome(metronome_enabled)
*
CTRL_L SHIFT_L M: keybinding.switch_metronome
I'll include the "ra.metronomeEnabled" function in the next release.
MusikMan74
Posts: 34
Joined: 06 Jan 2018 23:03

Re: Is there a keyboard shortcut to toggle the metronome on/off?

Post by MusikMan74 »

Thank you for your detailed response.
MusikMan74
Posts: 34
Joined: 06 Jan 2018 23:03

Re: Is there a keyboard shortcut to toggle the metronome on/off?

Post by MusikMan74 »

I've added the following line to my 'keybindings.conf' file...I am running v5.9.67

Code: Select all

CTRL_L SHIFT_L M: ra.evalScheme "(ra.enable-metronome (not (ra.metronome-enabled)))"
but I get the following error:

metronome.png
metronome.png (88.78 KiB) Viewed 11786 times

Can you please explain what I'm doing wrong?

Thanks.
kjetil
Site Admin
Posts: 582
Joined: 20 Jul 2017 20:45

Re: Is there a keyboard shortcut to toggle the metronome on/off?

Post by kjetil »

Yeah, it's "ra:", not "ra.". Sorry about that.
MusikMan74
Posts: 34
Joined: 06 Jan 2018 23:03

Re: Is there a keyboard shortcut to toggle the metronome on/off?

Post by MusikMan74 »

Thanks for the syntax heads-up; now working as expected.

Maybe you'll consider adding this shortcut as part of the default keybindings in a future release; I bet it would be useful to other users as well.
kjetil
Site Admin
Posts: 582
Joined: 20 Jul 2017 20:45

Re: Is there a keyboard shortcut to toggle the metronome on/off?

Post by kjetil »

Good idea. I've added Shift + Ctrl + M keybinding now to switch metronome on/off.
MusikMan74
Posts: 34
Joined: 06 Jan 2018 23:03

Re: Is there a keyboard shortcut to toggle the metronome on/off?

Post by MusikMan74 »

kjetil wrote: 25 Jun 2019 21:45 Good idea. I've added Shift + Ctrl + M keybinding now to switch metronome on/off.
Thanks!
Post Reply