Closed ghost closed 10 years ago
please tell me this output.
$('.slider').on({
slide: function() {
value = $('#slider').val();
console.log(value); // <-- what is this value?
}
});
and try this selector.
value = $('.slider').val();
Ah yes - I'm not sure how I missed that selector setting! Thank you for that, it resolved the undefined message.
Looking at the console I now see what the problem was, running the value through a parseInt made the required conversion [value = parseInt(value);]. It appears that T("sin", {freq:100, mul:0.5}).play(); didn't like to receiving floating points. Can synths be declared so that they can?
Doesn't parseInt
return an Integer?
// convert to a Number from a String
value = Number(value);
// or
value = +value;
Yes it does. I just wasn't sure if you could .set objects via floating point numbers.
The main problems I'm having at the moment are web audio API integration on mobile, and the loading of audio files on mobile (Android), however I feel that's for another discussion.
The original issue was resolved, so will close.
Thanks!
While trying to set the freq of a simple synth within a NoUiSlider function, timbre is printing a 'T("undefined") is not defined' error printed to the console.
When setting the freq explicitly as the below commented out line, there is no issue.
This may or may not be an issue with timbre.js. Please accept my apologies if not. Thank you for a wonderful library thus far.
http://refreshless.com/nouislider/