Audio Input and Opacity

Hi there,

Im using the Minim library and trying to create a program where the opacity of text is dependant on audio input. The louder the volume of input, the higher the opacity. I'm quite new to Processing and having trouble with the coding. I'm up to this point...

import ddf.minim.*;

Minim minim;
AudioInput in;

PFont font;
float myOpacity;

void setup(){
  size(1200, 800);

  font = loadFont("BebasNeue-80.vlw");
  textFont(font);

  minim = new Minim(this);
  in = minim.getLineIn(Minim.STEREO,512);

}

void draw(){
 background(255);
 smooth();

 text("SAM STRUDWICK", 420,350);

 textSize(80);
 fill(0,0,0, myOpacity);

 myOpacity = //??

}

it's creating the relationship between sound input and opacity I'm struggling with! Any help would be great,

Many thanks

Sign In or Register to comment.