Socket
Book a DemoInstallSign in
Socket

beepbox

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

beepbox

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

4.2.0
latest
Source
npmnpm
Version published
Weekly downloads
7
133.33%
Maintainers
2
Weekly downloads
 
Created
Source

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!

Keywords

beepbox

FAQs

Package last updated on 26 Aug 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.