Пример #1
0
        //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;
            }
        }
Пример #2
0
 public void SetVolume(float gain, OscillatorIndex oscillator)
 {
     if (oscillator == OscillatorIndex.Primary)
     {
         primaryGain = gain;
     }
     else if (oscillator == OscillatorIndex.Secondary)
     {
         secondaryGain = gain;
     }
 }
Пример #3
0
 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);
 }
Пример #4
0
 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;
     //}
 }
Пример #5
0
 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;
     //}
 }
Пример #6
0
 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;
         }
     }
 }