I just saw that the code from musical.js is just copied into this repo https://github.com/PencilCode/jquery-turtle/blob/master/jquery-turtle.js#L3865
Why not use musical.js as a dependecy?
It can be already installed with npm via GitHub endpoint with this command:
npm i PencilCode/musical.js --save
Then just require('musical.js') or any other way, but this is the common way to do it.