-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgpmixer.js
45 lines (36 loc) · 990 Bytes
/
gpmixer.js
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// MUSIC
let channelMusic = [];
let playerMusic = [];
let soundfiles = [
"Theremin_Hauptstimme",
"Theremin_Begleitung_Theremin_2",
"Theremin_Begleitung_Theremin_3",
"Theremin_Begleitung_Theremin_4",
];
soundfiles.map(function (url, i) {
channelMusic[i] = new Tone.Channel(1).toDestination();
channelMusic[i].mute = true;
playerMusic[i] = new Tone.GrainPlayer({
url: `data/music/${url}.wav`,
loop: true,
})
.sync()
.start(0);
playerMusic[i].connect(channelMusic[i]);
});
// FOLEYS
let channelFoley = [];
let playerFoley = [];
let foleyfiles = ["rain", "water", "pigs", "steps"];
foleyfiles.map(function (url, i) {
channelGain[i] = new Tone.Gain(-3.0).toDestination();
channelFoley[i] = new Tone.Channel(1).toDestination();
channelFoley[i].mute = true;
playerFoley[i] = new Tone.Player({
url: `data/music/${url}.wav`,
loop: true,
})
.sync()
.start(0);
playerFoley[i].connect(channelFoley[i]).connect(channelGain[i]);
});