danomatika / loaf

loaf: lua, osc, and openFrameworks
http://danomatika.com/code/loaf
GNU General Public License v3.0
53 stars 4 forks source link

syphon would be nice #1

Closed MacroMachines closed 3 years ago

MacroMachines commented 6 years ago

I figure with OSC and syphon, that's all you really need to intercommunicate.

danomatika commented 6 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.

dom1817 commented 5 years ago

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.

danomatika commented 5 years ago

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.

danomatika commented 3 years ago

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.

Screen Shot 2020-12-18 at 3 21 14 AM
danomatika commented 3 years ago

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.

danomatika commented 3 years ago

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.

danomatika commented 3 years ago

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

danomatika commented 3 years ago

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.