Example #1
0
 public OscillatorModule(Oscillator oscillator, int outputs, float halfToneOffset = 0, float gain = 1f, int sampleRate = 44100)
 {
     this.oscillator     = oscillator.Clone(sampleRate);
     frequencyMultiplier = (float)Tone.FrequencyMultiplierFromNoteOffset(halfToneOffset);
     this.gain           = gain;
     Inputs  = new ConnectionsArray(1, 1);
     Outputs = new ConnectionsArray(outputs);
     output  = new float[outputs];
 }
 public ConstantOscillatorModule(Oscillator oscillator, int outputs, float frequency, float gain = 1f, int sampleRate = 44100)
 {
     this.oscillator           = oscillator.Clone(sampleRate);
     this.oscillator.Frequency = frequency;
     this.gain      = gain;
     this.frequency = frequency;
     Inputs         = new ConnectionsArray(1, 1);
     Outputs        = new ConnectionsArray(outputs);
     output         = new float[outputs];
 }