package rosshendler2604; import java.io.*; 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 Voice1 extends SynthNote { // Declare units and ports. SynthEnvelope misc0; EnvelopePlayer envAmp; SineOscillator lfo1; public SynthInput modRate; public SynthInput modDepth; AddUnit add1; SawtoothOscillatorBL sawOscBl1; SawtoothOscillatorBL sawOscBl2; AddUnit add2; MultiplyUnit mult1; Filter_LowPass lowPass1; MultiplyUnit mult3; EnvelopePlayer envFilter; SynthEnvelope envelope1; public Voice1() { this( Synth.getSharedContext() ); } public Voice1( SynthContext synthContext ) { super( synthContext ); // Create unit generators. double[] misc0Data = { 0.05685764884685114, 0.9528301886792453, 0.07670399498876532, 0.7416666666666667, 0.07817926716442031, 0.42138364779874216, 0.1409988150273605, 0.2791666666666667, 0.15398946562688853, 0.3867924528301887, 0.0687029923566117, 0.1320754716981132, 0.11134622899175017, 0.24528301886792453, 0.15522475125437774, 0.0, }; misc0 = new SynthEnvelope( synthContext, misc0Data ); misc0Data = null; misc0.setSustainLoop( 2, 2 ); misc0.setReleaseLoop( -1, -1 ); add( envAmp = new EnvelopePlayer(synthContext) ); add( lfo1 = new SineOscillator(synthContext) ); add( add1 = new AddUnit(synthContext) ); add( sawOscBl1 = new SawtoothOscillatorBL(synthContext) ); add( sawOscBl2 = new SawtoothOscillatorBL(synthContext) ); add( add2 = new AddUnit(synthContext) ); add( mult1 = new MultiplyUnit(synthContext) ); add( lowPass1 = new Filter_LowPass(synthContext) ); add( mult3 = new MultiplyUnit(synthContext) ); add( envFilter = new EnvelopePlayer(synthContext) ); double[] envelope1Data = { 0.0, 0.0, 0.42500981444924585, 1.0, 0.27363454919196795, 0.15471698113207547, 0.2803533305792978, 0.9924528301886792, 0.5608456071701995, 0.27169811320754716, 0.9323008600633715, 0.0, }; envelope1 = new SynthEnvelope( synthContext, envelope1Data ); envelope1Data = null; envelope1.setSustainLoop( 1, 5 ); envelope1.setReleaseLoop( -1, -1 ); // Connect units and ports. envAmp.rate.set( 0, 1.0 ); envAmp.output.connect( sawOscBl1.amplitude); envAmp.output.connect( sawOscBl2.amplitude); addPort( frequency = add1.inputA, "frequency" ); frequency.setup( 0.0, 261.6263168, 4000.0 ); addPort( output = lowPass1.output, "output" ); lfo1.phase.set( 0, -0.9137762784957886 ); lfo1.output.connect( add1.inputB); addPort( modRate = lfo1.frequency, "modRate" ); modRate.setup( 0.0, 4.861202654271092, 30.0 ); addPort( modDepth = lfo1.amplitude, "modDepth" ); modDepth.setup( 0.0, 2.2798838570006374, 400.0 ); add1.output.connect( mult1.inputA); add1.output.connect( sawOscBl1.frequency); addPort( amplitude = envAmp.amplitude, "amplitude" ); amplitude.setup( 0.0, 0.5, 1.0 ); sawOscBl1.phase.set( 0, -0.15585535764694214 ); sawOscBl1.output.connect( add2.inputA); sawOscBl2.phase.set( 0, 0.07583419233560562 ); sawOscBl2.output.connect( add2.inputB); add2.output.connect( mult3.inputA); mult1.inputB.set( 0, 1.0099999904632568 ); mult1.output.connect( sawOscBl2.frequency); lowPass1.Q.set( 0, 9.311314582824707 ); lowPass1.amplitude.set( 0, 1.0 ); mult3.inputB.set( 0, 0.20000000298023224 ); mult3.output.connect( lowPass1.input); envFilter.rate.set( 0, 1.0 ); envFilter.amplitude.set( 0, 3346.263671875 ); envFilter.output.connect( lowPass1.frequency); } public void setStage( int time, int stage ) { switch( stage ) { case 0: envAmp.envelopePort.clear( time ); envAmp.envelopePort.queueOn( time, misc0 ); envFilter.envelopePort.clear( time ); envFilter.envelopePort.queueOn( time, envelope1 ); start( time ); break; case 1: envAmp.envelopePort.queueOff( time, misc0 ); envFilter.envelopePort.queueOff( time, envelope1 ); break; default: break; } } }