Plugin Text Limitations?
I'm working with the plugin version and I'm not getting the text to render. If there's text in T: it tries to engrave it on the staff. The same is true with w:. It doesn't render lyrics at all and tries finding letters to notate on a new staff line.
I'm able to get music to render without these, so abcjs seems to be working ok otherwise.
Here's a very basic example of what I'm experiencing:
X: 1
T:
M: 4/4
c8 |]
w: Hello
- I have to leave
T:empty or else it tries to engrave these letters. w: Helloengraves an eighth note E on the second line with a fermata.
I looked through the page mentioning the differences between abc and abcjs and didn't see anything specifically mentioning the plugin text issues I'm having in case it may be a limitation. I also checked in different browsers and am seeing the same thing.
I'm just learning abcjs, and so I'm just using a barebones html file with the minified abcjs being linked to with a script tag.
Thanks!
What you're doing should work. If you have a public facing URL that I can look at I'll see if I can debug.
I just saw a similar problem and it turned out that the person didn't copy the abcjs file correctly. If you try linking directly to: https://raw.githubusercontent.com/paulrosen/abcjs/master/bin/abcjs_plugin_5.2.0-min.js does it work?
The trick is that the JS minimizer changes "\x12" into the actual carriage return character, so if you cut and paste the code into vi or something, it won't be the same as the original.
Here's a quick repo made into a GH Pages link of what I'm trying and seeing.
I also tried cloning the abcjs repo and moved the abcjs_plugin_5.2.0-min.js file directly from the repo into my directory and got the same result.
Thank you so much for the help!
I looked at the file abc.js in your repo and it doesn't match https://raw.githubusercontent.com/paulrosen/abcjs/master/bin/abcjs_plugin_5.2.0-min.js. I think somewhere in the process you lost some characters.
Is there a place where the file is interpreted as ascii instead of binary and something is changing the line endings?
Yes, when I try
<script src="https://raw.githubusercontent.com/paulrosen/abcjs/master/bin/abcjs_plugin_5.2.0-min.js"></script>
I'm getting "Loading failed" in the console. The network tab is showing a 200 status, but nothing in the response.
Regarding the ascii question, sorry, I'm not sure where I would look to see if this is happening.
Aha! The abc standard requires that header lines have a colon as the second character. The way the <pre> tag is formatted in your code has some leading white space. So I changed it to this:
<pre>
X: 1
T: Abc Test
M: 4/4
c8 |]
w: Hello
</pre>
And it worked.
That's an interesting case: it is perfectly normal to ignore leading white space in html.
I can see a case made that the plugin should remove all leading space before passing the string to abcjs. I need to think about whether that would break another case.
Awesome! That did it! I just need to move all the abc music flush-left.
Thanks for looking into this! I'm hyping finding abcjs.