Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convenient way to view the value of a variable #6

Open
aatishb opened this issue Feb 5, 2020 · 0 comments
Open

convenient way to view the value of a variable #6

aatishb opened this issue Feb 5, 2020 · 0 comments

Comments

@aatishb
Copy link
Owner

aatishb commented Feb 5, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant