WEBVTT

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

00:00:01.948 --> 00:00:03.896 align:middle line:90%
[RUSTLING]

00:00:03.896 --> 00:00:07.305 align:middle line:90%
[CLICKING]

00:00:07.305 --> 00:00:09.452 align:middle line:90%


00:00:09.452 --> 00:00:11.660 align:middle line:84%
MICHAEL CUTHBERT: Today,
I'm going to be a little bit

00:00:11.660 --> 00:00:14.240 align:middle line:84%
boring for people
watching later and stuff

00:00:14.240 --> 00:00:17.250 align:middle line:84%
because we're going to mostly
be flipping things around.

00:00:17.250 --> 00:00:19.400 align:middle line:84%
So we're going to use
this time for quite

00:00:19.400 --> 00:00:21.985 align:middle line:90%
a lot of in-class work.

00:00:21.985 --> 00:00:25.070 align:middle line:90%
Hey, how you doing?

00:00:25.070 --> 00:00:26.300 align:middle line:90%
You might need a chair there.

00:00:26.300 --> 00:00:29.570 align:middle line:90%
And try to get things--

00:00:29.570 --> 00:00:32.270 align:middle line:84%
getting ready for
later, and having videos

00:00:32.270 --> 00:00:38.750 align:middle line:84%
online for some of the new
topics that are coming up.

00:00:38.750 --> 00:00:40.760 align:middle line:90%
Before we get to--

00:00:40.760 --> 00:00:43.490 align:middle line:84%
this is the fifth
week of the semester.

00:00:43.490 --> 00:00:51.050 align:middle line:84%
First, are there any questions
so far on problem set four?

00:00:51.050 --> 00:00:51.780 align:middle line:90%
Adam?

00:00:51.780 --> 00:00:53.947 align:middle line:84%
AUDIENCE: So with OPTIC,
you would want the two list

00:00:53.947 --> 00:00:56.930 align:middle line:90%
at the same length?

00:00:56.930 --> 00:00:58.170 align:middle line:90%
MICHAEL CUTHBERT: Let me see.

00:00:58.170 --> 00:01:04.900 align:middle line:84%
Would I want-- no,
not necessarily.

00:01:04.900 --> 00:01:06.960 align:middle line:84%
Let's think through,
again, OPTIC.

00:01:06.960 --> 00:01:08.322 align:middle line:90%
O is-- just shout it out.

00:01:08.322 --> 00:01:09.030 align:middle line:90%
AUDIENCE: Octave.

00:01:09.030 --> 00:01:10.072 align:middle line:90%
MICHAEL CUTHBERT: Octave.

00:01:10.072 --> 00:01:10.761 align:middle line:90%
P?

00:01:10.761 --> 00:01:12.084 align:middle line:90%
AUDIENCE: Permutation.

00:01:12.084 --> 00:01:12.966 align:middle line:90%
MICHAEL CUTHBERT: T?

00:01:12.966 --> 00:01:13.410 align:middle line:90%
AUDIENCE: Transposition.

00:01:13.410 --> 00:01:14.730 align:middle line:84%
MICHAEL CUTHBERT:
Transposition, good.

00:01:14.730 --> 00:01:15.247 align:middle line:90%
I?

00:01:15.247 --> 00:01:16.080 align:middle line:90%
AUDIENCE: Inversion.

00:01:16.080 --> 00:01:16.710 align:middle line:90%
MICHAEL CUTHBERT: Inversion.

00:01:16.710 --> 00:01:17.580 align:middle line:90%
And C?

00:01:17.580 --> 00:01:17.970 align:middle line:90%
AUDIENCE: Cardinal.

00:01:17.970 --> 00:01:19.095 align:middle line:90%
MICHAEL CUTHBERT: Cardinal.

00:01:19.095 --> 00:01:21.783 align:middle line:84%
One of those is very
important that you test--

00:01:21.783 --> 00:01:23.700 align:middle line:84%
with all of them, it's
important that you test

00:01:23.700 --> 00:01:25.270 align:middle line:90%
with different length sets.

00:01:25.270 --> 00:01:31.230 align:middle line:84%
But what's one of the ones that
might sometimes return true

00:01:31.230 --> 00:01:37.110 align:middle line:84%
if the two pitch sets
are equivalent if you

00:01:37.110 --> 00:01:40.483 align:middle line:90%
have this equivalence class?

00:01:40.483 --> 00:01:41.400 align:middle line:90%
AUDIENCE: Cardinality.

00:01:41.400 --> 00:01:42.900 align:middle line:84%
MICHAEL CUTHBERT:
Cardinality, yeah.

00:01:42.900 --> 00:01:47.220 align:middle line:84%
So cardinality equivalence, it's
kind of an odd thing, isn't it?

00:01:47.220 --> 00:01:50.830 align:middle line:84%
Because it's not-- it's kind
of the backwards one, isn't it?

00:01:50.830 --> 00:01:54.960 align:middle line:84%
It should be like optic
duplication or something

00:01:54.960 --> 00:01:57.430 align:middle line:84%
because it is
specifically not saying

00:01:57.430 --> 00:02:02.270 align:middle line:84%
that things are equivalent if
their cardinality is the same.

00:02:02.270 --> 00:02:06.435 align:middle line:84%
It is saying two things
are equivalent if they're--

00:02:06.435 --> 00:02:07.310 align:middle line:90%
what do you want to--

00:02:07.310 --> 00:02:12.280 align:middle line:84%
I suppose cardinality is that
if duplicates are removed.

00:02:12.280 --> 00:02:12.820 align:middle line:90%
Good.

00:02:12.820 --> 00:02:16.270 align:middle line:84%
So yeah, there
will be cases where

00:02:16.270 --> 00:02:21.970 align:middle line:84%
two pitch sets will have
different lengths of things

00:02:21.970 --> 00:02:25.420 align:middle line:90%
and be equivalent.

00:02:25.420 --> 00:02:28.900 align:middle line:90%
Oh, one important thing.

00:02:28.900 --> 00:02:32.170 align:middle line:84%
I'll do the one
that I forgot to do.

00:02:32.170 --> 00:02:34.690 align:middle line:90%
That's on inversion.

00:02:34.690 --> 00:02:41.560 align:middle line:84%
An inversion is one
of these things--

00:02:41.560 --> 00:02:44.200 align:middle line:84%
probably like mode or
something like that--

00:02:44.200 --> 00:02:48.370 align:middle line:84%
we used way too often in
music to mean too many

00:02:48.370 --> 00:02:50.460 align:middle line:90%
related but different things.

00:02:50.460 --> 00:02:54.370 align:middle line:84%
I'm just going to move
that more to the center.

00:02:54.370 --> 00:03:00.320 align:middle line:84%
So the two places that we've
been talking about inversion

00:03:00.320 --> 00:03:05.330 align:middle line:90%
are in this--

00:03:05.330 --> 00:03:10.520 align:middle line:84%
do you remember the circle
from C, C sharp slash D flat.

00:03:10.520 --> 00:03:11.630 align:middle line:90%
Spelling doesn't matter.

00:03:11.630 --> 00:03:13.980 align:middle line:84%
D-- am I getting
there about right?

00:03:13.980 --> 00:03:14.480 align:middle line:90%
Yep.

00:03:14.480 --> 00:03:18.390 align:middle line:90%
E flat, E, F. Now somehow I've--

00:03:18.390 --> 00:03:22.310 align:middle line:84%
well, because my circle
is more of an egg.

00:03:22.310 --> 00:03:27.993 align:middle line:84%
So on, and-- sorry,
I'm blanking on--

00:03:27.993 --> 00:03:29.660 align:middle line:84%
it's been a long time
since I've written

00:03:29.660 --> 00:03:32.660 align:middle line:84%
a circle of notes that is
not the circle of fifths

00:03:32.660 --> 00:03:33.720 align:middle line:90%
on the board.

00:03:33.720 --> 00:03:35.790 align:middle line:90%
OK, got that in order.

00:03:35.790 --> 00:03:39.380 align:middle line:84%
And we've thought about
this axis of inversion

00:03:39.380 --> 00:03:40.830 align:middle line:90%
that you can have.

00:03:40.830 --> 00:03:43.040 align:middle line:90%
Do you remember that?

00:03:43.040 --> 00:03:46.130 align:middle line:84%
That can define
ways that pitches

00:03:46.130 --> 00:03:47.940 align:middle line:90%
can invert to each other.

00:03:47.940 --> 00:03:50.760 align:middle line:90%
We also use inversion.

00:03:50.760 --> 00:03:54.520 align:middle line:84%
And so this is the primary
one that Dimitri Tymoczko

00:03:54.520 --> 00:03:55.580 align:middle line:90%
is talking about.

00:03:55.580 --> 00:03:57.940 align:middle line:84%
We also use inversion
to mean something which

00:03:57.940 --> 00:04:00.080 align:middle line:90%
is called tonal inversion.

00:04:00.080 --> 00:04:02.110 align:middle line:90%
Which is to say--

00:04:02.110 --> 00:04:02.690 align:middle line:90%
oh, yeah.

00:04:02.690 --> 00:04:04.480 align:middle line:84%
We did this in class
for a second, right?

00:04:04.480 --> 00:04:12.820 align:middle line:84%
That this can be
inverted to be this.

00:04:12.820 --> 00:04:15.700 align:middle line:90%


00:04:15.700 --> 00:04:19.240 align:middle line:84%
Even though-- so because
here, we go up a step.

00:04:19.240 --> 00:04:20.240 align:middle line:90%
Here, we go down a step.

00:04:20.240 --> 00:04:21.380 align:middle line:90%
Here we go up another step.

00:04:21.380 --> 00:04:24.490 align:middle line:84%
We go down a step, up
a step, down a step.

00:04:24.490 --> 00:04:27.050 align:middle line:84%
Even though the steps are
different sizes, right?

00:04:27.050 --> 00:04:29.500 align:middle line:90%
So F to G is what kind of step?

00:04:29.500 --> 00:04:30.670 align:middle line:90%
Whole step.

00:04:30.670 --> 00:04:31.720 align:middle line:90%
Next one.

00:04:31.720 --> 00:04:32.475 align:middle line:90%
Whole step.

00:04:32.475 --> 00:04:33.100 align:middle line:90%
AUDIENCE: Half.

00:04:33.100 --> 00:04:34.058 align:middle line:90%
MICHAEL CUTHBERT: Half.

00:04:34.058 --> 00:04:34.805 align:middle line:90%
And this one?

00:04:34.805 --> 00:04:35.430 align:middle line:90%
AUDIENCE: Half.

00:04:35.430 --> 00:04:37.460 align:middle line:84%
MICHAEL CUTHBERT:
Half, whole, whole.

00:04:37.460 --> 00:04:44.600 align:middle line:84%
But so in the strictly
enharmonic context of inversion,

00:04:44.600 --> 00:04:46.390 align:middle line:84%
they would not be
the same, which

00:04:46.390 --> 00:04:48.970 align:middle line:84%
is the context that
Dimitri Tymoczko is mostly

00:04:48.970 --> 00:04:50.035 align:middle line:90%
talking about.

00:04:50.035 --> 00:04:55.240 align:middle line:84%
In the tonal context, they
would be the same though, right?

00:04:55.240 --> 00:04:59.340 align:middle line:84%
But then there's this third
part, this third very common use

00:04:59.340 --> 00:05:02.910 align:middle line:84%
of the word inversion
in music that

00:05:02.910 --> 00:05:07.080 align:middle line:84%
is not what we're talking about
in any way on this problem set.

00:05:07.080 --> 00:05:08.715 align:middle line:90%
John, do you know what that is?

00:05:08.715 --> 00:05:09.840 align:middle line:90%
AUDIENCE: Chords inversion.

00:05:09.840 --> 00:05:11.257 align:middle line:84%
MICHAEL CUTHBERT:
Chord inversion.

00:05:11.257 --> 00:05:12.600 align:middle line:90%
Chord inversion.

00:05:12.600 --> 00:05:13.210 align:middle line:90%
Right.

00:05:13.210 --> 00:05:15.840 align:middle line:90%
So if I have a chord--

00:05:15.840 --> 00:05:17.503 align:middle line:90%
let's say, A major--

00:05:17.503 --> 00:05:21.090 align:middle line:90%


00:05:21.090 --> 00:05:26.630 align:middle line:84%
what is the base if I
am in second inversion?

00:05:26.630 --> 00:05:27.570 align:middle line:90%
AUDIENCE: E?

00:05:27.570 --> 00:05:30.810 align:middle line:90%
MICHAEL CUTHBERT: E, great.

00:05:30.810 --> 00:05:33.540 align:middle line:84%
So you might have
something like that.

00:05:33.540 --> 00:05:36.380 align:middle line:84%
Now here-- so that's
the explanation part.

00:05:36.380 --> 00:05:37.630 align:middle line:90%
That's the clarification part.

00:05:37.630 --> 00:05:39.900 align:middle line:84%
And now the critical
thinking thing.

00:05:39.900 --> 00:05:43.380 align:middle line:84%
Chord inversion,
in this sense, has

00:05:43.380 --> 00:05:46.410 align:middle line:90%
to do with what letter of optic?

00:05:46.410 --> 00:05:48.960 align:middle line:90%


00:05:48.960 --> 00:05:51.715 align:middle line:90%
AUDIENCE: P?

00:05:51.715 --> 00:05:54.410 align:middle line:84%
MICHAEL CUTHBERT: P.
And there's another one.

00:05:54.410 --> 00:05:58.720 align:middle line:84%
So P-- we could say
that A, C sharp, E is

00:05:58.720 --> 00:06:04.190 align:middle line:84%
the same as E, C sharp, A, but
there's something else we need.

00:06:04.190 --> 00:06:05.060 align:middle line:90%
Yeah?

00:06:05.060 --> 00:06:05.560 align:middle line:90%
AUDIENCE: O?

00:06:05.560 --> 00:06:08.920 align:middle line:84%
MICHAEL CUTHBERT: O.
So we need that this O

00:06:08.920 --> 00:06:12.490 align:middle line:84%
is equivalent to this
O, that this octave is

00:06:12.490 --> 00:06:13.610 align:middle line:90%
the same as this octave.

00:06:13.610 --> 00:06:14.902 align:middle line:90%
I see everybody shivering.

00:06:14.902 --> 00:06:16.610 align:middle line:84%
It's really cold in
here today, isn't it?

00:06:16.610 --> 00:06:17.490 align:middle line:90%
All right?

00:06:17.490 --> 00:06:17.990 align:middle line:90%
OK.

00:06:17.990 --> 00:06:19.480 align:middle line:90%
No, maybe it's just me.

00:06:19.480 --> 00:06:20.300 align:middle line:90%
You were cold.

00:06:20.300 --> 00:06:22.010 align:middle line:84%
Other people were
cold, and I'm up here.

00:06:22.010 --> 00:06:22.760 align:middle line:90%
OK.

00:06:22.760 --> 00:06:27.706 align:middle line:90%
So O and octave and permutation.

00:06:27.706 --> 00:06:30.400 align:middle line:90%


00:06:30.400 --> 00:06:34.550 align:middle line:84%
If you have an augmented triad,
there's an interesting-- here,

00:06:34.550 --> 00:06:35.810 align:middle line:90%
let's just keep playing.

00:06:35.810 --> 00:06:37.720 align:middle line:84%
We'll make a simpler
augmented triad

00:06:37.720 --> 00:06:41.170 align:middle line:84%
that you might have
thought of before.

00:06:41.170 --> 00:06:45.460 align:middle line:84%
Then the different
inversions have to do with--

00:06:45.460 --> 00:06:47.660 align:middle line:84%
you can think of
them as O and P.

00:06:47.660 --> 00:06:49.890 align:middle line:84%
But specifically for
the augmented triad,

00:06:49.890 --> 00:06:53.035 align:middle line:84%
there's another letter
that comes into play.

00:06:53.035 --> 00:07:00.260 align:middle line:90%


00:07:00.260 --> 00:07:03.100 align:middle line:84%
Let's get the sound of the
augmented triad into our ears.

00:07:03.100 --> 00:07:06.306 align:middle line:90%
[PIANO NOTES PLAYING]

00:07:06.306 --> 00:07:08.150 align:middle line:90%


00:07:08.150 --> 00:07:10.760 align:middle line:84%
What's a way that we
can do, let's say,

00:07:10.760 --> 00:07:18.380 align:middle line:84%
a first inversion of
this augmented triad?

00:07:18.380 --> 00:07:19.465 align:middle line:90%
Yeah?

00:07:19.465 --> 00:07:21.090 align:middle line:84%
Actually, I'm just
calling on somebody.

00:07:21.090 --> 00:07:22.520 align:middle line:90%
Yeah, go ahead.

00:07:22.520 --> 00:07:24.260 align:middle line:90%
AUDIENCE: I?

00:07:24.260 --> 00:07:25.340 align:middle line:90%
MICHAEL CUTHBERT: I?

00:07:25.340 --> 00:07:26.190 align:middle line:90%
Let's see.

00:07:26.190 --> 00:07:30.300 align:middle line:84%
Yes, because we can
invert around this point.

00:07:30.300 --> 00:07:33.620 align:middle line:84%
And what are the two
intervals from here to here?

00:07:33.620 --> 00:07:35.180 align:middle line:90%
AUDIENCE: The same.

00:07:35.180 --> 00:07:37.460 align:middle line:84%
MICHAEL CUTHBERT:
They're the same.

00:07:37.460 --> 00:07:41.264 align:middle line:90%
Yes, but what are they?

00:07:41.264 --> 00:07:42.363 align:middle line:90%
Yeah, go ahead.

00:07:42.363 --> 00:07:43.280 align:middle line:90%
AUDIENCE: Major third?

00:07:43.280 --> 00:07:45.484 align:middle line:84%
MICHAEL CUTHBERT:
Major third and?

00:07:45.484 --> 00:07:46.440 align:middle line:90%
AUDIENCE: Major third.

00:07:46.440 --> 00:07:47.310 align:middle line:84%
MICHAEL CUTHBERT: And
major third because you

00:07:47.310 --> 00:07:48.100 align:middle line:90%
already said the same.

00:07:48.100 --> 00:07:48.420 align:middle line:90%
Good.

00:07:48.420 --> 00:07:49.060 align:middle line:90%
Sorry.

00:07:49.060 --> 00:07:52.560 align:middle line:84%
Sometimes I forget that it
was prefaced with something

00:07:52.560 --> 00:07:58.590 align:middle line:84%
that required me to use the
C operator to map major third

00:07:58.590 --> 00:07:59.830 align:middle line:90%
to major third, major third.

00:07:59.830 --> 00:08:00.145 align:middle line:90%
Right?

00:08:00.145 --> 00:08:00.645 align:middle line:90%
Good.

00:08:00.645 --> 00:08:01.613 align:middle line:90%
So it can be inversion.

00:08:01.613 --> 00:08:03.280 align:middle line:84%
There's another way
you can think of it.

00:08:03.280 --> 00:08:04.240 align:middle line:90%
Yeah, Jason?

00:08:04.240 --> 00:08:04.590 align:middle line:90%
AUDIENCE: Transpositon?

00:08:04.590 --> 00:08:05.923 align:middle line:90%
MICHAEL CUTHBERT: Transposition.

00:08:05.923 --> 00:08:08.400 align:middle line:84%
So if we go up, what
do we have to go up?

00:08:08.400 --> 00:08:09.490 align:middle line:90%
A major third.

00:08:09.490 --> 00:08:20.500 align:middle line:84%
So C goes up to E. E goes
up a major third to G sharp.

00:08:20.500 --> 00:08:25.410 align:middle line:84%
And then G sharp goes
up a major third to?

00:08:25.410 --> 00:08:26.820 align:middle line:90%
AUDIENCE: C?

00:08:26.820 --> 00:08:32.130 align:middle line:84%
MICHAEL CUTHBERT: First, it goes
up a major third to B sharp.

00:08:32.130 --> 00:08:35.740 align:middle line:84%
And then what other
letter are we thinking of?

00:08:35.740 --> 00:08:36.240 align:middle line:90%
AUDIENCE: S.

00:08:36.240 --> 00:08:37.870 align:middle line:90%
MICHAEL CUTHBERT: S, spelling.

00:08:37.870 --> 00:08:41.559 align:middle line:84%
So that the-- what
do you call it?

00:08:41.559 --> 00:08:44.800 align:middle line:90%
The B sharp goes to C natural.

00:08:44.800 --> 00:08:48.430 align:middle line:84%
You can think of all of
these different letters

00:08:48.430 --> 00:08:50.050 align:middle line:84%
and different
equivalence classes

00:08:50.050 --> 00:08:53.320 align:middle line:84%
as quite often, depending on
your context, different ways

00:08:53.320 --> 00:08:55.420 align:middle line:90%
of getting to the same answer.

00:08:55.420 --> 00:08:57.230 align:middle line:84%
The hard part of
the problem set,

00:08:57.230 --> 00:08:58.870 align:middle line:84%
though, is sometimes
figuring out

00:08:58.870 --> 00:09:05.720 align:middle line:84%
if you're given multiple
of these letters together,

00:09:05.720 --> 00:09:10.570 align:middle line:84%
you're saying that you
have the O and P set.

00:09:10.570 --> 00:09:13.940 align:middle line:90%
Can you apply O and then P?

00:09:13.940 --> 00:09:18.040 align:middle line:84%
And is that the same as
applying P and then O?

00:09:18.040 --> 00:09:19.930 align:middle line:84%
Sometimes it will
be, sometimes it--

00:09:19.930 --> 00:09:23.870 align:middle line:84%
or some of these combinations of
letters, the order won't matter.

00:09:23.870 --> 00:09:26.020 align:middle line:84%
And some of the
combinations of letters

00:09:26.020 --> 00:09:31.660 align:middle line:84%
will open up new possibilities
that chaining one and then

00:09:31.660 --> 00:09:35.920 align:middle line:84%
the other will not
be sufficient for.

00:09:35.920 --> 00:09:40.995 align:middle line:84%
Anybody far enough on the P
set to encounter any of those?

00:09:40.995 --> 00:09:43.885 align:middle line:90%


00:09:43.885 --> 00:09:45.852 align:middle line:90%
No?

00:09:45.852 --> 00:09:46.560 align:middle line:90%
Some of you have.

00:09:46.560 --> 00:09:49.370 align:middle line:90%
Some people have turned them in.

00:09:49.370 --> 00:09:54.230 align:middle line:84%
Do you remember any of the
ones that were like that?

00:09:54.230 --> 00:09:56.750 align:middle line:84%
AUDIENCE: It was,
like, three days ago.

00:09:56.750 --> 00:09:57.510 align:middle line:90%
Yeah.

00:09:57.510 --> 00:10:02.673 align:middle line:84%
I think octave and permutation
didn't matter, I would say.

00:10:02.673 --> 00:10:04.340 align:middle line:84%
MICHAEL CUTHBERT:
Octave and permutation

00:10:04.340 --> 00:10:07.345 align:middle line:90%
didn't matter which one you did.

00:10:07.345 --> 00:10:10.208 align:middle line:90%


00:10:10.208 --> 00:10:11.430 align:middle line:90%
I think that's correct.

00:10:11.430 --> 00:10:11.930 align:middle line:90%
Yeah.

00:10:11.930 --> 00:10:12.630 align:middle line:90%
Yep.

00:10:12.630 --> 00:10:16.417 align:middle line:84%
So I should be thinking there's
how many combinations of--

00:10:16.417 --> 00:10:17.250 align:middle line:90%
what do you call it?

00:10:17.250 --> 00:10:19.590 align:middle line:90%
There's five choose two.

00:10:19.590 --> 00:10:22.410 align:middle line:84%
There's five factorial
combinations.

00:10:22.410 --> 00:10:27.420 align:middle line:84%
But we're just-- no, two to the
fifth combinations with optic.

00:10:27.420 --> 00:10:31.020 align:middle line:84%
But a lot of them
are never used.

00:10:31.020 --> 00:10:36.920 align:middle line:84%
You would never use, I
don't know, cardinal.

00:10:36.920 --> 00:10:38.960 align:middle line:84%
What's something
you wouldn't use?

00:10:38.960 --> 00:10:41.700 align:middle line:84%
Inversion without
permutation quite often,

00:10:41.700 --> 00:10:42.880 align:middle line:90%
or something like that.

00:10:42.880 --> 00:10:43.380 align:middle line:90%
Yeah.

00:10:43.380 --> 00:10:45.000 align:middle line:90%
Great.

00:10:45.000 --> 00:10:48.300 align:middle line:84%
Or inversion and permutation
without octave equivalents

00:10:48.300 --> 00:10:49.000 align:middle line:90%
or something.

00:10:49.000 --> 00:10:49.980 align:middle line:90%
Fantastic.

00:10:49.980 --> 00:10:53.590 align:middle line:84%
I want to introduce
you to another friend.

00:10:53.590 --> 00:10:55.080 align:middle line:84%
We're going to
have more as class

00:10:55.080 --> 00:10:58.210 align:middle line:84%
goes on, these little one to
two minute guest speakers.

00:10:58.210 --> 00:11:03.090 align:middle line:84%
And here is somebody who went
through this class like you.

00:11:03.090 --> 00:11:05.640 align:middle line:90%
Let's see.

00:11:05.640 --> 00:11:08.550 align:middle line:84%
SOPHIA SUN: Hi, I'm Sophia,
and I worked with Mike

00:11:08.550 --> 00:11:12.880 align:middle line:90%
with Music21 in 2016, 2017.

00:11:12.880 --> 00:11:17.070 align:middle line:84%
We wrote this paper
called Emotion Planning--

00:11:17.070 --> 00:11:19.440 align:middle line:84%
called Emotion
Painting: Lyric Affect

00:11:19.440 --> 00:11:22.750 align:middle line:84%
Musical Relationship in a
Large Scale Lead-Sheet Corpus.

00:11:22.750 --> 00:11:25.170 align:middle line:84%
And then the idea is
there's this concept called

00:11:25.170 --> 00:11:28.620 align:middle line:84%
word painting in classical
music, where the music reflects

00:11:28.620 --> 00:11:29.920 align:middle line:90%
what the lyric says.

00:11:29.920 --> 00:11:32.730 align:middle line:84%
So rise, you will
sing like rise.

00:11:32.730 --> 00:11:34.800 align:middle line:90%
Or fall, you would sing, fall.

00:11:34.800 --> 00:11:37.260 align:middle line:84%
And then we want to see
how prevalent that is

00:11:37.260 --> 00:11:40.160 align:middle line:90%
in, say, folk or popular music.

00:11:40.160 --> 00:11:44.920 align:middle line:84%
We had this corpus of around
1,900 songs of folk music

00:11:44.920 --> 00:11:49.600 align:middle line:84%
or popular music, and then we're
able to analyze it with Music21.

00:11:49.600 --> 00:11:52.210 align:middle line:84%
What we did is we used the
Natural Language Toolkit

00:11:52.210 --> 00:11:55.490 align:middle line:84%
and analyzed the emotion
conveyed by the lyrics,

00:11:55.490 --> 00:11:57.880 align:middle line:84%
and then looked at the
corresponding notes

00:11:57.880 --> 00:11:59.470 align:middle line:90%
in the music.

00:11:59.470 --> 00:12:02.000 align:middle line:84%
We found a bunch of
interesting things,

00:12:02.000 --> 00:12:06.610 align:middle line:84%
like more emotive words that
convey an emotion are more

00:12:06.610 --> 00:12:10.360 align:middle line:84%
likely to fall on
strong beat strengths--

00:12:10.360 --> 00:12:13.580 align:middle line:84%
like the first beat or
the third beat on beat--

00:12:13.580 --> 00:12:18.550 align:middle line:84%
whereas words that doesn't
convey emotion-- like is, and--

00:12:18.550 --> 00:12:20.720 align:middle line:84%
will fall on weaker
beat strengths.

00:12:20.720 --> 00:12:23.260 align:middle line:84%
And also interesting
things like words

00:12:23.260 --> 00:12:27.370 align:middle line:84%
with strong negative emotions
like anger, disgust, or fear

00:12:27.370 --> 00:12:30.340 align:middle line:90%
tend to fall on shorter notes.

00:12:30.340 --> 00:12:31.470 align:middle line:90%
And that's what we did.

00:12:31.470 --> 00:12:33.977 align:middle line:90%


00:12:33.977 --> 00:12:35.560 align:middle line:84%
MICHAEL CUTHBERT:
So we're going to be

00:12:35.560 --> 00:12:40.750 align:middle line:84%
moving on to the concept
of corpus and corpora

00:12:40.750 --> 00:12:41.690 align:middle line:90%
just a little bit.

00:12:41.690 --> 00:12:44.180 align:middle line:84%
And so what do we
do-- and statistics

00:12:44.180 --> 00:12:47.710 align:middle line:84%
because the only reason to
look at a huge number of pieces

00:12:47.710 --> 00:12:52.810 align:middle line:84%
is to come up with some
kind of statistical summary

00:12:52.810 --> 00:12:56.930 align:middle line:84%
or extraction, or to find things
that are outliers within it.

00:12:56.930 --> 00:12:58.880 align:middle line:84%
And even if you're
thinking-- oh, yeah,

00:12:58.880 --> 00:13:00.340 align:middle line:90%
or to do deep learning stuff.

00:13:00.340 --> 00:13:03.130 align:middle line:84%
And those who have taken
artificial intelligence

00:13:03.130 --> 00:13:07.130 align:middle line:84%
and deep learning classes,
you'll know that at its heart,

00:13:07.130 --> 00:13:08.810 align:middle line:84%
these are all just
statistics, right?

00:13:08.810 --> 00:13:10.870 align:middle line:84%
This is all just a
whole bunch of numbers

00:13:10.870 --> 00:13:14.740 align:middle line:84%
that are being trained
and extracted from things.

00:13:14.740 --> 00:13:18.890 align:middle line:84%
The corpus I was hoping
for us to work with today,

00:13:18.890 --> 00:13:22.150 align:middle line:84%
I haven't been able to
get it working well enough

00:13:22.150 --> 00:13:24.980 align:middle line:90%
to not crash on my system.

00:13:24.980 --> 00:13:29.380 align:middle line:84%
And that's my bad for
not having this up.

00:13:29.380 --> 00:13:32.740 align:middle line:84%
But I want to point out to you,
we're going to be talking about

00:13:32.740 --> 00:13:42.380 align:middle line:84%
more-- it's a collection of,
I think, 2,000 encoded lieds--

00:13:42.380 --> 00:13:46.250 align:middle line:84%
art songs, songs that are
sung in concerts and things

00:13:46.250 --> 00:13:54.470 align:middle line:84%
primarily by women and Black
and other minority composers.

00:13:54.470 --> 00:13:56.970 align:middle line:84%
You'll see that there
are some people in here--

00:13:56.970 --> 00:14:00.660 align:middle line:84%
Beethoven-- who don't fit
in any of those categories.

00:14:00.660 --> 00:14:05.930 align:middle line:84%
And that was in order to have
a comparison set in there.

00:14:05.930 --> 00:14:07.820 align:middle line:84%
I don't know, I'll
have to ask Mark

00:14:07.820 --> 00:14:10.260 align:middle line:84%
Gotham, the great researcher
who is doing this.

00:14:10.260 --> 00:14:12.920 align:middle line:84%
I think also, he had really
hoped to get 2,000 and had

00:14:12.920 --> 00:14:15.637 align:middle line:84%
a certain day and found that he
already had some Beethoven lying

00:14:15.637 --> 00:14:16.470 align:middle line:90%
around or something.

00:14:16.470 --> 00:14:19.230 align:middle line:84%
But it's a really
amazing corpus,

00:14:19.230 --> 00:14:21.830 align:middle line:84%
and I hope that we're going to
be able to work with it later

00:14:21.830 --> 00:14:23.690 align:middle line:90%
in the year.

00:14:23.690 --> 00:14:25.440 align:middle line:84%
Today being International
Women's Day,

00:14:25.440 --> 00:14:27.710 align:middle line:84%
I thought that would be
a particularly good day

00:14:27.710 --> 00:14:28.800 align:middle line:90%
to work with it.

00:14:28.800 --> 00:14:33.030 align:middle line:84%
But alas, things don't
often hit our deadlines,

00:14:33.030 --> 00:14:37.085 align:middle line:84%
and we can come
back to that later.

00:14:37.085 --> 00:14:40.410 align:middle line:90%


00:14:40.410 --> 00:14:43.390 align:middle line:84%
The second one that we're
going to be working with--

00:14:43.390 --> 00:14:46.050 align:middle line:84%
and the reason why you have
your laptops out today that

00:14:46.050 --> 00:14:48.250 align:middle line:84%
we're going to be working
with together in class--

00:14:48.250 --> 00:14:53.730 align:middle line:84%
is part of this
folk music data set.

00:14:53.730 --> 00:14:57.520 align:middle line:84%
And we're going to be looking
at the Irish folk music corpus.

00:14:57.520 --> 00:15:01.270 align:middle line:84%
There's a lot of Irish
folk music corpora online,

00:15:01.270 --> 00:15:02.670 align:middle line:90%
and we'll be looking at that.

00:15:02.670 --> 00:15:05.430 align:middle line:84%
Then just to sum
up, then we'll be

00:15:05.430 --> 00:15:08.010 align:middle line:84%
looking at probably
the most overlooked

00:15:08.010 --> 00:15:12.600 align:middle line:84%
at corpus of all time,
but one that there's

00:15:12.600 --> 00:15:16.020 align:middle line:84%
a lot of written about it, and
that is Johann Sebastian Bach's

00:15:16.020 --> 00:15:17.012 align:middle line:90%
Chorales.

00:15:17.012 --> 00:15:18.970 align:middle line:84%
The ones that you've
already been working with,

00:15:18.970 --> 00:15:21.012 align:middle line:84%
a couple of them, we're
going to see what happens

00:15:21.012 --> 00:15:22.980 align:middle line:90%
when we work with all of them.

00:15:22.980 --> 00:15:28.200 align:middle line:84%
One of the things I'm going to
be asking you to look at is one

00:15:28.200 --> 00:15:34.510 align:middle line:84%
by next class, if you can, is to
start reading an article by Bret

00:15:34.510 --> 00:15:37.220 align:middle line:84%
Aarden and David
Huron, which is--

00:15:37.220 --> 00:15:41.990 align:middle line:84%
as you can see from the
quality of the scans--

00:15:41.990 --> 00:15:43.400 align:middle line:90%
a little bit of an old article.

00:15:43.400 --> 00:15:45.590 align:middle line:84%
I think it's about
20 years old now.

00:15:45.590 --> 00:15:47.980 align:middle line:84%
But it was one of
the first ones to see

00:15:47.980 --> 00:15:51.520 align:middle line:84%
what happens when you
take musical features

00:15:51.520 --> 00:15:53.720 align:middle line:84%
and compare them to
geographic features.

00:15:53.720 --> 00:15:59.110 align:middle line:84%
So looking at a density
contour map of melodies

00:15:59.110 --> 00:16:01.850 align:middle line:84%
where most phrases
end on the tonic,

00:16:01.850 --> 00:16:05.950 align:middle line:84%
we can see that there's a huge
change from here to here in--

00:16:05.950 --> 00:16:07.460 align:middle line:90%
that's Denmark up here.

00:16:07.460 --> 00:16:10.850 align:middle line:84%
This is Germany, right
where the Alps began.

00:16:10.850 --> 00:16:14.290 align:middle line:84%
And so we can see how
geographic features

00:16:14.290 --> 00:16:19.220 align:middle line:90%
might change how music is.

00:16:19.220 --> 00:16:22.310 align:middle line:84%
So I'm going to blank
that for a second.

00:16:22.310 --> 00:16:25.160 align:middle line:84%
I'm going to open
up Jupyter Notebook.

00:16:25.160 --> 00:16:28.910 align:middle line:84%
And we're also going to unlock
a few things along the way.

00:16:28.910 --> 00:16:31.700 align:middle line:84%
So I'm hoping that
we'll get through some

00:16:31.700 --> 00:16:36.260 align:middle line:84%
of these Music21
topics as we go.

00:16:36.260 --> 00:16:42.590 align:middle line:84%
So we'll start by
importing something

00:16:42.590 --> 00:16:47.540 align:middle line:84%
that we've already unlocked
from Music21 import corpus.

00:16:47.540 --> 00:16:50.450 align:middle line:90%
And we'll call IRL--

00:16:50.450 --> 00:16:55.460 align:middle line:84%
abbreviation for
Ireland-- corpus parse.

00:16:55.460 --> 00:16:56.600 align:middle line:90%
We'll be safe.

00:16:56.600 --> 00:17:02.360 align:middle line:84%
Essen-- E-S-S-E-N--
folk song slash IRL.

00:17:02.360 --> 00:17:05.700 align:middle line:84%
See how close I can get this to
me so I'm still looking at you.

00:17:05.700 --> 00:17:06.200 align:middle line:90%
Oops.

00:17:06.200 --> 00:17:09.920 align:middle line:90%


00:17:09.920 --> 00:17:14.839 align:middle line:90%
Put this topic five, 2023.

00:17:14.839 --> 00:17:17.359 align:middle line:90%
Great.

00:17:17.359 --> 00:17:19.849 align:middle line:84%
So everybody, give
me a quick thumbs up

00:17:19.849 --> 00:17:21.740 align:middle line:90%
if we're at this place.

00:17:21.740 --> 00:17:22.295 align:middle line:90%
Awesome.

00:17:22.295 --> 00:17:22.795 align:middle line:90%
Super.

00:17:22.795 --> 00:17:26.438 align:middle line:90%


00:17:26.438 --> 00:17:26.938 align:middle line:90%
OK.

00:17:26.938 --> 00:17:29.677 align:middle line:90%


00:17:29.677 --> 00:17:32.010 align:middle line:84%
One of the things you can do,
anything that you get from

00:17:32.010 --> 00:17:36.150 align:middle line:84%
the corpus, just in case you
ever need to look at it-- oops,

00:17:36.150 --> 00:17:40.440 align:middle line:90%
sorry, I have an old thing--

00:17:40.440 --> 00:17:48.060 align:middle line:84%
is look at where it
is on your hard drive.

00:17:48.060 --> 00:17:53.550 align:middle line:84%
OK, now somebody can hack
my hard drive, and so on.

00:17:53.550 --> 00:17:56.830 align:middle line:84%
What kind of thing would
you expect IRL to be?

00:17:56.830 --> 00:17:57.695 align:middle line:90%
What kind of object?

00:17:57.695 --> 00:18:03.210 align:middle line:90%


00:18:03.210 --> 00:18:04.530 align:middle line:90%
An int.

00:18:04.530 --> 00:18:07.090 align:middle line:90%
Who votes for int?

00:18:07.090 --> 00:18:08.470 align:middle line:90%
Float?

00:18:08.470 --> 00:18:08.970 align:middle line:90%
String?

00:18:08.970 --> 00:18:16.710 align:middle line:90%


00:18:16.710 --> 00:18:17.670 align:middle line:90%
You think it's string?

00:18:17.670 --> 00:18:18.120 align:middle line:90%
No.

00:18:18.120 --> 00:18:18.828 align:middle line:90%
You don't think--

00:18:18.828 --> 00:18:21.840 align:middle line:84%
AUDIENCE: No, I was going
to say something else.

00:18:21.840 --> 00:18:26.290 align:middle line:84%
MICHAEL CUTHBERT: What usually
are we working with in Music21.

00:18:26.290 --> 00:18:27.148 align:middle line:90%
AUDIENCE: Stream.

00:18:27.148 --> 00:18:28.190 align:middle line:90%
MICHAEL CUTHBERT: Stream.

00:18:28.190 --> 00:18:28.690 align:middle line:90%
Great.

00:18:28.690 --> 00:18:30.913 align:middle line:84%
What kind of stream
do we think this--

00:18:30.913 --> 00:18:31.580 align:middle line:90%
AUDIENCE: Score.

00:18:31.580 --> 00:18:32.580 align:middle line:90%
MICHAEL CUTHBERT: Score.

00:18:32.580 --> 00:18:34.040 align:middle line:84%
Score would be most
logical, right?

00:18:34.040 --> 00:18:35.540 align:middle line:90%
In this case, we're working--

00:18:35.540 --> 00:18:38.950 align:middle line:84%
this our first time working with
something bigger than a score,

00:18:38.950 --> 00:18:40.220 align:middle line:90%
something called an opus.

00:18:40.220 --> 00:18:42.560 align:middle line:90%
So a collection of scores.

00:18:42.560 --> 00:18:45.220 align:middle line:84%
And so what we can
do is we can look

00:18:45.220 --> 00:18:51.290 align:middle line:90%
at how many scores are in here.

00:18:51.290 --> 00:18:53.750 align:middle line:84%
So this is a pretty
small corpus,

00:18:53.750 --> 00:18:57.320 align:middle line:84%
but big enough to start
doing some statistics on.

00:18:57.320 --> 00:19:01.720 align:middle line:90%
So we can do irl.scores0.show.

00:19:01.720 --> 00:19:08.950 align:middle line:90%


00:19:08.950 --> 00:19:14.060 align:middle line:90%
And good deterministic.

00:19:14.060 --> 00:19:17.410 align:middle line:84%
It's still the same one
that I thought it would be.

00:19:17.410 --> 00:19:18.050 align:middle line:90%
Let's see this.

00:19:18.050 --> 00:19:20.170 align:middle line:84%
One of the things
you'll find if you're

00:19:20.170 --> 00:19:24.620 align:middle line:84%
really interested
in being efficient

00:19:24.620 --> 00:19:29.540 align:middle line:84%
is instead of doing
what do you call it?

00:19:29.540 --> 00:19:32.120 align:middle line:90%
Square bracket zero?

00:19:32.120 --> 00:19:37.440 align:middle line:84%
On Music21 scores, once you've
done all your filtering,

00:19:37.440 --> 00:19:39.680 align:middle line:84%
you can do dot
first and dot last.

00:19:39.680 --> 00:19:43.550 align:middle line:90%
And all they are is O of one--

00:19:43.550 --> 00:19:47.420 align:middle line:84%
or that they stop
finding all the scores

00:19:47.420 --> 00:19:48.720 align:middle line:90%
once they found the first one.

00:19:48.720 --> 00:19:53.280 align:middle line:84%
So it's a little bit-- if you're
into algorithmic optimization,

00:19:53.280 --> 00:19:57.216 align:middle line:84%
it can sometimes be quite a
bit faster for very long notes.

00:19:57.216 --> 00:19:57.716 align:middle line:90%
OK.

00:19:57.716 --> 00:20:01.688 align:middle line:90%
So what I want to know is--

00:20:01.688 --> 00:20:03.150 align:middle line:90%
this is interesting.

00:20:03.150 --> 00:20:05.330 align:middle line:90%
It's in 3/4.

00:20:05.330 --> 00:20:06.795 align:middle line:90%
Pick up.

00:20:06.795 --> 00:20:07.295 align:middle line:90%
Good.

00:20:07.295 --> 00:20:13.820 align:middle line:84%
It does some of the things
that we expect tonal pieces

00:20:13.820 --> 00:20:15.810 align:middle line:90%
from folk era to do.

00:20:15.810 --> 00:20:18.230 align:middle line:90%
If you begin with--

00:20:18.230 --> 00:20:23.520 align:middle line:84%
what is that-- a dotted eighth,
a dotted quarter missing

00:20:23.520 --> 00:20:27.630 align:middle line:84%
at the beginning or added to the
pickup measure at the beginning,

00:20:27.630 --> 00:20:31.890 align:middle line:84%
you expect that at the very
end, you also have that.

00:20:31.890 --> 00:20:35.460 align:middle line:84%
So the pickup measure
and the ending measure

00:20:35.460 --> 00:20:38.182 align:middle line:90%
usually represent one.

00:20:38.182 --> 00:20:38.890 align:middle line:90%
Is everything OK?

00:20:38.890 --> 00:20:39.818 align:middle line:90%
Yeah, go ahead.

00:20:39.818 --> 00:20:41.610 align:middle line:84%
AUDIENCE: Could you
go-- scroll up, please?

00:20:41.610 --> 00:20:43.027 align:middle line:84%
MICHAEL CUTHBERT:
Sure, of course.

00:20:43.027 --> 00:20:45.360 align:middle line:90%
Always glad to.

00:20:45.360 --> 00:20:49.420 align:middle line:90%
So did we get it?

00:20:49.420 --> 00:20:49.933 align:middle line:90%
Is that--

00:20:49.933 --> 00:20:50.850 align:middle line:90%
AUDIENCE: That's good.

00:20:50.850 --> 00:20:52.470 align:middle line:84%
Yeah, the piece looks a
little bit different on mine.

00:20:52.470 --> 00:20:54.387 align:middle line:84%
MICHAEL CUTHBERT: The
piece looks a little bit

00:20:54.387 --> 00:20:56.850 align:middle line:90%
different on yours?

00:20:56.850 --> 00:20:59.160 align:middle line:90%
Hugely, terribly different?

00:20:59.160 --> 00:21:02.020 align:middle line:90%
No, just a little bit different?

00:21:02.020 --> 00:21:04.350 align:middle line:90%
OK.

00:21:04.350 --> 00:21:05.050 align:middle line:90%
Yeah.

00:21:05.050 --> 00:21:09.420 align:middle line:84%
I mean, depending
on your version,

00:21:09.420 --> 00:21:12.750 align:middle line:84%
here's what it looked like
a couple of years ago.

00:21:12.750 --> 00:21:18.540 align:middle line:84%
It's also quite a bit smaller
back then and things, but OK.

00:21:18.540 --> 00:21:23.010 align:middle line:90%
So it's in 3/4.

00:21:23.010 --> 00:21:24.965 align:middle line:84%
Is that common for
Irish folk music?

00:21:24.965 --> 00:21:28.810 align:middle line:90%


00:21:28.810 --> 00:21:30.370 align:middle line:90%
What do you think?

00:21:30.370 --> 00:21:34.770 align:middle line:84%
Who has heard Irish
musicians play Irish music?

00:21:34.770 --> 00:21:36.690 align:middle line:90%
Not very many.

00:21:36.690 --> 00:21:38.890 align:middle line:84%
Keep your hand up if
you're also over 21.

00:21:38.890 --> 00:21:40.500 align:middle line:90%
No, just kidding.

00:21:40.500 --> 00:21:42.780 align:middle line:90%
Because they do usually play--

00:21:42.780 --> 00:21:45.060 align:middle line:84%
one of the places you
can hear quite often

00:21:45.060 --> 00:21:50.580 align:middle line:84%
Irish folk musicians play in
Boston is in pubs and things.

00:21:50.580 --> 00:21:53.190 align:middle line:84%
So of people who
have heard or people

00:21:53.190 --> 00:21:58.560 align:middle line:84%
who think they might know this,
what's a time signature that you

00:21:58.560 --> 00:22:00.130 align:middle line:90%
think would be common?

00:22:00.130 --> 00:22:00.630 align:middle line:90%
Adam?

00:22:00.630 --> 00:22:00.970 align:middle line:90%
AUDIENCE: 2/4.

00:22:00.970 --> 00:22:01.740 align:middle line:90%
MICHAEL CUTHBERT: 2/4.

00:22:01.740 --> 00:22:02.190 align:middle line:90%
[? Sruthi? ?]

00:22:02.190 --> 00:22:02.610 align:middle line:90%
AUDIENCE: 6/8?

00:22:02.610 --> 00:22:03.527 align:middle line:90%
MICHAEL CUTHBERT: 6/8.

00:22:03.527 --> 00:22:04.180 align:middle line:90%
John?

00:22:04.180 --> 00:22:04.785 align:middle line:90%
6/8 also?

00:22:04.785 --> 00:22:06.160 align:middle line:84%
AUDIENCE: I was
going to say 6/8.

00:22:06.160 --> 00:22:07.077 align:middle line:90%
MICHAEL CUTHBERT: 6/8?

00:22:07.077 --> 00:22:10.140 align:middle line:84%
Well, this is one of
those cool questions where

00:22:10.140 --> 00:22:12.390 align:middle line:84%
if you have the same answer,
somebody else would still

00:22:12.390 --> 00:22:14.380 align:middle line:84%
want to hear it because that
starts building up consensus.

00:22:14.380 --> 00:22:15.790 align:middle line:84%
Somebody give me
a time signature

00:22:15.790 --> 00:22:18.950 align:middle line:84%
you don't expect
to be the highest--

00:22:18.950 --> 00:22:22.100 align:middle line:84%
the most commonly
used time signature.

00:22:22.100 --> 00:22:22.739 align:middle line:90%
Yeah, Jason?

00:22:22.739 --> 00:22:23.322 align:middle line:90%
AUDIENCE: 7/4.

00:22:23.322 --> 00:22:24.680 align:middle line:90%
MICHAEL CUTHBERT: 7/4.

00:22:24.680 --> 00:22:25.850 align:middle line:90%
Good, good.

00:22:25.850 --> 00:22:28.240 align:middle line:90%
OK, so we have some hypotheses.

00:22:28.240 --> 00:22:30.460 align:middle line:84%
What we're going to do
is try to figure out

00:22:30.460 --> 00:22:33.580 align:middle line:84%
what's the most commonly
used time signature

00:22:33.580 --> 00:22:35.480 align:middle line:90%
in this Irish folk thing.

00:22:35.480 --> 00:22:37.250 align:middle line:84%
And always start
with a hypothesis

00:22:37.250 --> 00:22:41.200 align:middle line:84%
because the number of times I've
seen people go ahead and publish

00:22:41.200 --> 00:22:46.600 align:middle line:84%
things where they don't
have a hypothesis,

00:22:46.600 --> 00:22:48.310 align:middle line:90%
and then they don't realize--

00:22:48.310 --> 00:22:51.040 align:middle line:84%
like, oh, I printed
out the measure number

00:22:51.040 --> 00:22:55.660 align:middle line:84%
divided by the number of
notes, not the time signature.

00:22:55.660 --> 00:23:00.640 align:middle line:84%
And therefore, 137 over 14,000
probably wasn't the most common

00:23:00.640 --> 00:23:01.370 align:middle line:90%
time signature.

00:23:01.370 --> 00:23:03.010 align:middle line:90%
So let's start.

00:23:03.010 --> 00:23:07.330 align:middle line:84%
This was a question that
came up at some point.

00:23:07.330 --> 00:23:11.860 align:middle line:84%
Can you use-- are anything
in the normal Python library

00:23:11.860 --> 00:23:12.880 align:middle line:90%
unlocked in this class?

00:23:12.880 --> 00:23:13.380 align:middle line:90%
Yes.

00:23:13.380 --> 00:23:15.170 align:middle line:90%
So let's import the counter.

00:23:15.170 --> 00:23:17.640 align:middle line:90%
Who has seen counter?

00:23:17.640 --> 00:23:18.540 align:middle line:90%
Not everybody.

00:23:18.540 --> 00:23:19.970 align:middle line:90%
OK, some people have.

00:23:19.970 --> 00:23:23.760 align:middle line:84%
Counter is just-- it's
a very cool little--

00:23:23.760 --> 00:23:25.260 align:middle line:90%
it's just a dictionary.

00:23:25.260 --> 00:23:28.890 align:middle line:84%
But it starts off at zero
when something's not there.

00:23:28.890 --> 00:23:30.230 align:middle line:90%
So you don't have to say--

00:23:30.230 --> 00:23:35.070 align:middle line:84%
when you're adding things up,
you can just start from that.

00:23:35.070 --> 00:23:39.920 align:middle line:84%
So you can just start
adding one to things.

00:23:39.920 --> 00:23:40.950 align:middle line:90%
So I kind of like that.

00:23:40.950 --> 00:23:48.603 align:middle line:84%
So let's say, for song in
the Irish corpus, we can do--

00:23:48.603 --> 00:23:50.520 align:middle line:84%
we're going to want to
get the time signature.

00:23:50.520 --> 00:23:53.836 align:middle line:84%
So I want you to
song dot something.

00:23:53.836 --> 00:23:56.750 align:middle line:90%


00:23:56.750 --> 00:23:57.320 align:middle line:90%
Oops.

00:23:57.320 --> 00:23:59.990 align:middle line:90%
Pull that up a little bit.

00:23:59.990 --> 00:24:01.950 align:middle line:90%
And fill out the rest.

00:24:01.950 --> 00:24:04.410 align:middle line:84%
Or maybe song-- maybe we don't
even need the dot something.

00:24:04.410 --> 00:24:07.240 align:middle line:84%
I don't know, song is
probably the next thing.

00:24:07.240 --> 00:24:11.240 align:middle line:90%


00:24:11.240 --> 00:24:15.520 align:middle line:84%
And we did put IRL
scores first up there,

00:24:15.520 --> 00:24:17.135 align:middle line:84%
so you know he can
test this on one.

00:24:17.135 --> 00:24:19.830 align:middle line:90%


00:24:19.830 --> 00:24:22.773 align:middle line:84%
Let's say we're only--
for simplicity's sake,

00:24:22.773 --> 00:24:24.690 align:middle line:84%
we're only going to be
counting the first time

00:24:24.690 --> 00:24:26.080 align:middle line:90%
signature in each song.

00:24:26.080 --> 00:24:30.610 align:middle line:84%
And that most of the
songs in this collection--

00:24:30.610 --> 00:24:32.530 align:middle line:84%
I think all of them
are monophonic,

00:24:32.530 --> 00:24:36.060 align:middle line:84%
so you're only going
to have one part.

00:24:36.060 --> 00:24:39.300 align:middle line:84%
What are some words
you're typing?

00:24:39.300 --> 00:24:40.600 align:middle line:90%
AUDIENCE: Get element by class.

00:24:40.600 --> 00:24:41.558 align:middle line:90%
MICHAEL CUTHBERT: Good.

00:24:41.558 --> 00:24:43.440 align:middle line:90%
Get element by class, or get--

00:24:43.440 --> 00:24:45.070 align:middle line:90%
there's one little type.

00:24:45.070 --> 00:24:48.380 align:middle line:90%
Get elements, plural.

00:24:48.380 --> 00:24:48.880 align:middle line:90%
Yeah.

00:24:48.880 --> 00:24:53.500 align:middle line:84%
So unfortunately, there
isn't a first element thing.

00:24:53.500 --> 00:24:54.000 align:middle line:90%
Great.

00:24:54.000 --> 00:24:57.030 align:middle line:84%
Anybody else having
other words that you're

00:24:57.030 --> 00:24:58.970 align:middle line:84%
typing that you'd like
everyone else to know?

00:24:58.970 --> 00:25:02.320 align:middle line:90%


00:25:02.320 --> 00:25:02.820 align:middle line:90%
No?

00:25:02.820 --> 00:25:09.690 align:middle line:90%


00:25:09.690 --> 00:25:12.580 align:middle line:84%
Unless I tell you otherwise,
like the midterm or something,

00:25:12.580 --> 00:25:16.080 align:middle line:84%
you're generally allowed to
talk to people around you.

00:25:16.080 --> 00:25:26.080 align:middle line:90%


00:25:26.080 --> 00:25:28.750 align:middle line:84%
So what's a word
that you've typed?

00:25:28.750 --> 00:25:32.020 align:middle line:84%
AUDIENCE: I'm going to just
select the [INAUDIBLE].

00:25:32.020 --> 00:25:35.200 align:middle line:90%
MICHAEL CUTHBERT: OK, cool.

00:25:35.200 --> 00:25:36.080 align:middle line:90%
Yeah, Misha?

00:25:36.080 --> 00:25:36.580 align:middle line:90%
What's--

00:25:36.580 --> 00:25:40.565 align:middle line:84%
AUDIENCE: I guess we can,
yeah, use meter.TimeSignature.

00:25:40.565 --> 00:25:42.440 align:middle line:84%
MICHAEL CUTHBERT: OK,
so meter.TimeSignature.

00:25:42.440 --> 00:25:45.050 align:middle line:84%
Yeah, so you'll probably
want to import meter.

00:25:45.050 --> 00:25:47.090 align:middle line:90%
Sorry if I didn't do that.

00:25:47.090 --> 00:25:49.270 align:middle line:84%
You can import anything
that's unlocked always.

00:25:49.270 --> 00:25:52.213 align:middle line:90%
So from Music21, import meter.

00:25:52.213 --> 00:25:53.630 align:middle line:84%
And what's the
word that you said?

00:25:53.630 --> 00:25:57.010 align:middle line:90%
Meter.TimeSignature.

00:25:57.010 --> 00:25:58.575 align:middle line:90%
That one might be helpful.

00:25:58.575 --> 00:26:03.850 align:middle line:90%


00:26:03.850 --> 00:26:07.380 align:middle line:84%
Anybody else have any words
that you've been typing?

00:26:07.380 --> 00:26:10.485 align:middle line:90%


00:26:10.485 --> 00:26:14.090 align:middle line:90%
I'm going to type a word.

00:26:14.090 --> 00:26:15.890 align:middle line:90%
My word is recurse.

00:26:15.890 --> 00:26:18.620 align:middle line:90%
Anybody type that word?

00:26:18.620 --> 00:26:20.330 align:middle line:90%
No?

00:26:20.330 --> 00:26:23.900 align:middle line:90%
Or flatten.

00:26:23.900 --> 00:26:25.060 align:middle line:90%
Anybody type that word?

00:26:25.060 --> 00:26:31.580 align:middle line:90%


00:26:31.580 --> 00:26:34.320 align:middle line:90%
I'm only asking for this line.

00:26:34.320 --> 00:26:38.630 align:middle line:84%
So I'm just trying to figure
out who has gotten a time

00:26:38.630 --> 00:26:40.220 align:middle line:90%
signature out?

00:26:40.220 --> 00:26:42.500 align:middle line:90%
OK, so some people have.

00:26:42.500 --> 00:26:45.637 align:middle line:84%
Vincent, what did you
type to get your time?

00:26:45.637 --> 00:26:47.220 align:middle line:84%
AUDIENCE: Oh, I made
a get suggestion.

00:26:47.220 --> 00:26:49.175 align:middle line:90%
So recurse.getElementsbyClass.

00:26:49.175 --> 00:26:50.300 align:middle line:90%
MICHAEL CUTHBERT: OK, good.

00:26:50.300 --> 00:26:52.210 align:middle line:90%
Recurse.getElementsbyClass.

00:26:52.210 --> 00:26:57.530 align:middle line:90%


00:26:57.530 --> 00:26:59.580 align:middle line:90%
And anybody, help.

00:26:59.580 --> 00:27:02.960 align:middle line:84%
What's the next thing
I'm going to type?

00:27:02.960 --> 00:27:05.895 align:middle line:90%
Meter.TimeSignature.

00:27:05.895 --> 00:27:06.395 align:middle line:90%
Great.

00:27:06.395 --> 00:27:09.390 align:middle line:90%


00:27:09.390 --> 00:27:12.920 align:middle line:84%
Anything else that I
should be typing on that?

00:27:12.920 --> 00:27:16.290 align:middle line:90%


00:27:16.290 --> 00:27:18.130 align:middle line:90%
Is this correct?

00:27:18.130 --> 00:27:23.040 align:middle line:84%
Will TS now be a
meter.TimeSignature?

00:27:23.040 --> 00:27:26.910 align:middle line:84%
OK, let's try this on
one song since I don't

00:27:26.910 --> 00:27:28.300 align:middle line:90%
know if we have this at all.

00:27:28.300 --> 00:27:32.590 align:middle line:84%
So we'll call-- we'll go
back to the irl.scores.first.

00:27:32.590 --> 00:27:36.130 align:middle line:84%
And what do we-- what was
that name of that song?

00:27:36.130 --> 00:27:37.090 align:middle line:90%
"A Lady Fair".

00:27:37.090 --> 00:27:44.160 align:middle line:84%
We'll call it lady
equals irl.scores.first.

00:27:44.160 --> 00:27:45.150 align:middle line:90%
Now we'll try this.

00:27:45.150 --> 00:27:51.810 align:middle line:84%
Lady.recurse.getElementsbyClass
meter.TimeSignature.

00:27:51.810 --> 00:27:54.720 align:middle line:90%


00:27:54.720 --> 00:27:58.500 align:middle line:84%
Who votes this is going to
get me a time signature?

00:27:58.500 --> 00:28:00.990 align:middle line:90%
Who votes not?

00:28:00.990 --> 00:28:01.858 align:middle line:90%
OK.

00:28:01.858 --> 00:28:02.650 align:middle line:90%
AUDIENCE: Not sure.

00:28:02.650 --> 00:28:03.900 align:middle line:90%
MICHAEL CUTHBERT: Not sure.

00:28:03.900 --> 00:28:05.320 align:middle line:90%
But not a time signature.

00:28:05.320 --> 00:28:07.350 align:middle line:84%
You had your hand up on
not a time signature?

00:28:07.350 --> 00:28:07.850 align:middle line:90%
Good.

00:28:07.850 --> 00:28:08.778 align:middle line:90%
Anybody else?

00:28:08.778 --> 00:28:10.070 align:middle line:90%
Vanessa, you look like you're--

00:28:10.070 --> 00:28:12.100 align:middle line:90%
AUDIENCE: [INAUDIBLE].

00:28:12.100 --> 00:28:13.350 align:middle line:90%
MICHAEL CUTHBERT: It's a what?

00:28:13.350 --> 00:28:15.630 align:middle line:84%
AUDIENCE: I think it's like a
getter function [INAUDIBLE].

00:28:15.630 --> 00:28:17.870 align:middle line:84%
MICHAEL CUTHBERT: Yeah,
something that will get what?

00:28:17.870 --> 00:28:20.180 align:middle line:90%
AUDIENCE: [INAUDIBLE].

00:28:20.180 --> 00:28:23.962 align:middle line:84%
From the song as opposed
to the song element itself.

00:28:23.962 --> 00:28:24.920 align:middle line:90%
MICHAEL CUTHBERT: Oops.

00:28:24.920 --> 00:28:27.290 align:middle line:90%
Do I not have--

00:28:27.290 --> 00:28:28.920 align:middle line:90%
oh, sorry.

00:28:28.920 --> 00:28:32.750 align:middle line:84%
Yes, that won't return
anything if I don't put these,

00:28:32.750 --> 00:28:34.395 align:middle line:90%
brackets right?

00:28:34.395 --> 00:28:36.020 align:middle line:84%
As I was trying to
do it on a function.

00:28:36.020 --> 00:28:39.570 align:middle line:90%


00:28:39.570 --> 00:28:46.580 align:middle line:84%
Oh, this comes up, by the
way, in problem sets sometimes

00:28:46.580 --> 00:28:47.330 align:middle line:90%
in answers.

00:28:47.330 --> 00:28:48.450 align:middle line:90%
The order matters, right?

00:28:48.450 --> 00:28:52.910 align:middle line:84%
I hadn't run the Music21
import meter yet.

00:28:52.910 --> 00:28:55.140 align:middle line:90%
Just something to keep in mind.

00:28:55.140 --> 00:28:56.880 align:middle line:84%
Always make sure
when you're done--

00:28:56.880 --> 00:28:58.547 align:middle line:84%
when you think your
problem set is done,

00:28:58.547 --> 00:29:01.530 align:middle line:84%
hit Restart and Run All, and
see if it gets to the end

00:29:01.530 --> 00:29:04.220 align:middle line:84%
because you might have been
solving a problem along the way

00:29:04.220 --> 00:29:05.530 align:middle line:90%
and then have--

00:29:05.530 --> 00:29:09.170 align:middle line:84%
oh, in order to
solve question two,

00:29:09.170 --> 00:29:10.940 align:middle line:84%
I imported something
from question three,

00:29:10.940 --> 00:29:13.010 align:middle line:84%
but then it's not
ready when I run it.

00:29:13.010 --> 00:29:15.560 align:middle line:84%
So yeah, so now
that we have this,

00:29:15.560 --> 00:29:21.860 align:middle line:84%
what is something called
a recursive iterator?

00:29:21.860 --> 00:29:24.190 align:middle line:90%
So it's not a time signature.

00:29:24.190 --> 00:29:29.440 align:middle line:84%
How do I get the time signature
from this if we have this?

00:29:29.440 --> 00:29:30.920 align:middle line:90%
Anybody?

00:29:30.920 --> 00:29:31.420 align:middle line:90%
Hannah?

00:29:31.420 --> 00:29:33.040 align:middle line:90%
AUDIENCE: You can index zero.

00:29:33.040 --> 00:29:35.440 align:middle line:90%
MICHAEL CUTHBERT: Index zero.

00:29:35.440 --> 00:29:36.460 align:middle line:90%
Perfect.

00:29:36.460 --> 00:29:41.110 align:middle line:84%
It's kind of like what
we did here, indexing

00:29:41.110 --> 00:29:44.352 align:middle line:90%
zero iterator over scores.

00:29:44.352 --> 00:29:46.060 align:middle line:84%
But now we have
something that's indexing

00:29:46.060 --> 00:29:47.240 align:middle line:90%
over the time signature.

00:29:47.240 --> 00:29:50.080 align:middle line:84%
So we should be able
to do this with--

00:29:50.080 --> 00:29:53.620 align:middle line:84%
if I remember my
parentheses, I do

00:29:53.620 --> 00:29:57.670 align:middle line:84%
get used to an IDE that fills
in my parentheses for me, which

00:29:57.670 --> 00:29:58.430 align:middle line:90%
I'm not using.

00:29:58.430 --> 00:30:04.760 align:middle line:84%
And I can do index zero or I
can do dot first, either one.

00:30:04.760 --> 00:30:07.370 align:middle line:84%
This is a particular
case where dot first

00:30:07.370 --> 00:30:09.303 align:middle line:84%
will save you a lot
of time because you're

00:30:09.303 --> 00:30:10.970 align:middle line:84%
pretty sure the time
signature should be

00:30:10.970 --> 00:30:12.810 align:middle line:90%
at the beginning of the score.

00:30:12.810 --> 00:30:14.623 align:middle line:90%
So once you hit one, stop.

00:30:14.623 --> 00:30:16.790 align:middle line:84%
Don't go through the whole
rest of the score looking

00:30:16.790 --> 00:30:19.600 align:middle line:84%
for more time signatures if
you only want the first one.

00:30:19.600 --> 00:30:20.100 align:middle line:90%
Good.

00:30:20.100 --> 00:30:22.010 align:middle line:90%
So we have the time signature.

00:30:22.010 --> 00:30:24.950 align:middle line:84%
Now what we can do-- this is
something we haven't seen.

00:30:24.950 --> 00:30:29.180 align:middle line:84%
The ratio of a time
signature-- the 3/4 sign--

00:30:29.180 --> 00:30:31.260 align:middle line:90%
is in its ratio string.

00:30:31.260 --> 00:30:33.750 align:middle line:84%
There's also a numerator
and denominator,

00:30:33.750 --> 00:30:36.080 align:middle line:84%
but this is the one
that's pretty helpful.

00:30:36.080 --> 00:30:42.900 align:middle line:84%
And then meter counter ratio,
what should I be doing now

00:30:42.900 --> 00:30:43.900 align:middle line:90%
if I want to count them?

00:30:43.900 --> 00:30:47.747 align:middle line:90%


00:30:47.747 --> 00:30:48.830 align:middle line:90%
AUDIENCE: Plus equals one?

00:30:48.830 --> 00:30:50.250 align:middle line:84%
MICHAEL CUTHBERT:
Plus equals one.

00:30:50.250 --> 00:30:51.590 align:middle line:90%
Good.

00:30:51.590 --> 00:30:54.835 align:middle line:84%
And then at the very end,
let's see our meter counter.

00:30:54.835 --> 00:30:57.530 align:middle line:90%


00:30:57.530 --> 00:31:02.850 align:middle line:84%
So we had hypotheses
of 3/4 and 6/8.

00:31:02.850 --> 00:31:06.630 align:middle line:90%
I put my money on 6/8.

00:31:06.630 --> 00:31:08.050 align:middle line:90%
And whoops, what did I forget?

00:31:08.050 --> 00:31:11.970 align:middle line:90%


00:31:11.970 --> 00:31:14.790 align:middle line:90%
Oh, irl.scores.

00:31:14.790 --> 00:31:16.830 align:middle line:90%
Thank you.

00:31:16.830 --> 00:31:21.360 align:middle line:84%
Irl.scores because the first
thing there was metadata.

00:31:21.360 --> 00:31:33.060 align:middle line:90%


00:31:33.060 --> 00:31:34.742 align:middle line:90%
So what's our winner?

00:31:34.742 --> 00:31:35.325 align:middle line:90%
AUDIENCE: 3/4.

00:31:35.325 --> 00:31:36.510 align:middle line:90%
MICHAEL CUTHBERT: 3/4.

00:31:36.510 --> 00:31:37.980 align:middle line:90%
Our runner up?

00:31:37.980 --> 00:31:38.688 align:middle line:90%
AUDIENCE: 4/4.

00:31:38.688 --> 00:31:42.580 align:middle line:84%
MICHAEL CUTHBERT:
4/4 And then 6/8.

00:31:42.580 --> 00:31:45.670 align:middle line:84%
At least 6/8 was on-- those of
us who were 6/8, the 6/8 crew,

00:31:45.670 --> 00:31:47.290 align:middle line:90%
we did OK on there.

00:31:47.290 --> 00:31:49.020 align:middle line:84%
But yeah, I might
have the difference

00:31:49.020 --> 00:31:52.180 align:middle line:84%
between this being sung
music versus fiddle music,

00:31:52.180 --> 00:31:52.810 align:middle line:90%
I don't know.

00:31:52.810 --> 00:31:56.590 align:middle line:84%
We can try some of the
other things in there.

00:31:56.590 --> 00:31:58.650 align:middle line:84%
By the way, with a
counter, you can also

00:31:58.650 --> 00:32:01.960 align:middle line:84%
do things like
meter counter.most

00:32:01.960 --> 00:32:08.470 align:middle line:84%
common, three most common, and
see what they are in that order.

00:32:08.470 --> 00:32:10.060 align:middle line:90%
Cool.

00:32:10.060 --> 00:32:16.810 align:middle line:84%
So that's one of the things
we can do with this corpus.

00:32:16.810 --> 00:32:22.430 align:middle line:84%
Let's jump over to the Bach
corpus for now for a little bit.

00:32:22.430 --> 00:32:24.320 align:middle line:90%
Are there questions about this?

00:32:24.320 --> 00:32:26.750 align:middle line:84%
I mean, that's just the
tiniest little thing.

00:32:26.750 --> 00:32:29.050 align:middle line:84%
We can figure out
all the questions

00:32:29.050 --> 00:32:30.830 align:middle line:90%
that we had before with it.

00:32:30.830 --> 00:32:33.760 align:middle line:90%
Oh, here.

00:32:33.760 --> 00:32:35.440 align:middle line:90%
Let's do this.

00:32:35.440 --> 00:32:40.720 align:middle line:84%
Let's do this type of
experiment that Sophia Son

00:32:40.720 --> 00:32:46.930 align:middle line:84%
was talking about with position
on the beat or whatever.

00:32:46.930 --> 00:32:54.430 align:middle line:84%
Let's look at where notes
with accidentals appear.

00:32:54.430 --> 00:33:00.650 align:middle line:84%
Are they most commonly in
this little passing position

00:33:00.650 --> 00:33:03.260 align:middle line:90%
in the middle of the bar?

00:33:03.260 --> 00:33:06.710 align:middle line:84%
Or are they more often
contradicting right

00:33:06.710 --> 00:33:09.710 align:middle line:90%
at the downbeat?

00:33:09.710 --> 00:33:11.390 align:middle line:90%
Hypothesis?

00:33:11.390 --> 00:33:14.770 align:middle line:84%
Who votes for accidentals
more in the middle of the bar?

00:33:14.770 --> 00:33:18.290 align:middle line:90%


00:33:18.290 --> 00:33:18.950 align:middle line:90%
Good.

00:33:18.950 --> 00:33:22.850 align:middle line:90%
7, 8-- and for on the downbeat?

00:33:22.850 --> 00:33:24.020 align:middle line:90%
Good.

00:33:24.020 --> 00:33:26.840 align:middle line:90%
Who's not participating?

00:33:26.840 --> 00:33:28.790 align:middle line:84%
That didn't add up to--
let's one more time.

00:33:28.790 --> 00:33:32.300 align:middle line:90%
In the middle of the bar?

00:33:32.300 --> 00:33:33.835 align:middle line:90%
Or downbeat?

00:33:33.835 --> 00:33:34.710 align:middle line:90%
A couple of downbeat.

00:33:34.710 --> 00:33:35.210 align:middle line:90%
Good.

00:33:35.210 --> 00:33:36.900 align:middle line:84%
I don't know what the
answer to this is.

00:33:36.900 --> 00:33:39.960 align:middle line:84%
Always just be thinking
about these things.

00:33:39.960 --> 00:33:43.310 align:middle line:84%
So let's do the
same type of thing.

00:33:43.310 --> 00:33:45.510 align:middle line:90%
We'll create another counter.

00:33:45.510 --> 00:33:49.460 align:middle line:84%
And we'll unlock another
little thing for you.

00:33:49.460 --> 00:33:56.890 align:middle line:90%
So we'll call this accidental--

00:33:56.890 --> 00:33:59.790 align:middle line:84%
we're not counting
accidentals, so maybe

00:33:59.790 --> 00:34:03.595 align:middle line:90%
just accidental positions.

00:34:03.595 --> 00:34:05.470 align:middle line:84%
But maybe we don't even
want to do a counter.

00:34:05.470 --> 00:34:12.840 align:middle line:84%
Maybe let's just do a list
so we can run averages on it.

00:34:12.840 --> 00:34:16.320 align:middle line:90%
Now, we'll be fair to compare--

00:34:16.320 --> 00:34:17.820 align:middle line:90%
well, I don't know--

00:34:17.820 --> 00:34:19.810 align:middle line:90%
where in the measure it is.

00:34:19.810 --> 00:34:23.670 align:middle line:84%
Maybe we want to just say we'll
just look at the 21 3/4 one

00:34:23.670 --> 00:34:26.620 align:middle line:84%
so that all of our measures
are the same length,

00:34:26.620 --> 00:34:30.750 align:middle line:84%
except for, hopefully, the
pickup measure and the end

00:34:30.750 --> 00:34:34.260 align:middle line:84%
measure are rounding
errors, but maybe not.

00:34:34.260 --> 00:34:37.150 align:middle line:84%
You know, because they
don't have the same length.

00:34:37.150 --> 00:34:42.810 align:middle line:84%
So what we can do is,
again, copy and paste.

00:34:42.810 --> 00:34:45.489 align:middle line:84%
Probably, if we're doing
this more, we can get this.

00:34:45.489 --> 00:34:52.050 align:middle line:84%
And instead, we want
to look at every note.

00:34:52.050 --> 00:34:56.650 align:middle line:84%
So there's something
called notes on this.

00:34:56.650 --> 00:34:59.440 align:middle line:84%
Or actually, we'll
do even better.

00:34:59.440 --> 00:35:01.270 align:middle line:84%
We haven't imported
note yet, right?

00:35:01.270 --> 00:35:08.170 align:middle line:90%
From Music21, import note.

00:35:08.170 --> 00:35:13.540 align:middle line:84%
Because of a bad decision
I made a while back,

00:35:13.540 --> 00:35:15.927 align:middle line:84%
dot notes also
will get you chords

00:35:15.927 --> 00:35:17.260 align:middle line:90%
if there are any chords in here.

00:35:17.260 --> 00:35:19.137 align:middle line:90%
And chords, we will get to soon.

00:35:19.137 --> 00:35:20.720 align:middle line:84%
They have to be dealt
with separately.

00:35:20.720 --> 00:35:23.155 align:middle line:84%
So we want to say
.recurse.getElem

00:35:23.155 --> 00:35:25.070 align:middle line:90%
entsbyClassnote.Note.

00:35:25.070 --> 00:35:27.170 align:middle line:84%
But there's another
way to do that.

00:35:27.170 --> 00:35:30.140 align:middle line:84%
Anyone remember what's
the shortcut for recurse?

00:35:30.140 --> 00:35:32.950 align:middle line:90%
Get elements by class?

00:35:32.950 --> 00:35:34.120 align:middle line:90%
Yeah, go ahead.

00:35:34.120 --> 00:35:36.492 align:middle line:84%
AUDIENCE: You use the
bracket and the class name.

00:35:36.492 --> 00:35:37.450 align:middle line:90%
MICHAEL CUTHBERT: Good.

00:35:37.450 --> 00:35:44.330 align:middle line:84%
So we'll put the bracket
for n in song note.Note.

00:35:44.330 --> 00:35:47.150 align:middle line:84%
So that will get us
every note there.

00:35:47.150 --> 00:35:53.810 align:middle line:84%
And how do we filter out
ones without accidentals?

00:35:53.810 --> 00:35:55.560 align:middle line:90%
So try that yourself.

00:35:55.560 --> 00:35:57.200 align:middle line:90%
Try to figure out--

00:35:57.200 --> 00:36:00.870 align:middle line:84%
pretty sure that this
is right for now.

00:36:00.870 --> 00:36:01.460 align:middle line:90%
Yep.

00:36:01.460 --> 00:36:02.880 align:middle line:84%
We've got a whole
bunch of notes.

00:36:02.880 --> 00:36:07.850 align:middle line:84%
We want to filter out
ones without accidentals.

00:36:07.850 --> 00:36:10.340 align:middle line:84%
Oh, why do we have
a five space thing?

00:36:10.340 --> 00:36:13.550 align:middle line:90%
That bothers me.

00:36:13.550 --> 00:36:16.926 align:middle line:90%
Filter out no accidentals.

00:36:16.926 --> 00:36:24.140 align:middle line:90%


00:36:24.140 --> 00:36:25.345 align:middle line:90%
We're going to have some--

00:36:25.345 --> 00:36:28.940 align:middle line:90%


00:36:28.940 --> 00:36:30.923 align:middle line:84%
we might not get
to the Bach example

00:36:30.923 --> 00:36:33.590 align:middle line:84%
because I came up with this one,
and there's a neat little twist

00:36:33.590 --> 00:36:36.920 align:middle line:90%
that I had forgotten about.

00:36:36.920 --> 00:36:40.490 align:middle line:84%
Go ahead and
interrupt the class,

00:36:40.490 --> 00:36:43.310 align:middle line:84%
and ask that for
everybody in a loud voice.

00:36:43.310 --> 00:36:47.150 align:middle line:84%
AUDIENCE: What do people
think about accidentals

00:36:47.150 --> 00:36:48.180 align:middle line:90%
in the key signature?

00:36:48.180 --> 00:36:50.970 align:middle line:84%
Are we counting
those as accidentals?

00:36:50.970 --> 00:36:52.915 align:middle line:90%
AUDIENCE: No.

00:36:52.915 --> 00:36:54.040 align:middle line:90%
MICHAEL CUTHBERT: OK, good.

00:36:54.040 --> 00:36:56.040 align:middle line:84%
So we're going to have
to do some-- that was

00:36:56.040 --> 00:36:57.370 align:middle line:90%
the wrinkle that I thought of.

00:36:57.370 --> 00:36:59.750 align:middle line:84%
One of the ways you could do
is you could say, oh shoot.

00:36:59.750 --> 00:37:00.250 align:middle line:90%
OK.

00:37:00.250 --> 00:37:05.380 align:middle line:84%
We're just going to look at ones
with C major so we can do it.

00:37:05.380 --> 00:37:08.370 align:middle line:84%
But presumably, sometimes you
can filter down your corpus

00:37:08.370 --> 00:37:10.650 align:middle line:84%
to get rid of some
corner cases that

00:37:10.650 --> 00:37:13.810 align:middle line:84%
might be a little bit
too hard to deal with,

00:37:13.810 --> 00:37:15.550 align:middle line:90%
at least in the first run.

00:37:15.550 --> 00:37:17.640 align:middle line:84%
But getting rid of
everything but C major

00:37:17.640 --> 00:37:20.530 align:middle line:84%
is probably not going to leave
us with enough of a corpus.

00:37:20.530 --> 00:37:26.400 align:middle line:84%
So let's temporarily
unlock a second module

00:37:26.400 --> 00:37:28.643 align:middle line:90%
from Music21 import key.

00:37:28.643 --> 00:37:31.170 align:middle line:90%


00:37:31.170 --> 00:37:37.290 align:middle line:84%
And first, let's get the first
key signature for each thing

00:37:37.290 --> 00:37:38.225 align:middle line:90%
so we can do--

00:37:38.225 --> 00:37:41.400 align:middle line:90%


00:37:41.400 --> 00:37:43.920 align:middle line:84%
how do we get the first
key signature in the piece?

00:37:43.920 --> 00:37:45.750 align:middle line:84%
Let's assume that
for now, that it

00:37:45.750 --> 00:37:47.316 align:middle line:90%
doesn't switch key signatures.

00:37:47.316 --> 00:37:52.110 align:middle line:90%


00:37:52.110 --> 00:37:54.870 align:middle line:84%
AUDIENCE: Song.recurse
parentheses.

00:37:54.870 --> 00:37:57.930 align:middle line:84%
MICHAEL CUTHBERT: Song.recurse
parentheses.getElementsbyClass.

00:37:57.930 --> 00:38:00.810 align:middle line:90%


00:38:00.810 --> 00:38:03.398 align:middle line:90%
Or what's a simpler way?

00:38:03.398 --> 00:38:04.440 align:middle line:90%
AUDIENCE: Square bracket.

00:38:04.440 --> 00:38:07.050 align:middle line:84%
MICHAEL CUTHBERT:
Square bracket key dot--

00:38:07.050 --> 00:38:10.064 align:middle line:84%
I'll tell you it's
key signature--

00:38:10.064 --> 00:38:10.920 align:middle line:90%
dot first.

00:38:10.920 --> 00:38:14.820 align:middle line:90%


00:38:14.820 --> 00:38:18.600 align:middle line:84%
So first, let's filter
out everything--

00:38:18.600 --> 00:38:22.660 align:middle line:84%
so now, let me make a
little introduction.

00:38:22.660 --> 00:38:24.700 align:middle line:84%
Man, I wish I could
edit at this part.

00:38:24.700 --> 00:38:26.500 align:middle line:90%
So let's go back.

00:38:26.500 --> 00:38:28.540 align:middle line:90%
Always work through one score.

00:38:28.540 --> 00:38:35.010 align:middle line:84%
So we have the Lady score,
and we'll get ks equals lady--

00:38:35.010 --> 00:38:36.870 align:middle line:90%
was it "My Lady Fair"?

00:38:36.870 --> 00:38:43.385 align:middle line:84%
Lady key-- I didn't import
key yet from Music21.

00:38:43.385 --> 00:38:46.080 align:middle line:90%


00:38:46.080 --> 00:38:49.390 align:middle line:84%
Let's pause for a
little bit and help

00:38:49.390 --> 00:38:52.640 align:middle line:84%
me get caught up so that
anybody watching this later

00:38:52.640 --> 00:38:53.390 align:middle line:90%
can get caught up.

00:38:53.390 --> 00:39:00.640 align:middle line:84%
Can you all come with me for a
second and eyes for a second?

00:39:00.640 --> 00:39:01.900 align:middle line:90%
Thanks.

00:39:01.900 --> 00:39:06.520 align:middle line:84%
Can somebody tell me what
I should be putting here?

00:39:06.520 --> 00:39:09.590 align:middle line:84%
I think we're mostly at
about this line together.

00:39:09.590 --> 00:39:15.790 align:middle line:84%
So who have I not
heard from very much?

00:39:15.790 --> 00:39:17.925 align:middle line:90%
Angelica?

00:39:17.925 --> 00:39:19.730 align:middle line:84%
AUDIENCE: OK, so
one doesn't work.

00:39:19.730 --> 00:39:24.430 align:middle line:84%
But I tried to say if
n.pitch.accidental,

00:39:24.430 --> 00:39:29.740 align:middle line:84%
and if the key
signature.accidental by step,

00:39:29.740 --> 00:39:31.660 align:middle line:90%
and then n.name.

00:39:31.660 --> 00:39:38.180 align:middle line:84%
MICHAEL CUTHBERT: And-- sorry,
and ks.accidental by step,

00:39:38.180 --> 00:39:38.680 align:middle line:90%
n.name?

00:39:38.680 --> 00:39:43.750 align:middle line:90%


00:39:43.750 --> 00:39:44.320 align:middle line:90%
Good.

00:39:44.320 --> 00:39:45.500 align:middle line:90%
That's a pretty good start.

00:39:45.500 --> 00:39:47.220 align:middle line:90%
I might change one thing on it.

00:39:47.220 --> 00:39:47.940 align:middle line:90%
Anybody else?

00:39:47.940 --> 00:39:52.850 align:middle line:84%
Anyone have a suggestion of
one thing to change on that?

00:39:52.850 --> 00:39:55.520 align:middle line:84%
So we're looking to see
there is an accidental

00:39:55.520 --> 00:39:57.680 align:middle line:84%
and there is an
accidental-- yeah.

00:39:57.680 --> 00:39:59.360 align:middle line:84%
AUDIENCE: I would
change name to step.

00:39:59.360 --> 00:40:00.943 align:middle line:84%
MICHAEL CUTHBERT:
Change name to step.

00:40:00.943 --> 00:40:04.070 align:middle line:84%
So the difference between name
and step, accidental by step

00:40:04.070 --> 00:40:05.270 align:middle line:90%
expects a step.

00:40:05.270 --> 00:40:09.890 align:middle line:90%
C sharp's name is C sharp.

00:40:09.890 --> 00:40:11.510 align:middle line:90%
C sharp step is--

00:40:11.510 --> 00:40:14.270 align:middle line:90%
shout it out.

00:40:14.270 --> 00:40:15.450 align:middle line:90%
Nobody knows.

00:40:15.450 --> 00:40:16.190 align:middle line:90%
Total mystery.

00:40:16.190 --> 00:40:17.570 align:middle line:90%
C. Good.

00:40:17.570 --> 00:40:23.340 align:middle line:90%
Step-- I know you knew that.

00:40:23.340 --> 00:40:24.720 align:middle line:90%
But just keep that going.

00:40:24.720 --> 00:40:25.220 align:middle line:90%
Good.

00:40:25.220 --> 00:40:28.440 align:middle line:90%
So what's this logic?

00:40:28.440 --> 00:40:34.340 align:middle line:84%
If the note pitch has
an accidental and there

00:40:34.340 --> 00:40:38.240 align:middle line:84%
is an accidental
there, then what?

00:40:38.240 --> 00:40:40.070 align:middle line:84%
Anybody who feels
confident that they

00:40:40.070 --> 00:40:46.240 align:middle line:84%
can code the next line of this,
even if you didn't have this?

00:40:46.240 --> 00:40:49.440 align:middle line:84%
Or even just logically,
what do we want to do now?

00:40:49.440 --> 00:40:52.198 align:middle line:90%


00:40:52.198 --> 00:40:53.490 align:middle line:90%
AUDIENCE: If they're the same--

00:40:53.490 --> 00:40:54.280 align:middle line:90%
MICHAEL CUTHBERT: Uh huh.

00:40:54.280 --> 00:40:55.630 align:middle line:90%
AUDIENCE: --we don't add one.

00:40:55.630 --> 00:40:55.975 align:middle line:90%
MICHAEL CUTHBERT: OK.

00:40:55.975 --> 00:40:57.590 align:middle line:84%
If they're the same,
we don't add one.

00:40:57.590 --> 00:40:58.300 align:middle line:90%
Good.

00:40:58.300 --> 00:41:09.190 align:middle line:84%
If n.pitch.accidental and equals
ks.accidental by step, n.step--

00:41:09.190 --> 00:41:12.940 align:middle line:90%


00:41:12.940 --> 00:41:13.670 align:middle line:90%
what is it?

00:41:13.670 --> 00:41:16.130 align:middle line:90%
Something plus equals zero.

00:41:16.130 --> 00:41:17.120 align:middle line:90%
We won't do anything.

00:41:17.120 --> 00:41:18.850 align:middle line:90%
Nil, we can pass.

00:41:18.850 --> 00:41:21.250 align:middle line:84%
Since we want to do
something at this point,

00:41:21.250 --> 00:41:24.280 align:middle line:90%
how can we flip those?

00:41:24.280 --> 00:41:27.460 align:middle line:84%
How can we flip it
so we can add this?

00:41:27.460 --> 00:41:31.035 align:middle line:84%
Don't worry, we'll improve some
of the redundancy in a second.

00:41:31.035 --> 00:41:36.220 align:middle line:90%


00:41:36.220 --> 00:41:38.360 align:middle line:84%
If it's like this, we
don't want to do anything.

00:41:38.360 --> 00:41:40.690 align:middle line:84%
If it's not like this,
what do we want to do?

00:41:40.690 --> 00:41:41.780 align:middle line:90%
Add one.

00:41:41.780 --> 00:41:44.690 align:middle line:90%
So how can we save ourselves?

00:41:44.690 --> 00:41:50.170 align:middle line:84%
I suppose we can put else
something plus equals one.

00:41:50.170 --> 00:41:50.980 align:middle line:90%
But--

00:41:50.980 --> 00:41:52.570 align:middle line:90%
AUDIENCE: You could do a not.

00:41:52.570 --> 00:41:53.820 align:middle line:90%
MICHAEL CUTHBERT: I can do a--

00:41:53.820 --> 00:41:54.700 align:middle line:90%
AUDIENCE: A not.

00:41:54.700 --> 00:41:55.360 align:middle line:90%
MICHAEL CUTHBERT: A not.

00:41:55.360 --> 00:41:55.940 align:middle line:90%
Not equal.

00:41:55.940 --> 00:42:00.080 align:middle line:84%
If these are not equal,
then we can do that.

00:42:00.080 --> 00:42:01.970 align:middle line:90%
So that could work.

00:42:01.970 --> 00:42:10.750 align:middle line:84%
What's another thing I can
probably save some redundancy?

00:42:10.750 --> 00:42:14.725 align:middle line:84%
Let's store these things at
acc equals n.pitch.accidental.

00:42:14.725 --> 00:42:18.064 align:middle line:90%


00:42:18.064 --> 00:42:23.020 align:middle line:90%
ks acc equals this.

00:42:23.020 --> 00:42:27.770 align:middle line:84%
When you find yourself writing
something twice in two lines,

00:42:27.770 --> 00:42:29.685 align:middle line:84%
you will probably
continue to write it.

00:42:29.685 --> 00:42:37.000 align:middle line:90%


00:42:37.000 --> 00:42:39.750 align:middle line:90%
And so we can do this.

00:42:39.750 --> 00:42:42.140 align:middle line:84%
We might even be
able to reduce this

00:42:42.140 --> 00:42:44.060 align:middle line:84%
further because
Python will allow

00:42:44.060 --> 00:42:53.030 align:middle line:84%
you to compare none not equal
to something else, but good.

00:42:53.030 --> 00:42:54.720 align:middle line:90%
Does that cover all the cases?

00:42:54.720 --> 00:42:59.475 align:middle line:84%
We have an accidental and
we have the accidental

00:42:59.475 --> 00:43:00.350 align:middle line:90%
in the key signature.

00:43:00.350 --> 00:43:01.892 align:middle line:84%
Angelica, by the
way, that was great.

00:43:01.892 --> 00:43:05.540 align:middle line:84%
Thank you for getting us
going on the right path.

00:43:05.540 --> 00:43:07.950 align:middle line:84%
And we have a key
signature accidental,

00:43:07.950 --> 00:43:10.260 align:middle line:84%
and so we have an
accident on the note.

00:43:10.260 --> 00:43:11.850 align:middle line:84%
We have a key
signature accidental.

00:43:11.850 --> 00:43:14.280 align:middle line:84%
And the two are not
equal to each other,

00:43:14.280 --> 00:43:17.795 align:middle line:84%
so therefore, we're going
to add one to something.

00:43:17.795 --> 00:43:19.920 align:middle line:84%
We'll figure out what we're
going to add something,

00:43:19.920 --> 00:43:21.510 align:middle line:84%
but we care about
that note, right?

00:43:21.510 --> 00:43:24.560 align:middle line:90%
Any other notes we care about?

00:43:24.560 --> 00:43:25.160 align:middle line:90%
Yeah?

00:43:25.160 --> 00:43:27.410 align:middle line:84%
AUDIENCE: What about notes
where the key signature has

00:43:27.410 --> 00:43:30.030 align:middle line:84%
them sharped or flatted,
But, then we natural them?

00:43:30.030 --> 00:43:31.300 align:middle line:90%
MICHAEL CUTHBERT: OK, good.

00:43:31.300 --> 00:43:31.800 align:middle line:90%
Good.

00:43:31.800 --> 00:43:36.843 align:middle line:84%
And the problem with
natural is what?

00:43:36.843 --> 00:43:38.760 align:middle line:84%
AUDIENCE: Technically,
it's not an accidental.

00:43:38.760 --> 00:43:41.400 align:middle line:84%
MICHAEL CUTHBERT: Technically,
it's not an accidental.

00:43:41.400 --> 00:43:45.390 align:middle line:84%
This is a thing that I did to
speed up so that there would

00:43:45.390 --> 00:43:50.680 align:middle line:84%
be one fewer object creation
back in 2004 and 2005,

00:43:50.680 --> 00:43:52.830 align:middle line:84%
when object creation
was still something

00:43:52.830 --> 00:43:54.340 align:middle line:90%
that was slow in Python.

00:43:54.340 --> 00:43:57.840 align:middle line:84%
Do I regret not putting
an accidental of natural

00:43:57.840 --> 00:43:59.770 align:middle line:90%
on every single note now?

00:43:59.770 --> 00:44:02.920 align:middle line:90%
Yes, I do regret that.

00:44:02.920 --> 00:44:07.580 align:middle line:84%
Here's a trick that I've started
to do a lot since I don't really

00:44:07.580 --> 00:44:08.080 align:middle line:90%
care.

00:44:08.080 --> 00:44:12.330 align:middle line:90%
We'll import pitch for a second.

00:44:12.330 --> 00:44:20.970 align:middle line:84%
Music21 import pitch, and
we'll just make one natural.

00:44:20.970 --> 00:44:23.850 align:middle line:84%
And I'll put it in all caps
because that means to me

00:44:23.850 --> 00:44:29.370 align:middle line:84%
that I'm going to try as much as
possible never to mutate this.

00:44:29.370 --> 00:44:36.070 align:middle line:84%
So one of the things we could
do now is since none returns

00:44:36.070 --> 00:44:37.130 align:middle line:90%
falsy--

00:44:37.130 --> 00:44:39.460 align:middle line:84%
so therefore, we
continue in the or-- we

00:44:39.460 --> 00:44:42.550 align:middle line:84%
can say the accidental
is this one or natural,

00:44:42.550 --> 00:44:45.340 align:middle line:90%
and this one is or natural.

00:44:45.340 --> 00:44:51.210 align:middle line:84%
Now we are always
comparing apples to apples.

00:44:51.210 --> 00:44:53.740 align:middle line:90%


00:44:53.740 --> 00:44:57.020 align:middle line:84%
So this is just a little
programming trick.

00:44:57.020 --> 00:45:02.390 align:middle line:84%
And in case you really
care about the runtime,

00:45:02.390 --> 00:45:05.920 align:middle line:84%
I only had to create one
extra accidental object.

00:45:05.920 --> 00:45:07.410 align:middle line:90%
I think that should work.

00:45:07.410 --> 00:45:09.970 align:middle line:90%


00:45:09.970 --> 00:45:11.000 align:middle line:90%
I see some confusing.

00:45:11.000 --> 00:45:12.640 align:middle line:90%
Yeah?

00:45:12.640 --> 00:45:15.320 align:middle line:84%
AUDIENCE: Why can't we just
have the not equal sign?

00:45:15.320 --> 00:45:17.920 align:middle line:84%
Like if there's a non-object
and it's something that's

00:45:17.920 --> 00:45:19.280 align:middle line:90%
not, then will it not compare?

00:45:19.280 --> 00:45:20.280 align:middle line:90%
MICHAEL CUTHBERT: Sorry.

00:45:20.280 --> 00:45:23.240 align:middle line:84%
Can you say a little bit
louder, both for me and others?

00:45:23.240 --> 00:45:24.160 align:middle line:90%
AUDIENCE: Yeah.

00:45:24.160 --> 00:45:26.783 align:middle line:84%
Once we have the accidental
in the key signature--

00:45:26.783 --> 00:45:27.700 align:middle line:90%
MICHAEL CUTHBERT: Yep.

00:45:27.700 --> 00:45:30.160 align:middle line:84%
AUDIENCE: --why do we need
to have the or natural?

00:45:30.160 --> 00:45:32.470 align:middle line:84%
If we're comparing the not
equals in the next line,

00:45:32.470 --> 00:45:34.113 align:middle line:90%
will that not work with non--

00:45:34.113 --> 00:45:34.988 align:middle line:90%
MICHAEL CUTHBERT: Ah.

00:45:34.988 --> 00:45:39.710 align:middle line:84%
Yeah, so one of the
reasons might be--

00:45:39.710 --> 00:45:40.770 align:middle line:90%
yeah, that's true.

00:45:40.770 --> 00:45:43.880 align:middle line:90%
We probably don't.

00:45:43.880 --> 00:45:45.030 align:middle line:90%
Wait, no, no.

00:45:45.030 --> 00:45:47.420 align:middle line:90%
Then we get to Matthew's case.

00:45:47.420 --> 00:45:51.830 align:middle line:90%
What case does this not cover?

00:45:51.830 --> 00:45:56.187 align:middle line:84%
AUDIENCE: I don't see a case
that this doesn't cover.

00:45:56.187 --> 00:45:57.230 align:middle line:90%
MICHAEL CUTHBERT: Great.

00:45:57.230 --> 00:46:01.280 align:middle line:84%
So here's the case
that doesn't cover.

00:46:01.280 --> 00:46:03.720 align:middle line:90%
ks, again, is our D major thing.

00:46:03.720 --> 00:46:12.545 align:middle line:84%
Accidental by step
of G is none, right?

00:46:12.545 --> 00:46:17.480 align:middle line:90%
n equals note.Note G sharp--

00:46:17.480 --> 00:46:18.570 align:middle line:90%
G sharp four.

00:46:18.570 --> 00:46:19.230 align:middle line:90%
Great.

00:46:19.230 --> 00:46:23.960 align:middle line:90%
Next n equals note.Note G four.

00:46:23.960 --> 00:46:27.470 align:middle line:84%
When I generate this, it's
going to get an accidental

00:46:27.470 --> 00:46:29.220 align:middle line:90%
because it needs something.

00:46:29.220 --> 00:46:32.640 align:middle line:84%
So you're going to end up
with next n.pitch.accidental--

00:46:32.640 --> 00:46:36.350 align:middle line:90%


00:46:36.350 --> 00:46:43.470 align:middle line:84%
oops. dot. pitch.accidental
equals pitch.accidental natural

00:46:43.470 --> 00:46:46.740 align:middle line:84%
because it will actually
have a natural sign.

00:46:46.740 --> 00:46:55.430 align:middle line:84%
And then this line up here,
next n.pitch.accidental.

00:46:55.430 --> 00:47:01.220 align:middle line:90%


00:47:01.220 --> 00:47:07.700 align:middle line:84%
Does it equal ks
accidental by step G?

00:47:07.700 --> 00:47:10.010 align:middle line:90%
Oops, what did I forget?

00:47:10.010 --> 00:47:13.370 align:middle line:84%
Didn't I import
pitch, or did I--

00:47:13.370 --> 00:47:15.650 align:middle line:90%
I never ran that.

00:47:15.650 --> 00:47:17.990 align:middle line:84%
I typed that, but
I forgot to run it.

00:47:17.990 --> 00:47:22.310 align:middle line:84%
False because this is a
natural, an explicit accidental

00:47:22.310 --> 00:47:27.980 align:middle line:90%
of natural, and this is a none.

00:47:27.980 --> 00:47:31.000 align:middle line:84%
Not a nun like the ones that
wear the habits and go around,

00:47:31.000 --> 00:47:33.900 align:middle line:90%
but N-O-N-E.

00:47:33.900 --> 00:47:35.817 align:middle line:90%
So that's the particular case.

00:47:35.817 --> 00:47:37.650 align:middle line:84%
Now, one of the things
we never talked about

00:47:37.650 --> 00:47:42.880 align:middle line:90%
is how do accidentals compare?

00:47:42.880 --> 00:47:47.700 align:middle line:84%
First, we want to make sure
does one accidental flat

00:47:47.700 --> 00:47:55.320 align:middle line:90%
equals another accidental flat?

00:47:55.320 --> 00:47:57.510 align:middle line:90%
Yes, they do.

00:47:57.510 --> 00:48:01.770 align:middle line:84%
So that's the reason
why I put in these or--

00:48:01.770 --> 00:48:09.060 align:middle line:84%
where'd they go-- or natural, so
that I'm always comparing apples

00:48:09.060 --> 00:48:10.350 align:middle line:90%
to apples.

00:48:10.350 --> 00:48:11.140 align:middle line:90%
Great idea.

00:48:11.140 --> 00:48:12.690 align:middle line:90%
Yeah, Jack?

00:48:12.690 --> 00:48:14.870 align:middle line:84%
AUDIENCE: I'm confused
how the example--

00:48:14.870 --> 00:48:16.440 align:middle line:90%
didn't we want it to be false?

00:48:16.440 --> 00:48:18.780 align:middle line:84%
MICHAEL CUTHBERT: Didn't
we want it to be false?

00:48:18.780 --> 00:48:21.870 align:middle line:84%
AUDIENCE: In the extra
thing you just wrote below.

00:48:21.870 --> 00:48:24.300 align:middle line:84%
MICHAEL CUTHBERT:
In the extra thing?

00:48:24.300 --> 00:48:26.190 align:middle line:90%
AUDIENCE: Yeah, that.

00:48:26.190 --> 00:48:27.190 align:middle line:90%
MICHAEL CUTHBERT: Right.

00:48:27.190 --> 00:48:33.220 align:middle line:84%
We want this one to be false
because we're in D major, right?

00:48:33.220 --> 00:48:36.350 align:middle line:90%
Accidental on G is none, right?

00:48:36.350 --> 00:48:41.300 align:middle line:84%
So this is none, and
this is a natural.

00:48:41.300 --> 00:48:43.700 align:middle line:84%
But the note is still
going to be a G natural.

00:48:43.700 --> 00:48:46.810 align:middle line:84%
It's just one of them is
represented with no accidental,

00:48:46.810 --> 00:48:50.500 align:middle line:84%
and the other is represented
with the accidental of natural.

00:48:50.500 --> 00:48:51.040 align:middle line:90%
So--

00:48:51.040 --> 00:48:52.457 align:middle line:84%
AUDIENCE: Oh,
you're saying having

00:48:52.457 --> 00:48:55.120 align:middle line:90%
the natural sign [INAUDIBLE]?

00:48:55.120 --> 00:48:58.100 align:middle line:84%
MICHAEL CUTHBERT: So by
putting the or natural--

00:48:58.100 --> 00:49:00.760 align:middle line:90%
so I've defined this now.

00:49:00.760 --> 00:49:09.100 align:middle line:84%
Acc equals next n's
pitch.accidental or natural.

00:49:09.100 --> 00:49:10.670 align:middle line:90%
What's acc now?

00:49:10.670 --> 00:49:12.910 align:middle line:90%
It's a natural.

00:49:12.910 --> 00:49:20.410 align:middle line:84%
ks-- key signature's accidental
equals ks accidental by step.

00:49:20.410 --> 00:49:29.150 align:middle line:84%
G or natural ks accidental
is now also a natural.

00:49:29.150 --> 00:49:34.550 align:middle line:84%
Acc equals ks
accidental is now true.

00:49:34.550 --> 00:49:40.070 align:middle line:84%
The notion that you don't care
about the difference between a G

00:49:40.070 --> 00:49:42.200 align:middle line:84%
that has no accidental
and a G that

00:49:42.200 --> 00:49:44.760 align:middle line:84%
has an accidental
of natural, right?

00:49:44.760 --> 00:49:49.940 align:middle line:90%
In this case, we do not.

00:49:49.940 --> 00:49:54.420 align:middle line:84%
So does that start
to clarify things?

00:49:54.420 --> 00:49:55.710 align:middle line:90%
OK.

00:49:55.710 --> 00:49:57.390 align:middle line:90%
Here are some notes.

00:49:57.390 --> 00:50:00.030 align:middle line:84%
Let's always go back
to actual music.

00:50:00.030 --> 00:50:03.000 align:middle line:84%
That's how this-- that's
why we're confused.

00:50:03.000 --> 00:50:05.490 align:middle line:84%
We haven't looked at some
actual music in a little while.

00:50:05.490 --> 00:50:07.170 align:middle line:90%
So we're in D major.

00:50:07.170 --> 00:50:08.810 align:middle line:90%
Here, we have two sharps.

00:50:08.810 --> 00:50:11.070 align:middle line:84%
Let's ignore the time
signature for now.

00:50:11.070 --> 00:50:14.213 align:middle line:90%
And now we have something like--

00:50:14.213 --> 00:50:17.200 align:middle line:90%
[MARKER SCRIBBLING]

00:50:17.200 --> 00:50:32.200 align:middle line:90%


00:50:32.200 --> 00:50:39.180 align:middle line:84%
How many notes here
contradict the key signature

00:50:39.180 --> 00:50:41.062 align:middle line:90%
if we're looking at this?

00:50:41.062 --> 00:50:41.645 align:middle line:90%
AUDIENCE: One.

00:50:41.645 --> 00:50:42.562 align:middle line:90%
MICHAEL CUTHBERT: One.

00:50:42.562 --> 00:50:44.470 align:middle line:90%
Which one?

00:50:44.470 --> 00:50:46.320 align:middle line:90%
That G sharp.

00:50:46.320 --> 00:50:48.640 align:middle line:90%
But this has a--

00:50:48.640 --> 00:50:52.373 align:middle line:84%
the accidental on this
note is probably none.

00:50:52.373 --> 00:50:55.020 align:middle line:90%


00:50:55.020 --> 00:50:59.755 align:middle line:84%
The accidental on this note
is almost certainly natural.

00:50:59.755 --> 00:51:02.700 align:middle line:90%


00:51:02.700 --> 00:51:04.860 align:middle line:90%
And the key signatures--

00:51:04.860 --> 00:51:06.480 align:middle line:90%
give me another color.

00:51:06.480 --> 00:51:12.520 align:middle line:84%
The ks of-- it would
go right here--

00:51:12.520 --> 00:51:20.523 align:middle line:84%
the accidental by
step for G is none.

00:51:20.523 --> 00:51:23.170 align:middle line:90%


00:51:23.170 --> 00:51:28.390 align:middle line:84%
So in this case, these
two would compare equal,

00:51:28.390 --> 00:51:29.775 align:middle line:90%
but these two would not.

00:51:29.775 --> 00:51:34.480 align:middle line:90%


00:51:34.480 --> 00:51:37.040 align:middle line:84%
Not a very good instructor of
software engineering today.

00:51:37.040 --> 00:51:37.820 align:middle line:90%
Sorry about that.

00:51:37.820 --> 00:51:39.200 align:middle line:90%
But I'll try to get better.

00:51:39.200 --> 00:51:41.050 align:middle line:90%
Any other questions?

00:51:41.050 --> 00:51:43.160 align:middle line:84%
We have about four
or five minutes.

00:51:43.160 --> 00:51:47.990 align:middle line:84%
I'd love to try to get a
little bit further in this,

00:51:47.990 --> 00:51:50.150 align:middle line:90%
so I'm going to jump back.

00:51:50.150 --> 00:51:51.980 align:middle line:84%
Oh, we have something
I never did.

00:51:51.980 --> 00:51:56.050 align:middle line:90%
Let's just make it--

00:51:56.050 --> 00:51:59.590 align:middle line:84%
in the interest of time,
we'll create a counter

00:51:59.590 --> 00:52:03.550 align:middle line:84%
and just keep track of
downbeat versus non downbeat.

00:52:03.550 --> 00:52:09.190 align:middle line:84%
So what we'll say is if the
accidental is not the same

00:52:09.190 --> 00:52:13.400 align:middle line:84%
as the key signature accidental,
then it's an interesting note.

00:52:13.400 --> 00:52:16.090 align:middle line:84%
So then we want to know
if it's on the downbeat

00:52:16.090 --> 00:52:17.360 align:middle line:90%
or off the downbeat.

00:52:17.360 --> 00:52:19.990 align:middle line:84%
What do y'all use to
figure out if something was

00:52:19.990 --> 00:52:22.490 align:middle line:90%
on the downbeat?

00:52:22.490 --> 00:52:23.190 align:middle line:90%
What'd you say?

00:52:23.190 --> 00:52:23.510 align:middle line:90%
AUDIENCE: Offset.

00:52:23.510 --> 00:52:24.990 align:middle line:90%
MICHAEL CUTHBERT: Offset, right.

00:52:24.990 --> 00:52:28.110 align:middle line:90%
So if the note's offset--

00:52:28.110 --> 00:52:30.843 align:middle line:84%
and here is where recurse
and flat are going

00:52:30.843 --> 00:52:32.010 align:middle line:90%
to be very different, right?

00:52:32.010 --> 00:52:39.240 align:middle line:84%
Because recurse's offset
is with respect to what?

00:52:39.240 --> 00:52:39.740 align:middle line:90%
Vincent?

00:52:39.740 --> 00:52:40.130 align:middle line:90%
AUDIENCE: Measure.

00:52:40.130 --> 00:52:41.380 align:middle line:90%
MICHAEL CUTHBERT: The measure.

00:52:41.380 --> 00:52:47.150 align:middle line:84%
And flatten's offset is
with respect to what, Misha?

00:52:47.150 --> 00:52:48.380 align:middle line:90%
AUDIENCE: The start of the--

00:52:48.380 --> 00:52:49.925 align:middle line:84%
MICHAEL CUTHBERT:
The start of the--

00:52:49.925 --> 00:52:50.930 align:middle line:90%
AUDIENCE: The score.

00:52:50.930 --> 00:52:51.200 align:middle line:90%
MICHAEL CUTHBERT: Yep.

00:52:51.200 --> 00:52:52.825 align:middle line:84%
Start of the piece,
start of the score.

00:52:52.825 --> 00:52:54.480 align:middle line:84%
Start of, yep, of
whatever it is.

00:52:54.480 --> 00:52:57.420 align:middle line:90%
So this one, we want this here.

00:52:57.420 --> 00:53:02.460 align:middle line:84%
If the offset is 1.0, we can
say accidental positions.

00:53:02.460 --> 00:53:07.700 align:middle line:84%
I'm going to do that for,
I don't know, downbeat.

00:53:07.700 --> 00:53:13.640 align:middle line:90%
Plus equals one else accidental.

00:53:13.640 --> 00:53:16.050 align:middle line:90%
Did I somehow not type properly?

00:53:16.050 --> 00:53:17.000 align:middle line:90%
There we go.

00:53:17.000 --> 00:53:25.480 align:middle line:84%
Dental positions
offbeat plus equals one.

00:53:25.480 --> 00:53:30.010 align:middle line:84%
Oh, the other thing
that we might want to do

00:53:30.010 --> 00:53:33.580 align:middle line:84%
is eventually normalize
this for how many notes

00:53:33.580 --> 00:53:37.730 align:middle line:84%
are on the downbeat versus how
many notes are on the offbeat.

00:53:37.730 --> 00:53:39.560 align:middle line:84%
You all know about
normalization, right?

00:53:39.560 --> 00:53:42.700 align:middle line:84%
You want to figure out how
much more likely is it.

00:53:42.700 --> 00:53:45.610 align:middle line:84%
No, but I can look
at the time and see

00:53:45.610 --> 00:53:51.110 align:middle line:84%
we're not going to be able
to do all that, so yeah.

00:53:51.110 --> 00:53:56.860 align:middle line:84%
So let's-- I think
this might work.

00:53:56.860 --> 00:54:00.610 align:middle line:84%
So let's look at the
accidental positions.

00:54:00.610 --> 00:54:03.050 align:middle line:84%
And I'm only
looking at 3/4 ones.

00:54:03.050 --> 00:54:09.160 align:middle line:84%
You might be-- anybody
get something like that?

00:54:09.160 --> 00:54:11.263 align:middle line:90%
Hannah, you had some results?

00:54:11.263 --> 00:54:13.180 align:middle line:84%
AUDIENCE: Well, I did
it a little differently,

00:54:13.180 --> 00:54:15.109 align:middle line:84%
but I had a slightly
different output.

00:54:15.109 --> 00:54:16.026 align:middle line:90%
MICHAEL CUTHBERT: Yep.

00:54:16.026 --> 00:54:20.085 align:middle line:84%
But It's kind of great when we
have two different people doing

00:54:20.085 --> 00:54:20.710 align:middle line:90%
different ways.

00:54:20.710 --> 00:54:22.377 align:middle line:84%
So you have a slightly
different output.

00:54:22.377 --> 00:54:27.280 align:middle line:84%
Did you find something like
this in your results or--

00:54:27.280 --> 00:54:28.530 align:middle line:90%
AUDIENCE: I took the average--

00:54:28.530 --> 00:54:29.780 align:middle line:90%
MICHAEL CUTHBERT: The average?

00:54:29.780 --> 00:54:32.160 align:middle line:84%
AUDIENCE: --of where it appears
in the measure, I guess.

00:54:32.160 --> 00:54:36.220 align:middle line:84%
So I guess the rest of what I
got was closer to the downbeat,

00:54:36.220 --> 00:54:37.137 align:middle line:90%
I think.

00:54:37.137 --> 00:54:38.970 align:middle line:84%
MICHAEL CUTHBERT: It
was a little bit closer

00:54:38.970 --> 00:54:39.640 align:middle line:90%
to the downbeat?

00:54:39.640 --> 00:54:40.140 align:middle line:90%
Great.

00:54:40.140 --> 00:54:40.973 align:middle line:90%
AUDIENCE: I do know.

00:54:40.973 --> 00:54:42.280 align:middle line:90%
It's closer to the middle.

00:54:42.280 --> 00:54:43.905 align:middle line:84%
MICHAEL CUTHBERT:
Closer to the middle?

00:54:43.905 --> 00:54:45.300 align:middle line:90%
Fantastic.

00:54:45.300 --> 00:54:49.840 align:middle line:84%
I'll give you one little
thing, as we do it,

00:54:49.840 --> 00:54:53.252 align:middle line:84%
that might be interesting
going forward.

00:54:53.252 --> 00:54:55.210 align:middle line:84%
We're not going to have
time to implement this,

00:54:55.210 --> 00:55:00.640 align:middle line:84%
but I will be unlocking this
for you right now for n in--

00:55:00.640 --> 00:55:05.040 align:middle line:84%
let's just look
at lady note.Note.

00:55:05.040 --> 00:55:09.623 align:middle line:90%
Print n and ends beat strength.

00:55:09.623 --> 00:55:12.210 align:middle line:90%


00:55:12.210 --> 00:55:13.960 align:middle line:84%
And we'll look at
this a little bit.

00:55:13.960 --> 00:55:15.940 align:middle line:90%
And this tells you--

00:55:15.940 --> 00:55:17.360 align:middle line:90%
here, do we have the--

00:55:17.360 --> 00:55:19.640 align:middle line:84%
I think somewhere
I have the score.

00:55:19.640 --> 00:55:22.190 align:middle line:84%
Again, sorry, I wish I
could split this here.

00:55:22.190 --> 00:55:24.530 align:middle line:84%
So the first D is
on the downbeat,

00:55:24.530 --> 00:55:28.610 align:middle line:84%
and then we're going to go up
to F natural and the C natural.

00:55:28.610 --> 00:55:30.760 align:middle line:90%
And when we look at this--

00:55:30.760 --> 00:55:39.238 align:middle line:84%
oops-- later, we can see we
have the three pickup notes.

00:55:39.238 --> 00:55:41.030 align:middle line:84%
And then we have
something on the downbeat.

00:55:41.030 --> 00:55:43.600 align:middle line:84%
And then we have a
bunch of offbeat things.

00:55:43.600 --> 00:55:44.740 align:middle line:90%
Yep.

00:55:44.740 --> 00:55:50.150 align:middle line:84%
Beat strength is just a
really, really hacky thing

00:55:50.150 --> 00:55:52.960 align:middle line:84%
I threw together in probably
about the same amount of time

00:55:52.960 --> 00:55:57.130 align:middle line:84%
as this thing here
that tries to measure

00:55:57.130 --> 00:56:00.223 align:middle line:84%
as a number between
epsilon and one.

00:56:00.223 --> 00:56:01.640 align:middle line:84%
There is no beat
strength of zero,

00:56:01.640 --> 00:56:10.000 align:middle line:84%
but how strong the position of
the note within its measure is.

00:56:10.000 --> 00:56:13.210 align:middle line:84%
I cannot believe how many
times I've seen it referenced

00:56:13.210 --> 00:56:13.880 align:middle line:90%
in papers now.

00:56:13.880 --> 00:56:16.170 align:middle line:84%
I've used it in papers
and things like that,

00:56:16.170 --> 00:56:21.710 align:middle line:84%
and now the world knows that
this was a terrible hack that

00:56:21.710 --> 00:56:24.600 align:middle line:84%
could probably be done
much, much, much better,

00:56:24.600 --> 00:56:27.980 align:middle line:84%
as you will realize when you
do beat strengths on triplets

00:56:27.980 --> 00:56:30.410 align:middle line:84%
and things because you can
see I'm doing something

00:56:30.410 --> 00:56:34.230 align:middle line:84%
about the log2 of the
proportion through the measure,

00:56:34.230 --> 00:56:37.830 align:middle line:84%
and therefore triplets won't
work as well or anything.

00:56:37.830 --> 00:56:40.740 align:middle line:84%
So I think we do something
separate for 6/8 so it works.

00:56:40.740 --> 00:56:45.200 align:middle line:84%
But this could be used to
give you a little bit more

00:56:45.200 --> 00:56:46.940 align:middle line:84%
of a sense of the
kind of problem

00:56:46.940 --> 00:56:49.440 align:middle line:84%
that Sophia Son was
talking about in the video

00:56:49.440 --> 00:56:53.390 align:middle line:84%
at the beginning of the class,
are certain things happen more

00:56:53.390 --> 00:56:56.390 align:middle line:90%
on strong places versus others.

00:56:56.390 --> 00:56:57.310 align:middle line:90%
OK.

00:56:57.310 --> 00:56:59.790 align:middle line:84%
Can you close what you're
working on for just a second?

00:56:59.790 --> 00:57:01.373 align:middle line:84%
And that's also the
cue that I'm going

00:57:01.373 --> 00:57:03.840 align:middle line:84%
to let you go just so I can
have some eyes and things.

00:57:03.840 --> 00:57:07.470 align:middle line:84%
So the next problem set--
you're working on this one,

00:57:07.470 --> 00:57:09.590 align:middle line:84%
but just don't pick
up for one second--

00:57:09.590 --> 00:57:14.940 align:middle line:84%
is going to be trying to find
yourself in interesting corpus.

00:57:14.940 --> 00:57:17.880 align:middle line:84%
Whether or not you
decide to end working

00:57:17.880 --> 00:57:20.170 align:middle line:84%
on a corpus study at the
end of the semester or not,

00:57:20.170 --> 00:57:23.370 align:middle line:84%
it's probably good to know that
we do not want to just continue

00:57:23.370 --> 00:57:25.800 align:middle line:84%
working with the Bach Chorales,
and the Irish folk songs,

00:57:25.800 --> 00:57:27.675 align:middle line:84%
and the Chinese folk
songs-- these three data

00:57:27.675 --> 00:57:30.130 align:middle line:84%
sets that are everywhere--
for the rest of our lives.

00:57:30.130 --> 00:57:31.540 align:middle line:90%
So we want to have that out.

00:57:31.540 --> 00:57:33.400 align:middle line:84%
You're going to be
asked to do that

00:57:33.400 --> 00:57:35.440 align:middle line:84%
and to write up what you
find about something,

00:57:35.440 --> 00:57:37.690 align:middle line:84%
and you're going to be asked
to do it in teams of two.

00:57:37.690 --> 00:57:42.090 align:middle line:84%
Your only condition is that
you cannot be on a team with

00:57:42.090 --> 00:57:44.650 align:middle line:84%
somebody that you did the
last group problem set with.

00:57:44.650 --> 00:57:48.400 align:middle line:84%
So find somebody who is not in
that problem set, and do that.

00:57:48.400 --> 00:57:50.500 align:middle line:84%
And I wanted to give you
some extra time for that.

00:57:50.500 --> 00:57:51.810 align:middle line:90%
Great.

00:57:51.810 --> 00:57:55.020 align:middle line:84%
It's a little bit more on the
Sofia Sun and my article online

00:57:55.020 --> 00:58:01.445 align:middle line:84%
that you can watch today in the
Canvas or later, and thank you.

00:58:01.445 --> 00:58:11.000 align:middle line:90%