Previous topicNext topic

Possible to Write 2DScene files that expose parameters?

Questions, comments, feedback, etc.
Post Reply
craftycurate
Posts: 21
Joined: Tue Jul 22, 2014 3:19 am

Possible to Write 2DScene files that expose parameters?

Post by craftycurate »

I'm wondering if it's possible to expose parameters from 2D Scenes files so they can be animated in Magic using sound, MIDI or other parameters?

e.g. if I have a function with an x parameter which draws a curve, could x be made available to Magic and linked to Volume?

I notice that 2DScenes files have a Speed and X,Y parameter, but the X & Y Params don't seem to affect the output in many cases. Is Magic set up to receive parameters from 2DScenes files?

Thanks
Richard
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Possible to Write 2DScene files that expose parameters?

Post by Magic »

Some of the 2DScenes files don't connect to the X and Y parameters, but some of them do. For example, the default file (default.glslf) does connect. It all depends on how the file was written by the original author.

If you want to try your hand at editing one of the files (which requires some knowledge of GLSL programming), you can make the X and Y parameters connect to any part of the file. I'd start with looking at the default file and trying to modify some variables to get an idea.
e.g. if I have a function with an x parameter which draws a curve, could x be made available to Magic and linked to Volume?
The answer, quite simply, is "yes". If you know enough about GLSL to be able to write a basic program that draws a curve, you could expose one of the program's variables as the X parameter, and then you could use Magic to link audio or MIDI to it.

The bottom line is that when the X or Y parameters are connected, they can be linked to audio or MIDI just like any other parameters. Check out the sample project "2DScenesExample" for an example of this.

This is a bit of a complicated topic so maybe I'll do a tutorial about it :).
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Possible to Write 2DScene files that expose parameters?

Post by Magic »

Ok, you inspired me, so I put this together quickly:
http://magicmusicvisuals.com/forums/vie ... p?f=3&t=86

:)
craftycurate
Posts: 21
Joined: Tue Jul 22, 2014 3:19 am

Re: Possible to Write 2DScene files that expose parameters?

Post by craftycurate »

Nice one! So do mouse.x and mouse.y correspond to Param X and Param Y?
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Possible to Write 2DScene files that expose parameters?

Post by Magic »

Yup, exactly.
Post Reply