Thursday, May 9, 2013

Final Project

For my final project in ISTA 401 I designed a program that could visualize data about the crimes that occur in the dorms at the University of Arizona. This particular data was from 2009, the year I happened to live in the dorms. My partner Alex and I made a program that contained a list of all the crimes alongside a map of all the dorms at U of A. Here is a picture of our program being run:

For each crime on the left side there is a corresponding ellipse or 'button' that can be selected or 'activated.' If a crime becomes selected, the program will create a transparent colored circle on the UA map around the corresponding dorm. The map will show the viewer all the dorms that contain instances of these crimes. A physical number appears in the center of the transparent circles that show the count of crime at that location. 
Here is a picture of our program with some crimes selected:

We loaded in a txt file with all the counts of all the crimes at each dorm. We split each value by a comma and created multiple arrays of ints. We created a crime class which draws all the crimes on the left with the button and we also created a CrimeMarker class which puts the transparent circles over the map.

We were trying to take a data set about a particular year of crime inside the University of Arizona dorms and  visualize it in a cool and exciting way. I this was very successful as an interactive data visualization. This visualization could be a useful tool for a group that deals with this type of data every day like the police. Alex and I would eventually want to add more years of data and have the user choose which year he wants to view. One of my other ideas was to use the data to predict where crime might occur in future years.  

My Role:
Alex and I worked really hard on this project. I wrote a lot of the code, including the buttons and list of crimes on the left side. I found the x and y coordinates of each dorm on our map of U of A (to indicate where to draw the circle if that dorm had a crime occur). I created the crime class where it can detect if the mouse is over a crime button and when it is selected. I also made another class called CrimeMarker which draws the transparent circle over the map of dorms. It has the x and y coordinated I recorded earlier and a radius to decide how big the circle would appear on the map (this depended on how many occurrences of a particular crime there are in that dorm). I made sure that each crime was assigned a color. Alex helped me assign the colors based on crime level or type. In all, this was a team effort with a pretty cool turnout!

Wednesday, May 8, 2013

Research Presentation: Minim Library

I wanted to explore and discover more about the Processing library called Minim. It is a fairly easy to use audio library which helps integrate audio into your sketches. I know a lot of people are interested, including me, in creating and editing audio in Processing sketches and knowing more about Minim could be very useful.

Installation
First you should install the Minim library here: http://code.compartmental.net/minim/distro/minim-2.0.2-lib.zip

Replace your existing Minim library that comes with processing with your newly downloaded library.

Restart Processing.

Usage
Here are some cool features that Minim has:


  • AudioPlayer: Mono and Stereo playback of WAV, AIFF, AU, SND, and MP3 files.
  • AudioMetaData: An object filled with metadata about a file, such as ID3 tags.
  • AudioRecorder: Mono and Stereo audio recording either buffered or direct to disk.
  • AudioInput: Mono and Stereo input monitoring.
  • AudioOutput: Mono and Stereo sound synthesis.
  • AudioSignal: A simple interface for writing your own sound synthesis classes.
  • Comes with all the standard waveforms, a pink noise generator and a white noise generator. Additionally, you can extend the Oscillator class for easy implementation of your own periodic waveform.
  • AudioEffect: A simple interface for writing your own audio effects.
  • Comes with low pass, high pass, band pass, and notch filters. Additionally, you can extend the IIRFilter class for easy implementation of your own IIR filters.
  • Easy to attach signals and effects to AudioInputs and AudioOutputs. All the mixing and processing is taken care of for you.
  • Provides an FFT class for doing spectrum analysis.
  • Provides a BeatDetect class for doing beat detection.
Examples
1. Here is some example code that simply shows how to play a audio file with Minim:

[snip java]
import ddf.minim.*;
Minim minim;
AudioPlayer song;
void setup()
{
size(100, 100);
minim = new Minim(this);
// this loads mysong.wav from the data folder
song = minim.loadFile(“mysong.wav”);
song.play();
}
void draw()
{
background(0);
}
void stop()
{
song.close();
minim.stop();
super.stop();
}
[/snip]
2. Here is some example code of how to add a square wave to the output that goes through a low pass filter:
[snip java]
import ddf.minim.*;
import ddf.minim.signals.*;
import ddf.minim.effects.*;
Minim minim;
AudioOutput out;
SquareWave square;
LowPassSP lowpass;
void setup()
{
size(512, 200);
minim = new Minim(this);
// get a stereo line out with a sample buffer of 512 samples
out = minim.getLineOut(Minim.STEREO, 512);
// create a SquareWave with a frequency of 440 Hz,
// an amplitude of 1 and the same sample rate as out
square = new SquareWave(440, 1, 44100);
// create a LowPassSP filter with a cutoff frequency of 200 Hz
// that expects audio with the same sample rate as out
lowpass = new LowPassSP(200, 44100);
// now we can attach the square wave and the filter to our output
out.addSignal(square);
out.addEffect(lowpass);
}
void draw()
{
// you might decide to draw the waveform here or do something else
}
// here we provide a way to mute out
// because, let's face it, it's not a very pleasant sound
void keyPressed()
{
if ( key == 'm' )
{
if ( out.isMuted() )
{
out.unmute();
}
else
{
out.mute();
}
}
}
void stop()
{
out.close();
minim.stop();
super.stop();
}
[/snip]

3. This is a link to the code and demonstration of a simple beat detect program that can see when a kick, snare, or hat is played: http://code.compartmental.net/minim/examples/BeatDetect/FrequencyEnergy/
More Info
You can do so much cool stuff with the many features that Minim has to offer. For some more info and even example codes check out the Minim website (http://code.compartmental.net/tools/minim/). If you click on Tools you can see more specific functions within Minim.
This is probably one of the coolest sketches I have seen with Minim: http://motscousus.com/stuff/2008-02_Processing.org_patterns/test_beat.pde

Wednesday, May 1, 2013

Infusing Musical Boundaries

Infusing Musical Boundaries is a music installation I made in my ISTA 401 class. In this installation, the users get to immerse themselves into a musical environment where they can create music with a touch of a button. I synced up all the buttons of the keyboard to a musical loop, whether it is drums, or a beat it will continue to loop until turned off. All sounds can be turned off when needed. We wanted to infuse the ideas of Jazz, Hip-hop and Techno. If you mix and match different genres together it makes a whole new work of art and we wanted to show this through our piece. 

Here are a few screenshots:





Our work is different from others because we take loops that are very available to the public and transform them into a whole new piece that the user can personally create. The visual aspect of our program makes it stand out from the rest. The visuals make our loops more prominent and creates a whole work of art into the piece. With this aspect of the program, the user doesn't necessarily have to be about the music, they can also explore the visuals of the project. Its more of a trial and error to experience the visuals and the music. We programmed it so you can easily extract a sound from many that are playing in case there is something off beat or it does not sound right, there is a lot of power available to the user to select what they want to do.There are a few guidelines but no major rules. It is here to help the creative juices flow. 

This installation was implemented in the 2013 SISTA Art Show! During the Art Show, Marie and I gave a 5-10 minute performance to demonstrate how to use it and we rocked out!

Thursday, February 21, 2013

Art Show Ideas

Kinect Visualizer
Use data from a kinect and create a visual colorful representation of the human movements.

Musical Riff Generator
Create a program that generates a complete riff based on a single note that is played.

Virtual DJ
Use an MPC or midi controller to create a full beat/song. I would map loops to each pad so that anyone could be able to become a DJ with this installation.

Music Creational Tool
I would program an interface to generate some cool sounds. This installation would be all about manipulating beats/sounds. It would also save your work so you could edit what you made later.

Sound Visualizer
Put a microphone that sends it's audio data into a program which then gets represented visually on a display or monitor. Depending on how loud/intense the sound is, the visualizer will fluctuate in it's craziness and colorfulness.

Interactive Data Visualization
Use a relevant database of information that viewers can easily compare/contrast information to come to a conclusion. All the data would be organized and displayed and designed in a very easy way to operate. 

Art Robot
Create a robot with the function of generating a random art piece. The art piece would probably be a painting and the robot would be a moving arm with a paint brush. It would have a small variety of colors and would not create very complex paintings but more abstract. 

Musical Chess
This installation would be a game of chess that plays music with every move. Based on the position of the pieces, the music would be either soft or intense. Every time a piece is moved to another square, the music would change in some way.

Musical Light Show
This installation would have a series of colored lights that would move to audio. The color and experience would almost give a concert or live feel to the music.

3D Visual Experience 
Create a visual representation of specific topic in 3D. This display would show users meaningful data (possibly a timeline of events) of something which flys towards you, similar to the into to star wars (but flying towards you). It would be an cool an interesting way to express information to a person.

Thursday, February 14, 2013

Installation Ideas

Music Interaction/Visualization

I would create an interactive installation that has multiple pads on the ground next to a wall. Each pad will be a specific instrument. The way people stomp/hit the pads will affect the sound. On two parallel walls, the sound wave will appear in an enlarged image on digital screens. On the other two walls will be a music visualizer that will correlate to the music/sounds. You would have a simple interface in the center of the room so you could loop sounds or samples that could potentially be imported.


Movement Visualizer

I think it would be cool to have a room full of screens that cover each of the walls. I would install sensors on the ground to pick up motion within the room. Every time a person steps inside this room, the sensors pick up whatever the person is doing in the room and creates a visual representation of the action the person is doing. This could be a fun to incorporate with a dance routine. The sensors might take the speed and force of the movements into account when programming this visualizer. Each movement could be shown as a colorful and interesting movement shown on the screens of the room.

Artist Statement

Bryan LaFrese is a new and upcoming artist dedicated to the furthering of creativity and interaction within his artwork. He uses different aspects of music and sound to help people explore their own creativity. He implements a visual component to represent his projects in an intuitive and cool way so that people can accurately see and understand what is going on. Bryan's music and visual installations inspire people to express themselves and to expand on their creativity. His mission is to show people that any ordinary person can be creative. He wants to give people the tools necessary that provide confidence so they can think in a creative way. Bryan accomplishes his goal by creating a physical space that acts as a music/sound creation tool. This tool is visually represented so one can see what is being created or changed. The Musical Interaction Visualizer allows users to explore the beauty between movement and music together with visual projections.

Sunday, February 10, 2013

Visual Poetry


I took rich text from the book, A Clash of Kings: A Song of Ice and Fire: Book Two, of the hit series Game of Thrones by George R.R. Martin. The series was so good it was converted into an HBO show. I have seen the first two seasons of this awesome show and am eagerly waiting for the third, which premieres on March 31, 2013. I used this book because the contents is very emotional and has a lot of descriptive words. Here is the portion I used: 

"The comet's tail spread across the dawn, a red slash that bled above the crags of Dragonstone like a wound in the pink and purple sky.
                The maester stood on the windswept balcony outside his chambers. It was here the ravens came, after long flight. Their droppings speckled the gargoyles that rose twelve feet tall on either side of him, a hellhound and a wyvern, two of the thousand that brooded over the walls of the ancient fortress. When first he came to Dragonstone, the army of stone grotesques had made him uneasy, but as the years passed he had grown used to them.  Now he thought of them as old friends. The three of them watched the sky together with foreboding."

I labeled each word of the rich text with their corresponding part of speech. The parts of speech I used was adjective, adverb, article, conjunction, preposition, pronoun, noun, and verb. I also added a fake part of speech called "to" for all the instances I came across the word "to" in the rich text. I believed my poem would flow better and make more sense if "to" was its own part of speech. I decided to use the lyrics from one of my favorite songs called, "I Feel Good" by Jay Electronica to create a structure of this randomized poem. This song always puts a big smile on my face even when I am not in a good mood. I chose these lyrics because I think people can relate to them. I replaced each word from these lyrics with their corresponding part of speech. Here are the lyrics I used:


"I feel good when I wake up in the morning
Yawning, crack a dawn
And I say my prayers
Thank god for makin me a super mc slayer
Brush my teeth hit the shower then I comb my hair
Step out the crib lookin dappa dappa
Hit the cipher on the corner then I smack a rapper
With a sweet sixteen
I'm so mean with this mic machine
You wanna battle me I'll battle you and shatter your dreams
I said what up, he said what up
I took you girl so what up
The crowd screamed he threw the towel man enough is enough ……
Now I'm, on my way it's a beautiful day
Sun shining on my back man what more can I pray
Rims shinin on the lak man what more can I say
Can't nobody make me angry cause I'm happy today
My little sister doin good my mama doin good and my grandmother just turned seventy three"


Here are some of the outputs I got after making the random poem generator in processing:





I put both the rich text and the lyric structure into two txt files (words.txt and grammar.txt). I imported the files as Strings into processing and split up the part of speech (the key) for words.txt with the corresponding words. I then went through my grammar.txt file, which contains the structure of my lyrics, and matched each part of speech with the key from the words.txt file. I used processing to randomly take a word from the corresponding part of speech whenever an instance of that part of speech would show up within the grammar.txt file. I used different fonts and colors for each part of speech. I added a background image of the throne from the HBO series Game of Thrones which gives it a more epic feel. One thing that could have been improved was punctuation. If there were start and end points to this poem it would make things flow a lot better. Another thing that could have limited my project was how specific the parts of speech were. I only used 9 parts of speech and since I used so few, the output might not flow as well as I hoped. I added a random number within the fill command of some words which makes them flicker. It is hard to see with these pictures so it would be best if the program actually runs.

You can download the contents of my project here: https://www.dropbox.com/s/hvro07u60iy6zeg/GameOfThrones.zip
Check it out!