Hoop Dreams: Programming Problems

In my initial plan, I had a vision of creating a hoop that could record both made shots and misses.  I had to almost threw this idea out because it was too difficult program the hoop to differentiate between a made shot and missed shot.  One idea was to attach buttons or sensors to the backboard but obviously a user could bank a shot and get it through the hoop.  Another idea was to use vibration sensors but the hoop vibrates significantly even when the ball goes in because of the flimsiness of the basket, the flexibility of the rim, and its overall light weight.  The other challenge was to record air balls, balls that don’t touch the rim or backboard.  This would require different technology like a camera that would be programmed to see the ball and basket and see it miss the hoop.  This would have taken weeks to program, not to mention the fact I have no idea how to program such an idea.

I am using Max 6 software to provide the sound effects and keep score.  Initially, I wanted to use sounds from the commentator off of Midway’s NBA Jam, and give the hoop a bit of a retro feel and pay tribute to one of the most entertaining sports video games of all time.  I found one website that had those sound bytes on a Flash soundboard.  There was not a clear way to download these sounds so I tried some programs that would supposedly allow me to rip the sounds like Soundflower and Jack but to no avail.  So I had to settle for using a free license sound byte from SoundBible.com of a crowd cheering in lieu of a commentator.  Now I could have still used the soundboard by hovering the cursor over one of the icons and clipped the MakeyMakey to receive mouse click messages and have the NBA Jam sounds come that way.  I decided not to do that since I didn’t want to have so many components to the project and I could only have one NBA sound byte going at the same time.  The NBA Jam sound bytes get really annoying if you hear one over and over repeatedly.

Another issue I had was a little more technical in nature.  I was able to create a counter on Max 6 to keep score, along with a reset button.  The challenge I had was that the counter would not count the first press of the button, it was only after the second press that it would count “1.”  I also struggled with the toggle switch on Max because the toggle switch would turn the sound effects on and off.  Therefore, when the arcade button is pressed, it triggers the toggle switch which will turn the sound effect on; however, if the sound effect is still playing and the button is struck again, it will turn the sound effect off.  What I wanted was the button to only turn the sound effect on.

I contacted Bill Turkel about these issues and he was able to tweak my patch and fix the issues. What he did was replace the toggle with a message that communicates to the sfplay to only play the sound clip.  He also added a trigger between the counter and integer  that tells it to goes directly to “1” when the button is struck.  See the before and after images below.  If you would like to play with the patches on your own computers, here’s a link to the raw data for the old patch and the new patch.

Problematic Max 6 patch for the interactive basketball hoop

Problematic Max 6 patch for the interactive basketball hoop

Functional Max 6 Patch for the interactive basketball hoop

Functional Max 6 Patch for the interactive basketball hoop

Basically, the programming problems are resolved.  The next blog post will continue to talk about the construction of the basketball hoop itself.

Advertisements

2 thoughts on “Hoop Dreams: Programming Problems

  1. Pingback: Problematic Max 6 Patch for the Interactive Basketball Hoop | Writing History and other things

  2. Pingback: Improved Max 6 Patch for the Interactive Basketball Hoop | Writing History and other things

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s