public SfxEffectVibrato(float minFrequency, float maxFrequency, float frequencyLFO) { lfo = new Oscillator(frequencyLFO, AudioSynth.Waveform.LFO); this.maxFrequency = maxFrequency; this.minFrequency = minFrequency; }
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; }
public override void Step(double deltaTime, Oscillator oscillator) { float t = (float)lfo.Step(deltaTime); oscillator.Frequency = Mathf.Lerp(minFrequency, maxFrequency, t); }