diff --git a/examples/keys.rs b/examples/keys.rs index f864b55..84359e4 100644 --- a/examples/keys.rs +++ b/examples/keys.rs @@ -465,14 +465,14 @@ impl eframe::App for State { }); let waveform = match self.waveform { Waveform::Sine => Net::wrap(Box::new(pitch * 2.0 >> sine() * 0.1)), - Waveform::Saw => Net::wrap(Box::new(pitch >> saw() * 0.25)), - Waveform::Square => Net::wrap(Box::new(pitch >> square() * 0.25)), - Waveform::Triangle => Net::wrap(Box::new(pitch >> triangle() * 0.25)), - Waveform::Organ => Net::wrap(Box::new(pitch >> organ() * 0.25)), - Waveform::Hammond => Net::wrap(Box::new(pitch >> hammond() * 0.25)), + Waveform::Saw => Net::wrap(Box::new(pitch >> saw() * 0.2)), + Waveform::Square => Net::wrap(Box::new(pitch >> square() * 0.2)), + Waveform::Triangle => Net::wrap(Box::new(pitch >> triangle() * 0.2)), + Waveform::Organ => Net::wrap(Box::new(pitch >> organ() * 0.2)), + Waveform::Hammond => Net::wrap(Box::new(pitch >> hammond() * 0.2)), Waveform::Pulse => Net::wrap(Box::new( (pitch | lfo(move |t| lerp11(0.01, 0.99, sin_hz(0.1, t)))) - >> pulse() * 0.25, + >> pulse() * 0.2, )), Waveform::Pluck => { Net::wrap(Box::new(zero() >> pluck(pitch_hz as f32, 0.5, 0.5) * 0.5)) @@ -485,11 +485,11 @@ impl eframe::App for State { >> resonator() >> shape(Adaptive::new(0.1, Atan(0.05))) * 0.5, )), - Waveform::PolySaw => Net::wrap(Box::new(pitch >> poly_saw() * 0.06)), - Waveform::PolySquare => Net::wrap(Box::new(pitch >> poly_square() * 0.06)), + Waveform::PolySaw => Net::wrap(Box::new(pitch >> poly_saw() * 0.2)), + Waveform::PolySquare => Net::wrap(Box::new(pitch >> poly_square() * 0.2)), Waveform::PolyPulse => Net::wrap(Box::new( (pitch | lfo(move |t| lerp11(0.01, 0.99, sin_hz(0.1, t)))) - >> poly_pulse() * 0.06, + >> poly_pulse() * 0.2, )), }; let filter = match self.filter { diff --git a/src/wavetable.rs b/src/wavetable.rs index 89e8b91..03c78a2 100644 --- a/src/wavetable.rs +++ b/src/wavetable.rs @@ -74,8 +74,7 @@ where super::fft::inverse_fft(&mut a); - let z = sqrt(length as f32); - + let z = length as f32; a.iter().map(|x| x.im * z).collect() } diff --git a/tests/test_basic.rs b/tests/test_basic.rs index bc0c9a8..e52e605 100644 --- a/tests/test_basic.rs +++ b/tests/test_basic.rs @@ -187,7 +187,7 @@ fn test_basic() { ); check_wave(dc((110.0, 220.0)) >> declick_s(0.1) + pass() >> (saw() ^ dsf_square_r(0.9))); check_wave( - dc((20.0, 40.0)) >> reverse() >> pass() * pass() >> (dsf_saw_r(0.999) ^ square() * 0.2), + dc((20.0, 40.0)) >> reverse() >> pass() * pass() >> (dsf_saw_r(0.999) ^ square() * 0.1), ); check_wave( dc((880.0, 440.0)) >> pass() - pass() >> branchf::(|f| (f - 0.5) * triangle()), @@ -207,8 +207,8 @@ fn test_basic() { | ((mls() | dc(880.0)) >> !bandpass_q(1.0) >> notch_q(2.0)), ); check_wave( - dc((440.0, 880.0)) >> multisplit::() >> sumi::(|_| saw() * 0.2) - | saw_hz(220.0).phase(0.5), + dc((440.0, 880.0)) >> multisplit::() >> sumi::(|_| saw() * 0.1) + | saw_hz(220.0).phase(0.5) * 0.1, ); check_wave( dc((440.0, 880.0)) >> multisplit::() >> multijoin::() >> (sine() | sine()),