示例#1
0
        public SfxEffectVibrato(float minFrequency, float maxFrequency, float frequencyLFO)
        {
            lfo = new Oscillator(frequencyLFO, AudioSynth.Waveform.LFO);

            this.maxFrequency = maxFrequency;
            this.minFrequency = minFrequency;
        }
示例#2
0
        public override void Step(double deltaTime, Oscillator oscillator)
        {
            if (timer > time)
            {
                return;
            }

            float t = (float)(timer / time);

            var frequency = Mathf.Lerp(startFrequency, endFrequency, t);
            var volume    = Mathf.Lerp(startVolume, endVolume, t);

            timer += deltaTime;

            oscillator.Frequency = frequency;
            oscillator.Volume    = volume;
        }
示例#3
0
        public override void Step(double deltaTime, Oscillator oscillator)
        {
            float t = (float)lfo.Step(deltaTime);

            oscillator.Frequency = Mathf.Lerp(minFrequency, maxFrequency, t);
        }