Mercurial > hg > cmdp
view src/uk/ac/qmul/eecs/depic/daw/beads/sonification/AutomationSound.java @ 4:473da40f3d39 tip
added html formatting to Daw/package-info.java
author | Fiore Martin <f.martin@qmul.ac.uk> |
---|---|
date | Thu, 25 Feb 2016 17:50:09 +0000 |
parents | c0412c81d274 |
children |
line wrap: on
line source
/* Cross-Modal DAW Prototype - Prototype of a simple Cross-Modal Digital Audio Workstation. Copyright (C) 2015 Queen Mary University of London (http://depic.eecs.qmul.ac.uk/) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ package uk.ac.qmul.eecs.depic.daw.beads.sonification; import net.beadsproject.beads.core.AudioContext; import net.beadsproject.beads.core.UGen; import net.beadsproject.beads.core.UGenChain; import net.beadsproject.beads.data.Buffer; import net.beadsproject.beads.ugens.BiquadFilter; import net.beadsproject.beads.ugens.Function; import net.beadsproject.beads.ugens.Noise; import net.beadsproject.beads.ugens.TapIn; import net.beadsproject.beads.ugens.TapOut; import net.beadsproject.beads.ugens.WavePlayer; /* not used */ public class AutomationSound extends UGenChain { private WavePlayer sinOsc; private UGen noise; private BiquadFilter highPass; private Function add; private TapIn delayIn; private TapOut delayOut; public AutomationSound(AudioContext ac) { super(ac, 0, 2); /* create ugens */ sinOsc = new WavePlayer(ac,0.0f,Buffer.SINE); noise = new Noise(ac); highPass = new BiquadFilter(ac,1); delayIn = new TapIn(ac,10f); delayOut = new TapOut(ac,delayIn,0.01f); /* configure ugens */ sinOsc.setFrequency(noise); sinOsc.setPhase(-0.35f); highPass.setType(BiquadFilter.BESSEL_HP); highPass.setFrequency(2000); highPass.setQ(3.25f); /* connect ugens */ delayIn.addInput(sinOsc); add = new Function(delayOut,sinOsc){ @Override public float calculate() { return x[0] + x[1]; } }; delayIn.addInput(add); highPass.addInput(add); /* output of this ugen */ addToChainOutput(highPass); } }