WEBVTT

00:00:00.000 --> 00:00:02.400 align:middle line:90%
[SQUEAKING]

00:00:02.400 --> 00:00:04.320 align:middle line:90%
[RUSTLING]

00:00:04.320 --> 00:00:07.200 align:middle line:90%
[CLICKING]

00:00:07.200 --> 00:00:10.147 align:middle line:90%


00:00:10.147 --> 00:00:12.230 align:middle line:84%
MICHAEL SCOTT ASATO CUTHBERT:
Hello, computational

00:00:12.230 --> 00:00:14.750 align:middle line:84%
musicologist and
music theorists.

00:00:14.750 --> 00:00:17.880 align:middle line:84%
While you're working on your
own representation formats,

00:00:17.880 --> 00:00:21.780 align:middle line:84%
I want to introduce one
representation format, indeed,

00:00:21.780 --> 00:00:24.170 align:middle line:84%
the most commonly
used representation

00:00:24.170 --> 00:00:27.630 align:middle line:84%
format for common Western
music notation scores.

00:00:27.630 --> 00:00:31.730 align:middle line:84%
And that is MusicXML created
by Michael Good around the year

00:00:31.730 --> 00:00:34.220 align:middle line:90%
2000.

00:00:34.220 --> 00:00:37.020 align:middle line:84%
Looking over at the
MusicXML website,

00:00:37.020 --> 00:00:39.930 align:middle line:84%
we can see their
version of Hello World!

00:00:39.930 --> 00:00:42.690 align:middle line:84%
As you know, in
programming traditions,

00:00:42.690 --> 00:00:44.720 align:middle line:84%
it's become traditional
to print out

00:00:44.720 --> 00:00:48.590 align:middle line:84%
the word Hello,
World to show how

00:00:48.590 --> 00:00:49.970 align:middle line:90%
a programming language works.

00:00:49.970 --> 00:00:53.210 align:middle line:84%
In music notation, it's
become common, instead,

00:00:53.210 --> 00:00:58.460 align:middle line:84%
to show how note middle
C would be represented,

00:00:58.460 --> 00:01:00.060 align:middle line:84%
whole note or
something like that.

00:01:00.060 --> 00:01:05.220 align:middle line:84%
And here's the example of that
middle C whole note in MusicXML

00:01:05.220 --> 00:01:08.460 align:middle line:84%
One of the things you
can see in MusicXML,

00:01:08.460 --> 00:01:11.660 align:middle line:84%
just like any XML
or HTML, we have

00:01:11.660 --> 00:01:15.920 align:middle line:84%
these things called tags which
are enclosed in angle brackets.

00:01:15.920 --> 00:01:18.410 align:middle line:84%
Then we have a
content for the tag,

00:01:18.410 --> 00:01:22.160 align:middle line:84%
and then the tag is closed
with those same angle brackets

00:01:22.160 --> 00:01:24.950 align:middle line:90%
with a slash in front.

00:01:24.950 --> 00:01:27.270 align:middle line:90%
Tags can enclose other tags.

00:01:27.270 --> 00:01:31.110 align:middle line:84%
So the score part encloses
a tag called part-name,

00:01:31.110 --> 00:01:33.270 align:middle line:90%
and then it's closed later.

00:01:33.270 --> 00:01:37.860 align:middle line:84%
And tags can also have
attributes, id equals P1.

00:01:37.860 --> 00:01:41.450 align:middle line:84%
And we'll look at those
in just a little bit.

00:01:41.450 --> 00:01:43.230 align:middle line:90%
Let's scroll down to the note.

00:01:43.230 --> 00:01:48.720 align:middle line:84%
So all of that is to set up what
we might normally do for a note.

00:01:48.720 --> 00:01:51.000 align:middle line:90%
So a note is a tag called note.

00:01:51.000 --> 00:01:53.910 align:middle line:84%
Within it, there's
a tag called pitch.

00:01:53.910 --> 00:01:56.460 align:middle line:84%
Within that, there's
a tag called step.

00:01:56.460 --> 00:01:59.700 align:middle line:84%
And the step has
a single letter.

00:01:59.700 --> 00:02:02.160 align:middle line:90%
This is very similar to music21.

00:02:02.160 --> 00:02:06.890 align:middle line:84%
In fact, I borrowed
these concepts from here,

00:02:06.890 --> 00:02:10.289 align:middle line:84%
so that the accidental
would be encoded elsewhere.

00:02:10.289 --> 00:02:13.110 align:middle line:84%
Then the octave is encoded
as a single number,

00:02:13.110 --> 00:02:15.560 align:middle line:90%
then the pitch is closed.

00:02:15.560 --> 00:02:18.720 align:middle line:84%
After that, we have
a duration tag.

00:02:18.720 --> 00:02:20.640 align:middle line:84%
And we'll get back
to that in a second.

00:02:20.640 --> 00:02:22.465 align:middle line:90%
But it's duration 4.

00:02:22.465 --> 00:02:23.840 align:middle line:84%
And then there's
something called

00:02:23.840 --> 00:02:26.280 align:middle line:90%
a type, which is different.

00:02:26.280 --> 00:02:29.690 align:middle line:84%
And it says whole, so it
says that this note's type is

00:02:29.690 --> 00:02:31.190 align:middle line:90%
a whole note.

00:02:31.190 --> 00:02:36.420 align:middle line:84%
We have the duration and
the type encoded separately,

00:02:36.420 --> 00:02:40.250 align:middle line:84%
because the type explains
to notation software

00:02:40.250 --> 00:02:44.990 align:middle line:84%
how to represent this note,
what it should look like.

00:02:44.990 --> 00:02:51.060 align:middle line:84%
And the duration, instead,
tells it how long it is.

00:02:51.060 --> 00:02:56.450 align:middle line:84%
So you could, in theory,
put a duration of any number

00:02:56.450 --> 00:02:58.550 align:middle line:84%
and a type of any
number, and you

00:02:58.550 --> 00:03:00.500 align:middle line:84%
could make things
that looked very

00:03:00.500 --> 00:03:03.360 align:middle line:84%
different from how they sounded
or how they were represented.

00:03:03.360 --> 00:03:05.510 align:middle line:84%
In practice, most
notation software

00:03:05.510 --> 00:03:09.080 align:middle line:84%
reads one or the other of these,
so that's kind of too bad.

00:03:09.080 --> 00:03:14.750 align:middle line:84%
The duration 4 does not, like
in music21 represent necessarily

00:03:14.750 --> 00:03:16.500 align:middle line:90%
four quarter notes.

00:03:16.500 --> 00:03:20.960 align:middle line:84%
What it does is it refers
back to the last tag

00:03:20.960 --> 00:03:23.640 align:middle line:84%
within an attributes
tag called divisions.

00:03:23.640 --> 00:03:28.640 align:middle line:84%
And this says how many
parts should a quarter

00:03:28.640 --> 00:03:30.330 align:middle line:90%
note be divided up into.

00:03:30.330 --> 00:03:34.590 align:middle line:84%
So in this case, because the
only note is a whole note,

00:03:34.590 --> 00:03:37.200 align:middle line:84%
we can just divide up the
quarter note into one part,

00:03:37.200 --> 00:03:39.290 align:middle line:84%
not divide it at
all, and then say

00:03:39.290 --> 00:03:42.680 align:middle line:90%
a whole note has four of these.

00:03:42.680 --> 00:03:46.350 align:middle line:84%
But if we were going to
later have an eighth note,

00:03:46.350 --> 00:03:48.270 align:middle line:84%
then this would have
to be at least 2,

00:03:48.270 --> 00:03:51.780 align:middle line:84%
because the quarter note can
be divided into two parts.

00:03:51.780 --> 00:03:55.880 align:middle line:84%
If we might have 16th notes, it
would need to be 4 because it

00:03:55.880 --> 00:03:57.600 align:middle line:90%
can be divided into four parts.

00:03:57.600 --> 00:04:02.910 align:middle line:84%
And if we were going to have
16th notes and triplets also,

00:04:02.910 --> 00:04:06.050 align:middle line:84%
then it would need to be 12
because you can divide it

00:04:06.050 --> 00:04:08.770 align:middle line:90%
into 12 different ways.

00:04:08.770 --> 00:04:12.190 align:middle line:84%
In practice, these
divisions usually end up

00:04:12.190 --> 00:04:15.190 align:middle line:90%
being much higher numbers.

00:04:15.190 --> 00:04:19.700 align:middle line:84%
Some people use 16, 3, 8,
4, which is a power of 2.

00:04:19.700 --> 00:04:23.890 align:middle line:84%
I like using a high power
of 2 multiplied by 3,

00:04:23.890 --> 00:04:25.940 align:middle line:84%
multiplied by 5,
multiplied by 7,

00:04:25.940 --> 00:04:30.190 align:middle line:84%
so I can exactly represent
triplets, quintuplets,

00:04:30.190 --> 00:04:32.210 align:middle line:90%
septuplets, things like that.

00:04:32.210 --> 00:04:35.720 align:middle line:84%
But you can change this
division with each,

00:04:35.720 --> 00:04:38.620 align:middle line:84%
I think, at least each measure,
so that you can make sure

00:04:38.620 --> 00:04:42.010 align:middle line:84%
that whatever you're going to
be representing will be there.

00:04:42.010 --> 00:04:44.740 align:middle line:84%
We can also see that
there's a key signature,

00:04:44.740 --> 00:04:50.570 align:middle line:84%
and that's marked in the
number of fifths from C.

00:04:50.570 --> 00:04:52.220 align:middle line:84%
So remember your
circle of fifths.

00:04:52.220 --> 00:04:56.050 align:middle line:84%
If you want a key signature
of D major of two sharps,

00:04:56.050 --> 00:04:57.350 align:middle line:90%
that would be 2.

00:04:57.350 --> 00:05:01.120 align:middle line:84%
If you want B major,
that should be 5.

00:05:01.120 --> 00:05:04.685 align:middle line:84%
If you want F major, well,
we're going the other way,

00:05:04.685 --> 00:05:06.310 align:middle line:84%
so that's going to
be negative 1, so we

00:05:06.310 --> 00:05:08.240 align:middle line:90%
can represent keys that way.

00:05:08.240 --> 00:05:09.820 align:middle line:84%
Time, you can
probably figure out.

00:05:09.820 --> 00:05:12.100 align:middle line:90%
Beats and beat type are 4/4.

00:05:12.100 --> 00:05:14.240 align:middle line:84%
Could be called numerator
and denominator.

00:05:14.240 --> 00:05:18.010 align:middle line:84%
But it is one of these
things about MusicXML

00:05:18.010 --> 00:05:26.660 align:middle line:84%
that the format likes to
show the musical meaning,

00:05:26.660 --> 00:05:28.850 align:middle line:84%
not just how it's
going to be laid out.

00:05:28.850 --> 00:05:30.320 align:middle line:90%
We have the clef.

00:05:30.320 --> 00:05:31.880 align:middle line:84%
Instead of saying
it's treble clef,

00:05:31.880 --> 00:05:36.220 align:middle line:84%
we say that it is
a G clef on line 2.

00:05:36.220 --> 00:05:41.210 align:middle line:84%
And so here is some of
the basics of MusicXML

00:05:41.210 --> 00:05:45.980 align:middle line:84%
You can go to musicxml.com
and read more about this.

00:05:45.980 --> 00:05:49.420 align:middle line:84%
We're going to look at a few
other components of MusicXML

00:05:49.420 --> 00:05:50.360 align:middle line:90%
before going on.

00:05:50.360 --> 00:05:56.170 align:middle line:84%
But you're not necessarily need
to learn everything about it.

00:05:56.170 --> 00:05:59.030 align:middle line:84%
So if we're looking
at how MusicXML works,

00:05:59.030 --> 00:06:02.140 align:middle line:84%
we're going to look at a
slightly more complex example

00:06:02.140 --> 00:06:04.010 align:middle line:90%
than just a single quarter note.

00:06:04.010 --> 00:06:08.080 align:middle line:84%
We have a vocal part
and then a piano part

00:06:08.080 --> 00:06:11.530 align:middle line:90%
represented on two staves.

00:06:11.530 --> 00:06:13.870 align:middle line:84%
Here, we're using
a divisions that's

00:06:13.870 --> 00:06:20.540 align:middle line:84%
a higher number than 1, negative
3 for the key signature,

00:06:20.540 --> 00:06:22.178 align:middle line:84%
and then we can
explicitly encode

00:06:22.178 --> 00:06:23.470 align:middle line:90%
that it's actually in minor So.

00:06:23.470 --> 00:06:24.640 align:middle line:90%
We're not in E-flat major.

00:06:24.640 --> 00:06:26.955 align:middle line:90%
We're in C minor, right?

00:06:26.955 --> 00:06:29.650 align:middle line:90%


00:06:29.650 --> 00:06:31.010 align:middle line:90%
There's transposition.

00:06:31.010 --> 00:06:33.790 align:middle line:84%
But we don't need to
know that for this.

00:06:33.790 --> 00:06:37.360 align:middle line:84%
The pitch element, the note
element, I'm sorry to say,

00:06:37.360 --> 00:06:44.630 align:middle line:84%
sorry, can also have ties
on it and can have lyrics.

00:06:44.630 --> 00:06:48.010 align:middle line:84%
We can say that this is an end
of a syllable that ends "meil."

00:06:48.010 --> 00:06:50.570 align:middle line:90%
And we end in extension.

00:06:50.570 --> 00:06:53.870 align:middle line:84%
This is another thing you
can do in XML-based formats.

00:06:53.870 --> 00:06:56.630 align:middle line:84%
If you want to open a tag
and immediately close it,

00:06:56.630 --> 00:06:58.740 align:middle line:84%
you can just put a slash
at the end, instead.

00:06:58.740 --> 00:07:01.300 align:middle line:90%


00:07:01.300 --> 00:07:06.170 align:middle line:84%
We'll look at tied notes, even
though it's just a little thing.

00:07:06.170 --> 00:07:10.840 align:middle line:84%
And that is that there
are two different parts

00:07:10.840 --> 00:07:14.110 align:middle line:84%
in a tied note in MusicXML
and for a number of things

00:07:14.110 --> 00:07:15.400 align:middle line:90%
in MusicXML.

00:07:15.400 --> 00:07:21.380 align:middle line:84%
There is the tie element
which represents conceptually,

00:07:21.380 --> 00:07:22.940 align:middle line:90%
is this note tie.

00:07:22.940 --> 00:07:26.660 align:middle line:84%
And then there is the
tied, with a D element.

00:07:26.660 --> 00:07:30.590 align:middle line:84%
And that says, how do we
draw the tie on the page.

00:07:30.590 --> 00:07:33.160 align:middle line:84%
So you can draw a tie
without having a note

00:07:33.160 --> 00:07:36.440 align:middle line:84%
that sounds tied or is
conceived of as tied.

00:07:36.440 --> 00:07:42.070 align:middle line:84%
Or you can have sounds conceived
of as tied but not drawn.

00:07:42.070 --> 00:07:44.390 align:middle line:84%
And this shows up
in other places,

00:07:44.390 --> 00:07:50.300 align:middle line:84%
namely in accidentals because
you can imagine a B-flat,

00:07:50.300 --> 00:07:53.170 align:middle line:84%
you conceive of it as
a B-flat, but you also

00:07:53.170 --> 00:07:54.890 align:middle line:90%
put a flat sign in front of it.

00:07:54.890 --> 00:07:59.600 align:middle line:84%
The next B in that same measure,
you conceive of it is B-flat,

00:07:59.600 --> 00:08:01.850 align:middle line:84%
but you don't put a flat
sign in front of it.

00:08:01.850 --> 00:08:07.870 align:middle line:84%
So there's a distinction between
how we represent a note on paper

00:08:07.870 --> 00:08:09.260 align:middle line:90%
and how we conceive of it.

00:08:09.260 --> 00:08:11.890 align:middle line:84%
And this is very
important, also.

00:08:11.890 --> 00:08:17.070 align:middle line:84%
We can look over here at chords
and see that a cord is simply--

00:08:17.070 --> 00:08:18.300 align:middle line:90%
here's a 3-note chord.

00:08:18.300 --> 00:08:19.350 align:middle line:90%
We start with a note.

00:08:19.350 --> 00:08:24.170 align:middle line:84%
It's a C in octave
4, And then we

00:08:24.170 --> 00:08:27.260 align:middle line:84%
have the next note
has this empty chord

00:08:27.260 --> 00:08:30.840 align:middle line:84%
tag that says it's part of a
chord of the previous note.

00:08:30.840 --> 00:08:32.780 align:middle line:84%
So in MusicXML, if
you want to know

00:08:32.780 --> 00:08:35.033 align:middle line:84%
whether something
is a chord, you

00:08:35.033 --> 00:08:36.450 align:middle line:84%
won't know it from
the first node.

00:08:36.450 --> 00:08:38.669 align:middle line:84%
You'll only know it
from the second note on.

00:08:38.669 --> 00:08:41.900 align:middle line:84%
Here's an example
where we have E-flat

00:08:41.900 --> 00:08:51.290 align:middle line:84%
altered by negative 1 semitones,
and then the next note G.

00:08:51.290 --> 00:08:56.840 align:middle line:84%
Here's a little example of
multi-part music, and especially

00:08:56.840 --> 00:09:01.850 align:middle line:84%
this part where we have
two different voices

00:09:01.850 --> 00:09:03.480 align:middle line:90%
in the same measure.

00:09:03.480 --> 00:09:06.830 align:middle line:84%
So we have two chords that
can be represented as just

00:09:06.830 --> 00:09:10.500 align:middle line:90%
a single set of note elements.

00:09:10.500 --> 00:09:12.930 align:middle line:84%
And then we have a chord
here and a chord here,

00:09:12.930 --> 00:09:15.270 align:middle line:84%
but in between, we have
this separate voice

00:09:15.270 --> 00:09:18.040 align:middle line:84%
with separate stem
directions and so on.

00:09:18.040 --> 00:09:21.630 align:middle line:84%
One of the things
that MusicXML does,

00:09:21.630 --> 00:09:23.770 align:middle line:84%
is that when you get
to a certain point,

00:09:23.770 --> 00:09:25.870 align:middle line:84%
you're reading through
all of your durations.

00:09:25.870 --> 00:09:27.820 align:middle line:84%
They're all considered
to be in a row.

00:09:27.820 --> 00:09:29.790 align:middle line:84%
You get to maybe the
end of the measure,

00:09:29.790 --> 00:09:34.290 align:middle line:84%
and you can back up a
certain number of divisions,

00:09:34.290 --> 00:09:36.070 align:middle line:84%
and then you can
go forward again.

00:09:36.070 --> 00:09:40.060 align:middle line:84%
In this case, you would
probably just back up 8.

00:09:40.060 --> 00:09:42.210 align:middle line:84%
But a lot of notation
software seems

00:09:42.210 --> 00:09:45.010 align:middle line:84%
to only use backup to go to
the beginning of the measure.

00:09:45.010 --> 00:09:46.900 align:middle line:84%
And then if you need
to skip forward,

00:09:46.900 --> 00:09:49.740 align:middle line:90%
you use a forward again.

00:09:49.740 --> 00:09:53.800 align:middle line:84%
And it is also customary,
though not strictly required,

00:09:53.800 --> 00:09:57.510 align:middle line:84%
I don't believe, but
almost a lot of notation,

00:09:57.510 --> 00:10:01.930 align:middle line:84%
things that read MusicXML, we
call them consumers of MusicXML.

00:10:01.930 --> 00:10:03.960 align:middle line:84%
A lot of them might
have a problem

00:10:03.960 --> 00:10:07.690 align:middle line:84%
or might crash if you don't
include what's customary, again,

00:10:07.690 --> 00:10:09.720 align:middle line:84%
then you end at the
end of the measure

00:10:09.720 --> 00:10:13.770 align:middle line:84%
by going forward
until the very end.

00:10:13.770 --> 00:10:16.180 align:middle line:84%
There's all kinds of
other things on repeats,

00:10:16.180 --> 00:10:17.830 align:middle line:90%
on sound suggestions, and so on.

00:10:17.830 --> 00:10:19.290 align:middle line:84%
But one of the
things you can see

00:10:19.290 --> 00:10:21.570 align:middle line:84%
is that, compared to
some of the thoughts

00:10:21.570 --> 00:10:24.610 align:middle line:84%
we had on compact
representations,

00:10:24.610 --> 00:10:27.670 align:middle line:90%
MusicXML is very verbose.

00:10:27.670 --> 00:10:30.310 align:middle line:84%
It takes up a lot of
space on the screen.

00:10:30.310 --> 00:10:33.640 align:middle line:84%
It takes up a good
amount of space on disk,

00:10:33.640 --> 00:10:37.000 align:middle line:84%
though not nearly as much as
this video would ever take.

00:10:37.000 --> 00:10:41.140 align:middle line:84%
So there is a compressed
format, and they call it MXL.

00:10:41.140 --> 00:10:45.840 align:middle line:84%
We call .XML or .musicxml, the
file extension for standard

00:10:45.840 --> 00:10:51.550 align:middle line:84%
MusicXML format, and .MXL
if it's just gzipped.

00:10:51.550 --> 00:10:53.580 align:middle line:84%
And right now, we're
working on ways

00:10:53.580 --> 00:10:56.070 align:middle line:84%
so that a gzip archive can
include the score, maybe

00:10:56.070 --> 00:11:00.030 align:middle line:84%
a compressed score, a
transposed score, and also all

00:11:00.030 --> 00:11:00.880 align:middle line:90%
of the parts.

00:11:00.880 --> 00:11:04.350 align:middle line:84%
So new things are still
coming out with MusicXML.

00:11:04.350 --> 00:11:08.490 align:middle line:84%
And we will turn to
learning more about MusicXML

00:11:08.490 --> 00:11:11.630 align:middle line:90%
from the creator.

00:11:11.630 --> 00:11:19.000 align:middle line:90%