fixed broken tests over delaybuffer fix

This commit is contained in:
Weird Constructor 2022-07-20 05:21:56 +02:00
parent c558e8226e
commit bad3e2043e
3 changed files with 60 additions and 61 deletions

View file

@ -34,30 +34,29 @@ fn check_node_comb_1() {
fft,
vec![
(0, 216),
(11, 221),
(22, 216),
(3381, 184),
(3391, 189),
(3402, 195),
(3413, 213),
(3424, 198),
(3435, 203),
(6815, 188),
(13587, 196),
(13598, 210),
(13609, 207),
(13620, 193)
(11, 219),
(22, 210),
(3122, 189),
(3133, 190),
(6266, 181),
(9421, 210),
(9432, 193),
(12565, 224),
(12575, 234)
]
);
pset_n_wait(&mut matrix, &mut node_exec, comb_1, "time", 0.030);
let fft = run_and_get_avg_fft4096_now(&mut node_exec, 180);
assert_eq!(fft, vec![(1001, 186), (3015, 186), (7031, 191)]);
assert_eq!(fft, vec![(980, 219), (3908, 225), (5868, 203), (6848, 195)]);
pset_n_wait(&mut matrix, &mut node_exec, comb_1, "g", 0.999);
let fft = run_and_get_avg_fft4096_now(&mut node_exec, 1000);
assert_eq!(fft, vec![(0, 2008), (11, 1017)]);
assert_eq!(
fft,
vec![(0, 1979), (11, 1002), (980, 1245), (1960, 1144), (2929, 1569), (2939, 1545)]
);
}
#[test]

View file

@ -68,16 +68,16 @@ fn check_node_delay_1() {
0.0,
0.0,
// delayed burst of sine for 100ms:
0.039102618,
-0.16390327,
0.27611724,
-0.2608055,
0.060164057,
0.20197779,
-0.28871512,
0.21515398,
-0.081471935,
0.0023831273,
0.05125899,
-0.17475566,
0.2607654,
-0.20392825,
-0.03003881,
0.26745066,
-0.30965388,
0.20431,
-0.064184606,
-0.0012322,
// silence afterwards:
0.0,
0.0,
@ -119,8 +119,8 @@ fn check_node_delay_2() {
vec![
// 10ms smoothing time for "inp"
0.001133, // 30ms delaytime just mixing the 0.5:
0.5, 0.5, 0.5, // the delayed smoothing ramp (10ms):
0.9513626, // the delay + input signal:
0.5, 0.5, 0.5, // the delayed smoothing ramp (10ms):
0.950001113, // the delay + input signal:
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0
]
);
@ -172,15 +172,15 @@ fn check_node_delay_time_mod() {
let fft = run_and_get_fft4096_now(&mut node_exec, 110);
// Expect a sine sweep over a
// range of low frequencies:
assert_eq!(fft[0], (86, 112));
assert_eq!(fft[5], (237, 112));
assert_eq!(fft[10], (517, 111));
assert_eq!(fft[0], (97, 113));
assert_eq!(fft[5], (312, 114));
assert_eq!(fft[10], (635, 110));
// Sweep upwards:
run_for_ms(&mut node_exec, 300.0);
let fft = run_and_get_fft4096_now(&mut node_exec, 122);
assert_eq!(fft[0], (2509, 123));
assert_eq!(fft[7], (2821, 123));
assert_eq!(fft[0], (2498, 122));
assert_eq!(fft[7], (2681, 122));
// Sweep at mostly highest point:
run_for_ms(&mut node_exec, 700.0);
@ -241,7 +241,7 @@ fn check_node_delay_trig() {
}
// We expect the signal to be delayed by 20ms:
assert_eq!(idx_first_non_zero, (44100 * 20) / 1000);
assert_eq!(idx_first_non_zero, (44100 * 20) / 1000 + 1);
}
#[test]
@ -274,7 +274,7 @@ fn check_node_delay_fb() {
let idxs_big = collect_signal_changes(&res.0[..], 50);
// We expect the signal to be delayed by 20ms:
assert_eq!(idxs_big, vec![(220, 106), (440, 53)]);
assert_eq!(idxs_big, vec![(222, 106), (444, 53)]);
}
#[test]
@ -306,7 +306,7 @@ fn check_node_delay_fb_neg() {
let idxs_big = collect_signal_changes(&res.0[..], 70);
assert_eq!(idxs_big, vec![(441, 100), (882, -100), (1323, 100)]);
assert_eq!(idxs_big, vec![(442, 100), (884, -100), (1326, 100)]);
}
#[test]
@ -341,15 +341,15 @@ fn check_node_delay_fb_pos() {
assert_eq!(
idxs_big,
vec![
(441, 100),
(441 + 1 * 441, 100),
(441 + 2 * 441, 100),
(441 + 3 * 441, 100),
(441 + 4 * 441, 100),
(441 + 5 * 441, 100),
(441 + 6 * 441, 100),
(441 + 7 * 441, 100),
(441 + 8 * 441, 100),
(442, 100),
(442 + 1 * 442, 100),
(442 + 2 * 442, 100),
(442 + 3 * 442, 100),
(442 + 4 * 442, 100),
(442 + 5 * 442, 100),
(442 + 6 * 442, 100),
(442 + 7 * 442, 100),
(442 + 8 * 442, 100),
]
);
}

View file

@ -125,10 +125,10 @@ fn check_node_pverb_dcy_1() {
// 19 []
// Now we see a very much longer tail:
assert_eq!(spec[0], vec![(388, 19), (431, 74), (474, 61), (517, 10)]);
assert_eq!(spec[5], vec![(388, 9), (431, 37), (474, 26)]);
assert_eq!(spec[9], vec![(388, 18), (431, 50), (474, 37), (517, 5)]);
assert_eq!(spec[19], vec![(388, 7), (431, 15), (474, 8)]);
assert_eq!(spec[0], vec![(388, 21), (431, 79), (474, 65), (517, 10)]);
assert_eq!(spec[5], vec![(388, 8), (431, 35), (474, 27), (517, 5)]);
assert_eq!(spec[9], vec![(388, 19), (431, 50), (474, 37), (517, 5)]);
assert_eq!(spec[19], vec![(388, 8), (431, 19), (474, 10)]);
}
#[test]
@ -149,7 +149,7 @@ fn check_node_pverb_dcy_2() {
assert_vec_feq!(
rms_spec.iter().map(|rms| rms.0).collect::<Vec<f32>>(),
// Decay over 500 ms:
vec![0.2108, 0.5744, 0.0881, 0.0021, 0.0006]
vec![0.23928945, 0.5664783, 0.07564733, 0.0016927856, 0.0006737139]
);
}
@ -172,7 +172,7 @@ fn check_node_pverb_dcy_3() {
assert_vec_feq!(
rms_spec.iter().map(|rms| rms.0).collect::<Vec<f32>>(),
// Decay over 5000 ms:
vec![0.6254, 0.2868, 0.0633, 0.0385, 0.0186,]
vec![0.6168, 0.2924, 0.0640, 0.0385, 0.0191]
);
}
@ -194,7 +194,7 @@ fn check_node_pverb_dcy_4() {
assert_vec_feq!(
rms_spec.iter().map(|rms| rms.0).collect::<Vec<f32>>(),
// Decay over 10000 ms:
vec![0.1313, 0.0995, 0.0932, 0.0507, 0.0456,]
vec![0.1319, 0.1046, 0.0942, 0.0517, 0.0435,]
);
}
@ -241,9 +241,9 @@ fn check_node_pverb_dif_on() {
// 17 []
// We expect a diffuse but defined response:
assert_eq!(spec[0], vec![(388, 8), (431, 35), (474, 35), (517, 7), (560, 5)]);
assert_eq!(spec[7], vec![(431, 18), (474, 21), (517, 6)]);
assert_eq!(spec[13], vec![(388, 6), (431, 6)]);
assert_eq!(spec[0], vec![(388, 9), (431, 38), (474, 36), (517, 7), (560, 6)]);
assert_eq!(spec[7], vec![(431, 15), (474, 19), (517, 6)]);
assert_eq!(spec[13], vec![(388, 5), (431, 4)]);
assert_eq!(spec[17], vec![]);
}
@ -295,10 +295,10 @@ fn check_node_pverb_dif_off() {
assert_eq!(spec[0], vec![]);
assert_eq!(
spec[1],
vec![(301, 4), (345, 6), (388, 84), (431, 206), (474, 152), (517, 23), (560, 7)]
vec![(301, 4), (345, 6), (388, 85), (431, 208), (474, 152), (517, 23), (560, 7)]
);
assert_eq!(spec[2], vec![]);
assert_eq!(spec[3], vec![(345, 7), (388, 79), (431, 198), (474, 134), (517, 15), (560, 4)]);
assert_eq!(spec[3], vec![(345, 7), (388, 79), (431, 198), (474, 134), (517, 16), (560, 5)]);
assert_eq!(spec[7], vec![]);
assert_eq!(spec[8], vec![(388, 6), (431, 17), (474, 11)]);
assert_eq!(spec[9], vec![(388, 7), (431, 20), (474, 13)]);
@ -331,7 +331,7 @@ fn check_node_pverb_dif_off_predly() {
trig_env(matrix, node_exec);
let spec = run_fft_spectrum_each_47ms(node_exec, 4, 20);
dump_table!(spec);
//d// dump_table!(spec);
// 0 []
// 1 []
@ -354,12 +354,12 @@ fn check_node_pverb_dif_off_predly() {
vec![
(215, 5),
(301, 11),
(345, 15),
(345, 14),
(388, 46),
(431, 105),
(431, 104),
(474, 86),
(517, 18),
(560, 14),
(517, 17),
(560, 15),
(603, 5)
]
);