spectrum analyzer

Lookie what I just found.

bar = ( ( val - min ) / (max - min) ) * win );

bar: the height of your bar in pixels
val: the value of the current frequency bucket
min: the minimum possible value of a bucket
max: the maximum possible value of a bucket
win: the height of your analyser window in pixels

All the math, none of the fuss of creating it myself.

No comments posted yet.

Post a Comment

Please add 3 and 4 and type the answer here:
  • About
  • Clint Rutkas: I build stuff that will eventually hurt me. I'm your average nerd.
  • Follow Clint on Twitter