The p5.sound library extends p5 with Web Audio functionality including audio input, playback, analysis and synthesis.
P5 Sound Videos - In particular, check out videos 11.6, 11.7, and 11.8.
Oscillator
Using the p5 sound library, you can create an Oscillator with 4 possible wave types. The default is a sine wave but you can specify the wave type using the setType()
method.
Envelope
Envelopes are pre-defined amplitude distribution over time. Typically, envelopes are used to control the output volume of an object, a series of fades referred to as Attack, Decay, Sustain and Release (ADSR).
Links & Resources
Jason Sigal’s Music Viz GitHub Repo