worldmaking / mischmasch

https://www.alicelab.world/msvr
MIT License
9 stars 1 forks source link

detecting feedback loops - part of the translation from OT to gen~. using a graph colouring algorithm. essential for a feedback loop between 2+ modules #16

Closed michaelpalumbo closed 4 years ago

michaelpalumbo commented 5 years ago

~current progress: can detect feedback loops (known as 'cycles' in graphs) between specific inlets and outlets, BUT as many ops/modules have multiple inlets and outlets, my current algorithm can't detect cycles between one module to another.~

michaelpalumbo commented 5 years ago

@grrrwaaa I wrote an algorithm for graph colouring. its likely very inefficient, but it seems to work for now. It will print all of the arcs which should have a gen [history] object inserted between them.

the code is at branch develop/findCycles.js

You can run it using either

node findCycles.js <full path to a scene.json file>
# or run it without an argument for it to just run on scene_rich2.json
node findCycle.js

@grrrwaaa I'm assuming this code would be placed within the Max client node.script... but it also occurs to me that this code could also be used to generate deltas for creating history arcs (either adding a history=true _prop to a connection delta as its being generated, or changing an existing connection's history=true _prop) -- thoughts?

michaelpalumbo commented 4 years ago

bump this thread. We decided yes to adding a history=true or history=false _prop to the OT spec in order to indicate a cable as either feedback or non-feedback cable in both the patcher scripting as well as the VR space.

michaelpalumbo commented 4 years ago

ready. see https://github.com/worldmaking/mischmasch/blob/develop/historify.js