Commit 96bea082 authored by Raymond Toy's avatar Raymond Toy Committed by Commit Bot

Remove Dezippering from OscillatorNode

Remove dezippering from the frequency and detune attributes. The values
are changed immediately instead of gradually changing from the old
value to the new.

Chromium Feature: https://www.chromestatus.com/features/5287995770929152
Intent to ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/YKYRrh0nWMo/aGzd3049AgAJ

Bug: 752987
Test: Oscillator/dezipper.html
Change-Id: I58df869ca99a24f6429c9cc50c1af2101dbdf03d
Reviewed-on: https://chromium-review.googlesource.com/609095
Commit-Queue: Raymond Toy <rtoy@chromium.org>
Reviewed-by: default avatarHongchan Choi <hongchan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532663}
parent 848e1096
...@@ -184,10 +184,8 @@ bool OscillatorHandler::CalculateSampleAccuratePhaseIncrements( ...@@ -184,10 +184,8 @@ bool OscillatorHandler::CalculateSampleAccuratePhaseIncrements(
frequency_->CalculateSampleAccurateValues(phase_increments, frequency_->CalculateSampleAccurateValues(phase_increments,
frames_to_process); frames_to_process);
} else { } else {
// Handle ordinary parameter smoothing/de-zippering if there are no // Handle ordinary parameter changes if there are no scheduled changes.
// scheduled changes. float frequency = frequency_->Value();
frequency_->Smooth();
float frequency = frequency_->SmoothedValue();
final_scale *= frequency; final_scale *= frequency;
} }
...@@ -212,10 +210,9 @@ bool OscillatorHandler::CalculateSampleAccuratePhaseIncrements( ...@@ -212,10 +210,9 @@ bool OscillatorHandler::CalculateSampleAccuratePhaseIncrements(
frames_to_process); frames_to_process);
} }
} else { } else {
// Handle ordinary parameter smoothing/de-zippering if there are no // Handle ordinary parameter changes if there are no scheduled
// scheduled changes. // changes.
detune_->Smooth(); float detune = detune_->Value();
float detune = detune_->SmoothedValue();
float detune_scale = powf(2, detune / 1200); float detune_scale = powf(2, detune / 1200);
final_scale *= detune_scale; final_scale *= detune_scale;
} }
...@@ -393,8 +390,8 @@ void OscillatorHandler::Process(size_t frames_to_process) { ...@@ -393,8 +390,8 @@ void OscillatorHandler::Process(size_t frames_to_process) {
float table_interpolation_factor = 0; float table_interpolation_factor = 0;
if (!has_sample_accurate_values) { if (!has_sample_accurate_values) {
frequency = frequency_->SmoothedValue(); frequency = frequency_->Value();
float detune = detune_->SmoothedValue(); float detune = detune_->Value();
float detune_scale = powf(2, detune / 1200); float detune_scale = powf(2, detune / 1200);
frequency *= detune_scale; frequency *= detune_scale;
periodic_wave_->WaveDataForFundamentalFrequency(frequency, lower_wave_data, periodic_wave_->WaveDataForFundamentalFrequency(frequency, lower_wave_data,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment