Hello, how can I port this https://www.abcjs.net/ libraryto p5js? It is useful for importing ABC music files (there’s a corpus for musicology research).
In the index.html
<script src="abcjs-basic-min.js" type="text/javascript"></script>
But in the documentation it says that a
<div id="target"></div>
is needed. I assume that with an createGraphics()
will satisfy that requirement.
In my js file I have
let a;
let abcString = "X:1\nT:Example\nK:Bb\nBcde|\n";
function setup() {
createCanvas(400, 400);
a = createGraphics(400, 400);
}
function draw() {
background(40);
console.log(abcjs.signature);
noLoop();
a.background(100);
a.noStroke();
renderAbc(a, abcString);
}
But the console returns: Uncaught ReferenceError: abcjs is not defined
I’m thinking that the abcjs-basic-min.js library is not sef-contained…
Someone has experience with this type of libraries?