aatishb/synthesine

convenient way to view the value of a variable

aatishb opened this issue · 0 comments

From Dan:

is there a way to print out values in Synthesine easily, like a printf statement?

thinking that in the loudness demos like this:

let freq = 600;
let amp;
let dbfs = -20;

function setup() {
  slider('freq', 20, 1000, 1); // create frequency slider (20 - 1000 Hz)
  slider('dbfs', -27, -6, 3);  // create loudness slider (-27 to -6 dBFS)
}

function loop() {

  amp = Math.pow(10, dbfs/20); // set amplitude based on decibel level
  
  // output sine wave at given frequency & amplitude
  return sinWave(freq).mult(amp);   
}

it would be handy to see what the amp value is when you move the slider