Jack Campin escreveu:
> 
> It would be handy if I could not merely configure a browser to start up
> an ABC application, but have it go to a particular tune in an ABC file
> using the HTML anchor syntax:
> 
>    <A HREF="NurseryRhymes.abc#OldMacDonald">Old MacDonald had a Farm</A>
> 
> in the referring file, and a tagged line like
> 
>    X:<A NAME=OldMacDonald>42</A>
> 
> in the ABC file.  (Or some means of at least directing the application
> to the right tune, if not a specific point in it).
> 
> Can any ABC application already do this?
> 
> For which others is it feasible?
>

Actually HTML4 supports this with a combination of the elements SCRIPT,
A and OBJECT and a couple of scripting language pieces of code,
especially as ABC has a registered MIME-Type.  As for HTML, the steps
should go like this:

1       Design, as you see fit, one or more script routines to write the HTML
code for an OBJECT element, say a JavaScript 'writeobject()' that should
be fed the required information (app, file, song, etc.) to accomplish
whatever you wish your link to do.

2       In the regular HTML link, call the routine via the attribute
'onclick';  e.g.:

        <A onclick="writeobject(arg1, arg2 ...)">Old MacDonald had a Farm</A>

The selection of a specific tune should not require additional tagging
in the ABC file itself, as it is up to your app to handle this,
according to how you intend to show the tune.  Suppose it is a
downloadable applet (which seems to be a most straightforward approach,
as it doesn't require the installation of scores of plugins) able to
play the tune as MIDI, show it as text (the default option here) and
render the score with a command line such as

        <applet> -f <filename> -t <tune number> [-r (midi|txt|score)]

Your script-generated OBJECT element should be like this:

        <OBJECT
          CLASSID="http://qualquer.com/applets/abc.exe";
          CODEBASE="http://qualquer.com/abc/tunes/";
          CODETYPE="MIME-type_of_your_application"
          >
                <PARAM NAME="-f" VALUE="NurseryRhymes.abc">
                <PARAM NAME="-t" VALUE="42">
                <PARAM NAME="-r" VALUE="midi">
                <P>It looks like your browser cannot display this resource on its
own.  Please check "Old MacDonald had a Farm" (Tune #42) in <A
HREF="http://qualquer.com/abc/tunes/NurseryRhymes.abc";>NurseryRhymes.abc</A>.</P>
        </OBJECT>

Of course you could cascade options options of rendering to the surfer: 
the original link could script-generate three onclick links to generate
three different OBJECT elements for midi, txt and score, respectively.

Another way, still using those elements, should be to take advantage of
the registered MIME-Type.  In that case, it *should* suffice to generate
an OBJECT like

        <OBJECT
          DATA="http://qualquer.com/abc/tunes/abc.exe";
          TYPE="text/vnd.abc"
          >
                <P>It looks like your browser cannot handle files in ABC format on its
own.  Please check "Old MacDonald had a Farm" (Tune #42) in <A
HREF="http://qualquer.com/abc/tunes/NurseryRhymes.abc";>NurseryRhymes.abc</A>.</P>
        </OBJECT>

Unfortunately I can't tell how browsers of any generation support either
way, especially the latter one.  For this, there is an additional
drawback:  as long as there is no standard in the ABC software developer
community as to how to render ABC data and as to how to specify
parameters, there seems to be no way to provide them so that the user
agent could handle the ABC data as intended by the author.  Anyway, the
P element should be shown by non-supporting software as long as they
support the scripting language and have it enabled, allowing the surfer
to fetch the resource by hand.

(Who knows, one day we will have a standard set of rendering features
and parameters supported by all ABC software so that the MIME-Type be
useful as far as a defaul ABC viewer of the user's choice is
concerned.)

For details on the elements mentioned, please check the HTML4 official
recommendation at <url: http://www.w3.org/TR/html4>.

Regards,

        Paulo Eleut�rio Tib�rcio
To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html

Reply via email to