tomara-x / quartz

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

output resetting #144

Closed tomara-x closed 1 month ago

tomara-x commented 2 months ago

i'd like nodes to be independent when processed. if a seq is playing, then we connect an oscillator, there's no need to reset the seq

tomara-x commented 2 months ago

little out() issues:

tomara-x commented 1 month ago

self modulation

tomara-x commented 1 month ago
  1. wait for the fundsp refactor and the bevy release

  2. yeet the slot. replacing it with a net with a backend

  3. we keep a resource and add/remove entity id's to it. in there we also keep a HashMap<Entity, NodeId>.. when an entity is added to out, we get its net, push that to the output net (mix to out), store its NodeId. (maybe just the hash map will do?)

  4. when a circle is removed, get its Entity, disconnect the node and remove it

  5. when a node is changed but is still connected, we replace (we check arity outside anyways)

tomara-x commented 1 month ago

is it possible to send networks back and forth (like with crossbeam)? like, i'm thinking mem::take and replace. the network is taken, sent to audio thread, it's ticked there. when it's disconnected we send something that says "hey i want that network back", we receive it, and use mem::replace. so now it's sitting in the component with its current state. so the audio thread keeps a vec of networks and mixes them. figure out if this is possible

wait, do we even need to take and replace? like if it's possible to send nets, then i don't care about if they reset. connect seq -> seq is sent to thread connect sine -> seq and sine are sent (but since seq is already in the audio thread's vec, it's ignored and we only add sine

i'm so missing something that's gonna render this plan into a joke tomorrow

oh lol lmao, make sure you use assert no alloc when testing this xD

why am i not sending &mut Net?

suppose this works, it's only useful when connecting new nets to an out.. aka never...

tomara-x commented 1 month ago

i don't think this will be possible :(

the way nets are cloned is necessary to the way the graphs are constructed, changing that means rewriting everything :<

tomara-x commented 1 week ago

hey baby! 3d96d6b