Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why net stacked with iteslf isn't identical to split #86

Closed
tomara-x opened this issue Feb 29, 2024 · 10 comments
Closed

why net stacked with iteslf isn't identical to split #86

tomara-x opened this issue Feb 29, 2024 · 10 comments
Labels

Comments

@tomara-x
Copy link
Owner

in the case of noise, yeah that's great, but why's an oscillator spitting different samples? the nets are cloned, they should be independent

try with other generators, maybe the ramp? what happens if it's the same oscillator going through a filter, then that's stacked?

@tomara-x
Copy link
Owner Author

tomara-x commented Mar 1, 2024

even you, ramp()?! BETRAYAL!
same with piping through a filter first (lol what did you expect?)

@tomara-x
Copy link
Owner Author

tomara-x commented Mar 1, 2024

try with multiple! like 8! see if any of them are identical

@tomara-x
Copy link
Owner Author

tomara-x commented Mar 3, 2024

i'm going to a commune in vermont and will deal with no unit of time shorter than a season

Screenshot_2024-03-03_09-27-58

@tomara-x
Copy link
Owner Author

tomara-x commented Mar 5, 2024

this has something to do with ping() and the AttoHash

Pico sized hasher. It is used in computing deterministic pseudorandom phase hashes

@tomara-x
Copy link
Owner Author

tomara-x commented Mar 5, 2024

but why would you assign a random phase to oscillators? it makes no sense

@tomara-x
Copy link
Owner Author

eh

@tomara-x
Copy link
Owner Author

tomara-x commented Jun 3, 2024

fuck! i need to bisect to be sure, but i think 67c6f4d stopped this behavior? (or something since 0.4)
(which is great! i'm happy that doesn't happen to oscillators anymore.. but the question is: why tf)

@tomara-x
Copy link
Owner Author

tomara-x commented Jun 3, 2024

i love fundsp! i love how i can just do this

use fundsp::hacker32::*;

fn main() {
    let mut net1 = Net32::wrap(Box::new(sine_hz(440.)));
    let mut net2 = Net32::wrap(Box::new(sine_hz(440.)));
    let mut net3 = net1.clone() | net2.clone();
    let mut net4 = Net32::wrap(Box::new(net1.clone() | net2.clone()));
    println!("1: {:?}", net1.get_mono());
    println!("2: {:?}", net2.get_mono());
    println!("3: {:?}", net3.get_stereo());
    println!("4: {:?}", net4.get_stereo());
}

and yep, that confirms it

1: -0.46202415
2: -0.46202415
3: (-0.46202415, -0.46202415)
4: (-0.26424092, -0.99266475)

@tomara-x
Copy link
Owner Author

tomara-x commented Jun 3, 2024

FunDSP uses a deterministic pseudorandom phase system for audio generators. Generator phases are seeded from network structure and node location.

network structure and node location..

@tomara-x
Copy link
Owner Author

tomara-x commented Jun 4, 2024

fundsp bug https://discord.com/channels/590254806208217089/780429214809063444/1247429203993821318

now the question is: why did the pseudorandom phase never happen with ramp() (the new version) (it needs the hash method to be implemented, right?)

yup! everything makes sense now!

    /// Set node pseudorandom phase hash.
    /// This is called from `ping` (only). It should not be called by users.
    /// The node is allowed to reset itself here.
    #[allow(unused_variables)]
    fn set_hash(&mut self, hash: u64) {
        // Override this to use the hash.
        // The default implementation does nothing.
    }

@tomara-x tomara-x closed this as not planned Won't fix, can't repro, duplicate, stale Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant