{"id":13438323,"url":"https://github.com/alemangui/pizzicato","last_synced_at":"2025-05-14T23:04:28.086Z","repository":{"id":27410620,"uuid":"30887530","full_name":"alemangui/pizzicato","owner":"alemangui","description":"Library to simplify the way you create and manipulate sounds with the Web Audio API.","archived":false,"fork":false,"pushed_at":"2025-04-07T16:16:20.000Z","size":10388,"stargazers_count":1685,"open_issues_count":77,"forks_count":132,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-05-14T23:04:07.502Z","etag":null,"topics":["audio","effects","javascript","sound"],"latest_commit_sha":null,"homepage":"https://alemangui.github.io/pizzicato/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alemangui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-02-16T20:47:44.000Z","updated_at":"2025-05-13T10:25:07.000Z","dependencies_parsed_at":"2025-04-13T19:32:15.309Z","dependency_job_id":"a87be27f-fc63-404d-a341-d0e1cef045c3","html_url":"https://github.com/alemangui/pizzicato","commit_stats":{"total_commits":220,"total_committers":12,"mean_commits":"18.333333333333332","dds":0.08181818181818179,"last_synced_commit":"688f4d5f23a4280c19d1c517883635f4569cec57"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alemangui%2Fpizzicato","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alemangui%2Fpizzicato/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alemangui%2Fpizzicato/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alemangui%2Fpizzicato/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alemangui","download_url":"https://codeload.github.com/alemangui/pizzicato/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254243358,"owners_count":22038046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","effects","javascript","sound"],"created_at":"2024-07-31T03:01:04.534Z","updated_at":"2025-05-14T23:04:23.030Z","avatar_url":"https://github.com/alemangui.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Sound editing","Obsolete"],"sub_categories":["Sound effects/processing","Community"],"readme":"\u003e [!NOTE]  \n\u003e Due to lack of time to focus on this project, **I'm actively looking for maintainers** who might be interested in working on Pizzicato. Don't hesitate to contact me! In the meantime, consider the project deprecated.\n\n\u003cimg align=\"center\" src=\"https://alemangui.github.io/pizzicato/img/horizontal-logo-outline.svg\" alt=\"Pizzicato.js\"\u003e\n\n[![Build Status](https://travis-ci.org/alemangui/pizzicato.svg?branch=master)](https://travis-ci.org/alemangui/pizzicato) [![npm](https://img.shields.io/npm/v/pizzicato.svg)](https://www.npmjs.com/package/pizzicato) [![Bower](https://img.shields.io/bower/v/pizzicato.svg)](https://bower.io/) [![CDNJS](https://img.shields.io/cdnjs/v/pizzicato.svg)](https://cdnjs.com/libraries/pizzicato)\n\n## A Web Audio library\n\nPizzicato aims to simplify the way you create and manipulate sounds via the Web Audio API. Take a look at the [demo site here](https://alemangui.github.io/pizzicato/).\n\n## Table of contents\n- [Get Pizzicato](#get-pizzicato)\n  - [npm](#npm)\n  - [bower](#bower)\n  - [cdnjs](#cdnjs)\n  - [Installing and testing](#installing-and-testing)\n- [TL;DR: How does it work?](#tldr)\n- [Create a sound](#create-a-sound)\n  - [Sounds from a wave](#sounds-from-a-wave)\n  - [Sounds from a file](#sounds-from-a-file)\n  - [Sounds from input](#sounds-from-input)\n  - [Sounds from a function](#sounds-from-a-function)\n- [Using sounds](#using-sounds)\n  - [play()](#sounds-play)\n  - [pause()](#sounds-pause)\n  - [stop()](#sounds-stop)\n  - [clone()](#sounds-clone)\n  - [addEffect()](#sounds-add-effect)\n  - [removeEffect()](#sounds-remove-effect)\n  - [volume](#sounds-volume)\n  - [attack](#sounds-attack)\n  - [release](#sounds-release)\n  - [frequency](#sounds-frequency)\n  - [Events](#sounds-events)\n    - [play](#sounds-events-play)\n    - [pause](#sounds-events-pause)\n    - [stop](#sounds-events-stop)\n    - [end](#sounds-events-end)\n  - [Connecting sounds to AudioNodes](#sounds-connect)\n- [Grouping sounds](#groups)\n  - [Create a group](#create-a-group)\n  - [addSound()](#group-add-sound)\n  - [removeSound()](#group-remove-sound)\n  - [addEffect()](#group-add-effect)\n  - [removeEffect()](#group-remove-effect)\n  - [play()](#group-play)\n  - [pause()](#group-pause)\n  - [stop()](#group-stop)\n  - [volume](#group-volume)\n- [Effects](#effects)\n  - [Delay](#delay)\n  - [Ping Pong Delay](#pingpongdelay)\n  - [Dub Delay](#dubdelay)\n  - [Distortion](#distortion)\n  - [Quadrafuzz](#quadrafuzz)\n  - [Flanger](#flanger)\n  - [Compressor](#compressor)\n  - [Low-pass filter](#low-pass-filter)\n  - [High-pass filter](#high-pass-filter)\n  - [Stereo Panner](#stereo-panner)\n  - [Convolver](#convolver)\n  - [Reverb](#reverb)\n  - [Ring Modulator](#ring-modulator)\n  - [Tremolo](#tremolo)\n  - [Connecting effects to and from AudioNodes](#effects-connect)\n- [Advanced](#advanced)\n  - [Accessing the audio context](#accessing-the-context)\n  - [Using Pizzicato objects in a web audio graph](#using-graph)\n  - [General volume](#general-volume)\n  - [Memory management](#memory-management)\n- [Support](#support)\n  - [Browsers](#browsers)\n  - [Audio formats](#audio-formats)\n\n\u003ca name=\"get-pizzicato\"/\u003e\n\n## Get Pizzicato\n\n\u003ca name=\"npm\"/\u003e\n\n### npm\n\n```\nnpm install pizzicato\n```\n\n\u003ca name=\"bower\"/\u003e\n\n### bower\n\n```\nbower install pizzicato\n```\n\n\u003ca name=\"cdnjs\"/\u003e\n\n### cdnjs\n\nFull source code:\n```html\n\u003cscript src=\"https://cdnjs.cloudflare.com/ajax/libs/pizzicato/0.6.4/Pizzicato.js\"\u003e\u003c/script\u003e\n```\n\nMinified:\n```html\n\u003cscript src=\"https://cdnjs.cloudflare.com/ajax/libs/pizzicato/0.6.4/Pizzicato.min.js\"\u003e\u003c/script\u003e\n```\n\n\u003ca name=\"installing-and-testing\"/\u003e\n\n### Installing and testing\n\n*Ensure you have gulp installed:* ```npm install -g gulp```.\n\nCheckout the project and install dependencies with :\n```\nnpm install\n```\n\nRun tests with:\n```\nnpm run test\n```\n\nBy default, Firefox is used for local testing. If you'd like to use Chrome you can use the setting active in TravisCI. To do so, go to ```karma.conf.js```, line 5, and change the browsers array to :\n\n```\nbrowsers: ['Chrome_travis_ci'],\n```\n\nBuild without tests with:\n```npm run build``` or ```npm run watch```\n\n\u003ca name=\"tldr\"/\u003e\n\n## TL;DR: How does it work?\nInclude Pizzicato in your site\n```html\n\u003cscript src=\"./Pizzicato.js\"\u003e\u003c/script\u003e\n```\n\nCreate a sound\n```javascript\nvar sawtoothWave = new Pizzicato.Sound({ \n    source: 'wave',\n    options: {\n        type: 'sawtooth'\n    }\n});\n```\n\nAdd effects\n```javascript\nvar delay = new Pizzicato.Effects.Delay();\nsawtoothWave.addEffect(delay);\n```\n\nPlay it!\n```javascript\nsawtoothWave.play();\n```\n\n\u003ca name=\"create-a-sound\"/\u003e\n\n## Create a sound\nTo create a new sound, use the ```Pizzicato.Sound``` constructor, which takes an object with the sound's ```description``` as argument and a callback that will be executed when the sound is ready to be used. If an error occurs, the callback will be called with the error as a parameter.\n```javascript\nvar sound = new Pizzicato.Sound(Object description, [Function callback]);\n```\nFor example:\n```javascript\nvar click = new Pizzicato.Sound({ source: 'wave' }, function(error) {\n    if (!error)\n        console.log('Sound ready to use!');\n});\n```\n\nTypically, the ```description``` object contains a string ```source``` and an object ```options```. The ```options``` object varies depending on the source of the sound being created.\n\nFor example, this objects describes a sine waveform with a frequency of 440:\n```javascript\n{\n    source: 'wave',\n    options: {\n        type: 'sine',\n        frequency: 440\n    }\n}\n```\n\nSounds can be created from a variety of sources.\n\n\u003ca name=\"sounds-from-a-wave\"/\u003e\n\n### Sounds from a wave ([example](https://alemangui.github.io/pizzicato/#sound-from-waveform))\nTo create a sound from an oscillator with a certain waveform, use the ```source: wave``` in your description. Additionally, the following optional parameters are possible inside the ```options``` object:\n* ```type``` _(Optional; ```sine```, ```square```, ```triangle``` or ```sawtooth```, defaults to ```sine```)_: Specifies the type of waveform.\n* ```frequency``` _(Optional; defaults to 440)_: Indicates the frequency of the wave (i.e., a 440 value will yield an A note).\n* ```volume``` _(Optional; min: 0, max: 1, defaults to 1)_: Loudness of the sound.\n* ```release``` _(Optional; defaults to 0.4)_: Value in seconds that indicates the fade-out time when the sound is stopped.\n* ```attack``` _(Optional; defaults to 0.4)_: Value in seconds that indicates the fade-in time when the sound is played.\n* ```detached``` _(Optional; defaults to false)_: If true, the sound will not be connected to the context's destination, and thus, will not be audible.\n\n```javascript\nvar sound = new Pizzicato.Sound({ \n        source: 'wave',\n        options: { type: 'sawtooth', frequency: 440 }\n});\n```\n\nCreating a Pizzicato Sound with an empty constructor will create a sound with a sine wave and a frequency of 440.\n\n```javascript\nvar sound = new Pizzicato.Sound();\n```\n\n\u003ca name=\"sounds-from-a-file\"/\u003e\n\n### Sounds from a file ([example](https://alemangui.github.io/pizzicato/#sound-from-file))\nIn order to load a sound from a file, include the ```source: file``` in your description. Additionally, the following  parameters are possible inside the ```options``` object:\n* ```path``` _(Mandatory; string or array of strings)_: Specifies the path of the sound file. It is also possible to have an array of paths to fallback on. Pizzicato will attempt to load the paths in order, passing on to the next one in case of failure.\n* ```loop``` _(Optional; boolean, defaults to false)_: If set, the file will start playing again after the end.\n* ```volume``` _(Optional; min: 0, max: 1, defaults to 1)_: Loudness of the sound.\n* ```release``` _(Optional; defaults to 0)_: Value in seconds that indicates the fade-out time once the sound is stopped.\n* ```attack``` _(Optional; defaults to 0.4)_: Value in seconds that indicates the fade-in time when the sound is played.\n* ```detached``` _(Optional; defaults to false)_: If true, the sound will not be connected to the context's destination, and thus, will not be audible.\n\n```javascript\nvar sound = new Pizzicato.Sound({ \n    source: 'file',\n    options: { path: './audio/sound.wav' }\n}, function() {\n    console.log('sound file loaded!');\n});\n```\nIt is possible to pass several paths to fallback in case of error:\n```javascript\nvar sound = new Pizzicato.Sound({ \n    source: 'file',\n    options: { path: ['./audio/sound-special-format.wav', './audio/sound.wav'] }\n}, function() {\n    console.log('sound file loaded!');\n});\n```\n\nAlternatively, you can also simply pass a string to the constructor with the path of the sound file.\n```\nvar sound = new Pizzicato.Sound('./audio/sound.wav', function() {...});\n```\nCheck the [supported audio files](#audio-formats) that can be played with Pizzicato.\n\n\u003ca name=\"sounds-from-input\"/\u003e\n\n### Sounds from the user input ([example](https://alemangui.github.io/pizzicato/#sound-from-input))\nIt is also possible to use the sound input from the computer. This is usually the microphone, but it could also be a line-in input. To use this, add ```source: input``` in your description. The following optional parameters are possible inside ```options``` object:\n* ```volume``` _(Optional; min: 0, max: 1, defaults to 1)_: Loudness of the sound.\n* ```release``` _(Optional; defaults to 0)_: Value in seconds that indicates the fade-out time once the sound is stopped.\n* ```attack``` _(Optional; defaults to 0.4)_: Value in seconds that indicates the fade-in time when the sound is played.\n* ```detached``` _(Optional; defaults to false)_: If true, the sound will not be connected to the context's destination, and thus, will not be audible.\n\n```javascript\nvar voice = new Pizzicato.Sound({\n    source: 'input',\n    options: { volume: 0.8 }\n});\n```\n\n\u003ca name=\"sounds-from-a-function\"/\u003e\n\n### Sounds from a function ([example](https://alemangui.github.io/pizzicato/#sound-from-function))\nFor more creative freedom, Pizzicato also allows direct audio processing. Sounds can be created from a Javascript function by including ```source: script``` in the description. The following parameters are possible in the ```options``` object:\n* ```audioFunction``` _(Mandatory; function(\u003caudio processing event\u003e))_: Function that will be called with the audio processing event.\n* ```bufferSize``` _(Optional; number - must be a power of 2.)_: This value controls how many sample frames will be processed at each audio process event. Lower values will result in lower latency, higher values help prevent glitches.\n* ```volume``` _(Optional; min: 0, max: 1, defaults to 1)_: Loudness of the sound.\n* ```release``` _(Optional; defaults to 0)_: Value in seconds that indicates the fade-out time once the sound is stopped.\n* ```attack``` _(Optional; defaults to 0.4)_: Value in seconds that indicates the fade-in time when the sound is played.\n* ```detached``` _(Optional; defaults to false)_: If true, the sound will not be connected to the context's destination, and thus, will not be audible.\n\nFor example:\n```javascript\nvar whiteNoise = Pizzicato.Sound({\n    source: 'script',\n    options: {\n        audioFunction: function(e) {\n            var output = e.outputBuffer.getChannelData(0);\n            for (var i = 0; i \u003c e.outputBuffer.length; i++)\n                output[i] = Math.random();\n        }\n    }\n});\n```\n\n\u003ca name=\"using-sounds\"/\u003e\n\n## Using sounds\n\n\u003ca name=\"sounds-play\"/\u003e\n\n### Play ([example](https://alemangui.github.io/pizzicato/#sound-from-waveform))\n\nYou can play a sound by calling it's ```play``` function. It takes two optional parameters:\n\n* ```when``` _(number, defaults to 0)_: Time in seconds to wait before playing the sound.\n* ```offset``` _(number, defaults to 0)_: Time in seconds where the sound will start.\n\nFor example, the following code will wait two seconds, then play a sound starting from position 00:04:\n\n```javascript\nsound.play(2, 4);\n```\n\n\u003ca name=\"sounds-pause\"/\u003e\n\n### Pause\n\nYou can pause a sound by calling it's ```pause``` function. Next time the sound is played, it will continue from where it left off.\n\n```javascript\nsound.pause();\n```\n\n\u003ca name=\"sounds-stop\"/\u003e\n\n### Stop\n\nYou can stop a sound by calling it's ```stop``` function. Next time the sound is played, it will continue from the start of the sound.\n\n```javascript\nsound.stop();\n```\n\n\u003ca name=\"sounds-clone\"/\u003e\n\n### Clone\n\nYou can clone a sound object by calling it's ```clone``` function. The object returned will have the same parameters as the original sound.\n\n```javascript\nsound.clone();\n```\n\n\u003ca name=\"sounds-add-effect\"/\u003e\n\n### Add effects ([example](https://alemangui.github.io/pizzicato/#delay))\n\nYou can add effects to a sound object by calling it's ```addEffect(effect)``` function. The function gets as parameter a Pizzicato Effect (see [effects](#effects)).\n\n* ```effect``` _(type: Pizzicato.Effect)_: The effect to add to the sound object.\n\nExample:\n```javascript\nvar sound = new Pizzicato.Sound();\nvar delay = new Pizzicato.Effects.Delay();\nsound.addEffect(delay);\n```\n\n\u003ca name=\"sounds-remove-effect\"/\u003e\n\n### Remove effects\n\nYou can remove effects that have been added to a sound object by calling it's ```removeEffect(effect)``` function. The function gets as parameter a Pizzicato Effect (see [effects](#effects)) that is already applied to the sound object.\n\n* ```effect``` _(type: Pizzicato.Effect)_: The effect to remove from the sound object.\n\nExample:\n```javascript\nvar sound = new Pizzicato.Sound();\nvar delay = new Pizzicato.Effects.Delay();\nsound.addEffect(delay);\n...\nsound.removeEffect(delay);\n```\n\n\u003ca name=\"sounds-volume\"/\u003e\n\n### Volume\n\nUse the sound's ```volume``` property to modify its volume.\n\n* ```volume``` _(min: 0, max: 1, defaults to 1)_: The sound's volume\n\nExample:\n```javascript\nvar sound = new Pizzicato.Sound();\nsound.volume = 0.5;\n```\n\n\u003ca name=\"sounds-attack\"/\u003e\n\n### Attack ([example](https://alemangui.github.io/pizzicato/#attack-release))\n\nUse the sound's ```attack``` property to modify its attack (or fade-in) value. This value eases the beginning of the sound, often avoiding unwanted clicks.\n\n* ```attack``` _(min: 0, max: 10, defaults to 0.04)_: The sound's attack.\n\nExample:\n```javascript\nvar sound = new Pizzicato.Sound();\nsound.attack = 0.9;\n```\n\n\u003ca name=\"sounds-release\"/\u003e\n\n### Release ([example](https://alemangui.github.io/pizzicato/#attack-release))\n\nUse the sound's ```release``` property to modify its release (or fade-out) value. This value eases the end of the sound, often avoiding unwanted clicks.\n\n* ```release``` _(min: 0, max: 10, defaults to 0.04)_: The sound's release.\n\nExample:\n```javascript\nvar sound = new Pizzicato.Sound();\nsound.release = 0.9;\n```\n\n\u003ca name=\"sounds-frequency\"/\u003e\n\n### Frequency\n\nIf you started a sound of type [wave](#sounds-from-a-wave), you can modify the frequency of the oscillator by altering the ```frequency``` property.\n\n* ```frequency``` _(defaults to 440)_: The oscillator's frequency of a sound of type wave.\n\nExample:\n```javascript\nvar sound = new Pizzicato.Sound();\n\nsound.play();\n\n// go up an octave\nsound.frequency = 880; // a5\n```\n\n\u003ca name=\"sounds-events\" /\u003e\n\n### Events\n\nIt is possible to subscribe to the following events that will occur on the Sound object: ```play```, ```pause```, ```stop```, ```end```.\n\n\u003ca name=\"sounds-events-play\" /\u003e\n\n#### ```play``` event\n\nThe ```play``` event will be fired when the sound is played.\n\nExample:\n```javascript\nvar sound = new Pizzicato.Sound();\n\nsound.on('play', function() {\n  //...\n})\n```\n\n\n\u003ca name=\"sounds-events-pause\" /\u003e\n\n#### ```pause``` event\n\nFired when the sound is paused. For example:\n\n```javascript\nvar sound = new Pizzicato.Sound();\n\nsound.on('pause', function() {\n  //...\n})\n```\n\n\u003ca name=\"sounds-events-stop\" /\u003e\n\n#### ```stop``` event\n\nFired when the sound is stopped. For example:\n\n```javascript\nvar sound = new Pizzicato.Sound();\n\nsound.on('stop', function() {\n  //...\n})\n```\n\n\u003ca name=\"sounds-events-end\" /\u003e\n\n#### ```end``` event\n\nFired when the sound has ended. This is only valid for sounds coming from a file. For example:\n\n```javascript\nvar sound = new Pizzicato.Sound();\n\nsound.on('end', function() {\n  //...\n})\n```\n\n\n\u003ca name=\"sounds-connect\" /\u003e\n\n###Connecting sounds to AudioNodes\nIt is possible to connect AudioNodes to sound objects by using the ```connect``` method. More details in the [advanced section of this file](#using-graph-sound).\n\n\u003ca name=\"groups\" /\u003e\n\n## Grouping sounds ([example](https://alemangui.github.io/pizzicato/#create-group))\nGroups are a way to handle multiple ```Pz.Sound``` objects at the same time.\n\n\u003ca name=\"create-a-group\" /\u003e\n\n### Create a group ([example](https://alemangui.github.io/pizzicato/#create-group))\n\nThe ```Pizzicato.Group``` constructor takes an optional array of sound objects. Please note these sounds must be detached for them to be usable inside a group (more details about detached sounds [here](#using-graph-sound-detached)).\n\n* ```sounds``` _(array, defaults to [])_: The sounds to be added to the group.\n\nExample:\n```javascript\nvar drums = new Pizzicato.Sound('./audio/drums.mp3');\nvar guitar = new Pizzicato.Sound('./audio/guitar.mp3');\n\nvar group = new Pizzicato.Group([drums, guitar]);\n```\n\n\u003ca name=\"group-add-sound\"/\u003e\n\n### addSound()\n\nTo add a sound to a group, use the function ```addSound()```, which receives one parameter:\n\n* ```sound``` _(Pz.Sound, mandatory)_: The sound to be added to the group.\n\nExample:\n```javascript\nvar drums = new Pizzicato.Sound('./audio/drums.mp3');\nvar guitar = new Pizzicato.Sound('./audio/guitar.mp3');\nvar group = new Pizzicato.Group();\n\ngroup.addSound(drums)\ngroup.addSound(guitar)\n```\n\n\u003ca name=\"group-remove-sound\"/\u003e\n\n### removeSound()\n\nTo remove a sound to a group, use the function ```removeSound()```, which receives one parameter:\n\n* ```sound``` _(Pz.Sound, mandatory)_: The sound to be removed from the group.\n\nExample:\n```javascript\nvar drums = new Pizzicato.Sound('./audio/drums.mp3');\nvar guitar = new Pizzicato.Sound('./audio/guitar.mp3');\nvar group = new Pizzicato.Group([guitar, drums]);\n\ngroup.removeSound(drums)\ngroup.removeSound(guitar)\n```\n\n\u003ca name=\"group-add-effect\"/\u003e\n\n### addEffect()\n\nTo add an effect to a group, use the function ```addEffect()```. Please note all sounds inside the group will be affected by the added effect. The function receives one parameter:\n\n* ```effect``` _(Pz.Effect, mandatory)_: The effect to be added to the group.\n\nExample:\n```javascript\nvar bass = new Pizzicato.Sound('./audio/bass.mp3');\nvar guitar = new Pizzicato.Sound('./audio/guitar.mp3');\nvar delay = new Pizzicato.Effects.Delay();\nvar group = new Pizzicato.Group([guitar, drums]);\n\ngroup.addEffect(delay)\n```\n\n\u003ca name=\"group-remove-effect\"/\u003e\n\n### removeEffect()\n\nTo remove an effect to a group, use the function ```removeEffect()```. The function receives one parameter:\n\n* ```effect``` _(Pz.Effect, mandatory)_: The effect to be removed from the group.\n\nExample:\n```javascript\nvar bass = new Pizzicato.Sound('./audio/bass.mp3');\nvar guitar = new Pizzicato.Sound('./audio/guitar.mp3');\nvar delay = new Pizzicato.Effects.Delay();\nvar group = new Pizzicato.Group([guitar, drums]);\n\ngroup.addEffect(delay)\n\ngroup.removeEffect(delay)\n```\n\n\u003ca name=\"group-play\"/\u003e\n\n### play()\n\nYou can play all sounds of a group simultaneously using the function ```play```, which takes no parameters.\n\nExample:\n```javascript\nvar drums = new Pizzicato.Sound('./audio/drums.mp3');\nvar guitar = new Pizzicato.Sound('./audio/guitar.mp3');\nvar group = new Pizzicato.Group([guitar, drums]);\n\ngroup.play();\n```\n\n\u003ca name=\"group-pause\"/\u003e\n\n### pause()\n\nYou can pause all sounds of a group simultaneously using the function ```pause```, which takes no parameters. Next time the group is played, it will continue from where it left off.\n\nExample:\n```javascript\nvar drums = new Pizzicato.Sound('./audio/drums.mp3');\nvar guitar = new Pizzicato.Sound('./audio/guitar.mp3');\nvar group = new Pizzicato.Group([guitar, drums]);\n\ngroup.play();\ngroup.pause();\n```\n\n\u003ca name=\"group-stop\"/\u003e\n\n### stop()\nYou can stop all sounds of a group simultaneously using the function ```stop```, which takes no parameters. Next time the group is played, it will continue from the start of the sounds composing it.\n\nExample:\n```javascript\nvar drums = new Pizzicato.Sound('./audio/drums.mp3');\nvar guitar = new Pizzicato.Sound('./audio/guitar.mp3');\nvar group = new Pizzicato.Group([guitar, drums]);\n\ngroup.play();\ngroup.stop();\n```\n\n\u003ca name=\"group-volume\"/\u003e\n\n### volume\n\nUse the group's ```volume``` property to modify the volume of all the group.\n\n* ```volume``` _(min: 0, max: 1, defaults to 1)_: The sound's volume\n\nExample:\n```javascript\nvar drums = new Pizzicato.Sound('./audio/drums.mp3');\nvar guitar = new Pizzicato.Sound('./audio/guitar.mp3');\nvar group = new Pizzicato.Group([guitar, drums]);\n\ngroup.volume = 0.5;\n```\n\n\u003ca name=\"effects\"/\u003e\n\n## Effects\nOnce a sound is created you can add effects to it by using the ```addEffect``` function. To remove an effect, you can use the ```removeEffect``` function.\n```javascript\nvar delay = new Pizzicato.Effects.Delay();\nsound.addEffect(delay);\nsound.removeEffect(delay);\n```\n\n\u003ca name=\"delay\"/\u003e\n\n### Delay ([example](https://alemangui.github.io/pizzicato/#delay))\nThe delay effect plays back the sound a certain number of times in defined intervals, giving the impression of an echo. The following options are available when creating a delay effect:\n* ```feedback``` _(min: 0, max: 1, defaults to 0.5)_: The intensity with which the input will echo back. A larger value will result in more echo repetitions.\n* ```time``` _(min: 0, max: 1, defaults to 0.3)_: Interval time in seconds.\n* ```mix``` _(min: 0, max: 1, defaults to 0.5)_: Volume balance between the original audio and the effected output (the delayed sound).\n\nExample:\n```javascript\nvar delay = new Pizzicato.Effects.Delay({\n    feedback: 0.8,\n    time: 0.22,\n    mix: 0.75\n});\nsound.addEffect(delay);\nsound.play();\n```\n\n\u003ca name=\"ping-pong-delay\"/\u003e\n\n### Ping Pong Delay ([example](https://alemangui.github.io/pizzicato/#ping-pong-delay))\nThe ping pong delay effect is similar to a regular [Delay](#delay) effect, however on each feedback loop the output is swapped between left and right channels. The following options are available when creating a delay effect:\n* ```feedback``` _(min: 0, max: 1, defaults to 0.5)_: The intensity with which the input will echo back. A larger value will result in more echo repetitions.\n* ```time``` _(min: 0, max: 1, defaults to 0.3)_: Interval time in seconds.\n* ```mix``` _(min: 0, max: 1, defaults to 0.5)_: Volume balance between the original audio and the effected output (the delayed sound).\n\nExample:\n```javascript\nvar pingPongDelay = new Pizzicato.Effects.PingPongDelay({\n    feedback: 0.3,\n    time: 0.2,\n    mix: 0.68\n});\nsound.addEffect(pingPongDelay);\nsound.play();\n```\n\n\u003ca name=\"dubdelay\"/\u003e\n\n### Dub Delay ([example](https://alemangui.github.io/pizzicato/#dub-delay))\nThe dub delay effect is similar to a regular [Delay](#delay) effect, however on each feedback loop the output is routed through a biquad filter. \n\nThis effect is based on [Chris Lowis'](https://twitter.com/chrislowis) article [Creating dub delay effects with the Web Audio API](http://blog.chrislowis.co.uk/2014/07/23/dub-delay-web-audio-api.html).\n\nThe following options are available when creating a delay effect:\n* ```feedback``` _(min: 0, max: 1, defaults to 0.5)_: The intensity with which the input will echo back. A larger value will result in more echo repetitions.\n* ```time``` _(min: 0, max: 1, defaults to 0.3)_: Interval time in seconds.\n* ```cutoff``` _(min: 0, max: 4000, defaults to 700)_: Frequency value applied to each successive loop. The lower the value, the more different each repetition will be perceived.\n* ```mix``` _(min: 0, max: 1, defaults to 0.5)_: Volume balance between the original audio and the effected output (the delayed sound).\n\nExample:\n```javascript\nvar dubDelay = new Pizzicato.Effects.DubDelay({\n    feedback: 0.6,\n    time: 0.7,\n    mix: 0.5,\n    cutoff: 700\n});\nsound.addEffect(dubDelay);\nsound.play();\n```\n\n\u003ca name=\"distortion\"/\u003e\n\n### Distortion ([example](https://alemangui.github.io/pizzicato/#distortion))\nThe distortion effect adds a basic \"override\" to the sound. The distortion effect only takes one parameter:\n* ```gain``` _(min: 0, max: 1, defaults to 0.5)_: Amount of distortion applied.\n\nExample:\n```javascript\nvar distortion = new Pizzicato.Effects.Distortion({\n    gain: 0.4\n});\nsound.addEffect(delay);\nsound.play();\n```\n\n\u003ca name=\"quadrafuzz\"\u003e\n\n### Quadrafuzz ([example](https://alemangui.github.io/pizzicato/#quadrafuzz))\nThe quadrafuzz effect divides the sound into separate bands and then distorts each band independently, allowing you to control which frequencies you distort and how much.\n\nThe quadrafuzz code in Pizzicato is based on [Michel Buffa's](https://twitter.com/micbuffa) implementation of the quadrafuzz effect.\n\nThe effect takes the following parameters:\n* ```lowGain``` _(min: 0, max: 1, defaults to 0.6)_: \n* ```midLowGain``` _(min: 0, max: 1, defaults to 0.8)_: \n* ```midHighGain``` _(min: 0, max: 1, defaults to 0.5)_: \n* ```highGain``` _(min: 0, max: 1, defaults to 0.6)_: \n\nExample:\n```javascript\nvar quadrafuzz = new Pizzicato.Effects.Quadrafuzz({\n    lowGain: 0.6,\n    midLowGain: 0.8,\n    midHighGain: 0.5,\n    highGain: 0.6,\n});\n\nsound.addEffect(quadrafuzz);\nsound.play();\n```\n\n\u003ca name=\"flanger\"/\u003e\n\n### Flanger ([example](https://alemangui.github.io/pizzicato/#flanger))\nThe flanger produces a swirling effect by delaying a \"copy\" of the sound by a small, gradually changing period. The flanger effect takes the following parameters:\n* ```time``` _(min: 0, max: 1, defaults to 0.45)_: Changes the small delay time applied to the copied signal.\n* ```speed``` _(min: 0, max: 1, defaults to 0.2)_: Changes the speed at which the flanging occurs.\n* ```depth``` _(min: 0, max: 1, defaults to 0.1)_: Changes the depth/intensity of the swirling effect.\n* ```feedback``` _(min: 0, max: 1, defaults to 0.1)_: Changes the volume of the delayed sound.\n* ```mix``` _(min: 0, max: 1, defaults to 0.5)_: Volume balance between the original audio and the effected output.\n\nExample:\n```javascript\nvar flanger = new Pizzicato.Effects.Flanger({\n    time: 0.45,\n    speed: 0.2,\n    depth: 0.1,\n    feedback: 0.1,\n    mix: 0.5\n});\n\nsound.addEffect(flanger);\nsound.play();\n```\n\n\u003ca name=\"compressor\"/\u003e\n\n### Compressor ([example](https://alemangui.github.io/pizzicato/#compressor))\nA compressor allows reducing the range between the loudest and the quietest parts of a sound. This is done by boosting the quiet segments and attenuating the loud ones.\n\nThe following options are available when creating a compressor effect:\n* ```threshold``` _(min: -100, max: 0, defaults to -24)_: The decibel value above which the compression will start taking effect.\n* ```knee``` _(min: 0, max: 40, defaults to 30)_: A value representing the range above the threshold where the curve smoothly transitions to the \"ratio\" portion.\n* ```attack``` _(min: 0, max: 1, defaults to 0.003)_: How soon the compressor starts to compress the dynamics after the threshold is exceeded. Short values will result in a fast response to sudden, loud sounds, but will make the changes in volume more obvious to listeners.\n* ```release``` _(min: 0, max: 1, defaults to 0.025)_: How soon the compressor starts to release the volume level back to normal after the level drops below the threshold. \n* ```ratio``` _(min: 1, max: 20, defaults to 12)_:  The amount of compression applied to the audio once it passes the threshold level. The higher the Ratio the more the loud parts of the audio will be compressed.\n* ```mix``` _(min: 0, max: 1, defaults to 0.5)_: Volume balance between the original audio and the effected output.\n\nExample:\n```javascript\nvar compressor = new Pizzicato.Effects.Compressor({\n    threshold: -20,\n    knee: 22,\n    attack: 0.05,\n    release: 0.05,\n    ratio: 18\n});\nsound.addEffect(compressor);\nsound.play();\n```\n\n\u003ca name=\"low-pass-filter\"/\u003e\n\n### Low-pass filter ([example](https://alemangui.github.io/pizzicato/#low-pass-filter))\nA low-pass filter passes signals with a frequency lower than a pre-determined cutoff frequency and attenuates signals with frequencies higher than the cutoff frequency. \n\n* ```frequency``` _(min: 10, max: 22050, defaults to 350)_: The cutoff frequency of the low-pass filter.\n* ```peak``` _(min: 0.0001, max: 1000, defaults to 1)_: Indicates how peaked the frequency is around the cutoff frequency. The greater the value is, the greater is the peak.\n\nExample:\n```javascript\nvar lowPassFilter = new Pizzicato.Effects.LowPassFilter({\n    frequency: 400,\n    peak: 10\n});\n\nsound.addEffect(lowPassFilter);\nsound.play();\n```\n\n\u003ca name=\"high-pass-filter\"/\u003e\n\n### High-pass filter ([example](https://alemangui.github.io/pizzicato/#high-pass-filter))\nA high-pass filter is the opposite of a low-pass filter (described above). It attenuates signals with a frequency lower than a pre-determined cutoff frequency and passes signals with frequencies higher than the cutoff frequency. \n\n* ```frequency``` _(min: 10, max: 22050, defaults to 350)_: The cutoff frequency of the high-pass filter.\n* ```peak``` _(min: 0.0001, max: 1000, defaults to 1)_: Indicates how peaked the frequency is around the cutoff frequency. The greater the value is, the greater is the peak.\n\nExample:\n```javascript\nvar highPassFilter = new Pizzicato.Effects.HighPassFilter({\n    frequency: 120,\n    peak: 10\n});\n\nsound.addEffect(highPassFilter);\nsound.play();\n```\n\n\u003ca name=\"stereo-panner\"/\u003e\n\n### Stereo panner ([example](https://alemangui.github.io/pizzicato/#stereo-panner))\nThe stereo panner is used to adjust the level of a sound through the left and right speakers. A ```-1``` value will channel all the sound through the left speaker, whereas a ```1``` value will do so through the right speaker.\n\n* ```pan``` _(min: -1, max: 1, defaults to 0)_: Pan value between -1 (full left pan) and 1 (full right pan).\n\nExample:\n```javascript\nvar stereoPanner = new Pizzicato.Effects.StereoPanner({\n    pan: 0.5\n});\n\nsound.addEffect(stereoPanner);\nsound.play();\n```\n\n\u003ca name=\"convolver\"/\u003e\n\n### Convolver ([example](https://alemangui.github.io/pizzicato/#convolver))\nThe convolver effect allows the sound to be heard with a certain ressonance or repercussion. This can be useful to simulate certain environments such as auditoriums, concert halls, or small rooms. \n\nIn order to get this acoustic environment, an external audio file must be used as a sound sample. This audio file must contain the desired ambience that will shape the convolution. Due to this file, this effect is asynchronous, so a callback can be provided and will be executed once the effect is ready to be used.\n\nThe [reverb](#reverb) is similar but allows programatic adjustments instead of requiring an external impulse file.\n\n_options object_\n\n* ```impulse``` _(Mandatory; string)_: Path to your impulse file.\n* ```mix``` _(min: 0, max: 1, defaults to 0.5)_: Volume balance between the original audio and the effected output.\n\n_callback_\n\n* ```callback``` _(function)_: function executed when the impulse file has been correctly loaded and the effect is ready to be used.\n\nExample:\n```javascript\nvar convolver = new Pizzicato.Effects.Convolver({\n    impulse: './path/to/your/impulse.wav',\n    mix: 0.5\n}, function() {\n    console.log('Convolver ready to be used.');\n});\n\nsound.addEffect(convolver);\nsound.play();\n```\n\n\u003ca name=\"reverb\"/\u003e\n\n### Reverb ([example](https://alemangui.github.io/pizzicato/#reverb))\nThe reverb effect is similar to the convolver effect in that it allows the sound to be heard with a certain ressonance or repercussion. This simulates a particular physical environment in which the sound could be played (e.g., an auditorium, a concert hall, etc).\n\nUnlike the convolver effect, the reverb can be adjusted programatically without the need for any external elements.\n\n* ```time``` _(min: 0.0001, max: 10, defaults to 0.01)_: Duration of impulse, in seconds.\n* ```decay``` _(min: 0, max: 10, defaults to 0.01)_: The rate for the reflections of sound to fade away.\n* ```reverse``` _(boolean)_: Whether or not to reverse the impulse shape.\n* ```mix``` _(min: 0, max: 1, defaults to 0.5)_: Volume balance between the original audio and the effected output.\n\nExample:\n```javascript\nvar reverb = new Pizzicato.Effects.Reverb({\n    time: 1,\n    decay: 0.8,\n    reverse: true,\n    mix: 0.5\n});\n\nsound.addEffect(reverb);\nsound.play();\n```\n\n\u003ca name=\"ring-modulator\"/\u003e\n\n### Ring Modulator ([example](https://alemangui.github.io/pizzicato/#ring-modulator))\nThe ring modulator effect combines two input signals, where one of the inputs is a sine wave modulating the other. \n\n[This article from the BBC](http://webaudio.prototyping.bbc.co.uk/ring-modulator/) - from where this effect was based from - goes into deeper detail and explains how to recreate it. The 'ring' in this effect derives from the layout of diode nodes in the original analogue equipment, and also refers to the sound being increasingly modulated as it travels through the ring of diodes. \n\n* ```distortion``` _(min: 0.2, max: 50, defaults to 1)_: Level of distortion applied to the diode nodes.\n* ```speed``` _(min: 0, max: 2000, defaults to 30)_: The frequency of the modulating signal.\n* ```mix``` _(min: 0, max: 1, defaults to 0.5)_: Volume balance between the original audio and the effected output.\n\nExample:\n```javascript\nvar ringModulator = new Pizzicato.Effects.RingModulator({\n    speed: 10,\n    distortion: 4,\n    mix: 0.5\n});\n\nsound.addEffect(ringModulator);\nsound.play();\n```\n\n\u003ca name=\"tremolo\"/\u003e\n\n### Tremolo ([example](https://alemangui.github.io/pizzicato/#tremolo))\nThe tremolo effect changes the volume of the sound over time. The outcome would be similar as if you turned the volume node up and down periodically.\n\n* ```speed``` _(min: 0, max: 20, defaults to 4)_: The speed at which the volume will change.\n* ```depth``` _(min: 0, max: 1, defaults to 1)_: The intensity of the volume change.\n* ```mix``` _(min: 0, max: 1, defaults to 0.5)_: Volume balance between the original audio and the effected output.\n\nExample:\n```javascript\nvar tremolo = new Pizzicato.Effects.Tremolo({\n    speed: 5,\n    depth: 1,\n    mix: 0.5\n});\n\nsound.addEffect(tremolo);\nsound.play();\n```\n\n\u003ca name=\"effects-connect\"\u003e\n\n### Connecting effects to and from AudioNodes\nIt is possible to connect AudioNodes to effects (and viceversa) by using the ```connect``` method. More details in the [advanced section of this file](#using-graph-effect).\n\n\u003ca name=\"advanced\"\u003e\n\n## Advanced\n\n\u003ca name=\"accessing-the-context\"\u003e\n\n### Accessing the audio context\nIf needed, the audio context used by Pizzicato is always accessible:\n```javascript\nvar context = Pizzicato.context;\n```\n\n\u003ca name=\"using-graph\"\u003e\n\n### Using Pizzicato objects in a web audio graph\nYou can use effects and sounds as part of an existing web audio graph.\n\n\u003ca name=\"using-graph-sound\"\u003e\n\n#### Connecting nodes to a Pizzicato.Sound object\nUsing the ```connect``` method, you can connect audio nodes to a Pizzicato.Sound object. For example:\n```javascript\nvar analyser = Pizzicato.context.createAnalyser();\nvar sound = new Pizzicato.Sound();\n\nsound.connect(analyser);\n```\n\n\u003ca name=\"using-graph-sound-detached\"\u003e\n\n#### Creating a detached Pizzicato.Sound object\nAll Pizzicato.Sound objects are connected to the context's destination by default. In the example above, the ```sound``` object will be connected to an analyser node and it will also remain connected to the context's destination node.\n\nTo have a Pizzicato.Sound object that is not connected to the context's destination, use the ```detached``` option as follows:\n\n```javascript\nvar analyser = Pizzicato.context.createAnalyser();\nvar sound = new Pizzicato.Sound({ \n    source: 'wave', \n    options: { \n        detached: true \n    } \n});\n\nsound.connect(analyser);\n```\n\n\u003ca name=\"using-graph-effect\"\u003e\n\n#### Connecting nodes to effects\nPizzicato effects can also be used in a web audio graph without the need to create Pizzicato.Sound objects by using the ```connect``` method.\n\nAdditionally, the ```connect``` method in an AudioNode can receive a Pizzicato effect as a parameter.\n\n```javascript\nvar oscillator = Pizzicato.context.createOscillator();\nvar distortion = new Pizzicato.Effects.Distortion();\nvar analyser = Pizzicato.context.createAnalyser();\n\noscillator.connect(distortion);\ndistortion.connect(analyser);\n```\n\n\u003ca name=\"general-volume\"\u003e\n\n### General volume\nIn order to change the general volume of all Pizzicato sounds, you can directly modify the property ```volume```:\n```javascript\nPizzicato.volume = 0.3;\n```\n\n\u003ca name=\"memory-management\"\u003e\n\n### Memory management\n\nWhen creating large numbers of Pizzicato objects you may experience a tipping point after which all sounds in the site are muted. This can vary depending on your browser, operating system and computer running the code.\n\nTo release some of the load, you can call the ```disconnect``` function on the Pizzicato.Sound objects no longer in use. This will disconnect them from the context's destination and they will become orphaned graphs, which will be freed when necessary.\n\n\u003ca name=\"support\"/\u003e\n\n## Support\n\n\u003ca name=\"browsers\"/\u003e\n\n### Browsers\nPizzicato can only work in [browsers with Web Audio support](http://caniuse.com/#feat=audio-api). This means:\n* Firefox 31+\n* Chrome 31+\n* Safari 7+ (input source not available in Safari)\n* Opera 30+\n* Edge 13+\n\n\u003ca name=\"audio-formats\"/\u003e\n\n### Audio formats\nPizzicato supports audio formats [supported by your browser](https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats#Browser_compatibility). These may vary depending on your system version and browser.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falemangui%2Fpizzicato","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falemangui%2Fpizzicato","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falemangui%2Fpizzicato/lists"}