Math.log2()
I need to convert list of frequencies to midi values, so i havevar freqList;
function anything()
{
var freqList = arrayfromargs(arguments);
var freqList = freqList.map(function(element) {
return 69 + 12 * Math.log2(element / 440);
});
outlet(0,freqList);
}
but Max returns an error "Math.log2 is not a function"
Any ideas?
https://stackoverflow.com/questions/3019278/how-can-i-specify-the-base-for-math-log-in-javascript/3019290
Thanks, that works . So javascript within Max doesn't have access to all the standard built in objects of javascript?
I am not sure which version of javascript supports the functionality that you are referring to, but maybe this here helps to understand what javascript version is supported by Max.
https://cycling74.com/forums/any-plans-to-update-support-for-recent-versions-of-js