charlieroberts / gibber.audio.lib

music and audio library for Gibber
http://www.charlie-roberts.com/gibber
MIT License
82 stars 10 forks source link

How to Access Value of a Property? #11

Closed jonobr1 closed 8 years ago

jonobr1 commented 8 years ago

Hey @charlieroberts,

I'm using the current unminified build on master. With it, I'm trying to put together a little app where I can change an FM('glockenspiel')'s properties over time. At some unspecified point in the future, I'd also like to access the value of certain properties. The changing part I think is working, but every time I try to access the properties value I get a function returned. e.g:

var a = FM('glockenspiel');
a.amp = 0.6;
console.log(a.amp);

Chrome says this in the console:

function 0.6

How do I get the just number value 0.6?

Thanks for your time!

jonobr1 commented 8 years ago

Nevermind! There's a value property on the object. e.g:

var a = FM('glockenspiel');
a.amp = 0.6;
console.log(a.amp.value);

Thanks and sorry for the spam!