Пример #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);
        }