The Unique Rhythm of Table Tennis as a Generative Musical System

by Jason Riggs
jnriggs(at)stanford-dot-edu

Overview

More than any sport I've played, ping pong has a wonderfully musical rhythm to it. Because the ball can fly indiscernibly fast at the professional level, pros have to use the game's natural rhythm to keep the ball in play.

The game's rhythm is unique through its predictable randomness. Because its tempo and the degree to which its rhythm is "swung" both change with each shot, ping pong has amazing sonic features. So, the beautiful rhythm of the game inherently begs us to use it as a musical system.

Introduction

To take musical advantage of ping pong, I have assigned instruments and musical phrases to different aspects of the game. The paddle hitting the ball triggers one sound, while the ball bouncing on the table triggers a different sound, and so on. All sounds assigned, the many aspects of ping pong create a unique symphony with the game's natural rhythm as conductor. A description of the programming will come later, but know for now that the only necessary equipment to do the below tasks is one microphone placed near the center of the table and one chuck program.

Designing the Sounds

I have designed each sound with a specific element of gameplay in mind. I want not just to make the game musical but intensely energetic as well. Below is a collection of individual sounds. As you listen to the sounds, keep in mind my descriptions of why I have chosen/designed them as I have.

Sound #1.wav: The paddle hits the ball. Two aspects of this sound are most relevant to why I designed it the way I did. One, the big bass beneath it, gives a feeling of powerful energy to the player hitting the ball. The second is the slight (80 ms) delayed stutter at the start of the sound. This is my way of further energizing the player by signifying the ball's gradual change of direction. The physical idea of impulse is at work here. If you bounce a basketball on a bed, the ball doesn't rebound the instant it hits the mattress. There's a brief period in which the two stay in contact as the mattress absorbs and then releases its elastic energy. When a ping pong ball hits a paddle, however, the two stay in contact for a much shorter time; the brevity of this period gives the player the illusion that hitting the ball is an instantaneous act, a weak "tap" that feels less energetic than a gradual, more energetic act. The noticeable delay of Sound #1 exposes the hit's impulse, thereby adding its otherwise hidden energy back into the game.

Sound #2.wav: The ball bounces on the table. While I want this sound to have lots of energy, that energy needs to be more potential than kinetic. When the player hits the ball, he needs to feel like he's detonating TNT. As the ball hits the table, however, it needs to show a huge potential of exploding rather than actually exploding. To remove explosiveness in Sound #2, I have omitted the energy that the low-end provides; to emphasize the potentiality of the energy, I have over-compressed the short, percussive sound so that ball seems more like it will explode if hit.

Sound #3.wav, Sound #4.wav, Sound #5.wav: The ball flying through the air. These are the most tonal sounds. Each time the ball travels through the air, the chuck program chooses a different one of the three above sound files. The instant the paddle hits the ball, the sound commences; the instant the ball hits the table, the sound ends. A slow attack and decay filter envelope dictates these sounds to signify the rise and fall of the ball. Though it would be impossible for a chuck shred to detect a visible phenomenon like a ball rising and falling, this problem fortunately winds up irrelevant due to the game's geometry. If the ball is hit hard towards the opponent, it travels in an approximately straight path, whereas a slow hit leads to an arced path. Analogously, the filter envelope does the same thing. If the sound is played for a short time (i.e. "the ball is hit hard/fast"), it plays only the "rising" portion of the sound; in doing so, the rise luckily adds to the potential energy of the system. If the ball is played for a longer time (i.e. "lob shot"), the sound rises and falls along with the ball.

Sound #6.wav: What if a player hits the ball really high? The opponent will prepare to smash the ball. To unleash that opponent's true hatred, the chuck program generously cues the "Finish Him!" sound from Mortal Kombat. (not yet implemented into Chuck code)

Sound #7.wav: The smash. If the ball remains in the air long enough to trigger Sound #6, when the player smashes the ball, the program triggers Sound #7, a combination of two previous sounds: Sound #1, that of the paddle hitting the ball, and a version of Sound #3 that has had its filter envelope altered to start at the decay stage. (not yet implemented into Chuck code)

Sound #8.wav: The bounce after the smash. If Sounds #6 and #7 are triggered, Sound #8 will play when the ball bounces one last time on the probable loser's side of the table. (not yet implemented into Chuck code)

The Symphony

Listen to one example of a real ping pong point. Try to imagine the game visually from the audio: Real Ping Pong

Here's what this same point might sound like with the music lying on top of it: Virtual Ping Pong!

Here's a version of the same file played at half the speed, so that the method is more easily discernible: Virtual Ping Pong! (half speed)

Keep in mind that this is only one ping pong symphony. The game's rhythm can be applied in infinitely many ways. Another cool way to use the game's rhythm is to remove the impulses of paddle hits and bounces altogether, to make the ball's movement less discernible, thereby making the rhythm more amorphous. The possibilities are endless...

How Chuck Works its Magic

As mentioned, I am using just one microphone by the ping pong table to generate this symphony. It's my friend Chuck's job to take the input from the microphone, dissect it, and create the symphony.

Because the use of all of the above sounds revolves around the difference between the paddle's hit and the ball's bounce, Chuck has to determine which shot is which from the incoming combination of both sounds. The table is a much more resonant mass than the paddle and generates more low-frequency energy. The paddle is relatively tiny and doesn't put out the bass that the table does. So, using a "leaky-integrator" envelope-follower, Chuck takes the input and first looks for any impulse above a certain volume (this threshold must be calibrated each time the microphone is placed). If it detects an impulse, it then views that impulse through the lens of a low-pass filter. If the program detects a low-end impulse, it triggers Sound #2, the effect of the ball hitting the table. If it detects an impulse, but that impulse registers more towards the high-end of the spectrum, it triggers Sound #1, the effect of the paddle hitting the ball. Sounds #3 through #8 depend upon the Sounds #1, #2, and the space between them, so once Chuck separates these two sounds, it has completed the categorizing, impulse-detection portion of the program.

The Chuck Code

In programming "chuckpong," the devil is in the details. Because the envelope-follower is extremely sensitive and difficult to control, the greatest hurdles are the values of numerous thresholds. Also, many obnoxious nuances of the ping pong system must be addressed through hacks or otherwise. Those and more can be viewed in the (incomplete) code itself: chuckpong.ck.

The "chuckpong.wav" sound file referenced towards the start of the above code can be found here: chuckpong.wav. The other five sounds currently implemented into the code are Sounds #1 through #5 above. They correspond like so:

Sound #1: paddle.wav

Sound #2: table.wav

Sounds #3, #4, and #5: whoosh1.wav, whoosh2.wav, whoosh3.wav

Intended Usage

The above Chuck code uses a .wav file "chuckpong.wav" as the input, but the program is intended to be used with a microphone. Moreover, the "only one-microphone" approach enables the realtime usage of this system in virtually any ping pong table environment.

Relevance of Project and Foresight

The most overarching aspect of the project is the use of a natural rhythmic environment as a generative musical system. At its highest level, this project is not at all limited to table tennis. The techniques used here for ping pong can, with some tweaking, be applied to any rhythmic system, natural or artificial. Ultimately, the musical ping pong system is one rhythmically unique part of a much greater idea.

Acknowledgements

Little did I know as I worked on this project... In 1998, a group of MIT students created a very neat, complex audio/visual ping pong environment called "Ping Pong Plus." The video can be viewed here.

Special thanks to Chris Chafe and Miriam Kolar for their sagely guidance, to Jason Chen for his expertise, and a special shout out to Ge Wang, the ChucK Ornholio himself, for being so willing to sacrifice his time and for being the baddest chucker in all the land.