Learn creative coding writing simple programs

99. Add sounds to your programs

Update: The LoadSample example program is now called TriggerASample.
Update: The stop() function is no longer required in Minim for Processing 2.1.

Adding sound to your Processing programs is easy. To play sounds we need to use an external library, because by default Processing does not play sounds. But it's just a few lines of code.

One important thing we discover in this episode is the Examples menu. That's a huge collection of programs that come with Processing. There are lots of examples for almost every feature. You can quickly open and run programs that experiment and explain math concepts, arrays, animation, 2D, 3D and much more, including the Minim sound library. It's a good idea to browse those examples, run each program and study the source code to understand how it works. It's a good way to learn and find inspiration for your own projects.

Tags: audio, sound, mp3, wav, effects

Code editor

You can make changes to the code below. Then
Below you can ask and answer questions related to this video. If your question is unrelated to the video, please post it at the Processing Forum as I'm unable to help with all of your programs and still have enough free time to eat and sleep :)
comments powered by Disqus