heroandtn3 / metronome

JavaScript metronome library using Web Audio API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Metronome

JavaScript metronome library using Web Audio API

See it in action: https://github.com/heroandtn3/pwa-metronome

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

  1. Clone the repo.
  2. Install the dependencies
  3. Run npm start then here you go!

License

MIT

About

JavaScript metronome library using Web Audio API


Languages

Language:HTML 53.2%Language:JavaScript 46.8%