npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

beepbox

v4.2.0

Published

BeepBox is an online tool for sketching and sharing instrumental music.

Downloads

146

Readme

BeepBox

BeepBox is a music synthesizer, along with an online editor for authoring songs that you can try out at beepbox.co!

The editor stores all song data in the URL as text after the hash mark, and this song data can be easily copied and shared. You can use the code in this npm package to synthesize music out loud from this song data, just like in the editor!

BeepBox is a passion project, and will always be free to use. If you find it valuable and have the means, any gratuity via PayPal would be appreciated! BeepBox is developed by John Nesky, and this code is available under the MIT license.

Getting the synthesizer without installing anything

You can easily use a script tag to load the synthesizer code, then use the global beepbox namespace to access the synthesizer:

<script src="https://cdn.jsdelivr.net/npm/beepbox/global/beepbox_synth.min.js"></script>
<script>
	const {Synth} = beepbox;
</script>

Installing the code from npm

If you're using npm, you can use that to install the synthesizer on the command line:

npm install beepbox

And then in your code you can import the synthesizer as a module:

import {Synth} from "beepbox";

Deploying code to your website that was written in this manner is a complex subject that's outside the scope of this README, but the advantage is that you can use many advanced tools, including TypeScript.

Using the synthesizer

Either way, you can use the Synth class in your code to play and pause songs using the song data that you can copy from the URL above BeepBox's online editor:

var synth = new Synth("#9n30sbk7l00e00t2-a7g00j00r1i0o443T0v2u00f0qw02d03w2h0E0T0v2u00f0qw02d03w2h0E0T0v0u00f0qw02d03w1h0E0bUp1OFEYtghQ4sBihS7dQQuwE8W2eywzwPbGcKCzZk4t17hghQCngpo");

document.getElementById("playButton").addEventListener("click", event => {
	if (synth.isPlayingSong) {
		synth.pause();
	} else {
		synth.play();
	}
});

Make sure that the playback is triggered by a user input event, such as a "click" event.

Beepbox-Lite

The npm package called beepbox has changed. If you were using npm to access the beepbox package before 2024-09, that version of the package has moved to beepbox-lite. Please update your dependencies!