diff --git a/README.md b/README.md index 19ba88c75..6b74281b3 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Music Visualiser Project -Name: - -Student Number: +Names: Gabriel Plaza and Sean Lawless + +Student Numbers: (Gabriel)C20474596, (Sean)C20447296 ## Instructions - Fork this repository and use it a starter project for your assignment @@ -12,6 +12,7 @@ Student Number: - Check out the WaveForm and AudioBandsVisual for examples of how to call the Processing functions from other classes that are not subclasses of PApplet # Description of the assignment +Object Oriented Programming group assignment to create an audio visualiser using java processing libraries. # Instructions diff --git a/java/data/light.mp3 b/java/data/light.mp3 new file mode 100644 index 000000000..e90e9d223 Binary files /dev/null and b/java/data/light.mp3 differ diff --git a/java/data/rain.mp3 b/java/data/rain.mp3 new file mode 100644 index 000000000..704bc45ef Binary files /dev/null and b/java/data/rain.mp3 differ diff --git a/java/data/tevvez.mp3 b/java/data/tevvez.mp3 new file mode 100644 index 000000000..7479007f1 Binary files /dev/null and b/java/data/tevvez.mp3 differ diff --git a/java/src/c123456/BryansVisual.java b/java/src/c123456/BryansVisual.java deleted file mode 100644 index e69de29bb..000000000 diff --git a/java/src/c20474596/Main.java b/java/src/c20474596/Main.java new file mode 100644 index 000000000..bab356ee8 --- /dev/null +++ b/java/src/c20474596/Main.java @@ -0,0 +1,15 @@ +package c20474596; + +public class Main{ + + public static void Start(){ + String[] a = {"MAIN"}; + processing.core.PApplet.runSketch( a, new Runner()); + } + + public static void main(String[] args){ + Start(); + } + +} + diff --git a/java/src/c20474596/Runner.java b/java/src/c20474596/Runner.java new file mode 100644 index 000000000..95294d3d2 --- /dev/null +++ b/java/src/c20474596/Runner.java @@ -0,0 +1,194 @@ +package c20474596; +import ddf.minim.AudioBuffer; +import ddf.minim.AudioInput; +import ddf.minim.AudioPlayer; +import ddf.minim.Minim; +import ddf.minim.analysis.FFT; + +public class Runner extends Visual{ + Minim minim; + AudioPlayer ap; + AudioInput ai; + AudioBuffer ab; + Star[] stars = new Star[900]; + float px; + float py; + int mode = 0; + float smoothedBoxSize = 0; + float angle = 0; + //sean edits + int c = 16; + float t = 1; + int nprime = 1; + float hue; + FFT fft; // Object that performs Fast Fourier Transform (FFT) + int OFF_MAX= 300; + drop d; + drop[] drops= new drop[500]; + float radius = 200; + float rot = 0; + + public void setup(){ + for(int i = 0; i < stars.length; i++){ + stars[i] = new Star(); + } + minim=new Minim(this); + startMinim(); + getFFT(); + loadAudio("light.mp3"); + colorMode(HSB,255); + hue = random(255); + //sean edits + noStroke(); + for(int i =0;i= '0' && key <= '9') { + mode = key - '0'; + } + if (key == ' ') + { + getAudioPlayer().cue(0); + getAudioPlayer().play(); + } + } + + public void settings(){ + size(800,800,P3D); + fullScreen(P3D, SPAN); + } + + public void draw(){ + background(0); + if(key == '1' || key == '2' || key == ' '){ //ensure everything is centered in visual 1 and 2 + translate(width/2, height/2); + } + switch(mode){ + case 1: //stars on screen visual + { + for(int i = 0; i= '0' && key <= '9') { + mode = key - '0'; + } + if (key == ' ') { + getAudioPlayer().cue(0); + getAudioPlayer().play(); + } + } + + public void setup(){ + for(int i = 0; i < stars.length; i++){ + stars[i] = new Star(); + } + startMinim(); + loadAudio("tevvez.mp3"); + colorMode(HSB); + + } + + public void settings(){ + size(800,800,P3D); + fullScreen(P3D, SPAN); + } + + + public void draw(){ + background(0); + + switch(mode){ + + case 1: //Star Wars warpdrive visual + { + translate(width/2, height/2); + for(int i = 0; iheight){ + y=random(-200,-100); + yspeed = map(z,0,20,4,10); + } + } + + void show(){ + + float thick= map(z,0,20,1,3); + strokeWeight(thick); + stroke(138,43,226); + line(x,y,x,y+len); + + + } + + + + + + private float map(int z2, int i, int j, double d, double e) { + return 0; + } + +} \ No newline at end of file diff --git a/java/src/example/AudioBandsVisual.java b/java/src/example/AudioBandsVisual.java index b6b99d6e5..032bee559 100644 --- a/java/src/example/AudioBandsVisual.java +++ b/java/src/example/AudioBandsVisual.java @@ -7,9 +7,9 @@ public class AudioBandsVisual { MyVisual mv; - public AudioBandsVisual(MyVisual mv) + public AudioBandsVisual(c20474596.MyVisual myVisual) { - this.mv = mv; + this.mv = myVisual; } public void render() diff --git a/java/src/example/CubeVisual1.java b/java/src/example/CubeVisual1.java index 8eebd97f8..b4285505d 100644 --- a/java/src/example/CubeVisual1.java +++ b/java/src/example/CubeVisual1.java @@ -14,7 +14,7 @@ public void setup() { startMinim(); //startListening(); - loadAudio("heroplanet.mp3"); + loadAudio("tevvez.mp3"); colorMode(HSB); } diff --git a/java/src/example/MyVisual.java b/java/src/example/MyVisual.java index 849e71bc2..e4c1dbca1 100644 --- a/java/src/example/MyVisual.java +++ b/java/src/example/MyVisual.java @@ -23,11 +23,11 @@ public void setup() startMinim(); // Call loadAudio to load an audio file to process - //loadAudio("heroplanet.mp3"); + loadAudio("tevvez.mp3"); // Call this instead to read audio from the microphone - startListening(); + //startListening(); wf = new WaveForm(this); abv = new AudioBandsVisual(this); diff --git a/java/src/example/RotatingAudioBands.java b/java/src/example/RotatingAudioBands.java index 72fd7a223..d49ca8443 100644 --- a/java/src/example/RotatingAudioBands.java +++ b/java/src/example/RotatingAudioBands.java @@ -32,7 +32,7 @@ public void setup() setFrameSize(256); startMinim(); - loadAudio("heroplanet.mp3"); + loadAudio("tevvez.mp3"); getAudioPlayer().play(); //startListening(); diff --git a/java/src/example/WaveForm.java b/java/src/example/WaveForm.java index 5d38aa700..64a348804 100644 --- a/java/src/example/WaveForm.java +++ b/java/src/example/WaveForm.java @@ -8,9 +8,9 @@ public class WaveForm MyVisual mv; float cy = 0; - public WaveForm(MyVisual mv) + public WaveForm(c20474596.MyVisual myVisual) { - this.mv = mv; + this.mv = myVisual; cy = this.mv.height / 2; } diff --git a/java/src/ie/tudublin/Main.java b/java/src/ie/tudublin/Main.java index 27489f824..299b91533 100644 --- a/java/src/ie/tudublin/Main.java +++ b/java/src/ie/tudublin/Main.java @@ -1,6 +1,7 @@ package ie.tudublin; import example.CubeVisual; +import example.CubeVisual1; import example.MyVisual; import example.RotatingAudioBands; @@ -10,7 +11,7 @@ public class Main public void startUI() { String[] a = {"MAIN"}; - processing.core.PApplet.runSketch( a, new MyVisual()); + processing.core.PApplet.runSketch( a, new RotatingAudioBands()); } public static void main(String[] args) diff --git a/java/src/ie/tudublin/Visual.java b/java/src/ie/tudublin/Visual.java index 927fe57b1..8bd379a63 100644 --- a/java/src/ie/tudublin/Visual.java +++ b/java/src/ie/tudublin/Visual.java @@ -22,6 +22,8 @@ public abstract class Visual extends PApplet private float smothedAmplitude = 0; + + public void startMinim() {