Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issues with playing abc tune w/ multiple voices #39

Open
jisike opened this issue Oct 24, 2017 · 8 comments
Open

issues with playing abc tune w/ multiple voices #39

jisike opened this issue Oct 24, 2017 · 8 comments

Comments

@jisike
Copy link

jisike commented Oct 24, 2017

I'm trying to play an abc tune with multiple voices but the play.html its throwings errors. Please see this jsbin. I just replaced the abc tune in the play.html example.

@jisike jisike changed the title issues with play issues with playing abc tune w/ multiple voices Oct 24, 2017
@moinejf
Copy link
Owner

moinejf commented Oct 25, 2017

Classical (X)HTML problem with foreign data: when there are reserved characters, you must use CDATA sequences.

@jisike
Copy link
Author

jisike commented Oct 25, 2017

I wrapped the abc in CDATA tag but its still throwing those errors. My issues are with the playback though. The sound still plays but it doesn't sound right. A lot of notes are out of time and pitch. So I thought it may be related to those errors.

@moinejf
Copy link
Owner

moinejf commented Oct 25, 2017

If there are errors, playing will not work.
The CDATA sequence must start and stop in a ABC comment:

%abc2-2
%<![CDATA[
... ABC stuff ...
%]]>

@jisike
Copy link
Author

jisike commented Oct 25, 2017

If there are errors, playing will not work.

what do you mean by it won't work? as i mentioned the sound still plays.

The CDATA sequence must start and stop in a ABC comment:

i tried this but it still throws errors. you can see the changes in the same jsbin

@moinejf
Copy link
Owner

moinejf commented Oct 25, 2017

  1. Playing is what is displayed. If there are error while displaying, playing will have errors.
  2. I don't see any CDATA in the file.

@bwl21
Copy link
Contributor

bwl21 commented Oct 25, 2017

Shouldn't he add the abc in a div etc. as well? in the GIST it is plain text somewhere, but has no HTML - Element around it, so it is not a single dom node.

@moinejf
Copy link
Owner

moinejf commented Oct 25, 2017

The ABC source is parsed from the raw body text content before the page is rendered. So, it may be anywhere, in the body or in any node of the DOM.
Then, the whole body source is re-written replacing each ABC fragment by SVG images as blocks.
The problem with the HTML reserved characters is due to HTML parsing by the web browser.

@moinejf
Copy link
Owner

moinejf commented Oct 31, 2017

Recently, I found informations about CDATA. It is working for XHTML only (not HTML) and, also, it will soon be deprecated.
But I found that reserved characters work with simple comments:

%abc2-2
%<!--
... ABC stuff ...
%-->

The only constraint is that there cannot 2 dashes ('--') in the ABC sequence (this could occur in lyrics).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants