- •Credits
- •About the Author
- •About the Reviewers
- •www.PacktPub.com
- •Table of Contents
- •Preface
- •Mission Briefing
- •Making Processing talk
- •Reading Shakespeare
- •Adding more actors
- •Building robots
- •Mission Accomplished
- •Mission Briefing
- •Connecting the Kinect
- •Making Processing see
- •Making a dancer
- •Dance! Dance! Dance!
- •Mission Accomplished
- •Mission Briefing
- •Can you hear me?
- •Blinking to the music
- •Making your disco dance floor
- •Here come the dancers
- •Mission Accomplished
- •Mission Briefing
- •Drawing your face
- •Let me change it
- •Hello Twitter
- •Tweet your mood
- •Mission Accomplished
- •Mission Briefing
- •Connecting your Arduino
- •Building your controller
- •Changing your face
- •Putting it in a box
- •Mission Accomplished
- •Mission Briefing
- •Drawing a sprite
- •Initiating the landing sequence
- •Running your sketch in the browser
- •Running the game on an Android phone
- •Mission Accomplished
- •Mission Briefing
- •Rotating a sphere
- •Let there be light
- •From sphere to globe
- •From globe to neon globe
- •Mission Accomplished
- •Mission Briefing
- •Reading a logfile
- •Geocoding IP addresses
- •Red Dot Fever
- •Interactive Red Dot Fever
- •Mission Accomplished
- •Mission Briefing
- •Beautiful functions
- •Generating an object
- •Exporting the object
- •Making it real
- •Mission Accomplished
- •Index
The Disco Dance Floor
Mission Accomplished
In this project, we learned how to use the Minim framework to play MP3 files and how to access the sample data. We used the samples to generate a visualizer for the currently played sound. We used thefft class of the Minim framework to generate an equalizer visualizer.
In our second task, we wrote five classes that change a pattern consisting of an 8 x 8 grid of tiles. We used a timer thread that triggers the changes in three of the classes. We also added a visualizer that uses the sample data and the fft class to generate the pattern.
In the third task, we changed the draw() method and used the visuals we generated in the second task as a texture. We also added a playlist functionality. The playlist controls the sequence of played songs and also the sequence of our visualizers and how long they are shown.
In the final task of our mission, we merged our visualizer texture and the playlist classes to the stick figure dance company from Project 2, The Stick Figure Dance Company. We also added a new function to our draw() method to display the song title and the artist that we retrieved from the MP3 metadata.
82
Project 3
You Ready to go Gung HO? A Hotshot
Challenge
In this mission, we created some very cool sound visualizations and we replaced the boring gray dance floor from the last mission with an awesome blinking disco dance floor. But even a very awesome disco dance floor can be made better! Why don't you try to take it to the next level by implementing one of the following ideas:
ff ff ff ff
ff
Add some light-effects, a disco ball, or a stroboscope Add some firework effects using particles
Change the red tiles to color-changing ones
Connect some DMX-controlled lights and make the virtual dance floor control your real one too
Add cross-fading to the playlist
83
Project 4
Smilie-O-Mat
When we communicate over a text-based medium like SMS, Twitter, or chat, it's somewhat hard to convey how we are currently feeling. It would be much easier and accurate to use pictures instead of a 140-character description. Humans have a lifelong training in reading emotions on faces, so our next mission is to create a Smilie-O-Mat. This little program allows us to adjust certain facial parameters of a smiley and then post the image on Twitter.
Mission Briefing
Our mission is to create the Smilie-O-Mat; a program that allows the user to create a smiley face that reflects his or her emotional state and posts it on Twitter. We will make three parameters adjustable: the angle of the eyebrows, the color of the face, and the position of the mouth (which is changeable, from frowning to smiling and vice-versa).
To post the image on Twitter, we are going to use a Java library named Twitter4J; we will also learn how to authorize a Processing sketch to change the status of a Twitter user using the OAuth authentication framework.
Why Is It Awesome?
You're feeling greenish-yellow today, with a little smile and neutral eyebrows. Don't know how to express that in 140 characters? No problem; adjust the face of the Smilie-O-Mat and tweet it. Life can be so easy when you have the right tools.
Besides that, accessing the Twitter data stream and then posting to it is a very rich data source for visualization projects or interactive Processing sketches.