/* * Created on Dec 3, 2004 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package crawford_final2604; import com.softsynth.jsyn.*; /************** ** WARNING - this code automatically generated by Wire. ** The real source is probably a Wire patch. ** Do NOT edit this file unless you copy it to another directory and change the name. ** Otherwise it is likely to get clobbered the next time you ** export Java source code from Wire. ** ** Wire is available from: http://www.softsynth.com/wire/ */ public class LangDroneBass extends SynthNote { // Declare units and ports. Filter_BandPass bandPass; Filter_BandPass bandPass2; AddUnit add; public SynthInput cutoff; MultiplyUnit mult; public SynthInput reson; ExponentialLag expLag; EnvelopePlayer envPlay; ExponentialLag expLag2; public SynthInput rate; SynthEnvelope envelope; public SynthInput realFreq; TriangleOscillator triOsc; public LangDroneBass() { this( Synth.getSharedContext() ); } public LangDroneBass( SynthContext synthContext ) { super( synthContext ); // Create unit generators. add( bandPass = new Filter_BandPass(synthContext) ); add( bandPass2 = new Filter_BandPass(synthContext) ); add( add = new AddUnit(synthContext) ); add( mult = new MultiplyUnit(synthContext) ); add( expLag = new ExponentialLag(synthContext) ); add( envPlay = new EnvelopePlayer(synthContext) ); add( expLag2 = new ExponentialLag(synthContext) ); double[] envelopeData = { 5, 1.0, 0.4, 0.8, 0.14, 0.799, 5, 0.0, 0.01, 0.0, }; envelope = new SynthEnvelope( synthContext, envelopeData ); envelopeData = null; envelope.setSustainLoop( 1, 1 ); envelope.setReleaseLoop( -1, -1 ); add( triOsc = new TriangleOscillator(synthContext) ); // Connect units and ports. addPort( amplitude = triOsc.amplitude, "amplitude" ); amplitude.setup( 0.0, 0.5, 1.0 ); addPort( output = envPlay.output, "output" ); bandPass.amplitude.set( 0, 1.0 ); bandPass.output.connect( add.inputA); bandPass2.amplitude.set( 0, 1.0 ); bandPass2.output.connect( add.inputB); add.output.connect( envPlay.amplitude); addPort( realFreq = triOsc.frequency, "realFreq" ); realFreq.setup( 10.0, 200.0, 12000.0 ); triOsc.phase.set( 0, 0.9429425597190857 ); triOsc.output.connect( bandPass.input); triOsc.output.connect( bandPass2.input); addPort( cutoff = expLag.input, "cutoff" ); cutoff.setup( 0.0, 100.0, 12000.0 ); mult.inputB.set( 0, 2.0 ); mult.output.connect( bandPass2.frequency); addPort( reson = expLag2.input, "reson" ); reson.setup( 0.0, 30.0, 50.0 ); expLag.halfLife.set( 0, 1.57163871335797E-4 ); expLag.current.set( 0, 100.0030288696289 ); expLag.output.connect( bandPass.frequency); expLag.output.connect( mult.inputA); expLag2.halfLife.set( 0, 1.57163871335797E-4 ); expLag2.current.set( 0, 29.999242782592773 ); expLag2.output.connect( bandPass.Q); expLag2.output.connect( bandPass2.Q); addPort( rate = envPlay.rate, "rate" ); rate.setup( 0.0, 1.0, 2.0 ); } public void setStage( int time, int stage ) { switch( stage ) { case 0: envPlay.envelopePort.clear( time ); envPlay.envelopePort.queueOn( time, envelope ); start( time ); break; case 1: envPlay.envelopePort.queueOff( time, envelope ); break; case 2: // added by hand envPlay.envelopePort.clear(time); envPlay.envelopePort.queue(time, envelope, envelope .getNumFrames() - 1, 1); default: break; } } }