Closed chaosprint closed 2 years ago
lcs algorithm is used to solve this issue, but further testing is needed
partially solved by pre-process mul node; need further test
Are you planning to try to save and load node state when updating the graph? (e.g. oscillator phase)
Are you planning to try to save and load node state when updating the graph? (e.g. oscillator phase)
Yes. Actually, I think this has been achieved. First, I use dynamic programming to find the longest common subsequence between the previous graph and the updated graph. Thus, most of the nodes remain untouched, which is important for nodes such as plate
reverb.
On top of this mechanism, I use a preprocessor for some nodes.
For example, out: sin 440
is preprocessed to be out: const 440 >> sin 1
.
Then, if it is updated as out: sin 220
, what the parser will receive is out: const 220>> sin 1
.
In this way, the previous phase information of the sin
node itself will remain.
So far, what still needs to be optimised is that all these tasks (parsing the updated code and making the new nodes) are scheduled to the beginning of a new bar, which makes the processing pressure on that audio block quite heavy.
maybe do some fading