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 & HelpSound,  Music Libraries › Sound in Breakout mod
Page Index Toggle Pages: 1
Sound in Breakout mod? (Read 451 times)
Sound in Breakout mod?
Aug 21st, 2008, 11:52pm
 
Hi there,

I'm working on an audio project on deadline, and am trying to add sound to the modded version of Breakout found here:

http://www.trsp.net/teaching/gamemod/

(Such a cool project, by the way)

I am new to Processing and haven't programmed before, except for Max/MSP. Can this be done easily? How would I go about doing this? Anyone want to help?

I've downloaded Ess but don't really understand what to do next. I know that I need to find the code that tells the  program what to do when the balls collide with the bricks, the wall, or the paddle (and I think I've found it) but I don't know how to trigger a sample there.

Any help greatly appreciated!

Thanks so much,
Betsey
Re: Sound in Breakout mod?
Reply #1 - Aug 23rd, 2008, 6:45pm
 
There should be an example in examples-library-ess
under FILE menu.

If you aven't already, copy the ESS folder to the libraries folder of processing.

in body of your program, put something like:

import krister.Ess.*;
Ess.start();

AudioChannel some_sound = new AudioChannel("blah.wav");

then in the part where there is a paddle hit, put:
some_sound.play();

Has there been any talk of including a standard sound library for processing?
Re: Sound in Breakout mod?
Reply #2 - Aug 23rd, 2008, 9:46pm
 
Hi there, and thanks so much for your response. I will try that. Luke's example of triggering sound files was on the Processing website, but since he was doing lots of stuff afterwards with the signal (panning, etc), I wasn't sure about how to simply trigger a sound file so that it played once. I didn't check the examples folder and I will do that. I had downloaded Ess.

I ended up simply downloading a video of a Breakout game from Youtube and then using the analyzer~ object in Max to substitute a different sound (of my choice) each time there was a hit. It worked pretty well - but it would be fun to play it myself! I'll give it a shot.

Thanks again,

Betsey
Page Index Toggle Pages: 1