UNPKG

@pedroloch/tuner

Version:

A javascript library to create a chromatic tuner that uses the ml5 pitch detection algorithm.

15 lines (14 loc) 268 B
let events = []; export const on = (callback) => { if (events) events.push(callback); else events = [callback]; }; export const trigger = (rest) => { if (events) { events.forEach((cb) => { cb(rest); }); } };