Beispiel #1
0
        public override double GetData()
        {
            double tmp;

            if (FM != null)
            {
                current += Math.PI * 2.0d * frequency * (1 + FM.GetData()) / sampleCount;
            }
            else
            {
                current += Math.PI * 2.0d * frequency / sampleCount;
            }

            if (AM != null)
            {
                tmp = ((Math.Asin(Math.Sin(current)) * amplitude * (1 + AM.GetData()) * 2 / Math.PI));
            }
            else
            {
                tmp = ((Math.Asin(Math.Sin(current)) * amplitude * 2 / Math.PI));
            }



            // current += step;

            return(tmp);
        }
Beispiel #2
0
 public override double GetData()
 {
     if (AM != null)
     {
         return(random.Next((int)(-amplitude * (1 + AM.GetData())), (int)(amplitude * (1 + AM.GetData()))));
     }
     else
     {
         return(random.Next((int)(-amplitude), (int)(amplitude)));
     }
 }
Beispiel #3
0
        public override double GetData()
        {
            var cycle = 2 * Math.PI;

            if (FM != null)
            {
                fiAngle += 2 * Math.PI * frequency * (1 + FM.GetData()) / sampleCount;
            }
            else
            {
                fiAngle += 2 * Math.PI * frequency / sampleCount;
            }

            if (AM != null)
            {
                return((fiAngle % cycle) / cycle > dutyCycle ? 0.0 : amplitude *(1 + AM.GetData()));
            }
            else
            {
                return((fiAngle % cycle) / cycle > dutyCycle ? 0.0 : amplitude);
            }
        }
Beispiel #4
0
        public override double GetData()
        {
            double tmp;

            if (FM != null)
            {
                current += Math.PI * 2.0 * frequency * (1 + FM.GetData()) / sampleCount;
            }
            else
            {
                current += Math.PI * 2 * frequency / sampleCount;
            }
            if (AM != null)
            {
                var s = AM.GetData();
                tmp = ((Math.Sin(current)) * amplitude * (1 + s));
            }
            else
            {
                tmp = ((Math.Sin(current)) * amplitude);
            }
            return(tmp);
        }