fixed warnings

This commit is contained in:
Weird Constructor 2021-06-18 05:09:36 +02:00
parent 8ee47a7eac
commit b4796e98cf
3 changed files with 13 additions and 10 deletions

View file

@ -21,8 +21,6 @@ macro_rules! fa_ad_mult { ($formatter: expr, $v: expr, $denorm_v: expr) => { {
write!($formatter, "{}", s)
} } }
const AD_STAGES : i8 = 2;
/// A simple amplifier
#[derive(Debug, Clone)]
pub struct Ad {
@ -125,7 +123,7 @@ impl DspNode for Ad {
atoms: &[SAtom], _params: &[ProcBuf], inputs: &[ProcBuf],
outputs: &mut [ProcBuf], ctx_vals: LedPhaseVals)
{
use crate::dsp::{out, inp, denorm, denorm_v, inp_dir, at};
use crate::dsp::{out, inp, denorm, at};
let inp = inp::Ad::inp(inputs);
let trig = inp::Ad::trig(inputs);
@ -260,7 +258,7 @@ impl DspNode for Ad {
0.0
} else {
let x = x - a;
let delta = ((d - x) / d);
let delta = (d - x) / d;
sqrt4_to_pow4(delta, dshp)
}
} else {

View file

@ -209,11 +209,13 @@ macro_rules! assert_minmax_of_rms {
}
}
#[allow(unused)]
pub fn pset_n(matrix: &mut Matrix, nid: NodeId, parm: &str, v_norm: f32) {
let p = nid.inp_param(parm).unwrap();
matrix.set_param(p, SAtom::param(v_norm));
}
#[allow(unused)]
pub fn pset_d(matrix: &mut Matrix, nid: NodeId, parm: &str, v_denorm: f32) {
let p = nid.inp_param(parm).unwrap();
matrix.set_param(p, SAtom::param(p.norm(v_denorm)));
@ -317,6 +319,7 @@ pub fn run_and_get_first_rms_mimax(
rms_mimax[0]
}
#[allow(unused)]
pub fn run_and_get_l_rms_mimax(
node_exec: &mut hexodsp::nodes::NodeExecutor,
len_ms: f32) -> (f32, f32, f32)
@ -326,6 +329,7 @@ pub fn run_and_get_l_rms_mimax(
rms_mimax[1]
}
#[allow(unused)]
pub fn run_and_get_counted_freq(
node_exec: &mut hexodsp::nodes::NodeExecutor, ms: f32)
-> f64
@ -359,7 +363,7 @@ pub fn run_and_get_counted_freq(
trans_per_sample * 44100.0 * 0.5
}
#[allow(unused)]
pub fn run_and_get_fft4096(
node_exec: &mut hexodsp::nodes::NodeExecutor,
thres: u32,
@ -376,6 +380,7 @@ pub fn run_and_get_fft4096(
fft_thres_at_ms(&mut out_l[..], FFT::F4096, thres, offs_ms)
}
#[allow(unused)]
pub fn run_and_get_fft4096_now(
node_exec: &mut hexodsp::nodes::NodeExecutor,
thres: u32) -> Vec<(u16, u32)>

View file

@ -76,7 +76,7 @@ fn check_node_ad_retrig() {
matrix.set_param(trig_p, SAtom::param(0.0));
let res = run_for_ms(&mut node_exec, 0.1);
run_for_ms(&mut node_exec, 0.1);
matrix.set_param(trig_p, SAtom::param(1.0));
let res = run_for_ms(&mut node_exec, 1.5);
assert_decimated_feq!(res.0, 2, vec![
@ -153,7 +153,7 @@ fn check_node_ad_inp_sin() {
// check if we have any frequencies resembling 440Hz
matrix.set_param(trig_p, SAtom::param(1.0));
let res = run_for_ms(&mut node_exec, 7.0);
run_for_ms(&mut node_exec, 7.0);
let fft = run_and_get_fft4096_now(&mut node_exec, 6);
assert_eq!(fft[0], (420, 6));
@ -169,7 +169,7 @@ fn check_node_ad_inp_sin() {
matrix.set_param(atk_p, SAtom::param(atk_p.norm(40.0)));
matrix.set_param(trig_p, SAtom::param(1.0));
let res = run_for_ms(&mut node_exec, 7.0);
run_for_ms(&mut node_exec, 7.0);
let fft = run_and_get_fft4096_now(&mut node_exec, 300);
assert_eq!(fft[0], (431, 322));
@ -185,7 +185,7 @@ fn check_node_ad_inp_sin() {
matrix.set_param(dcy_p, SAtom::param(dcy_p.norm(40.0)));
matrix.set_param(trig_p, SAtom::param(1.0));
let res = run_for_ms(&mut node_exec, 7.0);
run_for_ms(&mut node_exec, 7.0);
let fft = run_and_get_fft4096_now(&mut node_exec, 300);
assert_eq!(fft[0], (431, 489));
@ -322,7 +322,7 @@ fn check_node_ad_atk_dcy() {
pset_d(&mut matrix, ad, "atk", 20.0);
pset_n(&mut matrix, test, "p", 0.0);
let res = run_for_ms(&mut node_exec, 10.0);
run_for_ms(&mut node_exec, 10.0);
pset_n(&mut matrix, test, "p", 1.0);
let res = run_for_ms(&mut node_exec, 10.0);