Skip to content

Language Settings

Reverb

Reverb gives depth and perceived space to a sound. Here, noise is processed with reverb. *

To run this example locally, you will need the p5.sound library a sound file, and a running local server.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
let sound, reverb;
function preload() {
  soundFormats('mp3', 'ogg');
  soundFile = loadSound('assets/Damscray_DancingTiger');
  // disconnect the default connection
  // so that we only hear the sound via the reverb.process
  soundFile.disconnect();
}
function setup() {
  createCanvas(720, 100);
  background(0);
  reverb = new p5.Reverb();
  // sonnects soundFile to reverb with a
  // reverbTime of 6 seconds, decayRate of 0.2%
  reverb.process(soundFile, 6, 0.2);
  reverb.amp(4); // turn it up!
}
function mousePressed() {
  soundFile.play();
}
X

creative commons license