//public void SetWaveOut(WaveOut newWaveOut) //public void SetWaveOut(DirectSoundOut newWaveOut) public void SetOctaveDetune(double amount, OscillatorIndex oscillator) { if (oscillator == OscillatorIndex.Primary) { primaryOctaveDetune = amount; } else if (oscillator == OscillatorIndex.Secondary) { secondaryOctaveDetune = amount; } }
public void SetVolume(float gain, OscillatorIndex oscillator) { if (oscillator == OscillatorIndex.Primary) { primaryGain = gain; } else if (oscillator == OscillatorIndex.Secondary) { secondaryGain = gain; } }
public int DetuneOctave(double frequency, OscillatorIndex oscillator) { if (oscillator == OscillatorIndex.Primary) { return((int)(Math.Pow(2.0, primaryOctaveDetune) * frequency)); } else if (oscillator == OscillatorIndex.Secondary) { return((int)(Math.Pow(2.0, secondaryOctaveDetune) * frequency)); } return((int)frequency); }
public void SetOscillators(bool Active, OscillatorIndex oscillator) { if (oscillator == OscillatorIndex.Primary) { primaryOscillator = Active; } else if (oscillator == OscillatorIndex.Secondary) { secondaryOscillator = Active; } //else if (oscillator == OscillatorIndex.LFO) //{ // LFO = Active; //} }
public void SetWaveType(SignalGeneratorType type, OscillatorIndex oscillator) { if (oscillator == OscillatorIndex.Primary) { currentPrimaryWaveType = type; } else if (oscillator == OscillatorIndex.Secondary) { currentSecondaryWaveType = type; } //else if (oscillator == OscillatorIndex.LFO) //{ // LFOWaveType = type; //} }
public void ConfigureADSR(ADSR adsr, OscillatorIndex oscillator, float newValue) { if (oscillator == OscillatorIndex.Primary) { if (adsr == ADSR.Attack) { primaryAttack = newValue; } else if (adsr == ADSR.Decay) { primaryDecay = newValue; } else if (adsr == ADSR.Sustain) { primarySustain = newValue; } else if (adsr == ADSR.Release) { primaryRelease = newValue; } } else if (oscillator == OscillatorIndex.Secondary) { if (adsr == ADSR.Attack) { secondaryAttack = newValue; } else if (adsr == ADSR.Decay) { secondaryDecay = newValue; } else if (adsr == ADSR.Sustain) { secondarySustain = newValue; } else if (adsr == ADSR.Release) { secondaryRelease = newValue; } } }