license, readme
parent
d13deb7ded
commit
dd0b7069e5
@ -0,0 +1,5 @@
|
|||||||
|
Copyright <2017> <a_cAt> <http://www.aaaaa.cat>
|
||||||
|
|
||||||
|
You may do anything with this work that copyright law would normally
|
||||||
|
restrict. There is no warranty. Anyway, we are going to die.
|
||||||
|
Free yourself!
|
@ -0,0 +1,9 @@
|
|||||||
|
Author: Clàudia Giralt Monedero, a_cAt
|
||||||
|
Date: 2017
|
||||||
|
Title: The fine line
|
||||||
|
|
||||||
|
Description:
|
||||||
|
|
||||||
|
“The fine line between everything matters and nothing matters”
|
||||||
|
|
||||||
|
The idea of this project is to represent this line digitally and sonorously, and let the audience play with it. seeking balance and breaking it. Harmonious sounds and the disruption of those. Experiencing how close from each other opposites can be.
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,112 @@
|
|||||||
|
var carrier; // this is the carrierillator we will hear
|
||||||
|
var modulator; // this carrierillator will modulate the amplitude of the carrier
|
||||||
|
var fft; // we'll visualize the waveform
|
||||||
|
|
||||||
|
var opac;
|
||||||
|
var carrier;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function getRandomArbitrary(min, max) {
|
||||||
|
return Math.random() * (max - min) + min;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function setup() {
|
||||||
|
|
||||||
|
|
||||||
|
var myCanvas = createCanvas(innerWidth,100);
|
||||||
|
myCanvas.parent("canvasp5");
|
||||||
|
|
||||||
|
|
||||||
|
noFill();
|
||||||
|
|
||||||
|
|
||||||
|
//SETING FIRST OSCILLATOR: CARRIER
|
||||||
|
// EXPLANATION FROM WEBSITE: The carrier is typically set at an audible frequency (i.e. 440 Hz) and connected to master output by default. The carrier.amp is set to zero because we will have the modulator control its amplitude.
|
||||||
|
|
||||||
|
var randomnumb = getRandomArbitrary(0, 20);
|
||||||
|
|
||||||
|
console.log(randomnumb);
|
||||||
|
carrier = new p5.Oscillator(); // connects to master output by default
|
||||||
|
carrier.freq(200 + randomnumb); // it sets the frequency of the carrier. AN AUDIBLE ONE.
|
||||||
|
carrier.amp(1);
|
||||||
|
// carrier's amp is 0 by default, giving our modulator total control
|
||||||
|
|
||||||
|
carrier.start();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// create an fft to analyze the audio
|
||||||
|
//an FFT (fast Fourier transform) converts a signal from its original domain (often time or space) to a representation in the frequency domain and vice versa
|
||||||
|
|
||||||
|
fft = new p5.FFT();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function draw() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var modAmp= 1;
|
||||||
|
|
||||||
|
// si el mouseY és igual o el mateix que la meitat de l'altura, fes aixo. ((DEFINEIX LA AMPLITUD.))
|
||||||
|
/* if(mouseY <= height) {
|
||||||
|
|
||||||
|
var modAmp = map(mouseY, 0, height, 0.01, 2.02);
|
||||||
|
|
||||||
|
}else{
|
||||||
|
|
||||||
|
var modAmp = map(mouseY, height, 0, 0.01, 2.02);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
carrier.amp(modAmp, 0.01); // fade time of 0.1 for smooth fading
|
||||||
|
|
||||||
|
|
||||||
|
// analyze the waveform
|
||||||
|
waveform = fft.waveform();
|
||||||
|
|
||||||
|
|
||||||
|
background(255,255,255,50); // alpha
|
||||||
|
|
||||||
|
// draw the shape of the waveform
|
||||||
|
drawWaveform();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function drawWaveform() {
|
||||||
|
|
||||||
|
|
||||||
|
stroke(0,0,0,100);
|
||||||
|
strokeWeight(0.5);
|
||||||
|
beginShape();
|
||||||
|
for (var i = 0; i<waveform.length; i++){
|
||||||
|
var x = map(i, 0, (waveform.length)/8, 0, width/2);
|
||||||
|
var y = map((waveform[i])/8, -1, 1, height/2, -height/2);
|
||||||
|
vertex(x, y + 100);
|
||||||
|
}
|
||||||
|
endShape();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue