Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
var Tick = requrie("bpm-tick");
var b = new Tick(128);
b.register('beat', function (x) { console.log("bam"); });
b.register('bar' , function (x) { console.log("badam"); });
b.play();
It uses Date
so it shouldn't drift (aka. it won't fall out of tempo). It's not
guaranteed to be 100% precise on the note though.
You can register any of these:
Word key Power key Number (res. available)
sub 1/64 0
div 1/16 1
beat 1/4 2
bar 1 3
word 4 4
verse 16 5
song 64 6
Registering beat
, 1/4
, and 2
are exaclty the same thing.
Registration overwrites.
By default, resolution 2 is used. You can set your own resolution with
var b = beat(128 [, resolution]);
where resolution
is an integer from 0 to 6.
At resolution 2, only callbacks for beat
(1/4
) and longer are called. To get
sub
(1/64
) resolutions to be be called, you have to use resolution 0. (See
table above)
b.on
is an alias for b.register
.
b.devlog = true
will log numbers.
FAQs
A metronome for rhythmic callbacks
We found that bpm-tick demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.