Where can I find a metronome for music practice?












10















This is somehow a follow up of this question:



How can I detect the BPM (beats per minute) of a song?



But now instead of detecting them in songs, I want to generate them.





I am looking for an application that will output a sound (something short like a beep) a configurable number of times per minute.



If I say 20bpm, it will output that sound every 3 seconds. (60/20)

If 60bpm, every sec.

If 120bpm every half a sec.



The reason for this is that I am learning how to play drum sets and the bpm looks really important. I am following this video on youtube.



update



Seems they are called metronomes and even Google got one. Cool Stuff.
https://www.google.com/search?q=metronomes

Thanks Nick.










share|improve this question




















  • 1





    Audacity can do this (look under the "Generate" menu), though there are probably simpler programs. Online metronomes are plentiful, if you plan on having internet access during your practice.

    – Nick Weinberg
    Aug 20 '16 at 22:56








  • 2





    gtick, klick, gtklick, and kmetronome might be other options, and they're all available in the Ubuntu software repositories.

    – Nick Weinberg
    Aug 20 '16 at 22:58













  • The metronomes running under Linux are heavily outdated it seems. Not working, at least not out of the box. Time to write one :) @NickWeinberg I tried them all, not working (any more) it seems.

    – Jacob Vlijm
    Aug 20 '16 at 22:58













  • Hey @JacobVlijm Got a python script that can do this? I really should learn python...

    – Parto
    Aug 20 '16 at 23:01











  • I will give it a shot shortly!

    – Jacob Vlijm
    Aug 20 '16 at 23:02
















10















This is somehow a follow up of this question:



How can I detect the BPM (beats per minute) of a song?



But now instead of detecting them in songs, I want to generate them.





I am looking for an application that will output a sound (something short like a beep) a configurable number of times per minute.



If I say 20bpm, it will output that sound every 3 seconds. (60/20)

If 60bpm, every sec.

If 120bpm every half a sec.



The reason for this is that I am learning how to play drum sets and the bpm looks really important. I am following this video on youtube.



update



Seems they are called metronomes and even Google got one. Cool Stuff.
https://www.google.com/search?q=metronomes

Thanks Nick.










share|improve this question




















  • 1





    Audacity can do this (look under the "Generate" menu), though there are probably simpler programs. Online metronomes are plentiful, if you plan on having internet access during your practice.

    – Nick Weinberg
    Aug 20 '16 at 22:56








  • 2





    gtick, klick, gtklick, and kmetronome might be other options, and they're all available in the Ubuntu software repositories.

    – Nick Weinberg
    Aug 20 '16 at 22:58













  • The metronomes running under Linux are heavily outdated it seems. Not working, at least not out of the box. Time to write one :) @NickWeinberg I tried them all, not working (any more) it seems.

    – Jacob Vlijm
    Aug 20 '16 at 22:58













  • Hey @JacobVlijm Got a python script that can do this? I really should learn python...

    – Parto
    Aug 20 '16 at 23:01











  • I will give it a shot shortly!

    – Jacob Vlijm
    Aug 20 '16 at 23:02














10












10








10


5






This is somehow a follow up of this question:



How can I detect the BPM (beats per minute) of a song?



But now instead of detecting them in songs, I want to generate them.





I am looking for an application that will output a sound (something short like a beep) a configurable number of times per minute.



If I say 20bpm, it will output that sound every 3 seconds. (60/20)

If 60bpm, every sec.

If 120bpm every half a sec.



The reason for this is that I am learning how to play drum sets and the bpm looks really important. I am following this video on youtube.



update



Seems they are called metronomes and even Google got one. Cool Stuff.
https://www.google.com/search?q=metronomes

Thanks Nick.










share|improve this question
















This is somehow a follow up of this question:



How can I detect the BPM (beats per minute) of a song?



But now instead of detecting them in songs, I want to generate them.





I am looking for an application that will output a sound (something short like a beep) a configurable number of times per minute.



If I say 20bpm, it will output that sound every 3 seconds. (60/20)

If 60bpm, every sec.

If 120bpm every half a sec.



The reason for this is that I am learning how to play drum sets and the bpm looks really important. I am following this video on youtube.



update



Seems they are called metronomes and even Google got one. Cool Stuff.
https://www.google.com/search?q=metronomes

Thanks Nick.







sound software-recommendation application-development music






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 6 at 22:11









wjandrea

9,27942664




9,27942664










asked Aug 20 '16 at 22:42









PartoParto

9,4311965104




9,4311965104








  • 1





    Audacity can do this (look under the "Generate" menu), though there are probably simpler programs. Online metronomes are plentiful, if you plan on having internet access during your practice.

    – Nick Weinberg
    Aug 20 '16 at 22:56








  • 2





    gtick, klick, gtklick, and kmetronome might be other options, and they're all available in the Ubuntu software repositories.

    – Nick Weinberg
    Aug 20 '16 at 22:58













  • The metronomes running under Linux are heavily outdated it seems. Not working, at least not out of the box. Time to write one :) @NickWeinberg I tried them all, not working (any more) it seems.

    – Jacob Vlijm
    Aug 20 '16 at 22:58













  • Hey @JacobVlijm Got a python script that can do this? I really should learn python...

    – Parto
    Aug 20 '16 at 23:01











  • I will give it a shot shortly!

    – Jacob Vlijm
    Aug 20 '16 at 23:02














  • 1





    Audacity can do this (look under the "Generate" menu), though there are probably simpler programs. Online metronomes are plentiful, if you plan on having internet access during your practice.

    – Nick Weinberg
    Aug 20 '16 at 22:56








  • 2





    gtick, klick, gtklick, and kmetronome might be other options, and they're all available in the Ubuntu software repositories.

    – Nick Weinberg
    Aug 20 '16 at 22:58













  • The metronomes running under Linux are heavily outdated it seems. Not working, at least not out of the box. Time to write one :) @NickWeinberg I tried them all, not working (any more) it seems.

    – Jacob Vlijm
    Aug 20 '16 at 22:58













  • Hey @JacobVlijm Got a python script that can do this? I really should learn python...

    – Parto
    Aug 20 '16 at 23:01











  • I will give it a shot shortly!

    – Jacob Vlijm
    Aug 20 '16 at 23:02








1




1





Audacity can do this (look under the "Generate" menu), though there are probably simpler programs. Online metronomes are plentiful, if you plan on having internet access during your practice.

– Nick Weinberg
Aug 20 '16 at 22:56







Audacity can do this (look under the "Generate" menu), though there are probably simpler programs. Online metronomes are plentiful, if you plan on having internet access during your practice.

– Nick Weinberg
Aug 20 '16 at 22:56






2




2





gtick, klick, gtklick, and kmetronome might be other options, and they're all available in the Ubuntu software repositories.

– Nick Weinberg
Aug 20 '16 at 22:58







gtick, klick, gtklick, and kmetronome might be other options, and they're all available in the Ubuntu software repositories.

– Nick Weinberg
Aug 20 '16 at 22:58















The metronomes running under Linux are heavily outdated it seems. Not working, at least not out of the box. Time to write one :) @NickWeinberg I tried them all, not working (any more) it seems.

– Jacob Vlijm
Aug 20 '16 at 22:58







The metronomes running under Linux are heavily outdated it seems. Not working, at least not out of the box. Time to write one :) @NickWeinberg I tried them all, not working (any more) it seems.

– Jacob Vlijm
Aug 20 '16 at 22:58















Hey @JacobVlijm Got a python script that can do this? I really should learn python...

– Parto
Aug 20 '16 at 23:01





Hey @JacobVlijm Got a python script that can do this? I really should learn python...

– Parto
Aug 20 '16 at 23:01













I will give it a shot shortly!

– Jacob Vlijm
Aug 20 '16 at 23:02





I will give it a shot shortly!

– Jacob Vlijm
Aug 20 '16 at 23:02










5 Answers
5






active

oldest

votes


















19





+200









As mentioned in a comment, I couldn't get the mentioned metronomes (existing for Linux/Ubuntu) working on 16.04, at least not out of the box. I didn't spend much time in getting it to work, since practically all of them give the impression to be abandoned.



Time to write one...





This answer (work in progress) should eventually lead to a metronome, including GUI. A good time to mention possible features you'd like.



1. CLI metronome



Creating a straightforward metronome turns out to be shockingly simple:



#!/usr/bin/env python3
import subprocess
import sys
import time

bpm = int(sys.argv[1])
pauze = 60/bpm

while True:
time.sleep(pauze)
subprocess.Popen(["ogg123", "/usr/share/sounds/ubuntu/stereo/bell.ogg"])


How to use





  1. The metronome needs vorbis-tools, to play the sound



    sudo apt-get install vorbis-tools


  2. Copy the script above into an empty file, save it as metronome.py


  3. Run it with the bpm as argument:



    python3 /path/to/metronome.py <bpm>


    e.g.:



    python3 /path/to/metronome.py 100


    To run it with 100 beats per minute




Note



For the sound, I used the file /usr/share/sounds/ubuntu/stereo/bell.ogg, which should be on your system by default (tested 14.04/16.04). You can however use any (.ogg) sample you like. In the final version, A number of options (sounds) will be available.





2. Shockingly simple GUI version



As a next step, a very basic version, the last version without an installer:



enter image description here



The script



#!/usr/bin/env python3
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
import sys
import subprocess
import time
from threading import Thread
import os

path = os.path.dirname(os.path.realpath(__file__))

class MetroWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="Shockingly simple Metronome")
self.speed = 70
self.run = False
# maingrid
maingrid = Gtk.Grid()
maingrid.set_column_homogeneous(True)
maingrid.set_row_homogeneous(False)
maingrid.set_border_width(30)
self.add(maingrid)
# icon
image = Gtk.Image(xalign=0)
image.set_from_file(os.path.join(path, "icon.png"))
maingrid.attach(image, 0, 0, 1, 1)
# vertical slider, initial value, min, max, step, page, psize
self.v_scale = Gtk.Scale(
orientation=Gtk.Orientation.VERTICAL,
adjustment=Gtk.Adjustment.new(self.speed, 10, 240, 1, 0, 0)
)
self.v_scale.set_vexpand(True)
self.v_scale.set_digits(0)
self.v_scale.connect("value-changed", self.scale_moved)
maingrid.attach(self.v_scale, 1, 0, 2, 1)

self.togglebutton = Gtk.Button("_Run", use_underline=True)
self.togglebutton.connect("clicked", self.time_out)
self.togglebutton.set_size_request(70,20)
maingrid.attach(self.togglebutton, 3, 3, 1, 1)

# start the thread
self.update = Thread(target=self.run_metro, args=)
self.update.setDaemon(True)
self.update.start()

def scale_moved(self, event):
self.speed = int(self.v_scale.get_value())

def time_out(self, *args):
if self.run == True:
self.run = False
self.togglebutton.set_label("Run")
else:
self.run = True
self.togglebutton.set_label("Pauze")

def pauze(self):
return 60/self.speed

def run_metro(self):
soundfile = "/usr/share/sounds/ubuntu/stereo/bell.ogg"
while True:
if self.run == True:
subprocess.Popen([
"ogg123", soundfile
])
time.sleep(self.pauze())

def run_gui():
window = MetroWindow()
window.connect("delete-event", Gtk.main_quit)
window.set_resizable(False)
window.show_all()
Gtk.main()

run_gui()


The image



enter image description here



How to use





  1. Like the cli version, this one needs vorbis-tools:



    sudo apt-get install vorbis-tools


  2. Copy the script into an empty file, save it as metro.py


  3. Right- click on the image above, save it In one and the same directory as the script (exactly) as: icon.png.


  4. Simply run the metronome by the command:



    python3 /path/to/metro.py





3. PPA for the Orange Metronome



It is done!



The metronome is ready for installation.

The Orange Metronome comes with a set of different sounds to choose from, and the beats can be grouped. All changes are applied immediately on the running metronome:



enter image description here



enter image description here



enter image description here



To install:



sudo apt-add-repository ppa:vlijm/orangemetronome
sudo apt-get update
sudo apt-get install orangemetronome


Work to do




  • Currently, the metronome comes with four different sounds to choose from. Probably a few will be added in the next few days, some of them will be replaced/updated


  • On the longer term

    For the longer term, I am thinking of adding the option for (custom) complex structures like 3+3+2, 2+2+2+3 etc., which I always missed in existing metronomes.



Finally



The latest (current) version 0.5.3 adds a number of sounds, but more importantly, the option to run irregular (composite) beats. In this version, they are hard coded. Will be customizable from version > 1.



enter image description here






share|improve this answer


























  • @Parto cool, I will continue on this. What is your Ubuntu version btw?

    – Jacob Vlijm
    Aug 21 '16 at 9:35











  • Cool, will be here. Ubuntu version: 14.04.

    – Parto
    Aug 21 '16 at 9:37











  • @Parto ...and the first gui version...

    – Jacob Vlijm
    Aug 21 '16 at 13:56






  • 1





    I will give you the +15 for the correct answer but +100 to Nick to get him to over 2K rep.

    – Parto
    Aug 22 '16 at 8:52






  • 1





    @Parto absolutely! Might take a day or two, I would like to build in a few options.

    – Jacob Vlijm
    Aug 22 '16 at 8:52



















9





+100









It sounds like you're looking for a metronome!



The audio-editing software Audacity can generate a steady, metronome-like beat or tone (look under the "Generate" menu), though there are simpler programs that I'll list below. Audacity is in the Ubuntu software repositories and can be installed through the Software Center or by typing sudo apt install audacity in a terminal window.



Online metronomes are plentiful, if you plan on having internet access during your practice.



Other metronome software available in the Ubuntu software repositories includes gtick, klick, gtklick, and kmetronome, though I haven't tried any of them myself.






share|improve this answer































    8














    Simple Bash metronome



    Usage



    metronome.sh [beats per minute] [beats per measure]


    Info




    • It plays at 120 bpm in 4 by default

    • More info and a much more sophisticated script is available on my GitHub repo: metronome.sh. The below script is there under metronome-core.sh


    For example



    metronome.sh
    metronome.sh 75 # 75 BPM
    metronome.sh 120 3 # 120 BPM, 3 beats per measure


    Script



    #!/bin/bash
    # metronome.sh - Is a metronome.
    # Usage: metronome.sh [beats per minute] [beats per measure]

    # Set BPM and beats per measure.
    bpm="${1-120}"
    msr="${2-4}"

    # Get seconds per beat using bc.
    # "-0.004" accounts for approximate execution time.
    beat_time="$(bc -l <<< "scale=5; 60/$bpm-0.004")"

    echo "Metronome playing $bpm BPM, $msr beats per measure"
    echo -n "Press Ctrl+C to quit."

    while true; do
    for ((i=1; i<=$msr; i++)); do
    if [[ $i -eq 1 ]]; then
    # Accentuated beat.
    canberra-gtk-play --id='dialog-information' &
    else
    # Unaccentuated beat
    canberra-gtk-play --id='button-toggle-on' &
    fi
    # Wait before next beat. Will exit if beat time is invalid.
    sleep "$beat_time" || exit
    done
    done





    share|improve this answer


























    • Awesome one too. Tried it out.

      – Parto
      Aug 24 '16 at 8:38











    • Failed to play, sound is disabled. Error

      – Mark Deven
      Feb 5 at 19:33











    • @Mark Seems like you need to enable sound :p

      – wjandrea
      Feb 5 at 19:35













    • :) yes but how does one do that

      – Mark Deven
      Feb 5 at 19:36











    • @Mark IDK, but you can ask a new question

      – wjandrea
      Feb 5 at 19:36



















    1














    i play the Guitar and i use gtick, it works pretty well for me, i can adjust the beats per minute, volume and even time signatures, 1/4,2/4,3/4, and so on.
    you can install it from the command line using:



    sudo apt-get install gtick


    heres my gtick: i.imgsafe.org/f2dc6c70f2.png






    share|improve this answer


























    • Already mentioned by Nick. Also doesn't work on my system (Ubuntu Unity 16.04).

      – Jacob Vlijm
      Aug 24 '16 at 9:30











    • I know its mentioned by Nick, but i have used gtick myself, he has not, as he mentioned. I use Ubuntu 16.04 LTS and it works for me, are you missing some missing audio dependencies or so?

      – Abel Tom
      Aug 24 '16 at 9:42











    • See this: dl.dropboxusercontent.com/u/1155139/error.png happens no matter the settings etc., on multiple systems. Read something about it, had it running with tricks in the past, don't remember what it was. Don't want to remember. It should simply work. If something like this is not fixed after years, I prefer to write my own stuff.

      – Jacob Vlijm
      Aug 24 '16 at 21:55













    • im sorry it did not work for you, heres my gtick: i.imgsafe.org/f2dc6c70f2.png

      – Abel Tom
      Aug 25 '16 at 17:42



















    0














    Have you tried kmetronome? Should be able to use apt-get/synaptic.






    share|improve this answer
























    • Also already mentioned by Nick.

      – Jacob Vlijm
      Aug 25 '16 at 6:29











    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f814759%2fwhere-can-i-find-a-metronome-for-music-practice%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    5 Answers
    5






    active

    oldest

    votes








    5 Answers
    5






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    19





    +200









    As mentioned in a comment, I couldn't get the mentioned metronomes (existing for Linux/Ubuntu) working on 16.04, at least not out of the box. I didn't spend much time in getting it to work, since practically all of them give the impression to be abandoned.



    Time to write one...





    This answer (work in progress) should eventually lead to a metronome, including GUI. A good time to mention possible features you'd like.



    1. CLI metronome



    Creating a straightforward metronome turns out to be shockingly simple:



    #!/usr/bin/env python3
    import subprocess
    import sys
    import time

    bpm = int(sys.argv[1])
    pauze = 60/bpm

    while True:
    time.sleep(pauze)
    subprocess.Popen(["ogg123", "/usr/share/sounds/ubuntu/stereo/bell.ogg"])


    How to use





    1. The metronome needs vorbis-tools, to play the sound



      sudo apt-get install vorbis-tools


    2. Copy the script above into an empty file, save it as metronome.py


    3. Run it with the bpm as argument:



      python3 /path/to/metronome.py <bpm>


      e.g.:



      python3 /path/to/metronome.py 100


      To run it with 100 beats per minute




    Note



    For the sound, I used the file /usr/share/sounds/ubuntu/stereo/bell.ogg, which should be on your system by default (tested 14.04/16.04). You can however use any (.ogg) sample you like. In the final version, A number of options (sounds) will be available.





    2. Shockingly simple GUI version



    As a next step, a very basic version, the last version without an installer:



    enter image description here



    The script



    #!/usr/bin/env python3
    import gi
    gi.require_version('Gtk', '3.0')
    from gi.repository import Gtk
    import sys
    import subprocess
    import time
    from threading import Thread
    import os

    path = os.path.dirname(os.path.realpath(__file__))

    class MetroWindow(Gtk.Window):
    def __init__(self):
    Gtk.Window.__init__(self, title="Shockingly simple Metronome")
    self.speed = 70
    self.run = False
    # maingrid
    maingrid = Gtk.Grid()
    maingrid.set_column_homogeneous(True)
    maingrid.set_row_homogeneous(False)
    maingrid.set_border_width(30)
    self.add(maingrid)
    # icon
    image = Gtk.Image(xalign=0)
    image.set_from_file(os.path.join(path, "icon.png"))
    maingrid.attach(image, 0, 0, 1, 1)
    # vertical slider, initial value, min, max, step, page, psize
    self.v_scale = Gtk.Scale(
    orientation=Gtk.Orientation.VERTICAL,
    adjustment=Gtk.Adjustment.new(self.speed, 10, 240, 1, 0, 0)
    )
    self.v_scale.set_vexpand(True)
    self.v_scale.set_digits(0)
    self.v_scale.connect("value-changed", self.scale_moved)
    maingrid.attach(self.v_scale, 1, 0, 2, 1)

    self.togglebutton = Gtk.Button("_Run", use_underline=True)
    self.togglebutton.connect("clicked", self.time_out)
    self.togglebutton.set_size_request(70,20)
    maingrid.attach(self.togglebutton, 3, 3, 1, 1)

    # start the thread
    self.update = Thread(target=self.run_metro, args=)
    self.update.setDaemon(True)
    self.update.start()

    def scale_moved(self, event):
    self.speed = int(self.v_scale.get_value())

    def time_out(self, *args):
    if self.run == True:
    self.run = False
    self.togglebutton.set_label("Run")
    else:
    self.run = True
    self.togglebutton.set_label("Pauze")

    def pauze(self):
    return 60/self.speed

    def run_metro(self):
    soundfile = "/usr/share/sounds/ubuntu/stereo/bell.ogg"
    while True:
    if self.run == True:
    subprocess.Popen([
    "ogg123", soundfile
    ])
    time.sleep(self.pauze())

    def run_gui():
    window = MetroWindow()
    window.connect("delete-event", Gtk.main_quit)
    window.set_resizable(False)
    window.show_all()
    Gtk.main()

    run_gui()


    The image



    enter image description here



    How to use





    1. Like the cli version, this one needs vorbis-tools:



      sudo apt-get install vorbis-tools


    2. Copy the script into an empty file, save it as metro.py


    3. Right- click on the image above, save it In one and the same directory as the script (exactly) as: icon.png.


    4. Simply run the metronome by the command:



      python3 /path/to/metro.py





    3. PPA for the Orange Metronome



    It is done!



    The metronome is ready for installation.

    The Orange Metronome comes with a set of different sounds to choose from, and the beats can be grouped. All changes are applied immediately on the running metronome:



    enter image description here



    enter image description here



    enter image description here



    To install:



    sudo apt-add-repository ppa:vlijm/orangemetronome
    sudo apt-get update
    sudo apt-get install orangemetronome


    Work to do




    • Currently, the metronome comes with four different sounds to choose from. Probably a few will be added in the next few days, some of them will be replaced/updated


    • On the longer term

      For the longer term, I am thinking of adding the option for (custom) complex structures like 3+3+2, 2+2+2+3 etc., which I always missed in existing metronomes.



    Finally



    The latest (current) version 0.5.3 adds a number of sounds, but more importantly, the option to run irregular (composite) beats. In this version, they are hard coded. Will be customizable from version > 1.



    enter image description here






    share|improve this answer


























    • @Parto cool, I will continue on this. What is your Ubuntu version btw?

      – Jacob Vlijm
      Aug 21 '16 at 9:35











    • Cool, will be here. Ubuntu version: 14.04.

      – Parto
      Aug 21 '16 at 9:37











    • @Parto ...and the first gui version...

      – Jacob Vlijm
      Aug 21 '16 at 13:56






    • 1





      I will give you the +15 for the correct answer but +100 to Nick to get him to over 2K rep.

      – Parto
      Aug 22 '16 at 8:52






    • 1





      @Parto absolutely! Might take a day or two, I would like to build in a few options.

      – Jacob Vlijm
      Aug 22 '16 at 8:52
















    19





    +200









    As mentioned in a comment, I couldn't get the mentioned metronomes (existing for Linux/Ubuntu) working on 16.04, at least not out of the box. I didn't spend much time in getting it to work, since practically all of them give the impression to be abandoned.



    Time to write one...





    This answer (work in progress) should eventually lead to a metronome, including GUI. A good time to mention possible features you'd like.



    1. CLI metronome



    Creating a straightforward metronome turns out to be shockingly simple:



    #!/usr/bin/env python3
    import subprocess
    import sys
    import time

    bpm = int(sys.argv[1])
    pauze = 60/bpm

    while True:
    time.sleep(pauze)
    subprocess.Popen(["ogg123", "/usr/share/sounds/ubuntu/stereo/bell.ogg"])


    How to use





    1. The metronome needs vorbis-tools, to play the sound



      sudo apt-get install vorbis-tools


    2. Copy the script above into an empty file, save it as metronome.py


    3. Run it with the bpm as argument:



      python3 /path/to/metronome.py <bpm>


      e.g.:



      python3 /path/to/metronome.py 100


      To run it with 100 beats per minute




    Note



    For the sound, I used the file /usr/share/sounds/ubuntu/stereo/bell.ogg, which should be on your system by default (tested 14.04/16.04). You can however use any (.ogg) sample you like. In the final version, A number of options (sounds) will be available.





    2. Shockingly simple GUI version



    As a next step, a very basic version, the last version without an installer:



    enter image description here



    The script



    #!/usr/bin/env python3
    import gi
    gi.require_version('Gtk', '3.0')
    from gi.repository import Gtk
    import sys
    import subprocess
    import time
    from threading import Thread
    import os

    path = os.path.dirname(os.path.realpath(__file__))

    class MetroWindow(Gtk.Window):
    def __init__(self):
    Gtk.Window.__init__(self, title="Shockingly simple Metronome")
    self.speed = 70
    self.run = False
    # maingrid
    maingrid = Gtk.Grid()
    maingrid.set_column_homogeneous(True)
    maingrid.set_row_homogeneous(False)
    maingrid.set_border_width(30)
    self.add(maingrid)
    # icon
    image = Gtk.Image(xalign=0)
    image.set_from_file(os.path.join(path, "icon.png"))
    maingrid.attach(image, 0, 0, 1, 1)
    # vertical slider, initial value, min, max, step, page, psize
    self.v_scale = Gtk.Scale(
    orientation=Gtk.Orientation.VERTICAL,
    adjustment=Gtk.Adjustment.new(self.speed, 10, 240, 1, 0, 0)
    )
    self.v_scale.set_vexpand(True)
    self.v_scale.set_digits(0)
    self.v_scale.connect("value-changed", self.scale_moved)
    maingrid.attach(self.v_scale, 1, 0, 2, 1)

    self.togglebutton = Gtk.Button("_Run", use_underline=True)
    self.togglebutton.connect("clicked", self.time_out)
    self.togglebutton.set_size_request(70,20)
    maingrid.attach(self.togglebutton, 3, 3, 1, 1)

    # start the thread
    self.update = Thread(target=self.run_metro, args=)
    self.update.setDaemon(True)
    self.update.start()

    def scale_moved(self, event):
    self.speed = int(self.v_scale.get_value())

    def time_out(self, *args):
    if self.run == True:
    self.run = False
    self.togglebutton.set_label("Run")
    else:
    self.run = True
    self.togglebutton.set_label("Pauze")

    def pauze(self):
    return 60/self.speed

    def run_metro(self):
    soundfile = "/usr/share/sounds/ubuntu/stereo/bell.ogg"
    while True:
    if self.run == True:
    subprocess.Popen([
    "ogg123", soundfile
    ])
    time.sleep(self.pauze())

    def run_gui():
    window = MetroWindow()
    window.connect("delete-event", Gtk.main_quit)
    window.set_resizable(False)
    window.show_all()
    Gtk.main()

    run_gui()


    The image



    enter image description here



    How to use





    1. Like the cli version, this one needs vorbis-tools:



      sudo apt-get install vorbis-tools


    2. Copy the script into an empty file, save it as metro.py


    3. Right- click on the image above, save it In one and the same directory as the script (exactly) as: icon.png.


    4. Simply run the metronome by the command:



      python3 /path/to/metro.py





    3. PPA for the Orange Metronome



    It is done!



    The metronome is ready for installation.

    The Orange Metronome comes with a set of different sounds to choose from, and the beats can be grouped. All changes are applied immediately on the running metronome:



    enter image description here



    enter image description here



    enter image description here



    To install:



    sudo apt-add-repository ppa:vlijm/orangemetronome
    sudo apt-get update
    sudo apt-get install orangemetronome


    Work to do




    • Currently, the metronome comes with four different sounds to choose from. Probably a few will be added in the next few days, some of them will be replaced/updated


    • On the longer term

      For the longer term, I am thinking of adding the option for (custom) complex structures like 3+3+2, 2+2+2+3 etc., which I always missed in existing metronomes.



    Finally



    The latest (current) version 0.5.3 adds a number of sounds, but more importantly, the option to run irregular (composite) beats. In this version, they are hard coded. Will be customizable from version > 1.



    enter image description here






    share|improve this answer


























    • @Parto cool, I will continue on this. What is your Ubuntu version btw?

      – Jacob Vlijm
      Aug 21 '16 at 9:35











    • Cool, will be here. Ubuntu version: 14.04.

      – Parto
      Aug 21 '16 at 9:37











    • @Parto ...and the first gui version...

      – Jacob Vlijm
      Aug 21 '16 at 13:56






    • 1





      I will give you the +15 for the correct answer but +100 to Nick to get him to over 2K rep.

      – Parto
      Aug 22 '16 at 8:52






    • 1





      @Parto absolutely! Might take a day or two, I would like to build in a few options.

      – Jacob Vlijm
      Aug 22 '16 at 8:52














    19





    +200







    19





    +200



    19




    +200





    As mentioned in a comment, I couldn't get the mentioned metronomes (existing for Linux/Ubuntu) working on 16.04, at least not out of the box. I didn't spend much time in getting it to work, since practically all of them give the impression to be abandoned.



    Time to write one...





    This answer (work in progress) should eventually lead to a metronome, including GUI. A good time to mention possible features you'd like.



    1. CLI metronome



    Creating a straightforward metronome turns out to be shockingly simple:



    #!/usr/bin/env python3
    import subprocess
    import sys
    import time

    bpm = int(sys.argv[1])
    pauze = 60/bpm

    while True:
    time.sleep(pauze)
    subprocess.Popen(["ogg123", "/usr/share/sounds/ubuntu/stereo/bell.ogg"])


    How to use





    1. The metronome needs vorbis-tools, to play the sound



      sudo apt-get install vorbis-tools


    2. Copy the script above into an empty file, save it as metronome.py


    3. Run it with the bpm as argument:



      python3 /path/to/metronome.py <bpm>


      e.g.:



      python3 /path/to/metronome.py 100


      To run it with 100 beats per minute




    Note



    For the sound, I used the file /usr/share/sounds/ubuntu/stereo/bell.ogg, which should be on your system by default (tested 14.04/16.04). You can however use any (.ogg) sample you like. In the final version, A number of options (sounds) will be available.





    2. Shockingly simple GUI version



    As a next step, a very basic version, the last version without an installer:



    enter image description here



    The script



    #!/usr/bin/env python3
    import gi
    gi.require_version('Gtk', '3.0')
    from gi.repository import Gtk
    import sys
    import subprocess
    import time
    from threading import Thread
    import os

    path = os.path.dirname(os.path.realpath(__file__))

    class MetroWindow(Gtk.Window):
    def __init__(self):
    Gtk.Window.__init__(self, title="Shockingly simple Metronome")
    self.speed = 70
    self.run = False
    # maingrid
    maingrid = Gtk.Grid()
    maingrid.set_column_homogeneous(True)
    maingrid.set_row_homogeneous(False)
    maingrid.set_border_width(30)
    self.add(maingrid)
    # icon
    image = Gtk.Image(xalign=0)
    image.set_from_file(os.path.join(path, "icon.png"))
    maingrid.attach(image, 0, 0, 1, 1)
    # vertical slider, initial value, min, max, step, page, psize
    self.v_scale = Gtk.Scale(
    orientation=Gtk.Orientation.VERTICAL,
    adjustment=Gtk.Adjustment.new(self.speed, 10, 240, 1, 0, 0)
    )
    self.v_scale.set_vexpand(True)
    self.v_scale.set_digits(0)
    self.v_scale.connect("value-changed", self.scale_moved)
    maingrid.attach(self.v_scale, 1, 0, 2, 1)

    self.togglebutton = Gtk.Button("_Run", use_underline=True)
    self.togglebutton.connect("clicked", self.time_out)
    self.togglebutton.set_size_request(70,20)
    maingrid.attach(self.togglebutton, 3, 3, 1, 1)

    # start the thread
    self.update = Thread(target=self.run_metro, args=)
    self.update.setDaemon(True)
    self.update.start()

    def scale_moved(self, event):
    self.speed = int(self.v_scale.get_value())

    def time_out(self, *args):
    if self.run == True:
    self.run = False
    self.togglebutton.set_label("Run")
    else:
    self.run = True
    self.togglebutton.set_label("Pauze")

    def pauze(self):
    return 60/self.speed

    def run_metro(self):
    soundfile = "/usr/share/sounds/ubuntu/stereo/bell.ogg"
    while True:
    if self.run == True:
    subprocess.Popen([
    "ogg123", soundfile
    ])
    time.sleep(self.pauze())

    def run_gui():
    window = MetroWindow()
    window.connect("delete-event", Gtk.main_quit)
    window.set_resizable(False)
    window.show_all()
    Gtk.main()

    run_gui()


    The image



    enter image description here



    How to use





    1. Like the cli version, this one needs vorbis-tools:



      sudo apt-get install vorbis-tools


    2. Copy the script into an empty file, save it as metro.py


    3. Right- click on the image above, save it In one and the same directory as the script (exactly) as: icon.png.


    4. Simply run the metronome by the command:



      python3 /path/to/metro.py





    3. PPA for the Orange Metronome



    It is done!



    The metronome is ready for installation.

    The Orange Metronome comes with a set of different sounds to choose from, and the beats can be grouped. All changes are applied immediately on the running metronome:



    enter image description here



    enter image description here



    enter image description here



    To install:



    sudo apt-add-repository ppa:vlijm/orangemetronome
    sudo apt-get update
    sudo apt-get install orangemetronome


    Work to do




    • Currently, the metronome comes with four different sounds to choose from. Probably a few will be added in the next few days, some of them will be replaced/updated


    • On the longer term

      For the longer term, I am thinking of adding the option for (custom) complex structures like 3+3+2, 2+2+2+3 etc., which I always missed in existing metronomes.



    Finally



    The latest (current) version 0.5.3 adds a number of sounds, but more importantly, the option to run irregular (composite) beats. In this version, they are hard coded. Will be customizable from version > 1.



    enter image description here






    share|improve this answer















    As mentioned in a comment, I couldn't get the mentioned metronomes (existing for Linux/Ubuntu) working on 16.04, at least not out of the box. I didn't spend much time in getting it to work, since practically all of them give the impression to be abandoned.



    Time to write one...





    This answer (work in progress) should eventually lead to a metronome, including GUI. A good time to mention possible features you'd like.



    1. CLI metronome



    Creating a straightforward metronome turns out to be shockingly simple:



    #!/usr/bin/env python3
    import subprocess
    import sys
    import time

    bpm = int(sys.argv[1])
    pauze = 60/bpm

    while True:
    time.sleep(pauze)
    subprocess.Popen(["ogg123", "/usr/share/sounds/ubuntu/stereo/bell.ogg"])


    How to use





    1. The metronome needs vorbis-tools, to play the sound



      sudo apt-get install vorbis-tools


    2. Copy the script above into an empty file, save it as metronome.py


    3. Run it with the bpm as argument:



      python3 /path/to/metronome.py <bpm>


      e.g.:



      python3 /path/to/metronome.py 100


      To run it with 100 beats per minute




    Note



    For the sound, I used the file /usr/share/sounds/ubuntu/stereo/bell.ogg, which should be on your system by default (tested 14.04/16.04). You can however use any (.ogg) sample you like. In the final version, A number of options (sounds) will be available.





    2. Shockingly simple GUI version



    As a next step, a very basic version, the last version without an installer:



    enter image description here



    The script



    #!/usr/bin/env python3
    import gi
    gi.require_version('Gtk', '3.0')
    from gi.repository import Gtk
    import sys
    import subprocess
    import time
    from threading import Thread
    import os

    path = os.path.dirname(os.path.realpath(__file__))

    class MetroWindow(Gtk.Window):
    def __init__(self):
    Gtk.Window.__init__(self, title="Shockingly simple Metronome")
    self.speed = 70
    self.run = False
    # maingrid
    maingrid = Gtk.Grid()
    maingrid.set_column_homogeneous(True)
    maingrid.set_row_homogeneous(False)
    maingrid.set_border_width(30)
    self.add(maingrid)
    # icon
    image = Gtk.Image(xalign=0)
    image.set_from_file(os.path.join(path, "icon.png"))
    maingrid.attach(image, 0, 0, 1, 1)
    # vertical slider, initial value, min, max, step, page, psize
    self.v_scale = Gtk.Scale(
    orientation=Gtk.Orientation.VERTICAL,
    adjustment=Gtk.Adjustment.new(self.speed, 10, 240, 1, 0, 0)
    )
    self.v_scale.set_vexpand(True)
    self.v_scale.set_digits(0)
    self.v_scale.connect("value-changed", self.scale_moved)
    maingrid.attach(self.v_scale, 1, 0, 2, 1)

    self.togglebutton = Gtk.Button("_Run", use_underline=True)
    self.togglebutton.connect("clicked", self.time_out)
    self.togglebutton.set_size_request(70,20)
    maingrid.attach(self.togglebutton, 3, 3, 1, 1)

    # start the thread
    self.update = Thread(target=self.run_metro, args=)
    self.update.setDaemon(True)
    self.update.start()

    def scale_moved(self, event):
    self.speed = int(self.v_scale.get_value())

    def time_out(self, *args):
    if self.run == True:
    self.run = False
    self.togglebutton.set_label("Run")
    else:
    self.run = True
    self.togglebutton.set_label("Pauze")

    def pauze(self):
    return 60/self.speed

    def run_metro(self):
    soundfile = "/usr/share/sounds/ubuntu/stereo/bell.ogg"
    while True:
    if self.run == True:
    subprocess.Popen([
    "ogg123", soundfile
    ])
    time.sleep(self.pauze())

    def run_gui():
    window = MetroWindow()
    window.connect("delete-event", Gtk.main_quit)
    window.set_resizable(False)
    window.show_all()
    Gtk.main()

    run_gui()


    The image



    enter image description here



    How to use





    1. Like the cli version, this one needs vorbis-tools:



      sudo apt-get install vorbis-tools


    2. Copy the script into an empty file, save it as metro.py


    3. Right- click on the image above, save it In one and the same directory as the script (exactly) as: icon.png.


    4. Simply run the metronome by the command:



      python3 /path/to/metro.py





    3. PPA for the Orange Metronome



    It is done!



    The metronome is ready for installation.

    The Orange Metronome comes with a set of different sounds to choose from, and the beats can be grouped. All changes are applied immediately on the running metronome:



    enter image description here



    enter image description here



    enter image description here



    To install:



    sudo apt-add-repository ppa:vlijm/orangemetronome
    sudo apt-get update
    sudo apt-get install orangemetronome


    Work to do




    • Currently, the metronome comes with four different sounds to choose from. Probably a few will be added in the next few days, some of them will be replaced/updated


    • On the longer term

      For the longer term, I am thinking of adding the option for (custom) complex structures like 3+3+2, 2+2+2+3 etc., which I always missed in existing metronomes.



    Finally



    The latest (current) version 0.5.3 adds a number of sounds, but more importantly, the option to run irregular (composite) beats. In this version, they are hard coded. Will be customizable from version > 1.



    enter image description here







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Aug 27 '16 at 13:07

























    answered Aug 21 '16 at 8:42









    Jacob VlijmJacob Vlijm

    64.7k9129224




    64.7k9129224













    • @Parto cool, I will continue on this. What is your Ubuntu version btw?

      – Jacob Vlijm
      Aug 21 '16 at 9:35











    • Cool, will be here. Ubuntu version: 14.04.

      – Parto
      Aug 21 '16 at 9:37











    • @Parto ...and the first gui version...

      – Jacob Vlijm
      Aug 21 '16 at 13:56






    • 1





      I will give you the +15 for the correct answer but +100 to Nick to get him to over 2K rep.

      – Parto
      Aug 22 '16 at 8:52






    • 1





      @Parto absolutely! Might take a day or two, I would like to build in a few options.

      – Jacob Vlijm
      Aug 22 '16 at 8:52



















    • @Parto cool, I will continue on this. What is your Ubuntu version btw?

      – Jacob Vlijm
      Aug 21 '16 at 9:35











    • Cool, will be here. Ubuntu version: 14.04.

      – Parto
      Aug 21 '16 at 9:37











    • @Parto ...and the first gui version...

      – Jacob Vlijm
      Aug 21 '16 at 13:56






    • 1





      I will give you the +15 for the correct answer but +100 to Nick to get him to over 2K rep.

      – Parto
      Aug 22 '16 at 8:52






    • 1





      @Parto absolutely! Might take a day or two, I would like to build in a few options.

      – Jacob Vlijm
      Aug 22 '16 at 8:52

















    @Parto cool, I will continue on this. What is your Ubuntu version btw?

    – Jacob Vlijm
    Aug 21 '16 at 9:35





    @Parto cool, I will continue on this. What is your Ubuntu version btw?

    – Jacob Vlijm
    Aug 21 '16 at 9:35













    Cool, will be here. Ubuntu version: 14.04.

    – Parto
    Aug 21 '16 at 9:37





    Cool, will be here. Ubuntu version: 14.04.

    – Parto
    Aug 21 '16 at 9:37













    @Parto ...and the first gui version...

    – Jacob Vlijm
    Aug 21 '16 at 13:56





    @Parto ...and the first gui version...

    – Jacob Vlijm
    Aug 21 '16 at 13:56




    1




    1





    I will give you the +15 for the correct answer but +100 to Nick to get him to over 2K rep.

    – Parto
    Aug 22 '16 at 8:52





    I will give you the +15 for the correct answer but +100 to Nick to get him to over 2K rep.

    – Parto
    Aug 22 '16 at 8:52




    1




    1





    @Parto absolutely! Might take a day or two, I would like to build in a few options.

    – Jacob Vlijm
    Aug 22 '16 at 8:52





    @Parto absolutely! Might take a day or two, I would like to build in a few options.

    – Jacob Vlijm
    Aug 22 '16 at 8:52













    9





    +100









    It sounds like you're looking for a metronome!



    The audio-editing software Audacity can generate a steady, metronome-like beat or tone (look under the "Generate" menu), though there are simpler programs that I'll list below. Audacity is in the Ubuntu software repositories and can be installed through the Software Center or by typing sudo apt install audacity in a terminal window.



    Online metronomes are plentiful, if you plan on having internet access during your practice.



    Other metronome software available in the Ubuntu software repositories includes gtick, klick, gtklick, and kmetronome, though I haven't tried any of them myself.






    share|improve this answer




























      9





      +100









      It sounds like you're looking for a metronome!



      The audio-editing software Audacity can generate a steady, metronome-like beat or tone (look under the "Generate" menu), though there are simpler programs that I'll list below. Audacity is in the Ubuntu software repositories and can be installed through the Software Center or by typing sudo apt install audacity in a terminal window.



      Online metronomes are plentiful, if you plan on having internet access during your practice.



      Other metronome software available in the Ubuntu software repositories includes gtick, klick, gtklick, and kmetronome, though I haven't tried any of them myself.






      share|improve this answer


























        9





        +100







        9





        +100



        9




        +100





        It sounds like you're looking for a metronome!



        The audio-editing software Audacity can generate a steady, metronome-like beat or tone (look under the "Generate" menu), though there are simpler programs that I'll list below. Audacity is in the Ubuntu software repositories and can be installed through the Software Center or by typing sudo apt install audacity in a terminal window.



        Online metronomes are plentiful, if you plan on having internet access during your practice.



        Other metronome software available in the Ubuntu software repositories includes gtick, klick, gtklick, and kmetronome, though I haven't tried any of them myself.






        share|improve this answer













        It sounds like you're looking for a metronome!



        The audio-editing software Audacity can generate a steady, metronome-like beat or tone (look under the "Generate" menu), though there are simpler programs that I'll list below. Audacity is in the Ubuntu software repositories and can be installed through the Software Center or by typing sudo apt install audacity in a terminal window.



        Online metronomes are plentiful, if you plan on having internet access during your practice.



        Other metronome software available in the Ubuntu software repositories includes gtick, klick, gtklick, and kmetronome, though I haven't tried any of them myself.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 21 '16 at 3:05









        Nick WeinbergNick Weinberg

        3,53841827




        3,53841827























            8














            Simple Bash metronome



            Usage



            metronome.sh [beats per minute] [beats per measure]


            Info




            • It plays at 120 bpm in 4 by default

            • More info and a much more sophisticated script is available on my GitHub repo: metronome.sh. The below script is there under metronome-core.sh


            For example



            metronome.sh
            metronome.sh 75 # 75 BPM
            metronome.sh 120 3 # 120 BPM, 3 beats per measure


            Script



            #!/bin/bash
            # metronome.sh - Is a metronome.
            # Usage: metronome.sh [beats per minute] [beats per measure]

            # Set BPM and beats per measure.
            bpm="${1-120}"
            msr="${2-4}"

            # Get seconds per beat using bc.
            # "-0.004" accounts for approximate execution time.
            beat_time="$(bc -l <<< "scale=5; 60/$bpm-0.004")"

            echo "Metronome playing $bpm BPM, $msr beats per measure"
            echo -n "Press Ctrl+C to quit."

            while true; do
            for ((i=1; i<=$msr; i++)); do
            if [[ $i -eq 1 ]]; then
            # Accentuated beat.
            canberra-gtk-play --id='dialog-information' &
            else
            # Unaccentuated beat
            canberra-gtk-play --id='button-toggle-on' &
            fi
            # Wait before next beat. Will exit if beat time is invalid.
            sleep "$beat_time" || exit
            done
            done





            share|improve this answer


























            • Awesome one too. Tried it out.

              – Parto
              Aug 24 '16 at 8:38











            • Failed to play, sound is disabled. Error

              – Mark Deven
              Feb 5 at 19:33











            • @Mark Seems like you need to enable sound :p

              – wjandrea
              Feb 5 at 19:35













            • :) yes but how does one do that

              – Mark Deven
              Feb 5 at 19:36











            • @Mark IDK, but you can ask a new question

              – wjandrea
              Feb 5 at 19:36
















            8














            Simple Bash metronome



            Usage



            metronome.sh [beats per minute] [beats per measure]


            Info




            • It plays at 120 bpm in 4 by default

            • More info and a much more sophisticated script is available on my GitHub repo: metronome.sh. The below script is there under metronome-core.sh


            For example



            metronome.sh
            metronome.sh 75 # 75 BPM
            metronome.sh 120 3 # 120 BPM, 3 beats per measure


            Script



            #!/bin/bash
            # metronome.sh - Is a metronome.
            # Usage: metronome.sh [beats per minute] [beats per measure]

            # Set BPM and beats per measure.
            bpm="${1-120}"
            msr="${2-4}"

            # Get seconds per beat using bc.
            # "-0.004" accounts for approximate execution time.
            beat_time="$(bc -l <<< "scale=5; 60/$bpm-0.004")"

            echo "Metronome playing $bpm BPM, $msr beats per measure"
            echo -n "Press Ctrl+C to quit."

            while true; do
            for ((i=1; i<=$msr; i++)); do
            if [[ $i -eq 1 ]]; then
            # Accentuated beat.
            canberra-gtk-play --id='dialog-information' &
            else
            # Unaccentuated beat
            canberra-gtk-play --id='button-toggle-on' &
            fi
            # Wait before next beat. Will exit if beat time is invalid.
            sleep "$beat_time" || exit
            done
            done





            share|improve this answer


























            • Awesome one too. Tried it out.

              – Parto
              Aug 24 '16 at 8:38











            • Failed to play, sound is disabled. Error

              – Mark Deven
              Feb 5 at 19:33











            • @Mark Seems like you need to enable sound :p

              – wjandrea
              Feb 5 at 19:35













            • :) yes but how does one do that

              – Mark Deven
              Feb 5 at 19:36











            • @Mark IDK, but you can ask a new question

              – wjandrea
              Feb 5 at 19:36














            8












            8








            8







            Simple Bash metronome



            Usage



            metronome.sh [beats per minute] [beats per measure]


            Info




            • It plays at 120 bpm in 4 by default

            • More info and a much more sophisticated script is available on my GitHub repo: metronome.sh. The below script is there under metronome-core.sh


            For example



            metronome.sh
            metronome.sh 75 # 75 BPM
            metronome.sh 120 3 # 120 BPM, 3 beats per measure


            Script



            #!/bin/bash
            # metronome.sh - Is a metronome.
            # Usage: metronome.sh [beats per minute] [beats per measure]

            # Set BPM and beats per measure.
            bpm="${1-120}"
            msr="${2-4}"

            # Get seconds per beat using bc.
            # "-0.004" accounts for approximate execution time.
            beat_time="$(bc -l <<< "scale=5; 60/$bpm-0.004")"

            echo "Metronome playing $bpm BPM, $msr beats per measure"
            echo -n "Press Ctrl+C to quit."

            while true; do
            for ((i=1; i<=$msr; i++)); do
            if [[ $i -eq 1 ]]; then
            # Accentuated beat.
            canberra-gtk-play --id='dialog-information' &
            else
            # Unaccentuated beat
            canberra-gtk-play --id='button-toggle-on' &
            fi
            # Wait before next beat. Will exit if beat time is invalid.
            sleep "$beat_time" || exit
            done
            done





            share|improve this answer















            Simple Bash metronome



            Usage



            metronome.sh [beats per minute] [beats per measure]


            Info




            • It plays at 120 bpm in 4 by default

            • More info and a much more sophisticated script is available on my GitHub repo: metronome.sh. The below script is there under metronome-core.sh


            For example



            metronome.sh
            metronome.sh 75 # 75 BPM
            metronome.sh 120 3 # 120 BPM, 3 beats per measure


            Script



            #!/bin/bash
            # metronome.sh - Is a metronome.
            # Usage: metronome.sh [beats per minute] [beats per measure]

            # Set BPM and beats per measure.
            bpm="${1-120}"
            msr="${2-4}"

            # Get seconds per beat using bc.
            # "-0.004" accounts for approximate execution time.
            beat_time="$(bc -l <<< "scale=5; 60/$bpm-0.004")"

            echo "Metronome playing $bpm BPM, $msr beats per measure"
            echo -n "Press Ctrl+C to quit."

            while true; do
            for ((i=1; i<=$msr; i++)); do
            if [[ $i -eq 1 ]]; then
            # Accentuated beat.
            canberra-gtk-play --id='dialog-information' &
            else
            # Unaccentuated beat
            canberra-gtk-play --id='button-toggle-on' &
            fi
            # Wait before next beat. Will exit if beat time is invalid.
            sleep "$beat_time" || exit
            done
            done






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Feb 6 at 23:50

























            answered Aug 21 '16 at 16:55









            wjandreawjandrea

            9,27942664




            9,27942664













            • Awesome one too. Tried it out.

              – Parto
              Aug 24 '16 at 8:38











            • Failed to play, sound is disabled. Error

              – Mark Deven
              Feb 5 at 19:33











            • @Mark Seems like you need to enable sound :p

              – wjandrea
              Feb 5 at 19:35













            • :) yes but how does one do that

              – Mark Deven
              Feb 5 at 19:36











            • @Mark IDK, but you can ask a new question

              – wjandrea
              Feb 5 at 19:36



















            • Awesome one too. Tried it out.

              – Parto
              Aug 24 '16 at 8:38











            • Failed to play, sound is disabled. Error

              – Mark Deven
              Feb 5 at 19:33











            • @Mark Seems like you need to enable sound :p

              – wjandrea
              Feb 5 at 19:35













            • :) yes but how does one do that

              – Mark Deven
              Feb 5 at 19:36











            • @Mark IDK, but you can ask a new question

              – wjandrea
              Feb 5 at 19:36

















            Awesome one too. Tried it out.

            – Parto
            Aug 24 '16 at 8:38





            Awesome one too. Tried it out.

            – Parto
            Aug 24 '16 at 8:38













            Failed to play, sound is disabled. Error

            – Mark Deven
            Feb 5 at 19:33





            Failed to play, sound is disabled. Error

            – Mark Deven
            Feb 5 at 19:33













            @Mark Seems like you need to enable sound :p

            – wjandrea
            Feb 5 at 19:35







            @Mark Seems like you need to enable sound :p

            – wjandrea
            Feb 5 at 19:35















            :) yes but how does one do that

            – Mark Deven
            Feb 5 at 19:36





            :) yes but how does one do that

            – Mark Deven
            Feb 5 at 19:36













            @Mark IDK, but you can ask a new question

            – wjandrea
            Feb 5 at 19:36





            @Mark IDK, but you can ask a new question

            – wjandrea
            Feb 5 at 19:36











            1














            i play the Guitar and i use gtick, it works pretty well for me, i can adjust the beats per minute, volume and even time signatures, 1/4,2/4,3/4, and so on.
            you can install it from the command line using:



            sudo apt-get install gtick


            heres my gtick: i.imgsafe.org/f2dc6c70f2.png






            share|improve this answer


























            • Already mentioned by Nick. Also doesn't work on my system (Ubuntu Unity 16.04).

              – Jacob Vlijm
              Aug 24 '16 at 9:30











            • I know its mentioned by Nick, but i have used gtick myself, he has not, as he mentioned. I use Ubuntu 16.04 LTS and it works for me, are you missing some missing audio dependencies or so?

              – Abel Tom
              Aug 24 '16 at 9:42











            • See this: dl.dropboxusercontent.com/u/1155139/error.png happens no matter the settings etc., on multiple systems. Read something about it, had it running with tricks in the past, don't remember what it was. Don't want to remember. It should simply work. If something like this is not fixed after years, I prefer to write my own stuff.

              – Jacob Vlijm
              Aug 24 '16 at 21:55













            • im sorry it did not work for you, heres my gtick: i.imgsafe.org/f2dc6c70f2.png

              – Abel Tom
              Aug 25 '16 at 17:42
















            1














            i play the Guitar and i use gtick, it works pretty well for me, i can adjust the beats per minute, volume and even time signatures, 1/4,2/4,3/4, and so on.
            you can install it from the command line using:



            sudo apt-get install gtick


            heres my gtick: i.imgsafe.org/f2dc6c70f2.png






            share|improve this answer


























            • Already mentioned by Nick. Also doesn't work on my system (Ubuntu Unity 16.04).

              – Jacob Vlijm
              Aug 24 '16 at 9:30











            • I know its mentioned by Nick, but i have used gtick myself, he has not, as he mentioned. I use Ubuntu 16.04 LTS and it works for me, are you missing some missing audio dependencies or so?

              – Abel Tom
              Aug 24 '16 at 9:42











            • See this: dl.dropboxusercontent.com/u/1155139/error.png happens no matter the settings etc., on multiple systems. Read something about it, had it running with tricks in the past, don't remember what it was. Don't want to remember. It should simply work. If something like this is not fixed after years, I prefer to write my own stuff.

              – Jacob Vlijm
              Aug 24 '16 at 21:55













            • im sorry it did not work for you, heres my gtick: i.imgsafe.org/f2dc6c70f2.png

              – Abel Tom
              Aug 25 '16 at 17:42














            1












            1








            1







            i play the Guitar and i use gtick, it works pretty well for me, i can adjust the beats per minute, volume and even time signatures, 1/4,2/4,3/4, and so on.
            you can install it from the command line using:



            sudo apt-get install gtick


            heres my gtick: i.imgsafe.org/f2dc6c70f2.png






            share|improve this answer















            i play the Guitar and i use gtick, it works pretty well for me, i can adjust the beats per minute, volume and even time signatures, 1/4,2/4,3/4, and so on.
            you can install it from the command line using:



            sudo apt-get install gtick


            heres my gtick: i.imgsafe.org/f2dc6c70f2.png







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Aug 26 '16 at 7:50

























            answered Aug 24 '16 at 9:16









            Abel TomAbel Tom

            375213




            375213













            • Already mentioned by Nick. Also doesn't work on my system (Ubuntu Unity 16.04).

              – Jacob Vlijm
              Aug 24 '16 at 9:30











            • I know its mentioned by Nick, but i have used gtick myself, he has not, as he mentioned. I use Ubuntu 16.04 LTS and it works for me, are you missing some missing audio dependencies or so?

              – Abel Tom
              Aug 24 '16 at 9:42











            • See this: dl.dropboxusercontent.com/u/1155139/error.png happens no matter the settings etc., on multiple systems. Read something about it, had it running with tricks in the past, don't remember what it was. Don't want to remember. It should simply work. If something like this is not fixed after years, I prefer to write my own stuff.

              – Jacob Vlijm
              Aug 24 '16 at 21:55













            • im sorry it did not work for you, heres my gtick: i.imgsafe.org/f2dc6c70f2.png

              – Abel Tom
              Aug 25 '16 at 17:42



















            • Already mentioned by Nick. Also doesn't work on my system (Ubuntu Unity 16.04).

              – Jacob Vlijm
              Aug 24 '16 at 9:30











            • I know its mentioned by Nick, but i have used gtick myself, he has not, as he mentioned. I use Ubuntu 16.04 LTS and it works for me, are you missing some missing audio dependencies or so?

              – Abel Tom
              Aug 24 '16 at 9:42











            • See this: dl.dropboxusercontent.com/u/1155139/error.png happens no matter the settings etc., on multiple systems. Read something about it, had it running with tricks in the past, don't remember what it was. Don't want to remember. It should simply work. If something like this is not fixed after years, I prefer to write my own stuff.

              – Jacob Vlijm
              Aug 24 '16 at 21:55













            • im sorry it did not work for you, heres my gtick: i.imgsafe.org/f2dc6c70f2.png

              – Abel Tom
              Aug 25 '16 at 17:42

















            Already mentioned by Nick. Also doesn't work on my system (Ubuntu Unity 16.04).

            – Jacob Vlijm
            Aug 24 '16 at 9:30





            Already mentioned by Nick. Also doesn't work on my system (Ubuntu Unity 16.04).

            – Jacob Vlijm
            Aug 24 '16 at 9:30













            I know its mentioned by Nick, but i have used gtick myself, he has not, as he mentioned. I use Ubuntu 16.04 LTS and it works for me, are you missing some missing audio dependencies or so?

            – Abel Tom
            Aug 24 '16 at 9:42





            I know its mentioned by Nick, but i have used gtick myself, he has not, as he mentioned. I use Ubuntu 16.04 LTS and it works for me, are you missing some missing audio dependencies or so?

            – Abel Tom
            Aug 24 '16 at 9:42













            See this: dl.dropboxusercontent.com/u/1155139/error.png happens no matter the settings etc., on multiple systems. Read something about it, had it running with tricks in the past, don't remember what it was. Don't want to remember. It should simply work. If something like this is not fixed after years, I prefer to write my own stuff.

            – Jacob Vlijm
            Aug 24 '16 at 21:55







            See this: dl.dropboxusercontent.com/u/1155139/error.png happens no matter the settings etc., on multiple systems. Read something about it, had it running with tricks in the past, don't remember what it was. Don't want to remember. It should simply work. If something like this is not fixed after years, I prefer to write my own stuff.

            – Jacob Vlijm
            Aug 24 '16 at 21:55















            im sorry it did not work for you, heres my gtick: i.imgsafe.org/f2dc6c70f2.png

            – Abel Tom
            Aug 25 '16 at 17:42





            im sorry it did not work for you, heres my gtick: i.imgsafe.org/f2dc6c70f2.png

            – Abel Tom
            Aug 25 '16 at 17:42











            0














            Have you tried kmetronome? Should be able to use apt-get/synaptic.






            share|improve this answer
























            • Also already mentioned by Nick.

              – Jacob Vlijm
              Aug 25 '16 at 6:29
















            0














            Have you tried kmetronome? Should be able to use apt-get/synaptic.






            share|improve this answer
























            • Also already mentioned by Nick.

              – Jacob Vlijm
              Aug 25 '16 at 6:29














            0












            0








            0







            Have you tried kmetronome? Should be able to use apt-get/synaptic.






            share|improve this answer













            Have you tried kmetronome? Should be able to use apt-get/synaptic.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Aug 24 '16 at 23:36









            Jodamo117Jodamo117

            60111




            60111













            • Also already mentioned by Nick.

              – Jacob Vlijm
              Aug 25 '16 at 6:29



















            • Also already mentioned by Nick.

              – Jacob Vlijm
              Aug 25 '16 at 6:29

















            Also already mentioned by Nick.

            – Jacob Vlijm
            Aug 25 '16 at 6:29





            Also already mentioned by Nick.

            – Jacob Vlijm
            Aug 25 '16 at 6:29


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f814759%2fwhere-can-i-find-a-metronome-for-music-practice%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

            Mangá

            Eduardo VII do Reino Unido