musical-metronome
v0.0.3
Published
JavaScript metronome library using Web Audio API
Downloads
4
Readme
Metronome
JavaScript metronome library using Web Audio API
Installation
npm i musical-metronome
Usage
// ES Module
import { Metronome } from 'musical-metronome';
// CommonJS
const { Metronome } = require('musical-metronome');
//UMD
const Metronome = window.musicalMetronome.Metronome;
const metronome = new Metronome({ tempo: 120 });
metronome.init(); // call on user action, e.g. onClick
setInterval(() => metronome.tick(), 25);
metronome.play();
metronome.stop();
See example in public
directory.
Development
- Clone the repo.
- Install the dependencies
- Run
npm start
then here you go!