On 27 Apr 2004, at 18:37, Bernard Hill wrote:

In message <[EMAIL PROTECTED]>, Christian M. Cepel <[EMAIL PROTECTED]> writes
Exu Yangi wrote:

<Snip>

Ah, yes. What do we output? Once again, the number of output technologies available in common would seem to indicate either XML or INI format. They are text based, and portable assuming we ignore the wierd end-of-line marker problems on Macs.

I would vote for XML.

Maybe I'm stupid, but I don't understand this bit of the conversation. I would expect that a parser would not have ANY form of structured output for an entire tune, or an entire book of tunes. I don't understand why anyone would want to write a parser to parse a file and then spit out a new file (or buffer) of stuff that then itself has to be re parsed to be used???

Simply because abc is such a mish-mash (read: "humanly readable") notation that the production of a structured output from it is the hard part. It's easy to write an XML parser (or other) in comparison.

It's true that it's much easier to parse XML than abc. That doesn't make XML a good choice for the output of a general-purpose abc parser though. What happens is that you convert an average tune of 250 bytes to 100K of XML, then parse all that huge volume of text again to get what you actually want. That's going to be incredibly inefficient.


Actually, I don't think it's possible to make a single abc parser to suit all purposes. In BarFly I ended up writing two separate parsers. One parses the tune for playing, generating midi and doing analysis; it's quite slow, very tolerant of syntax errors (reports them discreetly but mostly carries on anyway) and knows about stress programming. The other parses the tune to produce a picture of the staff notation. It's very fast (so it can be run after every keystroke and the screen display kept up to date during editing), much more critical of syntax errors, and it keeps track of correspondence between the abc symbols and the position of the corresponding notes in the picture, so that the user can select the text by clicking on the picture.

If you can come up with a single parser that will do all of that then I may use it. Otherwise I'll just carry on with what I have.

Phil Taylor

To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html

Reply via email to