Esempio n. 1
0
        public override double Render(bool flag)
        {
            if (flag ^ RenderFlag)
            {
                RenderFlag = flag;

                RenderCache = Component.Render(flag);

                return(RenderCache * LeftGain);
            }

            return(RenderCache * LeftGain);
        }
Esempio n. 2
0
        public override double Render(bool flag)
        {
            if (RenderFlag ^ flag)
            {
                RenderFlag = flag;

                var lfo = Lfo.Render(flag);

                RenderCache = Envelope.Render(flag) * Math.Sin(phase + feedback + Modulation) * (1 - (lfo + 1) * lfoAmpGain * 0.5);
                feedback    = RenderCache * FeedbackRatio;

                phase += phaseStep * Math.Pow(lfoPitchGain, lfo);
                if (phase >= Pi2)
                {
                    phase -= Pi2;
                }

                RenderCache *= outputGain;

                return(RenderCache);
            }

            return(RenderCache);
        }