From 1cc2092d818d9aaa8518497298bac98ce6c69176 Mon Sep 17 00:00:00 2001 From: git checkout -b sisqrd Date: Tue, 16 Apr 2019 18:31:42 -0400 Subject: [PATCH] new file --- Albers_Pattern/Algoraveset3/Algoraveset3.pde | 222 ++++++++++++++++++ Albers_Pattern/Algoraveset3/sketch.properties | 2 + 2 files changed, 224 insertions(+) create mode 100644 Albers_Pattern/Algoraveset3/Algoraveset3.pde create mode 100644 Albers_Pattern/Algoraveset3/sketch.properties diff --git a/Albers_Pattern/Algoraveset3/Algoraveset3.pde b/Albers_Pattern/Algoraveset3/Algoraveset3.pde new file mode 100644 index 0000000..c4fb90e --- /dev/null +++ b/Albers_Pattern/Algoraveset3/Algoraveset3.pde @@ -0,0 +1,222 @@ +// FOR PROCESSING +// looping song code reference: +// 1. http://www.andrew.cmu.edu/course/15-100mns/bn22.pdf +// 2. http://code.compartmental.net/minim/audioplayer_method_loop.html +// livecoding for visuals w/ processing tutorial by Kesson +// https://www.youtube.com/watch?v=fO1uW-xhwtA&t=303s +// MUSIC: NUCLEYA: download link: https://nucleya.bandcamp.com/album/bass-rani + +// sisixiyu x harshikajain + +//---------------------------------------------------------------------------- +import vsync.*; +import peasy.*; +import processing.serial.*; +import processing.sound.*; + +import ddf.minim.*; +import ddf.minim.analysis.*; +import ddf.minim.effects.*; +import ddf.minim.signals.*; +import ddf.minim.spi.*; +import ddf.minim.ugens.*; + +Minim minim; +AudioIn in2; +AudioInput in; +BeatDetect beat; +AudioPlayer song; + +//Serial myPort; //initialise variable myPort for serial communication +float changing_colour; + +PeasyCam cam; + +int loopcount; + +//initialize for Albers +static final int NUM_LINES = 40; +float t; +color line1 = color(45,55,47); +//color line2 = color(148,0,211); +color line2 = color(34,58,116); + +//---------------------------------------------------------------------------- +void setup() { + size(600, 600, P3D); + cam = new PeasyCam(this, 500); + + minim = new Minim(this); + //in = minim.getLineIn(Minim, STEREO, 1024); + beat = new BeatDetect(); + beat.setSensitivity(400); + + //Connect to Arduino + //myPort = new Serial(this, "/dev/cu.usbmodem14301", 9600); + //myPort.bufferUntil ( '\n' ); // Receiving the data from the Arduino IDE + + //Audio from synth + //in2 = new AudioIn(this,0); + //in2.start(); + //in2.play(); + //in = minim.getLineIn(); + + + song = minim.loadFile("/Users/sisi/Desktop/LiveCoding/Rose.mp3"); + song.play(); + song.loop(4); +} + +//---------------------------------------------------------------------------- +//void serialEvent (Serial myPort) { +// // Changing the background color according to received data +// changing_colour = float (myPort.readStringUntil ( '\n' ) ) ; +//} + +//---------------------------------------------------------------------------- +void draw() { + //comment the background in and out + //background(changing_colour, 150, 50); // Initial background color, when we will open the serial window + background(50, 50, 200); // Initial background color, when we will open the serial window + + + beat.detect(song.mix); + + + cam.beginHUD(); + + for (int i=0; i