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 Simplesine extends SynthNote { // Declare units and ports. SineOscillator sinOsc; EnvelopePlayer envPlay; SynthEnvelope envelope; public Simplesine() { this( Synth.getSharedContext() ); } public Simplesine( SynthContext synthContext ) { super( synthContext ); // Create unit generators. add( sinOsc = new SineOscillator(synthContext) ); add( envPlay = new EnvelopePlayer(synthContext) ); double[] envelopeData = { 0.1, 1.0, 0.19849175000000002, 0.0, 0.5, 0.0, }; envelope = new SynthEnvelope( synthContext, envelopeData ); envelopeData = null; envelope.setSustainLoop( -1, -1 ); envelope.setReleaseLoop( -1, -1 ); // Connect units and ports. addPort( frequency = sinOsc.frequency, "frequency" ); frequency.setup( 0.0, 349.22923456435507, 3000.0 ); addPort( amplitude = envPlay.amplitude, "amplitude" ); amplitude.setup( 0.0, 0.5, 1.0 ); addPort( output = sinOsc.output, "output" ); sinOsc.phase.set( 0, -0.5443716049194336 ); envPlay.rate.set( 0, 1.0 ); envPlay.output.connect( sinOsc.amplitude); } 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; default: break; } } }