cuthbertLab / music21j

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

Using music21j in node js, not browser #140

Closed ultraGentle closed 2 years ago

ultraGentle commented 2 years ago

I'm attempting to run music21j in node js ( repo link , npm link ).

I get ReferenceError: self is not defined

When trying to simply initialize music21j:

const music21 = require('music21j');
const n = new music21.note.Note('F#');

Does this mean it's not possible to run outside of the browser, or am I somehow initializing to the wrong environment?

The github documentation states

...or use it in your javascript/typescript project

, hence my confusion.

mscuthbert commented 2 years ago

At present it's not possible to run outside of the browser. :-( But we're working on removing certain JQuery patches that should make it easier to do. You may however need to use ES6-style imports.

ultraGentle commented 2 years ago

Okay, thanks for the response.