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

gibber.audio.lib

v2.1.4

Published

standalone audio library from Gibber to use in node or in HTML documents

Downloads

41

Readme

gibber.audio.lib

Gibber is an audiovisual programming library and live coding environment for the browser.

Try the playground

Building (for development)

You can simply download the repo and skip straight to the Usage section if you don't need to modify the library. If you want to modify gibber.audio.lib, here's how to build it:

  1. If you don't have it, install npm (the Node.js package manager) from [npmjs.org][].
  2. Inside the top level of the repo, run npm install in a terminal.
  3. Run gulp (gulp is the build system, it is installed in step 2).

The build outputs a UMD file, gibber.audio.js, to the dist folder.

Usage

The library can be used with plain script tags, or CommonJS-/ AMD- style includes. Below is an example HTML file which plays a simple drum beat, bass line, and random melody.

Gibber.init() returns a promise; all code should be placed in a function that will execute when the promise resolves (shown below).

<html lang='en'>

<head>
  <script src='./dist/gibber.audio.js'></script>
</head>

<body><p>click window to begin.</p></body>

<script>

  window.onclick = function() {
    Gibber.init().then( () => {

      const syn = Synth()
      syn.note.seq( [0,1], 1/4 )

      window.onclick = null
    })
  }

</script>

</html>

Gibber uses a file (dist/gibberish_worklet.js) and needs to know where it is in order to function. By default, it assumes that you have a directory structure similar to the following:

index.html
dist
  > gibber.audio.js
  > gibberish_worklet.js

If you don't have this directory structure, you need to tell Gibber where gibberish_worklet.js is when you call Gibber.init(). For example, if you create an index.html page and then use npm install gibber.audio.lib to install the library, you'll get the following directory structure:

index.html
node_modules
  > gibber.audio.lib
    > dist
      > gibber.audio.js
      > gibberish_worklet.js

In this instance, we would need to both change the src attribute of our <script> and also pass the location of the worklet relative to the location of the index.html file. Our call to Gibber.init would be:

Gibber.init({ workletPath:'node_modules/gibber.audio.lib/dist/gibberish_worklet.js' })

The simple demo uses a CDN to fetch the worklet, which might be the easiest option.