I started working on this project after being inspired from a similar project as seen below:
In this video, the user created a game of pong using MAX/MSP, Jitter and Flash and used pitch detection to control one paddle and colour detection to control the second paddle.
For my experiment I was using a Max5 to control the pitch elements and decided to use a program called Processing to create my game of pong.
The reason for choosing processing is because I don't have a wide knowledge of computer programming or flash skills, programming seemed relatively straight forward in its command based programming style as opposed to a script such as html.. Being an open source software, there is a huge audience that are creating new things on the platform that made it more appealing to someone new to the field.
As pong was used in one of the softwares demonstrations, there are plenty patches already made that give the general structure for the game. I used one of these patches and modified it to suit my needs, slowing down the paddle speed as well as making it slightly bigger, changing the speed of the ball as I felt it to be too fast when you are trying to play with pitch to hit it and decided to make it a one player game. I had originally decided to make this for two people to play but went against that idea as I thought one microphone may pick up too many pitches at once. I was not completely sure how to write so that the ball bounced against the wall instead of the paddle so used a second patch and copy and pasted sections and modified the scripting until I understood how the ball should bounce and not bounce into the side or too early.
Here is a screenshot of my game of pong in action:
The next stage was to have pitch detection working in Max 5. Having never used pitch detection before I had to find info on how to send live audio into Max and for that to read the pitch of my voice.
Using the Cycling 74 website, I came across a tutorial on how to use live inputs in Max:
From there U researched pitch detection and found that I'd need an external tool for Max named sigmund which would gather pitch data in Max that is detected from the selected audio input device. From here I managed to create a simple patch based upon the Sigmund help document that detected the pitch of my voice received through my computers microphone.
My first problem I came across was filtering what I did not need in my max patch. I knew that to control my pong paddle efficiently that I would need the pitch detection to be accurate from the lowest note that I make to the highest. In the patch that I modified, my slider would move from the bottom to roughly the middle when I made the lowest note, meaning I needed to make a cut off so that the bottom of my slider was the lowest note possible. I couldn't figure out however where in my patch to add the numbered cut off.
My second and worst problem was the integration between my processing pong game and my Max 5 patch. Having both patches almost ready to go with only slight modifications needed, I needed to figure out how to integrate both pieces. I tried looking all over the internet for similar patches made. The best I could find was a patch that was using a midi controller in Max to control faders in Processing. Unfortunately processing doesn't come complete with the ability to link these two objects easily and external plug ins need to be added into both programs. My searching led me to the belief that I needed the ability to send OSC messages to each program and possibly needed GUI controls to aid my pong, pitch abilities.
This is unfortunately where I got a bit over my head and couldn't figure out how to actually link the two pieces and how to program each side so that they work with the other and had to call a day on the project.
This is a project that I would like to continue and do further searching on and believe that if I can get the two sides working with each other that it will open up a lot of new possibilities with the new skills that I have learnt on each format.


No comments:
Post a Comment