public override double GenerateSample()
        {
            FiAngle += 2 * Math.PI * Frequency * (1 + (FM?.GenerateSample() ?? 0)) / SampleRate;
            var cycle = 2 * Math.PI;

            return((FiAngle % cycle) / cycle > DutyCycle ? 0.0 : Amplitude);
        }
 public override double GenerateSample()
 {
     FiAngle += Math.PI * Frequency * (1 + (FM?.GenerateSample() ?? 0)) / SampleRate;
     return(-2 * Amplitude / Math.PI * Math.Atan(1.0 / Math.Tan(FiAngle)));
 }
Пример #3
0
 public override double GenerateSample()
 {
     FiAngle += 2 * Math.PI * Frequency * (1 + (FM?.GenerateSample() ?? 0)) / SampleRate;
     return(Amplitude * Math.Sin(FiAngle));
 }