notator / Moritz

Contains two related Windows desktop programs, written in C#, that I use for creating scores.
MIT License
7 stars 2 forks source link

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

Open notator opened 6 years ago

notator commented 6 years ago

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>