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

tone-modular

v0.6.0

Published

Special build of Tone.js that allows requiring of individual components and avoids the global AudioContext. This make it much more browserify friendly and easier to use with existing code or other libraries.

Downloads

6

Readme

Tone.js - modular require edition

This is a special build of Yotam Mann's excellent Tone.js framework that allows requiring of individual components and avoids the global AudioContext. This make it much more browserify friendly and easier to use with existing code or other libraries.

Tone.js is a Web Audio framework for creating interactive music in the browser. The architecture of Tone.js aims to be familiar to both musicians and audio programmers looking to create web-based audio applications. On the high-level, Tone offers common DAW (digital audio workstation) features like a global transport for scheduling and timing events and prebuilt synths and effects. For signal-processing programmers (coming from languages like Max/MSP), Tone provides a wealth of high performance, low latency building blocks and DSP modules to build your own synthesizers, effects, and complex control signals.

Install via npm

$ npm install tone-modular

Documentation

Usage is same as official API, except that you require the modules you need individually instead of as one bundle. Constructors have an additional first argument where you must specify the AudioContext to use.

You must manually apply any Web Audio compatibility shims yourself, as these are not included in this build.

Global objects like Transport can be accessed by requiring and then calling .withContext(audioContext).

Example

var SimpleSynth = require('tone-modular/instrument/simple-synth')
var Sequence = require('tone-modular/event/sequence')
var Transport = require('tone-modular/core/transport')
var Freeverb = require('tone-modular/effect/freeverb')

var audioContext = new window.AudioContext()

var transport = Transport.forContext(audioContext)
transport.timeSignature = [6, 4]
transport.bpm.value = 180
transport.start()

var reverb = Freeverb(audioContext, {
  roomSize: 0.2,
  wet: 0.3
})

var output = audioContext.createGain()
output.connect(audioContext.destination)

var synth = SimpleSynth(audioContext)
synth.connect(reverb)
reverb.connect(output)

var playback = Sequence(audioContext, function (time, note) {
  synth.triggerAttackRelease(note, '8n', time)
}, ['E4', 'F#4', 'B4', 'C#5', 'D5', 'F#4', 'E4', 'C#5', 'B4', 'F#4', 'C#5', 'B4'], '8n')

playback.start()

Version

This module should track the latest version of the official Tone.js module. If it gets behind, feel welcome to send a pull request updating to latest version!

You can use rebuild.js to update all the modules from the master repo, but base.js must be manually updated from Tone/core/Tone.js