fixed warnings
This commit is contained in:
parent
8ee47a7eac
commit
b4796e98cf
3 changed files with 13 additions and 10 deletions
|
@ -21,8 +21,6 @@ macro_rules! fa_ad_mult { ($formatter: expr, $v: expr, $denorm_v: expr) => { {
|
||||||
write!($formatter, "{}", s)
|
write!($formatter, "{}", s)
|
||||||
} } }
|
} } }
|
||||||
|
|
||||||
const AD_STAGES : i8 = 2;
|
|
||||||
|
|
||||||
/// A simple amplifier
|
/// A simple amplifier
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct Ad {
|
pub struct Ad {
|
||||||
|
@ -125,7 +123,7 @@ impl DspNode for Ad {
|
||||||
atoms: &[SAtom], _params: &[ProcBuf], inputs: &[ProcBuf],
|
atoms: &[SAtom], _params: &[ProcBuf], inputs: &[ProcBuf],
|
||||||
outputs: &mut [ProcBuf], ctx_vals: LedPhaseVals)
|
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 inp = inp::Ad::inp(inputs);
|
||||||
let trig = inp::Ad::trig(inputs);
|
let trig = inp::Ad::trig(inputs);
|
||||||
|
@ -260,7 +258,7 @@ impl DspNode for Ad {
|
||||||
0.0
|
0.0
|
||||||
} else {
|
} else {
|
||||||
let x = x - a;
|
let x = x - a;
|
||||||
let delta = ((d - x) / d);
|
let delta = (d - x) / d;
|
||||||
sqrt4_to_pow4(delta, dshp)
|
sqrt4_to_pow4(delta, dshp)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -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) {
|
pub fn pset_n(matrix: &mut Matrix, nid: NodeId, parm: &str, v_norm: f32) {
|
||||||
let p = nid.inp_param(parm).unwrap();
|
let p = nid.inp_param(parm).unwrap();
|
||||||
matrix.set_param(p, SAtom::param(v_norm));
|
matrix.set_param(p, SAtom::param(v_norm));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(unused)]
|
||||||
pub fn pset_d(matrix: &mut Matrix, nid: NodeId, parm: &str, v_denorm: f32) {
|
pub fn pset_d(matrix: &mut Matrix, nid: NodeId, parm: &str, v_denorm: f32) {
|
||||||
let p = nid.inp_param(parm).unwrap();
|
let p = nid.inp_param(parm).unwrap();
|
||||||
matrix.set_param(p, SAtom::param(p.norm(v_denorm)));
|
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]
|
rms_mimax[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(unused)]
|
||||||
pub fn run_and_get_l_rms_mimax(
|
pub fn run_and_get_l_rms_mimax(
|
||||||
node_exec: &mut hexodsp::nodes::NodeExecutor,
|
node_exec: &mut hexodsp::nodes::NodeExecutor,
|
||||||
len_ms: f32) -> (f32, f32, f32)
|
len_ms: f32) -> (f32, f32, f32)
|
||||||
|
@ -326,6 +329,7 @@ pub fn run_and_get_l_rms_mimax(
|
||||||
rms_mimax[1]
|
rms_mimax[1]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(unused)]
|
||||||
pub fn run_and_get_counted_freq(
|
pub fn run_and_get_counted_freq(
|
||||||
node_exec: &mut hexodsp::nodes::NodeExecutor, ms: f32)
|
node_exec: &mut hexodsp::nodes::NodeExecutor, ms: f32)
|
||||||
-> f64
|
-> f64
|
||||||
|
@ -359,7 +363,7 @@ pub fn run_and_get_counted_freq(
|
||||||
trans_per_sample * 44100.0 * 0.5
|
trans_per_sample * 44100.0 * 0.5
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(unused)]
|
||||||
pub fn run_and_get_fft4096(
|
pub fn run_and_get_fft4096(
|
||||||
node_exec: &mut hexodsp::nodes::NodeExecutor,
|
node_exec: &mut hexodsp::nodes::NodeExecutor,
|
||||||
thres: u32,
|
thres: u32,
|
||||||
|
@ -376,6 +380,7 @@ pub fn run_and_get_fft4096(
|
||||||
fft_thres_at_ms(&mut out_l[..], FFT::F4096, thres, offs_ms)
|
fft_thres_at_ms(&mut out_l[..], FFT::F4096, thres, offs_ms)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(unused)]
|
||||||
pub fn run_and_get_fft4096_now(
|
pub fn run_and_get_fft4096_now(
|
||||||
node_exec: &mut hexodsp::nodes::NodeExecutor,
|
node_exec: &mut hexodsp::nodes::NodeExecutor,
|
||||||
thres: u32) -> Vec<(u16, u32)>
|
thres: u32) -> Vec<(u16, u32)>
|
||||||
|
|
|
@ -76,7 +76,7 @@ fn check_node_ad_retrig() {
|
||||||
|
|
||||||
|
|
||||||
matrix.set_param(trig_p, SAtom::param(0.0));
|
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));
|
matrix.set_param(trig_p, SAtom::param(1.0));
|
||||||
let res = run_for_ms(&mut node_exec, 1.5);
|
let res = run_for_ms(&mut node_exec, 1.5);
|
||||||
assert_decimated_feq!(res.0, 2, vec![
|
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
|
// check if we have any frequencies resembling 440Hz
|
||||||
matrix.set_param(trig_p, SAtom::param(1.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, 6);
|
let fft = run_and_get_fft4096_now(&mut node_exec, 6);
|
||||||
assert_eq!(fft[0], (420, 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(atk_p, SAtom::param(atk_p.norm(40.0)));
|
||||||
matrix.set_param(trig_p, SAtom::param(1.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);
|
let fft = run_and_get_fft4096_now(&mut node_exec, 300);
|
||||||
assert_eq!(fft[0], (431, 322));
|
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(dcy_p, SAtom::param(dcy_p.norm(40.0)));
|
||||||
matrix.set_param(trig_p, SAtom::param(1.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);
|
let fft = run_and_get_fft4096_now(&mut node_exec, 300);
|
||||||
assert_eq!(fft[0], (431, 489));
|
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_d(&mut matrix, ad, "atk", 20.0);
|
||||||
pset_n(&mut matrix, test, "p", 0.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);
|
pset_n(&mut matrix, test, "p", 1.0);
|
||||||
let res = run_for_ms(&mut node_exec, 10.0);
|
let res = run_for_ms(&mut node_exec, 10.0);
|
||||||
|
|
Loading…
Reference in a new issue