We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Live programming
Page Index Toggle Pages: 1
Live programming (Read 1392 times)
Live programming
Aug 13th, 2007, 12:56am
 
Is it possible to launch an app, and keep it updating while modifying the sketch?
For example, I want to change the background color and I already launched the app and it has a black background, i then go to the sketch and change the color value of teh background to red and it updates immidiately..

Edit: found http://youtube.com/watch?v=pquN6i-yx3c, how?

Slm
Re: Live programming
Reply #1 - Aug 13th, 2007, 6:56am
 
This isn't what they're using in the video, but I found it a pretty lightweight way to get started --

1. Download the Processing xmlrpc library here -- http://plw.media.mit.edu/people/arikan/xmlrpclib/

2. Create procedures in your Processing app that control the variables you want to be able to change while it's running. They can be super-simple, e.g.

boolean changeBackground(int newcolor) {
 gBackgroundColor = newcolor;
 return true;
}

3. Use a Ruby interpreter (on OSX just go to the command line and type 'irb') to activate those procedures as your Processing app runs.

The documentation on the xmlrpc library page is quite good & will get you up-and-running if you decide to go this route.

It's best for simple interactions -- changing background colors, etc., as you describe. For more complicated & more real-time maneuvers, you probably need to use something more high-tech.
Re: Live programming
Reply #2 - Aug 13th, 2007, 1:18pm
 
kontrol wrote on Aug 13th, 2007, 12:56am:
Is it possible to launch an app, and keep it updating while modifying the sketch


There are several projects out there specifically designed to allow/promote this.  For audio impromtu comes to mind, for visuals Fluxus.  Both sites have lots of good links to related tools also (a few of which do the live aspects too):

Impromtu
http://impromptu.moso.com.au/index.html
Fluxus
http://www.pawfal.org/Software/fluxus/

Not a processing-centric answer, but an answer.
Re: Live programming
Reply #3 - Aug 13th, 2007, 4:06pm
 
Reminds me of this thread: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Integrate;action=display;num=1120340727;start=0
Re: Live programming
Reply #4 - Aug 13th, 2007, 5:50pm
 

I think you can do that sort of thing by connecting a software like PD or MAX to processing via open sound control (OSC) and then send midi messages to processing to do real time manipulation on various parameters.

I guess..
Re: Live programming
Reply #5 - Aug 14th, 2007, 10:54pm
 
thx.. ill dig into it!
Re: Live programming
Reply #6 - Aug 16th, 2007, 7:48pm
 
error wrote on Aug 13th, 2007, 5:50pm:
I think you can do that sort of thing by connecting a software like PD or MAX to processing via open sound control (OSC) and then send midi messages to processing to do real time manipulation on various parameters.

I guess..


that's different from live coding though, live coding's a bit more specific / niche. what you describe is just like a playing a synth (albeit a light synth) whereas with live coding people can see you manipulate the code.

http://www.pawfal.org/Software/fluxus/images/spasm.png

is a good example - the image (which responds to the music being generated elsewhere) is overlaid by the code that generates the image. you can see edits being made and how the image changes due to those edits.

this requires a system that'll pick up edits and execute them immediately with no recompilation or loss of state. hence the original question.

(ha, actually "Fluxus reads live audio or OSC network messages which can be used as a source of animation data for realtime performances or installations. Keyboard or mouse input can also be read for simple games development, and a physics engine is included for realtime simulations of rigid body dynamics." so you were right about OSC, but for 'live coding' there's gotta be source and editing.)
Re: Live programming
Reply #7 - Aug 17th, 2007, 12:00am
 
johnG has made something that does the trick:

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=os_libraries_tools;action=display;num=1187096508
Page Index Toggle Pages: 1