Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Processing 2: Creative Coding Hotshot

You're reading from   Processing 2: Creative Coding Hotshot Learn Processing with exciting and engaging projects to make your computer talk, see, hear, express emotions, and even design physical objects

Arrow left icon
Product type Paperback
Published in May 2013
Publisher Packt
ISBN-13 9781782166726
Length 266 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Nikolaus Gradwohl Nikolaus Gradwohl
Author Profile Icon Nikolaus Gradwohl
Nikolaus Gradwohl
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Processing 2: Creative Coding Hotshot
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Romeo and Juliet FREE CHAPTER 2. The Stick Figure Dance Company 3. The Disco Dance Floor 4. Smilie-O-Mat 5. The Smilie-O-Mat Controller 6. Fly to the Moon 7. The Neon Globe 8. Logfile Geo-visualizer 9. From Virtual to Real Index

Blinking to the music


The second task of our current mission is to create visualizers that generate an array of 8 x 8 tiles based on a timer or on the audio information we get from Minim. The array of tiles will be used by our draw() method to generate a top view of the dance floor.

To switch between the different visualizers, we are going to write a thread that runs in the background and chooses a new visualizer every n seconds.

Engage Thrusters

Let's blink to the music:

  1. Let's start with a new sketch and import the Minim library. In our setup() method, we define a Minim context and an AudioPlayer object like we did in the previous task. This time, we start the looping of the player directly in the setup() method, so the loop starts as soon as the sketch is run.

    import ddf.minim.spi.*;
    import ddf.minim.signals.*;
    import ddf.minim.*;
    import ddf.minim.analysis.*;
    import ddf.minim.ugens.*;
    import ddf.minim.effects.*;
    
    Minim minim;
    AudioPlayer player;
    
    void setup() {
      size(300,300);
      
      minim ...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image