MSCX Structure: Note Tags

• May 28, 2021 - 01:50

Do the Note tags always contain Events and Event tags even when there is no event data?

NoteEvent.png


Comments

No, not normally. In 3.x in the beginning, some empty tags were written, even doubled, but this ought to not be the case. Maybe you edited that note with the pianoroll editor before?

AIUI pitch and tpc are mandatory (and probably fret and string for tab clefs, but I don’t have any scores with them).

The feature you want to use should look like the example below.

          <Chord>
            <durationType>quarter</durationType>
            <Note>
              <Events>
                <Event>
                  <ontime>1000</ontime>
                  <len>2000</len>
                  </Event>
                </Events>
              <pitch>60</pitch>
              <tpc>14</tpc>
              <fret>1<fret>
              <string>1</string>
              </Note>
            </Chord>

Otherwise, they are not required if there is no change in the length or velocity of the note.

I recently made some changes while reviewing a score. But these changes in PRE were written in the score as an empty meta tag as in your example.
I think when you reset a modified Len value (or rewrite it to 1000) or reset a modified onTime value (or rewrite it to 0) these empty tags show up.

In reply to by Ziya Mete Demircan

Thanks. I'd forgotten about ontime but I now recall seeing it in arpeggios. Velocity comes after tpc so it's not in my way. I'm only going to mod len but I'll clearly have to check if it's already present or whether I need to add the Events group.

Do you know whether MSCX files are always in English?

In reply to by yonah_ag

If you deal with MuseScore files directly, you might be interested in looking at a couple of things I did.

http://www.mirbsd.org/music/Mscore2/mscx-cln.xsl (XSLT)
‣ “cleans” a MuseScore 2 file: removes everything but the first voice in each stave, all lyrics, dynamics, ornaments and other… hidden “gems” often found in MIDI or MusicXML import or from mu͒.com scores

http://www.mirbsd.org/music/resources/xlyrics.xsl (XSLT)
‣ extracts lyrics from a MuseScore file (pass2); if the file is v2 (not v3), a first pass converts the Measure tags from tick-separated to grouped by voice tags, which may be of use elsewhere as well

http://www.mirbsd.org/music/resources/mscz
‣ packs and unpacks .mscz, .workspace, etc. files with the container structure used by mu͒

http://www.mirbsd.org/music/resources/number
‣ (editor filter: reads from stdin, writes to stdout) numbers the measures in a mu͒3 file, so I can get more easily from “position in file” to “position in score in the engraving software”

http://www.mirbsd.org/music/resources/pathname (Korn Shell)
‣ adjusts some metaTags (rather boring)

http://www.mirbsd.org/music/resources/syllabicfix
‣ fixes the syllabic tag inside Lyrics elements by tracking lyrics’ syllabics state per stave, voice and verse and fixing some transitions that seemingly work in the software but break else (e.g. in xlyrics.xsl), for example begin+begin ⇒ begin+middle; end+end ⇒ end+(empty); etc.

I think the last one is the really interesting one, though the shell ones all operate on the files assuming they were written by MuseScore 2 or 3 (including assumptions about indentation); the XSLT ones operate on them as XML of course.

I’m also working on a “tuner” (apply various tunings) and perhaps something to shorten the length at phrase ends in vocal scores.

In reply to by mirabilos

Many thanks, I'll take a look at these although I don't know what some of the terms are yet, (XSLT, Korn Shell), so I'll need to do some reading.

I have written an MSCX explorer/editor for Excel which is going to be the basis of a guitar "let ring" plugout, (an external plugin). I should probably write it as a Musescore plugin but I'm only at beginner level with plugins.

At the moment it loads/saves scores, builds a measure map and exposes some of the tag properties. I'm now writing a measure parser to produce a chord/note map from which I will be able to calculate "let ring" and then change/create event data.

MuseEdit.png

Do you still have an unanswered question? Please log in first to post your question.