ideoforms / signalflow

A sound synthesis framework for Python, designed for clear and concise expression of complex musical ideas
https://signalflow.dev
MIT License
167 stars 14 forks source link

Propagate SIGNALFLOW_NODE_STATE_STOPPED through child nodes #99

Closed ideoforms closed 1 year ago

ideoforms commented 1 year ago

So that (e.g.) env = ASREnvelope ** 2 still successfully triggers an auto_free event, even though its value is a Pow node.

ideoforms commented 1 year ago

Closing as I don't think this is a problem that can be solved elegantly in the general case. Intuitively:

So for state-propagation to be successful and consistent, all Nodes would need to implement a should_propagate_input_state property. Relatively simple to solve for these basic cases, but gets harder for e.g. feedback delays, which would have to integrate significant logic to figure out when the delay is "finished" (tantamount to DetectSilence).

The most common gotcha is cases in which an Envelope have a multiplier or curve applied to them as in the issue description, so a good fix may be to implement a curve and multiply parameter across all Envelope classes.