An Introduction to MusicXML

15
An Introduction to MusicXML Dr David Parsons David Parsons - May 31st 2013

description

A very brief intro to the basics of MusicXML

Transcript of An Introduction to MusicXML

Page 1: An Introduction to MusicXML

David Parsons - May 31st 2013

An Introduction to MusicXML

Dr David Parsons

Page 2: An Introduction to MusicXML

David Parsons - May 31st 2013

MusicXML files are the standard format for sharing interactive sheet music

More than 160 applications include MusicXML support◦ Including Cubase, Sibelius and Myriad

What is MusicXML?

Page 3: An Introduction to MusicXML

David Parsons - May 31st 2013

“I feel that MIDI is an outdated standard for music education. I believe that MusicXML is the proper standard for music education …import/export with notation accuracy is a world of hurt with MIDI and much improved with MusicXML”

Christopher J. Russell, Ph.D. - Technology in Music Education Blog, May 2012

MusicXML and education

Page 4: An Introduction to MusicXML

David Parsons - May 31st 2013

XML◦ eXtensible Markup Langauge

XML is◦ Semi-structured◦ Self describing◦ Fundamental to the web, web services, RSS feeds

etc.◦ Provides a common way for any two applications

to communicate with one another XML is a meta language – you can create

your own languages from it

MusicXML is a dialect of XML

Page 5: An Introduction to MusicXML

David Parsons - May 31st 2013

Elements and attributes

What do you notice about this data structure?

What does XML look like?

<element1> <element2 attribute1=“value”> some data </element2> <element3> some more data </element3></element1>

Page 6: An Introduction to MusicXML

David Parsons - May 31st 2013

Why can’t I just use MIDI?◦ Musical scores need to know about keys◦ MIDI doesn’t know if your note is an A# or a B♭◦ MIDI doesn’t know about much beyond the notes

themselves

You can create a MIDI file from MusicXML, or a notation file

Why do I need MusicXML?

Page 7: An Introduction to MusicXML

David Parsons - May 31st 2013

What do you need to specify if you want to represent a note like this middle C semibreve?

Specifying a note

Page 8: An Introduction to MusicXML

David Parsons - May 31st 2013

MusicXML includes ‘note’ elements Nested elements inside this specify the

pitch and the length of the note

MusicXML for the note

<note>         <pitch>           <step>C</step>           <octave>4</octave>       </pitch>         <duration>4</duration>         <type>whole</type>      </note>

Page 9: An Introduction to MusicXML

David Parsons - May 31st 2013

The key and the clef

the key the clef

The key is defined using the circle of fifths◦ Zero+major is C Major

The clef has a sign, and the stave line it appears on

<key>           <fifths>0</fifths>  <mode>major</mode></key>

<clef>     <sign>G</sign>        <line>2</line>         </clef>  

Page 10: An Introduction to MusicXML

David Parsons - May 31st 2013

4/4 time? Easy enough

The time signature

<time> <beats>4</beats> <beat-type>4</beat-type></time>

Page 11: An Introduction to MusicXML

David Parsons - May 31st 2013

These are typically used for metadata◦ Not the actual music data, but things that tell us

about it Here’s an example:

◦ Each musical part is given a unique id so we can refer to it from other elements

◦ Each measure needs a number we are in the first measure of the first part

Attributes

<part id="P1">     <measure number="1">      

Page 12: An Introduction to MusicXML

David Parsons - May 31st 2013

Including stuff we haven’t talked about

Just for one note, right?

Sure, but you don’t do this stuff by hand

Software reads and/or writes MusicXML

Here’s the whole thing

<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 3.0 Partwise//EN"  "http://www.musicxml.org/dtds/partwise.dtd"> <score-partwise version="3.0">   <part-list>     <score-part id="P1">       <part-name>Music</part-name>     </score-part>   </part-list>   <part id="P1">     <measure number="1">       <attributes>         <divisions>1</divisions>         <key>           <fifths>0</fifths>         </key>         <time>           <beats>4</beats>           <beat-type>4</beat-type>         </time>         <clef>           <sign>G</sign>           <line>2</line>         </clef>       </attributes>       <note>         <pitch>           <step>C</step>           <octave>4</octave>         </pitch>         <duration>4</duration>         <type>whole</type>       </note>     </measure>   </part></score-partwise>

Page 13: An Introduction to MusicXML

David Parsons - May 31st 2013

Here’s our file in Myriad Melody Player We can see it, and hear it

Reading MusicXML

Page 14: An Introduction to MusicXML

David Parsons - May 31st 2013

Understand how different applications communicate musical data

Use MusicXML to transfer data between them

Write software that can generate MusicXML◦ so you music can be scored◦ e.g. write a mobile composition app that streams

MusicXML to the cloud) Write software that can read MusicXML

◦ so you can present it how you like◦ e.g. create sound driven animations in HTML 5

So what can I do with it?

Page 15: An Introduction to MusicXML

David Parsons - May 31st 2013

You could utilise any or all of the following… Technologies for processing XML

◦ XPath / XSLT / XQuery◦ SAX (serial access) parsers◦ DOM (document object model) parsers

XML data Streams◦ File streaming◦ Web services

Tools that understand MusicXML◦ e.g. Java Music Specification Language

What’s the next step?