apply better clamping for the tpt filters
This commit is contained in:
parent
ebb5dd3a9b
commit
6f14af5293
1 changed files with 8 additions and 4 deletions
|
@ -88,7 +88,8 @@ impl DspNode for SFilter {
|
||||||
0 => {
|
0 => {
|
||||||
for frame in 0..ctx.nframes() {
|
for frame in 0..ctx.nframes() {
|
||||||
let input = inp.read(frame) as f64;
|
let input = inp.read(frame) as f64;
|
||||||
let freq = (denorm::SFilter::freq(freq, frame) as f64);
|
let freq = denorm::SFilter::freq(freq, frame) as f64;
|
||||||
|
let freq = freq.clamp(10.0, 22050.0);
|
||||||
out.write(frame,
|
out.write(frame,
|
||||||
process_1pole_lowpass(
|
process_1pole_lowpass(
|
||||||
input, freq, self.israte, &mut self.z)
|
input, freq, self.israte, &mut self.z)
|
||||||
|
@ -98,7 +99,8 @@ impl DspNode for SFilter {
|
||||||
1 => {
|
1 => {
|
||||||
for frame in 0..ctx.nframes() {
|
for frame in 0..ctx.nframes() {
|
||||||
let input = inp.read(frame) as f64;
|
let input = inp.read(frame) as f64;
|
||||||
let freq = (denorm::SFilter::freq(freq, frame) as f64);
|
let freq = denorm::SFilter::freq(freq, frame) as f64;
|
||||||
|
let freq = freq.clamp(10.0, 18000.0);
|
||||||
out.write(frame,
|
out.write(frame,
|
||||||
process_1pole_tpt_lowpass(
|
process_1pole_tpt_lowpass(
|
||||||
input, freq, self.israte, &mut self.z)
|
input, freq, self.israte, &mut self.z)
|
||||||
|
@ -108,7 +110,8 @@ impl DspNode for SFilter {
|
||||||
2 => {
|
2 => {
|
||||||
for frame in 0..ctx.nframes() {
|
for frame in 0..ctx.nframes() {
|
||||||
let input = inp.read(frame) as f64;
|
let input = inp.read(frame) as f64;
|
||||||
let freq = (denorm::SFilter::freq(freq, frame) as f64);
|
let freq = denorm::SFilter::freq(freq, frame) as f64;
|
||||||
|
let freq = freq.clamp(10.0, 22050.0);
|
||||||
out.write(frame,
|
out.write(frame,
|
||||||
process_1pole_highpass(
|
process_1pole_highpass(
|
||||||
input, freq, self.israte, &mut self.z, &mut self.y)
|
input, freq, self.israte, &mut self.z, &mut self.y)
|
||||||
|
@ -118,7 +121,8 @@ impl DspNode for SFilter {
|
||||||
3 => {
|
3 => {
|
||||||
for frame in 0..ctx.nframes() {
|
for frame in 0..ctx.nframes() {
|
||||||
let input = inp.read(frame) as f64;
|
let input = inp.read(frame) as f64;
|
||||||
let freq = (denorm::SFilter::freq(freq, frame) as f64);
|
let freq = denorm::SFilter::freq(freq, frame) as f64;
|
||||||
|
let freq = freq.clamp(10.0, 18000.0);
|
||||||
out.write(frame,
|
out.write(frame,
|
||||||
process_1pole_tpt_highpass(
|
process_1pole_tpt_highpass(
|
||||||
input, freq, self.israte, &mut self.z)
|
input, freq, self.israte, &mut self.z)
|
||||||
|
|
Loading…
Reference in a new issue