How to make interactive audiovisual effect in 5 minutes using Blender and MaxMSP
Blender is now a new force in 3D art. Although new but not young, about twenties.
In [Experimental Programming], I generally use Blender as a Python runtime environment out of the box, like:
Using Blender to run Python and visualizing the Fourier Series.
And this time, it is a simple and crude VJ / music visualization / audio-visual interaction software:
Fingers hurt a little, change a prop:
One more:
Controlled by mobile of course:
The OSC Controller above is BugOSC, which is based on “Wechat Mini Program” and developed by myself.
The full video only takes a few minutes:
The following is a detailed explanation of the text.
Several core modules:
-Blender Eevee Engine: responsible for real-time rendering
-NodeOSC Blender addon: responsible for OSC data sending and receiving
-MaxMSP: responsible for sound processing
-BugOSC: OSC controller
Chapter One
Step 1, download the Blender Eevee demo “Wasp Bot”
https://www.blender.org/download/demo-files/
Step 2, download and install NodeOSC addon
https://github.com/maybites/blender.NodeOSC
Install the addon in Preferences:
After installing and modifying the options, remember to save the settings:
Step 3, config NodeOSC
NodeOSC opens from here:
Firstly make a simple Cube to practice.
Set the IP and port of the PC host in NodeOSC, and bind the OSC address to the Cube’s scale attribute:
Note the two fields datapath and property in Message handlers.
For the default Cube, NodeOSC has already filled it for you:
datapath:`bpy.data.objects['Cube']`
property: `location`
Just change the location in the property to scale, because here I show the scaling effect.
Step 4, make a simple OSC sender in MaxMSP
The /cube/scale
corresponds to address
on NodeOSC.
Step 5, got it!
The real-time interaction between MaxMSP and Blender is completed, only two steps more than putting the elephant in the refrigerator.
However, this article is not over, and the excitement has just begun.
Chapter Two
Now let’s try Eevee demo:Wasp Bot
1. Open the Wasp Bot file downloaded before, and config NodeOSC
OSC is used to control the eyes, so first find the node of the eye parameter:
Try adjusting the Color parameter in the node. Well, that’s the taste:
How to fill in the parameters of Eye Object in NodeOSC?
Don’t panic, here I have a family heirloom recipe.
Click on the parameters you want to set in Color Node, and then go to the script information window to find the corresponding command line parameters!
Then copy and paste into datapath and property of NodeOSC!
datapath:`bpy.data.materials["Head"].node_tree.nodes["Emission"].inputs[1]`
property: `default_value`
If the script information window is not open, you can refer to the related operations in the video.
2. config MaxMSP
Next, play a piece of rhythmic music in MaxMSP, or collect the sound of the microphone:
3. got it!
Chapter Three
Now try to control the model in Blender with mobile phone.
First, in NodeOSC, change the IP from 127.0.0.1 to the IP of the PC in the LAN, such as 10.0.0.11, or 192.168.1.123.
Make sure your phone and PC are in the same LAN.
The OSC message address may also need to be changed to keep consistent with the OSC controller App in the phone.
For OSC App, you can use TouchOSC.
Of course, I use my BugOSC.
I use the first Toggle button in BugOSC, and its address is /bug_slider1
.
BugOSC will send two numbers 1 and 0 to NodeOSC according to the on / off state of the Toggle button.
The datapath
of NodeOSC has been bound to the parameters of the model eyes, so as to achieve the blinking effect controlled by the mobile phone.
References
- Blender Eevee demo Wasp Bot
https://www.blender.org/download/demo-files/ - NodeOSC Blender addon
https://github.com/maybites/blender.NodeOSC - BugOSC
Development article: BugOSC, an OSC controller based on WeChat Mini Program
Search in Wechat: BugOSC
Talk is cheap. Show me the code!
The entire process is included in the video.
If you still need the source files (MaxMSP and Blender), you can get them from my Patreon.
There are many articles, patches, source code and some advanced Patron-only content there.
You can find more resources in my site floatbug.com.
Your encouragement is my driving energy!
Cheers~
Contra
Website: floatbug.com
Github: github.com/avantcontra
Facebook: facebook.com/avantcontra
Twitter: twitter.com/avantcontra
Instagram: instagram.com/avantcontra
Patreon: patreon.com/avantcontra