p5.sound library

⊥Źródła: Reference: libraries/p5.sound,  p5.js Sound Tutorial,
                GitHub: processing/p5.js-sound

p5.sound extends p5 with Web Audio functionality including audio input, playback, analysis and synthesis.

p5.SoundFile: Load and play sound files.
p5.Amplitude: Get the current volume of a sound.
p5.AudioIn: Get sound from an input source, typically a computer microphone.
p5.FFT: Analyze the frequency of sound. Returns results from the frequency spectrum or time domain (waveform).
p5.Oscillator: Generate Sine, Triangle, Square and Sawtooth waveforms. Base class of p5.Noise and p5.Pulse.
p5.Env: An Envelope is a series of fades over time. Often used to control an object’s output gain level as an “ADSR Envelope” (Attack, Decay, Sustain, Release). Can also modulate other parameters.
p5.Delay: A delay effect with parameters for feedback, delayTime, and lowpass filter.
p5.Filter: Filter the frequency range of a sound.
p5.Reverb: Add reverb to a sound by specifying duration and decay.
p5.Convolver: Extends p5.Reverb to simulate the sound of real physical spaces through convolution.
p5.SoundRecorder: Record sound for playback / save the .wav file.p5.Phrase, p5.Part and p5.Score: Compose musical sequences.



Noise is a type of oscillator that generates a buffer with random values.

Extiende p5.Oscillator

This function requires you include the p5.sound library. Add the following into the head of your index.html file:

<script language="javascript" type="text/javascript" src="path/to/p5.sound.js"></script>


new p5.Noise(type)


type String:Type of noise can be ‘white’ (default), ‘brown’ or ‘pink’.


setType() Set type of noise to ‘white’, ‘pink’ or ‘brown’. White is the default.
start() Start the noise
stop() Stop the noise.
pan() Pan the noise.
amp() Set the amplitude of the noise between 0 and 1.0. Or, modulate amplitude with an audio signal such as an oscillator.
connect() Send output to a p5.sound or web audio object
disconnect() Disconnect all output.