Skip to content

Create and <use> a <score:midiDefs> element #11

Description

@notator

This should be done parallel to, and immediately below, the SVG <defs> element.
Each midiDef would be used analogously to the graphic definitions in SVG <defs>.
The corresponding <use> elements can have a transform attribute, similar to standard SVG's.
The transform attribute could have an argument string containing the following:

  1. msDuration(newMsDuration) // sets a new msDuration, overriding the original msDuration
  2. transpose(transposition) // transposition is a positive or negative floating point number representing the number of semitones to add to the current MIDI pitch values.
  3. gliss(fromTransposition, toTransposition) // gradually changes the transposition
  4. midiCC(CCindex, CCvalue) // sets/overrides the value of a midi continuous controller
  5. midiCC(CCindex, fromCCvalue, toCCvalue) // gradually changes the value of a midi continuous controller

The end values of gradual changes are always reached at the beginning of the following event.

For example (roughly):

<svg xmlns:score="http://www.james-ingram-act-two.de/open-source/svgScoreExtensions.html">
  
  <!-- standard svg defs -->
  <defs>
    <!-- svg defs -->
  </defs>
  
  <score:midiDefs>
    <midiDef id="midiDef1">
      <!-- midi definition (in Study 2, from palette) - see Moritz Issue #6 -->
    </midiDef>
    <midiDef id="midiDef2">
      <!-- etc. -->
    </midiDef>
    <midiDef id="midiDef3">
      <!-- etc. -->
    </midiDef>
    <!-- etc. -->
  </score:midiDefs>
  
  <g class="systems">
    <g class="system">
      <g class="staff">
        <g class="voice">
          <g class="chord" score:alignment="1540.156">
            <score:midi>
              <use href="#midiDef1" transform="transpose(4)" />
            </score:midi>
            <g class="graphics">
              <!-- explicit graphics definition, as before.-->
            </g>
          </g>
        </g>
      </g>
    </g>
  </g>
</svg>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions