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

p5.gibber.js

v0.2.4

Published

Music and audio programming for p5.js

Downloads

26

Readme

p5.gibber.js

Music and audio programming for p5.js. This is a thin wrapper around Gibber.lib, which enables easy musical sequencing and audio signal processing.

##Usage The library can be found in the dist folder. To use it in a p5 sketch:

  1. Include p5.js
  2. Include p5.gibber.js
  3. Include your sketch.js file

There are a variety of examples in the included examples directory.

##Using Drum Samples Gibber will look for a folder named 'resources' that lives in the same directory as your index.html and sketch.js files. Inside this folder is where you should place any audio samples you'd like to use or the Gibber drum samples. So, a sample directory that uses the standard Gibber Drums object might look like this:

yourProjectDirectory
  > resources
    > audiofiles
      > electronic 
        kick.wav
        hat.wav
        snare.wav
        openhat.wav
  index.html
  sketch.js

Audio resources can only be loaded from a running webserver, as HTTP is used to transfer the files. There is always the EDrums object to use if such a server is unavailable... it provides synthetic drums that are tweakable instead of the sample-based drums used by the Drums object.

Using SoundFonts

In a similar fashion to the drum and audio samples, soundfonts must be placed in a directory named 'soundfonts' inside a directory named 'resources' that lives in your project directory.

yourProjectDirectory
  > resources
    > soundfonts
    accordion-mp3.js
    acoustic-bass-mp3.js
    acoustic-grand-piano-mp3.js
    ... etc.
  index.html
  sketch.js

The actual soundfont used has been converted by Benjamin Gleitzman at the following repo: https://github.com/gleitz/midi-js-soundfonts

You only need the .js files to be stored on your server, the actual .mp3s aren't needed. As with the Drums samples, the SoundFont object only works if you load the .html file from a running web server.

##Examples Simple examples of p5 and p5.gibber.js can be found here.

##Building The library is an extremely thin wrapper around Gibber.lib; it currently only adds eight lines of code. This code ensures that Gibber functions are exported either to the global namespace or the p5.prototype object only, as per the instructions found here. Thus, if you need to hack on Gibber, it's best to do so on Gibber.lib.

If you really want to build the library:

  1. If you didn't install the library using npm, run npm install in the top-level of the repo to install all the libraries needed to build p5.gibber.js.
  2. Now run gulp at the top-level of the repo.