Help: Any idea why my MML won't play?
Closed this issue · 1 comments
everythingability commented
Korilakkuma commented
For the time being, it is possible to play the MML by fixing doMML
function as following.
function doMML() {
const mml1 ='T74O4AF+DB2AEB4G+4AF+C+2&AF+C+8F+8A8O5F+8AF+D2AEB4G+4 AF+D2BB4O6C+AE+2.&C+AE+8O5BG+16AF+16BG+E2G+B8AC+8G+B8EG+8F+C+A4.F+F+8G+G+8F+F+8G+G+4AF+C+2.BB4AEB2.&AEB8G+16F+16G+EB2R4';
const mml2 = 'T74O2B2O3C+2D1O2B2O3C+2D2E2O2A1E1F+2E2O3DD1EE1&EE1';
const mmls = [mml1, mml2];
const clones = [];
const sources = [];
for (let i = 0, len = mmls.length; i < len; i++) {
const cloned = X.clone();
clones.push(cloned);
sources.push(cloned('oscillator'));
cloned('oscillator').setup([true, true, true, true]);
}
for (let i = 0, len = clones.length; i < len; i++) {
clones[i]('mml').ready(clones[i]('oscillator'), mmls[i]);
clones[i]('mml').start(0);
}
X('mixer').mix(sources)
}
By the way, https://github.com/Korilakkuma/XSound.js (v1.x.x) is deprecated.
Please use https://github.com/Korilakkuma/XSound (v2.x.x).
Thanks !