-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathaudio_engine_test.html
72 lines (59 loc) · 2.22 KB
/
audio_engine_test.html
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html lang="en">
<head>
<title>moz-shadow liv3c0der</title>
<link rel="stylesheet" type="text/css" href="/style.css">
</head>
<body>
<button id="play">Play</button>
<button id="stop">Stop</button>
<script src="/javascript/vendor/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="/javascript/audio_engine.js?v=104" charset="utf-8"></script>
<script type="text/javascript">AE.instance = new AE.Engine();</script>
<script type="text/javascript">
$(function() {
var counter = 0;
var dubfilter = new AE.LfoFilter(AE.instance.audioContext, {type: 'highpass', lfo_freq: 0.2, lfo_gain: 5000, frequency: 7000});
console.log(dubfilter)
dubfilter.connect(AE.instance.audioContext.destination);
var pattern = function(c, o, t, l, s) {
AE.SpreadSynth.play(dubfilter.destination, t[10], l*16, 48, 0.1);
// AE.ReverbLine.mix.value = 0.5;
// AE.DelayLine.delayTime.value = l*3;
// AE.DelayLine.filterFrequency.value = 500;
// AE.DelayLine.feedback.value = 0.7;
// AE.AcidSynth.Q = 2;
//
// AE.AcidSynth.flt_f = 50;
// AE.AcidSynth.flt_mod = 50 + Math.random() * 4000;
// var i;
//
// AE.AcidSynth.decay = 0.3;
//
// AE.AcidSynth.play(AE.ReverbLine.destination, t[0], l*4, 24);
// AE.AcidSynth.play(AE.ReverbLine.destination, t[8], l*4, 24 + 2);
// AE.AcidSynth.play(AE.ReverbLine.destination, t[14], l*2, 24 - 2);
//
// base_note = 48;
// if (counter % 4 == 2) base_note += 4;
// if (counter % 4 == 3) base_note += 7;
// AE.SpreadSynth.flt_f = 100;
// AE.SpreadSynth.spread = 20;
// AE.SpreadSynth.flt_a = 0.5;
// AE.SpreadSynth.flt_env = 100 + Math.random() * 8000;
// AE.SpreadSynth.play(AE.DelayLine.destination, t[10], l*2, base_note, 0.1);
// AE.SpreadSynth.play(AE.DelayLine.destination, t[10], l*2, base_note + 3, 0.1);
// AE.SpreadSynth.play(AE.DelayLine.destination, t[10], l*2, base_note + 7, 0.1);
// counter++;
}
var empty = function() {};
$('#play').click(function() {
AE.instance.setPatternMethod(pattern);
})
$('#stop').click(function() {
AE.instance.setPatternMethod(function() {});
})
});
</script>
</body>
</html>