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

The current 'score' namespace definition #7

Open
notator opened this Issue Jul 12, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@notator
Owner

notator commented Jul 12, 2017

This namespace contains the elements and attributes used by Moritz to write specialized information into SVG scores. This includes the <score:midi> element in which temporal information is added to the graphics. The content of the <score:midi> element is defined in issue #6.

Top level requirements:

  • The SVG document includes the score namespace in the standard way (see below).
  • A complete list of all the element classes used by Moritz, including information as to how they nest, can be found here.
    Those that contain score: elements or have score: attributes are as follows:
container contained by number of occurrences
<g class='systems'> <svg> 1
<g class='system'> <g class='systems'> 1 or more
<g class='staff'> <g class='system'> 1 or more
<g class='voice'> <g class='staff'> 1 or 2
<g class='chord'> <g class='voice'> 0 or more

Optionally, scores can also contain the following input containers (These can be used in conjunction with a MIDI Input device to control the performance of a score.):

container contained by number of occurrences
<g class='inputStaff'> <g class='system'> 0, 1 or 2
<g class='inputVoice'> <g class='inputStaff'> 1 or 2
<g class='inputChord'> <g class='inputVoice'> 1 or more
  • System elements and elements inside voice elements are in chronological order.

Attributes and Elements in the score namespace

element contained by number of occurrences
<score:leftToRight> <g class='system'> 0 or 1*
<score:topToBottom> <g class='system'> 0 or 1*

A system element must contain either a <score:leftToRight> or a <score:topToBottom> element.
A <score:leftToRight> element has two numeric attributes: systemTop and systemBottom.
A <score:topToBottom> element also has two numeric attributes: systemLeft and systemRight.
The systemTop, systemBottom, systemLeft and systemRight attributes are coordinates of the system's bounding box (including all the graphic objects it contains). The client application uses these values both to discover the direction in which time flows, and to set the endpoints of the running cursor which appears during a performance of the system.
The Assistant Performer currently just plays scores that read from left to right, but this could change in future.

element contained by number of occurrences
<score:midi> <g class='chord'> 1 or more

Moritz currently writes (and the Assistant Performer reads) just use one <score:midi> element per chord.
See issue #6 for the current <score:midi> definition.

element contained by number of occurrences
<score:ccSettings> <g class='inputChord'> 0 or 1
<score:inputNotes> <g class='inputChord'> 1

Both <g class='chord'> and <g class='inputChord'> elements have a score:alignment attribute. This is an x- or y-coordinate, depending on the direction in which the cursor moves: If the cursor moves horizontally, this is an x-coordinate, otherwise it is a y-coordinate.

A skeleton SVG document (without input elements) using the score namespace:

<?xml version="1.0" encoding="utf-8"?>
<!-- a fontsStyleSheet goes here, for example: 
<?xml-stylesheet href="../../fontsStyleSheet.css" type="text/css"?>
-->
<svg ...
    xmlns="http://www.w3.org/2000/svg"
    xmlns:score="http://www.james-ingram-act-two.de/open-source/svgScoreNamespace.html"
    ...>
    <!--
    Other elements can also exist inside this <svg> element (<title>, <metadata>, <defs> etc.),
    but there is only one "systems" container. -->
    --> 
    <g class="systems" ... > <!-- The unique "systems" container -->
        <!--
        Other elements can also exist inside this "systems" container, but there are
        one or more "system" elements.
        The "system" elements are in chronological order.
        -->
        <g class="system" ... >
            <!--
            Other elements can also exist inside this "system" container, but there
            is either one <score:leftToRight> or one <score:topToBottom> element, and
            one or more "staff" elements.
            -->
            <!--
            The <score:leftToRight> or <score:topToBottom> element determines the order
            in which the system will be performed (and the meaning of the durationSymbol's
            score:alignment attribute).
            The systemTop and systemBottom attributes are coordinates of the
            system's bounding box, including all the graphics it contains.
            -->
            <score:leftToRight systemTop="42.3456" systemBottom="1234.5678" ... />
            <!--
            There are two classes of "staff": "inputStaff" and "staff".
            Output staves contain "voice"s
            Input staves contain "inputVoice"s.
            Input staves are optional. Here, for example is a staff:
            -->
            <g class="staff" ... >
                <!--
                Any number of components go here, including a stafflines group and one or more
                voices.
                (Output) voices contain "chord"s and "rest"s.
                Input voices contain "inputChord"s and "inputRest"s.
                -->
                <g class="stafflines">
                    <line class="staffline" ... />
                    <line class="staffline" ... />
                    <!-- etc.-->
                </g>
                <g class="voice" ... >
                    <!--
                    Many elements can exist inside this voice container, including one or more
                    "chord"s or "rest"s.
                    Every "chord" and "rest" contains one or more <score:midi> elements.
                    The duration symbols in an inputVoice are either "inputChord"s or "inputRest"s.
                    The duration symbol elements are in chronological order inside each voice. 
                    -->
                    <g class="chord" score:alignment="1234.5678" ... >
                        <!--
                        Any number of elements go here, including one or more <score:midi>
                        elements (temporal definitions) and the "chord"'s graphics
                        (its spatial definition). Moritz only writes one <score:midi> element
                        per durationSymbol, but other applications could write more.
                        -->
                        <score:midi>
                            <!--
                            A temporal (MIDI) interpretation of the durationSymbol goes here.
                            -->
                        <score:midi>
                    </g>           
                </g>        
            </g>
        </g>
    </g>
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment