cuthbertLab / music21j

Javascript port of music21 -- Toolkit for Computational Musicology
Other
142 stars 41 forks source link

Compatibility with Deno #234

Open PetrosiliusPatter opened 6 months ago

PetrosiliusPatter commented 6 months ago

I'm trying to use this package with Deno, importing it via esm.sh, like this:

import * as m21j from "https://esm.sh/music21j@0.14.6"
console.log("m21j", m21j)

But I get the following erro:

error: Uncaught (in promise) ReferenceError: Audio is not defined
    at https://esm.sh/v135/music21j@0.14.6/denonext/music21j.mjs:378:850
    at https://esm.sh/v135/music21j@0.14.6/denonext/music21j.mjs:382:10470
    at https://esm.sh/v135/music21j@0.14.6/denonext/music21j.mjs:382:10476
    at https://esm.sh/v135/music21j@0.14.6/denonext/music21j.mjs:373:18569
    at Object../node_modules/midicube/releases/midicube.js (https://esm.sh/v135/music21j@0.14.6/denonext/music21j.mjs:373:18574)
    at rt (https://esm.sh/v135/music21j@0.14.6/denonext/music21j.mjs:383:1051430)
    at Module../src/main.ts (https://esm.sh/v135/music21j@0.14.6/denonext/music21j.mjs:187:4536)
    at rt (https://esm.sh/v135/music21j@0.14.6/denonext/music21j.mjs:383:1051430)
    at https://esm.sh/v135/music21j@0.14.6/denonext/music21j.mjs:383:1052046
    at https://esm.sh/v135/music21j@0.14.6/denonext/music21j.mjs:383:1052077

Any chance we can get this package compatible with Deno?

mscuthbert commented 2 weeks ago

I have no idea what Deno is, so you'd need to debug this yourself. Glad to take a PR.