Closed MacroMachines closed 3 years ago
I don't plan to add any extra addons to the core of loaf. The general idea is to support dynamically loading pre-compiled addons as Lua plugins, although I've not gone into this too much in depth yet.
Besides being able to share GPU textures across different softwares as @MacroMachines say, Syphon also offers an easy way to record video output. That would be a useful feature for Loaf.
I agree it could be useful, but this is really a non-core requirement. There are lots of addons that could be useful to have, but then the project becomes massive.
This is better solved by building ofxSyphon as a dynamic Lua module via a Makefile. I don't have an example of this, but I did some quick testing with ofxOsc years ago and it was possible.
I've been playing around with building addons as dynamic models to use with loaf. Syphon seemed like a good target to start and it's more or less working, although the makefile needs some cleanup and testing.
You can try the example ofxSyphon module here: https://github.com/danomatika/ofxLua/tree/master/modules
Build the module, then you can load it via require "syphon"
. See the small test.lua script.
Note: loaf may crash using the syphon module if the script is reloaded, either manually or by the file change watcher mechanism. I'm not sure why yet. The --ignore
command line flag can be used to disable the watcher.
After going down the modules rabbit-hole, I've found that SWIG does not recommend nor support mixing static and dynamic modules. This is unfortunate as it means using the syphon module is unstable, hence the crash on reload. The fix is either to make the of and gem modules dynamic or compile the syphon module into loaf like the osc module. sigh
Ok, Syphon support added with loaf 1.6.0. I've tested on macOS 10.14.6 with the Syphon Recorder application.
The macOS build is here: http://docs.danomatika.com/releases/loaf/loaf-1.6.0-macos.zip
The overview is here: https://github.com/danomatika/loaf#syphon-support
There are also command line options to start the built-in server and set it's name.
I figure with OSC and syphon, that's all you really need to intercommunicate.