Working with Sounds

Sounds are a necessary part of many interactive and entertainment projects. They increase the level of immersion and add feedback to the interactions. Also, sounds play a central role in sound art projects. In this chapter you will learn how to play sound samples, synthesize new sounds, and get sounds from the microphone. Also, you will learn how to get information from sound using its spectrum and use it for controlling visualization parameters:

  • Playing sound samples
  • Generating sounds
  • Using a microphone
  • Getting spectral data from sound

Codes and executables for Windows, openFrameworks 0.074, Visual Studio Express 2010 C++: Download

Bouncing Ball

Consider a ball bouncing on the floor. Let the ball jump in the left or right direction after each bounce and let’s play a sound sample at each bounce, with the speed (and hence a tone) of the sample depending on the ball position. Over time, some random sequences of samples with different tones will be played. It is a piece of computer-generated music, based on physical modeling.


Singing Voices

This example plays several looped samples, slowly changing its volumes.
The volume changing is implemented using Perlin noise.


PWM Synth

This example synthesizes PWM-sound. The mouse position change parameters: x – frequency, y – PWM-value.


Image to Sound

This example transcodes central horizontal of the image grabbed by webcamera to sound.


Loop Sampler

This example records and plays short sound sample. Press “1” for recording, and press “2” for playing.


Dancing Cloud

This example draws points cloud and plays music track. Also it analyzes music spectrum and use this data for controlling the radius and shuffle of the cloud.


Music track “surface.wav” by Ilya Orange (

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s