-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrainDelay.js
More file actions
28 lines (22 loc) · 764 Bytes
/
Copy pathgrainDelay.js
File metadata and controls
28 lines (22 loc) · 764 Bytes
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
// ### SOUND EFFECTS SETTINGS
let fbdelay;
// interactive pbr control
//let pbrcontrol = false;
//let grainfbdelay = false;
let graindelay_pbrate;
// sample file
let audioFile = "data/music/motive/TRAUM_Melodie.ogg";
// tone audio buffer can be assigner to gp.buffer
const sampleBuffer = new Tone.ToneAudioBuffer(audioFile, () => {
// console.log('loaded');
});
let grainBufChannel = new Tone.Channel(1).toDestination();
// audio buffer to apply sound effects to
const audioBuffer = new Tone.ToneBufferSource(audioFile, () => {
// console.log('loaded');
grainBuffer.buffer = audioBuffer.buffer;
}).toDestination();
audioBuffer.loop = true;
audioBuffer.connect(grainBufChannel);
// buffer should loop during interaction
let audioBufTemp = sampleBuffer;