DAWFileKit icon indicating copy to clipboard operation
DAWFileKit copied to clipboard

MusicXML Support

Open orchetect opened this issue 2 years ago • 1 comments

Proposal

Add support for reading and authoring MusicXML.

Support for markers will be the main priority.

Considerations

A bit of testing is needed to determine if precise timing information can be derived.

  • There is a possibility that it may be a fairly lossy format.
  • It's also not totally clear whether MusicXML supports a novel 'marker' element type. It appears be treated as generic text which means that various DAWs may encode or interpret it differently.
  • In practicality, using MusicXML may not be as worthwhile as other potential formats.

Preliminary Observations

For example, a MusicXML xml file exported from Digital Performer 10 is summarized below.

  • It contains two markers: one at 1:00:00:00, and another at 1:00:01:00
  • DP exports markers as Direction markings. The <direction> element with inner element <words> are used.
  • Similar to a MIDI file, it contains tempo, time signature, and PPQ information.
  • However, no frame rate or origin timecode information is included and would need to be supplied separately by the user.
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 3.0 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd">

<score-partwise>
	<identification>
		<creator type="composer">Steffan Andrews</creator>
		<rights>© Steffan Andrews</rights>
		<encoding>
			<software>Digital Performer 10.13 86175</software>
			<encoding-date>2021-02-06</encoding-date>
			<supports attribute="new-system" element="print" type="no" value="yes"/>
			<supports attribute="new-page" element="print" type="no" value="yes"/>
			<supports element="accidental" type="yes"/>
			<supports element="beam" type="yes"/>
			<supports element="stem" type="no"/>
		</encoding>
	</identification>
	<part-list>
		<part-group number="2" type="start">
			<group-symbol>bracket</group-symbol>
			<group-barline>yes</group-barline>
		</part-group>
		<score-part id="P0">
			<part-name>MIDI-1</part-name>
			<part-abbreviation>MI.1</part-abbreviation>
		</score-part>
		<part-group number="2" type="stop"/>
	</part-list>
	<part id="P0">
		<measure number="1">
			<attributes>
				<divisions>480</divisions>
				<key>
					<fifths>0</fifths>
					<mode>major</mode>
				</key>
				<time>
					<beats>4</beats>
					<beat-type>4</beat-type>
				</time>
				<staves>1</staves>
				<clef number="1">
					<sign>G</sign>
					<line>2</line>
				</clef>
				<transpose>
					<diatonic>0</diatonic>
					<chromatic>0</chromatic>
					<octave-change>0</octave-change>
				</transpose>
			</attributes>
			<note>
				<rest measure="yes"/>
				<duration>1920</duration>
				<voice>1</voice>
				<staff>1</staff>
			</note>
			<direction placement="above">
				<direction-type>
					<metronome>
						<beat-unit>quarter</beat-unit>
						<per-minute>120.00</per-minute>
					</metronome>
				</direction-type>
				<offset>-1920</offset>
				<voice>1</voice>
				<staff>1</staff>
				<sound tempo="120.00"/>
			</direction>
		</measure>
		<measure number="2">
			<note>
				<rest measure="yes"/>
				<duration>1920</duration>
				<voice>1</voice>
				<staff>1</staff>
			</note>
		</measure>

                <!-- ... (snipped: empty measures 3 through 1800 which are identical to measure 2) ... -->

		<measure number="1801">
			<note>
				<rest measure="yes"/>
				<duration>1920</duration>
				<voice>1</voice>
				<staff>1</staff>
			</note>
			<direction placement="above">
				<direction-type>
					<words>Unlocked Marker 1_00_00_00</words>
				</direction-type>
				<offset>-1920</offset>
				<voice>1</voice>
				<staff>1</staff>
			</direction>
			<direction placement="above">
				<direction-type>
					<words>Locked Marker 1_00_01_00</words>
				</direction-type>
				<offset>-960</offset>
				<voice>1</voice>
				<staff>1</staff>
			</direction>
		</measure>
		<measure number="1802">
			<note>
				<rest measure="yes"/>
				<duration>1920</duration>
				<voice>1</voice>
				<staff>1</staff>
			</note>
			<barline location="right">
				<bar-style>light-heavy</bar-style>
			</barline>
		</measure>
	</part>
</score-partwise>

References

https://github.com/w3c/musicxml/blob/799e2defb2ece0ae7bafe08dcbcac25b2c631d53/schema/direction.mod#L83-L97

https://github.com/w3c/musicxml/blob/799e2defb2ece0ae7bafe08dcbcac25b2c631d53/schema/direction.mod#L117-L127

orchetect avatar May 12 '23 02:05 orchetect

Update: Importing the above xml file into Cubase does not import any text or marker events.

So the theory is correct that there is no standard MusicXML event type for a marker.

orchetect avatar May 12 '23 03:05 orchetect