Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A simple javascript metronome.
branch: master
Failed to load latest commit information.
lib Fixed name
src Fixed name
.gitignore Updated gitignore and homepage
Cakefile First commit First commit First commit
package.json Updated gitignore and homepage


Install with:

npm install pendulum

Simple metronome. You can include the script in your browser, or require it via Node.

Pendulum = require('pendulum').Pendulum;

In the browser, after including pendulum.js or pendulum.min.js, the Pendulum class will be available in the window object.

After that, creating a metronome is as simple as:

m = new Pendulum(80);

Where 80 is the beats-per-minute (BPM).

To start and stop the metronome:


You may also want to change the BPM:



To register a callback function, use on.

m.on(event, callback);

The start event is fired when the metronome starts. The stop event is fired when the metronome starts. The bpm event is fired after calling set. The callback function takes two parameters: the old and the new BPM values.

m.on('bpm', function(oldBPM, newBPM) {
    console.log("BPM changed from " + oldBPM + " to " + newBPM);

Finally, the tick event is fired when the metronome ticks.

m.on('tick', function() {


  • Set bpm using 'lento', 'adagio', etc.
  • Add musical meter notation ("3/4", etc) to stress different ticks
Something went wrong with that request. Please try again.