f@0
|
1 /*
|
f@0
|
2 Cross-Modal DAW Prototype - Prototype of a simple Cross-Modal Digital Audio Workstation.
|
f@0
|
3
|
f@0
|
4 Copyright (C) 2015 Queen Mary University of London (http://depic.eecs.qmul.ac.uk/)
|
f@0
|
5
|
f@0
|
6 This program is free software: you can redistribute it and/or modify
|
f@0
|
7 it under the terms of the GNU General Public License as published by
|
f@0
|
8 the Free Software Foundation, either version 3 of the License, or
|
f@0
|
9 (at your option) any later version.
|
f@0
|
10
|
f@0
|
11 This program is distributed in the hope that it will be useful,
|
f@0
|
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
f@0
|
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
f@0
|
14 GNU General Public License for more details.
|
f@0
|
15
|
f@0
|
16 You should have received a copy of the GNU General Public License
|
f@0
|
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
|
f@0
|
18 */
|
f@0
|
19 package uk.ac.qmul.eecs.depic.daw.beads.sonification;
|
f@0
|
20
|
f@0
|
21 import net.beadsproject.beads.core.AudioContext;
|
f@0
|
22 import net.beadsproject.beads.core.UGen;
|
f@0
|
23 import net.beadsproject.beads.core.UGenChain;
|
f@0
|
24 import net.beadsproject.beads.data.Buffer;
|
f@0
|
25 import net.beadsproject.beads.ugens.BiquadFilter;
|
f@0
|
26 import net.beadsproject.beads.ugens.Function;
|
f@0
|
27 import net.beadsproject.beads.ugens.Noise;
|
f@0
|
28 import net.beadsproject.beads.ugens.TapIn;
|
f@0
|
29 import net.beadsproject.beads.ugens.TapOut;
|
f@0
|
30 import net.beadsproject.beads.ugens.WavePlayer;
|
f@0
|
31
|
f@2
|
32 /* not used */
|
f@0
|
33 public class AutomationSound extends UGenChain {
|
f@0
|
34 private WavePlayer sinOsc;
|
f@0
|
35 private UGen noise;
|
f@0
|
36 private BiquadFilter highPass;
|
f@0
|
37 private Function add;
|
f@0
|
38 private TapIn delayIn;
|
f@0
|
39 private TapOut delayOut;
|
f@0
|
40
|
f@0
|
41 public AutomationSound(AudioContext ac) {
|
f@0
|
42 super(ac, 0, 2);
|
f@0
|
43
|
f@0
|
44 /* create ugens */
|
f@0
|
45 sinOsc = new WavePlayer(ac,0.0f,Buffer.SINE);
|
f@0
|
46 noise = new Noise(ac);
|
f@0
|
47 highPass = new BiquadFilter(ac,1);
|
f@0
|
48 delayIn = new TapIn(ac,10f);
|
f@0
|
49 delayOut = new TapOut(ac,delayIn,0.01f);
|
f@0
|
50
|
f@0
|
51
|
f@0
|
52 /* configure ugens */
|
f@0
|
53 sinOsc.setFrequency(noise);
|
f@0
|
54 sinOsc.setPhase(-0.35f);
|
f@0
|
55
|
f@0
|
56 highPass.setType(BiquadFilter.BESSEL_HP);
|
f@0
|
57 highPass.setFrequency(2000);
|
f@0
|
58 highPass.setQ(3.25f);
|
f@0
|
59
|
f@0
|
60 /* connect ugens */
|
f@0
|
61 delayIn.addInput(sinOsc);
|
f@0
|
62 add = new Function(delayOut,sinOsc){
|
f@0
|
63 @Override
|
f@0
|
64 public float calculate() {
|
f@0
|
65 return x[0] + x[1];
|
f@0
|
66 }
|
f@0
|
67
|
f@0
|
68 };
|
f@0
|
69 delayIn.addInput(add);
|
f@0
|
70 highPass.addInput(add);
|
f@0
|
71
|
f@0
|
72 /* output of this ugen */
|
f@0
|
73 addToChainOutput(highPass);
|
f@0
|
74 }
|
f@0
|
75
|
f@0
|
76 }
|
f@0
|
77
|