tomara-x / quartz

visual programming and dsp playground
https://codeberg.org/tomara-x/quartz
Apache License 2.0
90 stars 3 forks source link

panic unrelated to in() #182

Closed tomara-x closed 5 months ago

tomara-x commented 5 months ago

a node that has 2 outputs being fed into 2 nodes stacked together

discovered because of in() but it's (thankfully/sadly) isn't a problem there

Screenshot_2024-06-09_11-28-30

test1.txt

passing it through a pass() | pass() first makes it work:

Screenshot_2024-06-09_11-36-56

test2.txt

the panic happens in audionode.rs:126 a failed assertion in process. for some reason the input.len() is 1 but the self.inputs() is 2 on some node

tomara-x commented 5 months ago

doesn't happen in 0.4 so i'm guessing it's related to the net wrapping that's removed in 0.5 67c6f4d

tomara-x commented 5 months ago

why tf do we have a node (an audionode) with inputs() of 2?

tomara-x commented 5 months ago

forgive me sami

use fundsp::hacker32::*;

fn main() {
    let dc = Net32::wrap(Box::new(dc(42.)));
    let dcs = dc.clone() | dc;
    let reverb = Net32::wrap(Box::new(reverb_stereo(40., 5., 1.)));
    let filter = Net32::wrap(Box::new(lowpass_hz(1729.,1.)));
    let filters = filter.clone() | filter;
    let mut net = dcs >> reverb >> filters;
    let input : &[&[f32]] = &[];
    let output : &mut [&mut [f32]] = &mut[&mut [0.;32]];
    println!("{:?}", output);
    net.process(32, input, output);
    println!("{:?}", output);
}
tomara-x commented 5 months ago

this and #86 are both fixed in the latest fundsp 079ac86