Skip to content
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

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

Open
notator opened this issue Jun 15, 2018 · 0 comments
Open

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

notator opened this issue Jun 15, 2018 · 0 comments
Labels

Comments

@notator
Copy link
Owner

notator commented Jun 15, 2018

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant