jameshball / osci-render-juce

γ€°πŸ“ΊπŸ”Š Synthesizer for making music by drawing objects on an oscilloscope using audio. Now as an audio plugin!
GNU General Public License v3.0
8 stars 0 forks source link

Blender integration #36

Closed jameshball closed 1 year ago

jameshball commented 1 year ago

CONTEXT AS TO WHAT THIS IS: https://www.youtube.com/watch?v=pCn297Ejvlw

Should be relatively straightforward to implement by copying the implementation from legacy osci-render https://github.com/jameshball/osci-render/blob/master/src/main/java/sh/ball/engine/ObjectServer.java

JUCE has a StreamingSocket class that should make setting up the TCP server easy, and a JSON class that will let you parse the message.

For completeness, this is the client-side code for connecting to the server in Blender https://github.com/jameshball/osci-render/blob/master/blender/osci_render/__init__.py . This will let you see the JSON format that is sent to osci-render.

The only complex part of this will be routing up the lines that are drawn to the PluginProcessor, either via the frameFifo directly https://github.com/jameshball/osci-render-juce/blob/9293214943af555d2aaa15eb4f71dc3771a66a9d/Source/PluginProcessor.cpp#L404 or somehow integrating it with FileParser but I think the first option is probably best. This would mean you'd need to disable the current frame source / file parser whilst connected to blender and then have the blender server thread add frames directly.

jameshball commented 1 year ago

Now that I've migrated to juce Synthesiser, it probs makes sense to create a ShapeSound just for Blender, and have the ObjectServer add frames directly to it. Then it can just be set as the sound if we want to use it.