WEBVTT

00:00:00.000 --> 00:00:00.978 align:middle line:90%


00:00:00.978 --> 00:00:02.445 align:middle line:90%
[SQUEAKING]

00:00:02.445 --> 00:00:04.401 align:middle line:90%
[RUSTLING]

00:00:04.401 --> 00:00:05.868 align:middle line:90%
[CLICKING]

00:00:05.868 --> 00:00:13.665 align:middle line:90%


00:00:13.665 --> 00:00:16.040 align:middle line:84%
MICHAEL CUTHBERT: I'm going
to switch over to the Jupyter

00:00:16.040 --> 00:00:20.460 align:middle line:84%
Notebook to talk a
review of last class,

00:00:20.460 --> 00:00:21.900 align:middle line:90%
and then going forward.

00:00:21.900 --> 00:00:25.380 align:middle line:84%
So what are some of the
things we unlocked last class?

00:00:25.380 --> 00:00:29.300 align:middle line:84%
So Music21 objects
that we can use.

00:00:29.300 --> 00:00:32.540 align:middle line:90%
Shout them out.

00:00:32.540 --> 00:00:33.170 align:middle line:90%
What's that?

00:00:33.170 --> 00:00:33.870 align:middle line:90%
Stream.

00:00:33.870 --> 00:00:34.520 align:middle line:90%
Good.

00:00:34.520 --> 00:00:34.932 align:middle line:90%
AUDIENCE: Pitch.

00:00:34.932 --> 00:00:35.640 align:middle line:90%
AUDIENCE: Corpus.

00:00:35.640 --> 00:00:37.700 align:middle line:84%
MICHAEL CUTHBERT:
Pitch, corpus, I heard.

00:00:37.700 --> 00:00:38.538 align:middle line:90%
Anything else?

00:00:38.538 --> 00:00:39.330 align:middle line:90%
AUDIENCE: Duration?

00:00:39.330 --> 00:00:40.455 align:middle line:90%
MICHAEL CUTHBERT: Duration.

00:00:40.455 --> 00:00:43.525 align:middle line:84%
And pitch from duration
lets you do what?

00:00:43.525 --> 00:00:44.150 align:middle line:90%
AUDIENCE: Note.

00:00:44.150 --> 00:00:44.910 align:middle line:90%
MICHAEL CUTHBERT: Note, good.

00:00:44.910 --> 00:00:45.660 align:middle line:90%
We remember that.

00:00:45.660 --> 00:00:48.090 align:middle line:84%
And there's one other one
I just want to remind you.

00:00:48.090 --> 00:00:49.590 align:middle line:84%
We're not going to
use it very much.

00:00:49.590 --> 00:00:50.850 align:middle line:90%
It's called converter.

00:00:50.850 --> 00:00:52.392 align:middle line:84%
Let me make this a
little bit bigger.

00:00:52.392 --> 00:00:54.110 align:middle line:90%
Oh, that's nice for me, too.

00:00:54.110 --> 00:00:57.890 align:middle line:90%
And sorry.

00:00:57.890 --> 00:01:00.530 align:middle line:90%
Great.

00:01:00.530 --> 00:01:03.020 align:middle line:84%
Because converter does the
same thing as corpus, but loads

00:01:03.020 --> 00:01:07.260 align:middle line:84%
any file on your hard drive
or anywhere on the web.

00:01:07.260 --> 00:01:11.130 align:middle line:84%
But since I don't know
what's on your hard drive,

00:01:11.130 --> 00:01:13.220 align:middle line:84%
we're not going to
use it that much.

00:01:13.220 --> 00:01:15.620 align:middle line:90%
Great.

00:01:15.620 --> 00:01:18.840 align:middle line:84%
And what's something
we did last class?

00:01:18.840 --> 00:01:19.940 align:middle line:90%
What's the problem?

00:01:19.940 --> 00:01:23.790 align:middle line:84%
So let's all load
that Bach piece.

00:01:23.790 --> 00:01:25.532 align:middle line:84%
Anyone remember
what I should type?

00:01:25.532 --> 00:01:26.240 align:middle line:90%
AUDIENCE: Corpus.

00:01:26.240 --> 00:01:27.703 align:middle line:90%
MICHAEL CUTHBERT: Corpus dot--

00:01:27.703 --> 00:01:28.370 align:middle line:90%
AUDIENCE: Parse.

00:01:28.370 --> 00:01:29.090 align:middle line:90%
MICHAEL CUTHBERT: Parse.

00:01:29.090 --> 00:01:29.730 align:middle line:90%
Good.

00:01:29.730 --> 00:01:35.160 align:middle line:90%
And I said it was Bach BWV 66.6.

00:01:35.160 --> 00:01:36.860 align:middle line:84%
The only thing you
actually need is

00:01:36.860 --> 00:01:38.810 align:middle line:84%
whatever is necessary
to distinguish it

00:01:38.810 --> 00:01:41.000 align:middle line:90%
from anything else.

00:01:41.000 --> 00:01:43.460 align:middle line:84%
So you'll sometimes
see I'm going

00:01:43.460 --> 00:01:44.850 align:middle line:90%
to be taking a shortcut there.

00:01:44.850 --> 00:01:45.920 align:middle line:90%
Good.

00:01:45.920 --> 00:01:48.570 align:middle line:84%
And how many things
were in Bach?

00:01:48.570 --> 00:01:49.320 align:middle line:90%
Do you remember?

00:01:49.320 --> 00:01:49.820 align:middle line:90%
Estimate.

00:01:49.820 --> 00:01:50.470 align:middle line:90%
Six.

00:01:50.470 --> 00:01:50.970 align:middle line:90%
Oh, good.

00:01:50.970 --> 00:01:52.170 align:middle line:90%
We have the exact number.

00:01:52.170 --> 00:01:52.910 align:middle line:90%
Yep.

00:01:52.910 --> 00:01:55.430 align:middle line:90%
Why?

00:01:55.430 --> 00:01:58.170 align:middle line:90%
Where are the notes?

00:01:58.170 --> 00:02:03.030 align:middle line:84%
We have a score object, I'm
pretty sure, just to recall.

00:02:03.030 --> 00:02:05.070 align:middle line:90%
Yep.

00:02:05.070 --> 00:02:06.520 align:middle line:90%
We have score object.

00:02:06.520 --> 00:02:09.460 align:middle line:84%
And then what's inside
of it, the main thing,

00:02:09.460 --> 00:02:11.753 align:middle line:90%
four of the six things?

00:02:11.753 --> 00:02:12.420 align:middle line:90%
AUDIENCE: Parts.

00:02:12.420 --> 00:02:13.670 align:middle line:90%
MICHAEL CUTHBERT: Parts, good.

00:02:13.670 --> 00:02:15.410 align:middle line:84%
And then inside
the part, Hannah,

00:02:15.410 --> 00:02:17.410 align:middle line:84%
did you-- you had your
hand up for the last one.

00:02:17.410 --> 00:02:18.180 align:middle line:90%
I'll get you in.

00:02:18.180 --> 00:02:19.973 align:middle line:90%
What's inside of a part?

00:02:19.973 --> 00:02:20.890 align:middle line:90%
AUDIENCE: The measure?

00:02:20.890 --> 00:02:21.940 align:middle line:84%
MICHAEL CUTHBERT:
Measure objects.

00:02:21.940 --> 00:02:22.440 align:middle line:90%
Good.

00:02:22.440 --> 00:02:25.463 align:middle line:84%
And what's inside
the measure objects?

00:02:25.463 --> 00:02:26.130 align:middle line:90%
AUDIENCE: Notes?

00:02:26.130 --> 00:02:28.660 align:middle line:84%
MICHAEL CUTHBERT: Notes, and
other things, but primarily.

00:02:28.660 --> 00:02:31.780 align:middle line:84%
So we have this hierarchy,
this nested hierarchy.

00:02:31.780 --> 00:02:36.760 align:middle line:90%
Score, parts, measure, notes.

00:02:36.760 --> 00:02:40.990 align:middle line:84%
There may sometimes even be
another level of hierarchy.

00:02:40.990 --> 00:02:44.130 align:middle line:84%
For instance, in
scores like this

00:02:44.130 --> 00:02:50.340 align:middle line:84%
where you have two different
voices on the same part, there--

00:02:50.340 --> 00:02:51.220 align:middle line:90%
what do you call it?

00:02:51.220 --> 00:02:54.370 align:middle line:84%
There may be a voice
object inside of a measure.

00:02:54.370 --> 00:02:56.930 align:middle line:84%
And if you have a whole
collection of scores,

00:02:56.930 --> 00:03:00.105 align:middle line:84%
we call it something
begins with an O-P.

00:03:00.105 --> 00:03:00.730 align:middle line:90%
AUDIENCE: Opus.

00:03:00.730 --> 00:03:01.450 align:middle line:90%
MICHAEL CUTHBERT: Opus, yeah.

00:03:01.450 --> 00:03:04.010 align:middle line:84%
So you can have something
that's bigger than a score.

00:03:04.010 --> 00:03:06.670 align:middle line:84%
You can have opuses,
opera, technically,

00:03:06.670 --> 00:03:09.380 align:middle line:84%
an opus that has
scores inside it.

00:03:09.380 --> 00:03:11.570 align:middle line:84%
And then you can put
opuses inside opuses,

00:03:11.570 --> 00:03:12.950 align:middle line:84%
because I didn't want
to make anything bigger.

00:03:12.950 --> 00:03:13.720 align:middle line:90%
Yeah, go ahead, Misha.

00:03:13.720 --> 00:03:14.350 align:middle line:90%
AUDIENCE: Can we close the door?

00:03:14.350 --> 00:03:15.380 align:middle line:84%
MICHAEL CUTHBERT:
Oh yeah, sure, sure.

00:03:15.380 --> 00:03:17.630 align:middle line:84%
Can you close the door for
somebody who can get there?

00:03:17.630 --> 00:03:20.150 align:middle line:90%
Thanks.

00:03:20.150 --> 00:03:23.410 align:middle line:90%
Thank you, I appreciate it.

00:03:23.410 --> 00:03:24.130 align:middle line:90%
Great.

00:03:24.130 --> 00:03:29.350 align:middle line:90%
So how did we get down to the--

00:03:29.350 --> 00:03:32.110 align:middle line:84%
how did we get down to
the notes last time?

00:03:32.110 --> 00:03:36.882 align:middle line:84%
We did something like
four thing in score.

00:03:36.882 --> 00:03:37.840 align:middle line:90%
You don't have to type.

00:03:37.840 --> 00:03:38.890 align:middle line:90%
This as all review.

00:03:38.890 --> 00:03:44.230 align:middle line:90%
In Bach if thing, in if--

00:03:44.230 --> 00:03:48.550 align:middle line:84%
we remember that isinstance is
the Python way of figuring out

00:03:48.550 --> 00:03:53.390 align:middle line:84%
same thing in score
is a stream dot part.

00:03:53.390 --> 00:03:55.610 align:middle line:84%
We can also just say
stream dot stream.

00:03:55.610 --> 00:04:01.930 align:middle line:84%
If it's some of a stream, then
for thing in part in thing

00:04:01.930 --> 00:04:04.120 align:middle line:90%
in score.

00:04:04.120 --> 00:04:06.430 align:middle line:84%
I don't want to waste
too much time on this.

00:04:06.430 --> 00:04:09.970 align:middle line:90%
I can do this.

00:04:09.970 --> 00:04:12.350 align:middle line:90%
If instance thing in part.

00:04:12.350 --> 00:04:14.980 align:middle line:84%
Somebody tell me if I type
something wrong on this,

00:04:14.980 --> 00:04:16.339 align:middle line:90%
because I'll probably do it.

00:04:16.339 --> 00:04:19.750 align:middle line:90%
And there's no tricks on this.

00:04:19.750 --> 00:04:25.840 align:middle line:90%
For thing in-- what is it?

00:04:25.840 --> 00:04:34.070 align:middle line:84%
Measure in thing in part,
print thing in measure.

00:04:34.070 --> 00:04:35.560 align:middle line:90%
Hopefully, that works.

00:04:35.560 --> 00:04:36.640 align:middle line:90%
Yep.

00:04:36.640 --> 00:04:39.190 align:middle line:84%
So that lets us get
down to the lowest

00:04:39.190 --> 00:04:44.350 align:middle line:90%
level of what's happening here.

00:04:44.350 --> 00:04:46.330 align:middle line:90%
We have a whole bunch of notes.

00:04:46.330 --> 00:04:47.210 align:middle line:90%
What are we doing?

00:04:47.210 --> 00:04:50.630 align:middle line:90%


00:04:50.630 --> 00:04:53.860 align:middle line:84%
You'll remember the two
representations, the box

00:04:53.860 --> 00:04:58.660 align:middle line:84%
representation or the
salami slice, time wise.

00:04:58.660 --> 00:04:59.810 align:middle line:90%
What are we doing?

00:04:59.810 --> 00:05:02.450 align:middle line:84%
Are we going through all
the parts here first,

00:05:02.450 --> 00:05:06.290 align:middle line:84%
or are we going through
one part and then another?

00:05:06.290 --> 00:05:06.790 align:middle line:90%
Hint.

00:05:06.790 --> 00:05:08.540 align:middle line:84%
You can always look
back at your score.

00:05:08.540 --> 00:05:10.935 align:middle line:84%
You know the piece and
you have the notes.

00:05:10.935 --> 00:05:18.070 align:middle line:90%


00:05:18.070 --> 00:05:18.680 align:middle line:90%
Go ahead.

00:05:18.680 --> 00:05:23.772 align:middle line:84%
And when you have it, just
look up and then shout it out.

00:05:23.772 --> 00:05:24.730 align:middle line:90%
AUDIENCE: Part by part.

00:05:24.730 --> 00:05:26.690 align:middle line:84%
MICHAEL CUTHBERT: We're
going part by part.

00:05:26.690 --> 00:05:31.480 align:middle line:84%
The soprano C-sharp,
B, A, B, C-sharp.

00:05:31.480 --> 00:05:33.670 align:middle line:90%
Fermata.

00:05:33.670 --> 00:05:36.530 align:middle line:84%
It's nice to see that
fermatas are not in here,

00:05:36.530 --> 00:05:38.170 align:middle line:90%
so they must be someplace else.

00:05:38.170 --> 00:05:39.140 align:middle line:90%
E, C-sharp.

00:05:39.140 --> 00:05:42.860 align:middle line:84%
Yeah, so we're going part
by part in this case.

00:05:42.860 --> 00:05:45.110 align:middle line:90%
Great.

00:05:45.110 --> 00:05:48.310 align:middle line:84%
And we also saw last class
that we could do something.

00:05:48.310 --> 00:05:50.380 align:middle line:84%
If we knew exactly
where something

00:05:50.380 --> 00:05:55.200 align:middle line:84%
was, we could say Bach 2,
which I happen to remember,

00:05:55.200 --> 00:05:58.080 align:middle line:84%
there's a metadata
soprano then alto.

00:05:58.080 --> 00:05:59.998 align:middle line:90%
So that would be two.

00:05:59.998 --> 00:06:00.540 align:middle line:90%
I don't know.

00:06:00.540 --> 00:06:04.820 align:middle line:84%
Let's choose a random measure,
and we can make a list out

00:06:04.820 --> 00:06:05.400 align:middle line:90%
of this.

00:06:05.400 --> 00:06:06.275 align:middle line:90%
I can't remember if--

00:06:06.275 --> 00:06:07.520 align:middle line:90%
I think I demonstrated that.

00:06:07.520 --> 00:06:10.500 align:middle line:90%
And get what is in here.

00:06:10.500 --> 00:06:14.270 align:middle line:84%
And we'll keep seeing that
these random other things keep

00:06:14.270 --> 00:06:20.240 align:middle line:84%
popping up here, like
system layouts and so on.

00:06:20.240 --> 00:06:26.060 align:middle line:84%
So we'll need a better
way to get to notes.

00:06:26.060 --> 00:06:27.150 align:middle line:90%
Questions?

00:06:27.150 --> 00:06:29.010 align:middle line:84%
This is review, so
I went pretty fast.

00:06:29.010 --> 00:06:32.040 align:middle line:84%
But the important thing
is, if I'm reviewing it,

00:06:32.040 --> 00:06:34.550 align:middle line:84%
it's probably important that
we have good understanding

00:06:34.550 --> 00:06:36.830 align:middle line:90%
before we move on.

00:06:36.830 --> 00:06:37.610 align:middle line:90%
Yeah, Jake.

00:06:37.610 --> 00:06:39.150 align:middle line:84%
AUDIENCE: You had us
recurse on the first day?

00:06:39.150 --> 00:06:39.800 align:middle line:90%
Are we going to use that?

00:06:39.800 --> 00:06:42.090 align:middle line:84%
MICHAEL CUTHBERT: So we're going
to get to that in just a second.

00:06:42.090 --> 00:06:42.890 align:middle line:90%
Yep.

00:06:42.890 --> 00:06:43.620 align:middle line:90%
Good.

00:06:43.620 --> 00:06:44.475 align:middle line:90%
Yeah.

00:06:44.475 --> 00:06:45.350 align:middle line:90%
AUDIENCE: Close that.

00:06:45.350 --> 00:06:46.308 align:middle line:90%
MICHAEL CUTHBERT: Sure.

00:06:46.308 --> 00:06:49.070 align:middle line:90%
Great, great.

00:06:49.070 --> 00:06:49.950 align:middle line:90%
There we go.

00:06:49.950 --> 00:06:51.998 align:middle line:84%
Sorry that the blackout
blind over there

00:06:51.998 --> 00:06:53.123 align:middle line:90%
doesn't seem to be working.

00:06:53.123 --> 00:06:58.010 align:middle line:90%


00:06:58.010 --> 00:06:59.480 align:middle line:84%
If you email me
after class, I'll

00:06:59.480 --> 00:07:01.470 align:middle line:84%
remember to put in a
facilities request.

00:07:01.470 --> 00:07:04.377 align:middle line:84%
Or if you email me right now
in class, you'll hear a ding.

00:07:04.377 --> 00:07:05.960 align:middle line:84%
Then I'll put in a
facilities request,

00:07:05.960 --> 00:07:09.680 align:middle line:84%
because that's going to get
annoying after daylight savings

00:07:09.680 --> 00:07:11.885 align:middle line:90%
time starts for this class.

00:07:11.885 --> 00:07:12.385 align:middle line:90%
Good.

00:07:12.385 --> 00:07:15.600 align:middle line:90%


00:07:15.600 --> 00:07:20.570 align:middle line:84%
Any other things that we
want before from the review

00:07:20.570 --> 00:07:21.180 align:middle line:90%
last time?

00:07:21.180 --> 00:07:21.680 align:middle line:90%
Yeah.

00:07:21.680 --> 00:07:23.900 align:middle line:84%
I showed a whole bunch of
things on the first class

00:07:23.900 --> 00:07:29.340 align:middle line:84%
that are not done yet, but
we'll be getting to them sooner.

00:07:29.340 --> 00:07:31.290 align:middle line:84%
So assume everything
on the first class,

00:07:31.290 --> 00:07:34.410 align:middle line:84%
I think I said at the end,
was then immediately relocked.

00:07:34.410 --> 00:07:38.750 align:middle line:84%
But as far as this recurse
thing, we're going to get to it

00:07:38.750 --> 00:07:42.615 align:middle line:84%
and unlock it in
just a few seconds.

00:07:42.615 --> 00:07:43.115 align:middle line:90%
Great.

00:07:43.115 --> 00:07:46.370 align:middle line:90%


00:07:46.370 --> 00:07:51.130 align:middle line:84%
So any stream can be converted
to a list by doing it,

00:07:51.130 --> 00:07:53.070 align:middle line:84%
so we can get the list
of everything that's

00:07:53.070 --> 00:07:57.850 align:middle line:84%
in the top level
score for Bach here.

00:07:57.850 --> 00:08:03.070 align:middle line:84%
And then we can,
yeah, do other things.

00:08:03.070 --> 00:08:06.247 align:middle line:84%
There are some differences
between a stream and a list

00:08:06.247 --> 00:08:07.330 align:middle line:90%
that are pretty important.

00:08:07.330 --> 00:08:11.560 align:middle line:84%
So when I say a list,
array in other languages,

00:08:11.560 --> 00:08:13.390 align:middle line:84%
what are some of the
things you can do?

00:08:13.390 --> 00:08:15.010 align:middle line:90%
It's a mutable container.

00:08:15.010 --> 00:08:18.090 align:middle line:84%
So what some things
you can do to it?

00:08:18.090 --> 00:08:18.760 align:middle line:90%
Yeah.

00:08:18.760 --> 00:08:19.390 align:middle line:90%
AUDIENCE: You can add to it.

00:08:19.390 --> 00:08:20.470 align:middle line:84%
MICHAEL CUTHBERT:
You can add to it.

00:08:20.470 --> 00:08:21.180 align:middle line:90%
Great.

00:08:21.180 --> 00:08:23.520 align:middle line:90%
Other things?

00:08:23.520 --> 00:08:24.480 align:middle line:90%
You usually can add.

00:08:24.480 --> 00:08:25.320 align:middle line:90%
AUDIENCE: You can pop things.

00:08:25.320 --> 00:08:26.680 align:middle line:84%
MICHAEL CUTHBERT: You
can pop things off of it.

00:08:26.680 --> 00:08:27.180 align:middle line:90%
Great.

00:08:27.180 --> 00:08:29.200 align:middle line:90%
You can remove things out of it.

00:08:29.200 --> 00:08:31.470 align:middle line:84%
What are some other
things that lists do?

00:08:31.470 --> 00:08:32.340 align:middle line:90%
Yeah, go ahead.

00:08:32.340 --> 00:08:34.059 align:middle line:84%
AUDIENCE: You can change
things at certain indices.

00:08:34.059 --> 00:08:35.799 align:middle line:84%
MICHAEL CUTHBERT: You can change
things at certain indices.

00:08:35.799 --> 00:08:38.150 align:middle line:84%
Yeah, you can replace
one thing with another.

00:08:38.150 --> 00:08:38.650 align:middle line:90%
Good.

00:08:38.650 --> 00:08:42.120 align:middle line:90%
Any other things we can do?

00:08:42.120 --> 00:08:42.667 align:middle line:90%
Yeah, Jason.

00:08:42.667 --> 00:08:43.750 align:middle line:90%
AUDIENCE: Find the length?

00:08:43.750 --> 00:08:44.920 align:middle line:84%
MICHAEL CUTHBERT: You
can find the length.

00:08:44.920 --> 00:08:45.450 align:middle line:90%
Great.

00:08:45.450 --> 00:08:47.492 align:middle line:84%
You can find the length,
and you can append to it

00:08:47.492 --> 00:08:49.470 align:middle line:84%
and change the length,
all those things.

00:08:49.470 --> 00:08:54.010 align:middle line:84%
One other thing beginning
with IT that you can do.

00:08:54.010 --> 00:08:54.620 align:middle line:90%
Yeah, John.

00:08:54.620 --> 00:08:55.620 align:middle line:90%
AUDIENCE: Iterate on it.

00:08:55.620 --> 00:08:56.470 align:middle line:84%
MICHAEL CUTHBERT:
You can iterate it.

00:08:56.470 --> 00:08:58.900 align:middle line:84%
You can put it into a
for loop and get things.

00:08:58.900 --> 00:09:00.660 align:middle line:90%
Great, great.

00:09:00.660 --> 00:09:02.208 align:middle line:90%
There's one more over here.

00:09:02.208 --> 00:09:03.000 align:middle line:90%
AUDIENCE: Splicing?

00:09:03.000 --> 00:09:04.375 align:middle line:84%
MICHAEL CUTHBERT:
Splicing, yeah.

00:09:04.375 --> 00:09:06.670 align:middle line:84%
You can get little
parts of it, too.

00:09:06.670 --> 00:09:14.140 align:middle line:84%
So in this way a stream
really does work like a list.

00:09:14.140 --> 00:09:17.260 align:middle line:84%
We can get out, get
rid of that metadata.

00:09:17.260 --> 00:09:20.250 align:middle line:84%
We can get rid of
other things here.

00:09:20.250 --> 00:09:23.590 align:middle line:84%
If I had been
smarter 20 years ago,

00:09:23.590 --> 00:09:26.220 align:middle line:84%
it probably would inherit
from list, but it does not.

00:09:26.220 --> 00:09:30.480 align:middle line:84%
But it has a lot of
things that are list-like.

00:09:30.480 --> 00:09:32.610 align:middle line:84%
But there's some things
that you can also

00:09:32.610 --> 00:09:35.790 align:middle line:90%
do that are a little different.

00:09:35.790 --> 00:09:38.670 align:middle line:84%
Actually, what was
that over here?

00:09:38.670 --> 00:09:42.520 align:middle line:90%
We went up to Bach 2, 4.

00:09:42.520 --> 00:09:44.690 align:middle line:90%
Let's get that out here.

00:09:44.690 --> 00:09:49.100 align:middle line:84%
I think that should
be measure three.

00:09:49.100 --> 00:09:50.090 align:middle line:90%
Let's see.

00:09:50.090 --> 00:09:54.080 align:middle line:84%
And m equals this, and
we'll see what m is.

00:09:54.080 --> 00:09:56.180 align:middle line:90%
Yep, measure three.

00:09:56.180 --> 00:09:56.680 align:middle line:90%
Great.

00:09:56.680 --> 00:09:59.560 align:middle line:84%
So measure three
of the second thing

00:09:59.560 --> 00:10:01.810 align:middle line:84%
up here, so the third
thing, because we're

00:10:01.810 --> 00:10:07.030 align:middle line:84%
doing 2, 0 index 0, 1, 2,
measure three of the alto part.

00:10:07.030 --> 00:10:09.970 align:middle line:84%
Here is something
that I don't think,

00:10:09.970 --> 00:10:13.160 align:middle line:84%
for all the amazing things
MIT CS training does,

00:10:13.160 --> 00:10:15.230 align:middle line:84%
I don't think it
does very, very well.

00:10:15.230 --> 00:10:19.310 align:middle line:84%
I think that this says measure
three of the alto part.

00:10:19.310 --> 00:10:20.870 align:middle line:90%
And here's the contents of it.

00:10:20.870 --> 00:10:22.790 align:middle line:84%
Let's just go through
and make sure.

00:10:22.790 --> 00:10:24.945 align:middle line:84%
Remember, pickups
are measure what?

00:10:24.945 --> 00:10:25.570 align:middle line:90%
AUDIENCE: Zero.

00:10:25.570 --> 00:10:26.095 align:middle line:90%
MICHAEL CUTHBERT: Zero.

00:10:26.095 --> 00:10:28.615 align:middle line:84%
So let's make sure that this
is actually measure three.

00:10:28.615 --> 00:10:32.500 align:middle line:90%


00:10:32.500 --> 00:10:33.200 align:middle line:90%
Is that right?

00:10:33.200 --> 00:10:34.980 align:middle line:90%
Do we get the right measure?

00:10:34.980 --> 00:10:39.520 align:middle line:90%


00:10:39.520 --> 00:10:41.195 align:middle line:84%
The next problem set,
the one that we're

00:10:41.195 --> 00:10:43.070 align:middle line:84%
going to be talking
about at the end of class

00:10:43.070 --> 00:10:47.720 align:middle line:84%
today, it's probably
the least time

00:10:47.720 --> 00:10:52.200 align:middle line:84%
consuming of any of the ones
you've had so far, so good.

00:10:52.200 --> 00:10:54.900 align:middle line:84%
I figure every third one, you
need a little bit of a break.

00:10:54.900 --> 00:10:56.430 align:middle line:90%
So we'll go down on that.

00:10:56.430 --> 00:10:59.180 align:middle line:84%
I will tell you in
advance where people

00:10:59.180 --> 00:11:04.020 align:middle line:84%
lose points on this problem set,
is that they write the code,

00:11:04.020 --> 00:11:05.940 align:middle line:84%
the code works, and
then they go on,

00:11:05.940 --> 00:11:07.940 align:middle line:84%
and there's a little
programming error somewhere

00:11:07.940 --> 00:11:11.240 align:middle line:84%
that could have easily been
fixed by looking at the score

00:11:11.240 --> 00:11:15.560 align:middle line:84%
during show and checking
that your answer was actually

00:11:15.560 --> 00:11:17.160 align:middle line:90%
what it should be.

00:11:17.160 --> 00:11:22.060 align:middle line:84%
So just to have that
there, and that's now,

00:11:22.060 --> 00:11:25.050 align:middle line:84%
my feeling is everybody
can get an A plus.

00:11:25.050 --> 00:11:27.480 align:middle line:84%
We can all get
perfects on everything.

00:11:27.480 --> 00:11:32.810 align:middle line:84%
I don't need to play
gotcha games for [LAUGH].

00:11:32.810 --> 00:11:34.950 align:middle line:90%
Now there's nothing to mark off.

00:11:34.950 --> 00:11:35.460 align:middle line:90%
So good.

00:11:35.460 --> 00:11:37.290 align:middle line:84%
So make sure that you're
always doing that,

00:11:37.290 --> 00:11:40.010 align:middle line:84%
and make sure to do these
column sanity checks,

00:11:40.010 --> 00:11:41.720 align:middle line:84%
that you're getting
out from your data

00:11:41.720 --> 00:11:44.090 align:middle line:90%
what you should be getting in.

00:11:44.090 --> 00:11:47.510 align:middle line:84%
OK, so these are some
things that are similar.

00:11:47.510 --> 00:11:51.930 align:middle line:90%
One of the things, though, in--

00:11:51.930 --> 00:11:54.210 align:middle line:84%
so we have this
measure, object n.

00:11:54.210 --> 00:11:54.710 align:middle line:90%
We'll look.

00:11:54.710 --> 00:11:57.212 align:middle line:90%


00:11:57.212 --> 00:12:00.020 align:middle line:84%
Shape of your
brackets does matter.

00:12:00.020 --> 00:12:01.560 align:middle line:90%
You have something here.

00:12:01.560 --> 00:12:09.080 align:middle line:84%
Now, if this was just a
normal list, m dot insert 2,

00:12:09.080 --> 00:12:11.250 align:middle line:84%
we're going to
put it position 2.

00:12:11.250 --> 00:12:12.680 align:middle line:90%
Let's put a note dot note.

00:12:12.680 --> 00:12:14.270 align:middle line:84%
Let's do one that
we can immediately

00:12:14.270 --> 00:12:18.480 align:middle line:90%
recognize, A double flat 4.

00:12:18.480 --> 00:12:20.760 align:middle line:90%
We can create an object in here.

00:12:20.760 --> 00:12:22.950 align:middle line:90%
Actually, we'll be smart.

00:12:22.950 --> 00:12:27.350 align:middle line:84%
We'll call that n and
define it before n equals,

00:12:27.350 --> 00:12:29.490 align:middle line:84%
so that we can
reference it again.

00:12:29.490 --> 00:12:32.660 align:middle line:84%
Sorry, I'll try not to get
this at the very bottom

00:12:32.660 --> 00:12:33.260 align:middle line:90%
of the screen.

00:12:33.260 --> 00:12:33.760 align:middle line:90%
Great.

00:12:33.760 --> 00:12:44.040 align:middle line:90%


00:12:44.040 --> 00:12:51.440 align:middle line:84%
So what should have happened
if this were a normal list?

00:12:51.440 --> 00:12:56.280 align:middle line:84%
Where would you have expected
to see that double flat,

00:12:56.280 --> 00:12:59.060 align:middle line:90%
A double flat?

00:12:59.060 --> 00:12:59.600 align:middle line:90%
Adam.

00:12:59.600 --> 00:13:00.660 align:middle line:90%
AUDIENCE: After the G-sharp.

00:13:00.660 --> 00:13:02.160 align:middle line:84%
MICHAEL CUTHBERT:
After the G-sharp.

00:13:02.160 --> 00:13:04.190 align:middle line:90%


00:13:04.190 --> 00:13:05.930 align:middle line:90%
Everybody agree?

00:13:05.930 --> 00:13:09.050 align:middle line:84%
Sometimes everybody agrees when
the professor's like, yeah, does

00:13:09.050 --> 00:13:10.590 align:middle line:90%
it go after two or does it--

00:13:10.590 --> 00:13:13.170 align:middle line:84%
I can't remember, but yeah,
I'm pretty sure that's right.

00:13:13.170 --> 00:13:17.780 align:middle line:84%
So it should be
somewhere over here.

00:13:17.780 --> 00:13:18.900 align:middle line:90%
Why is it here?

00:13:18.900 --> 00:13:23.390 align:middle line:84%
Let's go back to that
alto part, measure 2,

00:13:23.390 --> 00:13:27.410 align:middle line:84%
and see it's coming
after the C-sharp.

00:13:27.410 --> 00:13:30.652 align:middle line:84%
Does the C-sharp have
a fermata on it or not?

00:13:30.652 --> 00:13:32.860 align:middle line:84%
I just want to make sure
we're all on the same place.

00:13:32.860 --> 00:13:39.300 align:middle line:90%


00:13:39.300 --> 00:13:42.720 align:middle line:84%
Yeah, John's nodding his
head and John's almost always

00:13:42.720 --> 00:13:46.230 align:middle line:84%
right on these
things, so good, good.

00:13:46.230 --> 00:13:49.550 align:middle line:84%
And yeah, so we have
it on the last "ya"

00:13:49.550 --> 00:13:53.284 align:middle line:84%
of that word that I'm not going
to say during Lent, right?

00:13:53.284 --> 00:13:54.820 align:middle line:90%
And good.

00:13:54.820 --> 00:13:56.740 align:middle line:84%
So it's come in
right after there,

00:13:56.740 --> 00:14:01.680 align:middle line:84%
and yet we said we
should put it at 2.

00:14:01.680 --> 00:14:05.400 align:middle line:90%
What might be happening here?

00:14:05.400 --> 00:14:06.420 align:middle line:90%
Yeah, John.

00:14:06.420 --> 00:14:10.980 align:middle line:84%
AUDIENCE: It's being put at
the second beat, 12, 0 index.

00:14:10.980 --> 00:14:14.070 align:middle line:84%
MICHAEL CUTHBERT: The
second beat, yeah,

00:14:14.070 --> 00:14:16.510 align:middle line:90%
with the beginning being 0.

00:14:16.510 --> 00:14:19.570 align:middle line:84%
Now, I told you that's very,
very close to the right answer.

00:14:19.570 --> 00:14:20.915 align:middle line:90%
So great, great.

00:14:20.915 --> 00:14:22.290 align:middle line:84%
I said at the
beginning there was

00:14:22.290 --> 00:14:26.140 align:middle line:84%
a reason why I didn't like to
use beat as a fundamental unit.

00:14:26.140 --> 00:14:27.185 align:middle line:90%
What was that?

00:14:27.185 --> 00:14:30.480 align:middle line:90%


00:14:30.480 --> 00:14:35.250 align:middle line:84%
Or because of things
like 5/8 where the--

00:14:35.250 --> 00:14:41.190 align:middle line:84%
fast 5/8, 1, 1 and 2, and a 1
and 2 and a, where beats can

00:14:41.190 --> 00:14:44.830 align:middle line:84%
change their duration
even within a measure.

00:14:44.830 --> 00:14:48.610 align:middle line:90%
So what's something equivalent?

00:14:48.610 --> 00:14:51.037 align:middle line:84%
What would durations
measured in?

00:14:51.037 --> 00:14:52.620 align:middle line:84%
I'm going to call
on Misha next, but I

00:14:52.620 --> 00:14:54.420 align:middle line:84%
want to make sure that
we have-- yeah, Misha.

00:14:54.420 --> 00:14:55.560 align:middle line:84%
AUDIENCE: Yeah, I
think it was just said.

00:14:55.560 --> 00:14:57.990 align:middle line:84%
I think you said you used
quarter notes, I assume.

00:14:57.990 --> 00:14:59.740 align:middle line:84%
MICHAEL CUTHBERT: Yeah,
so quarter length.

00:14:59.740 --> 00:15:01.960 align:middle line:84%
So in this case, it's
exactly the same as beat.

00:15:01.960 --> 00:15:04.530 align:middle line:84%
So this correct
answer in this case,

00:15:04.530 --> 00:15:06.196 align:middle line:90%
because we're in four quarters.

00:15:06.196 --> 00:15:09.450 align:middle line:90%
But so we've put it in--

00:15:09.450 --> 00:15:10.210 align:middle line:90%
what do we have?

00:15:10.210 --> 00:15:11.110 align:middle line:90%
Eighth, eighth.

00:15:11.110 --> 00:15:18.750 align:middle line:84%
So that's all
within 0, 0.5, 1, 2.

00:15:18.750 --> 00:15:21.670 align:middle line:84%
But there might
be a problem here.

00:15:21.670 --> 00:15:26.070 align:middle line:90%
Why is it after the C-sharp?

00:15:26.070 --> 00:15:27.970 align:middle line:90%
Well, let's do this.

00:15:27.970 --> 00:15:30.210 align:middle line:84%
We remember some
of our iteration

00:15:30.210 --> 00:15:33.750 align:middle line:84%
for, I'll still, say thing in
m, even though they're mostly

00:15:33.750 --> 00:15:34.510 align:middle line:90%
notes.

00:15:34.510 --> 00:15:38.480 align:middle line:90%
Print thing and things.

00:15:38.480 --> 00:15:42.640 align:middle line:84%
New term that we haven't
seen, it's offset.

00:15:42.640 --> 00:15:45.880 align:middle line:84%
So the offset, just
like the duration

00:15:45.880 --> 00:15:48.250 align:middle line:84%
is measured in quarter
lengths, the offset

00:15:48.250 --> 00:15:51.610 align:middle line:84%
from the beginning of
the current container

00:15:51.610 --> 00:15:53.930 align:middle line:90%
is measured in quarter lengths.

00:15:53.930 --> 00:15:55.730 align:middle line:90%
So we have here.

00:15:55.730 --> 00:15:59.690 align:middle line:84%
And we can actually now have
two notes at the same time.

00:15:59.690 --> 00:16:03.800 align:middle line:84%
So you can have multiple
things at the same position.

00:16:03.800 --> 00:16:05.380 align:middle line:84%
That makes it a
little bit harder

00:16:05.380 --> 00:16:10.400 align:middle line:84%
to remove by offset
that you want to have,

00:16:10.400 --> 00:16:13.870 align:middle line:84%
because unlike in an
array where there can only

00:16:13.870 --> 00:16:16.510 align:middle line:84%
be one thing at a
particular index, here

00:16:16.510 --> 00:16:20.350 align:middle line:84%
you can have multiple
things at the same index.

00:16:20.350 --> 00:16:22.040 align:middle line:90%
This is a simplification.

00:16:22.040 --> 00:16:25.420 align:middle line:84%
We'll see in a little bit
that notes and everything else

00:16:25.420 --> 00:16:29.060 align:middle line:84%
can have an infinite number
of offsets simultaneously.

00:16:29.060 --> 00:16:33.940 align:middle line:84%
But this is good
enough to start here.

00:16:33.940 --> 00:16:35.350 align:middle line:90%
Yeah, go ahead.

00:16:35.350 --> 00:16:37.720 align:middle line:84%
AUDIENCE: So if you do
show, it doesn't put them

00:16:37.720 --> 00:16:38.650 align:middle line:90%
in the same place.

00:16:38.650 --> 00:16:40.817 align:middle line:84%
MICHAEL CUTHBERT: If you
put it in show, it doesn't.

00:16:40.817 --> 00:16:43.720 align:middle line:84%
Right, because not,
that's a great thing.

00:16:43.720 --> 00:16:47.770 align:middle line:84%
You're going to find it is easy
to create things that are valid

00:16:47.770 --> 00:16:56.230 align:middle line:84%
musical concepts that cannot
be shown by any of our music

00:16:56.230 --> 00:16:59.410 align:middle line:84%
representation software,
our MuseScores, or Finales,

00:16:59.410 --> 00:17:01.360 align:middle line:90%
or whatever like that.

00:17:01.360 --> 00:17:01.960 align:middle line:90%
Why?

00:17:01.960 --> 00:17:06.280 align:middle line:84%
Because if you have a
part, do you have two--

00:17:06.280 --> 00:17:08.599 align:middle line:90%
This is an ontological question.

00:17:08.599 --> 00:17:12.780 align:middle line:84%
Do you have two notes that sound
at the same time in one part?

00:17:12.780 --> 00:17:15.550 align:middle line:90%


00:17:15.550 --> 00:17:18.250 align:middle line:84%
Or do you have
something else that

00:17:18.250 --> 00:17:23.200 align:middle line:84%
happens when you have two
notes at the same time?

00:17:23.200 --> 00:17:26.589 align:middle line:84%
What other representation
might be for two notes,

00:17:26.589 --> 00:17:29.360 align:middle line:84%
for two things that
sound at the same time?

00:17:29.360 --> 00:17:30.150 align:middle line:90%
I won't say notes.

00:17:30.150 --> 00:17:33.770 align:middle line:90%


00:17:33.770 --> 00:17:35.867 align:middle line:90%
Nobody?

00:17:35.867 --> 00:17:36.950 align:middle line:90%
AUDIENCE: Different parts?

00:17:36.950 --> 00:17:38.390 align:middle line:84%
MICHAEL CUTHBERT:
You would have--

00:17:38.390 --> 00:17:40.340 align:middle line:84%
A, you could have it in
two different parts, which

00:17:40.340 --> 00:17:41.180 align:middle line:90%
is what we've normally seen.

00:17:41.180 --> 00:17:41.750 align:middle line:90%
Or yep.

00:17:41.750 --> 00:17:44.780 align:middle line:84%
AUDIENCE: You can have a
split, like one person going

00:17:44.780 --> 00:17:45.420 align:middle line:90%
up and down.

00:17:45.420 --> 00:17:47.295 align:middle line:84%
MICHAEL CUTHBERT: Yeah,
you can have a split.

00:17:47.295 --> 00:17:48.120 align:middle line:90%
Yeah, a split.

00:17:48.120 --> 00:17:50.028 align:middle line:90%
We call those voices in this.

00:17:50.028 --> 00:17:51.570 align:middle line:84%
So you have two
voices at that thing.

00:17:51.570 --> 00:17:56.090 align:middle line:84%
What's the other thing,
another fundamental part

00:17:56.090 --> 00:17:57.590 align:middle line:90%
of our ontologies?

00:17:57.590 --> 00:17:58.183 align:middle line:90%
[PIANO CHORD]

00:17:58.183 --> 00:17:58.850 align:middle line:90%
AUDIENCE: Chord?

00:17:58.850 --> 00:17:59.850 align:middle line:90%
MICHAEL CUTHBERT: Chord.

00:17:59.850 --> 00:18:03.020 align:middle line:84%
So in this case,
your software wants

00:18:03.020 --> 00:18:05.630 align:middle line:84%
me to have created a chord
object, which is not yet

00:18:05.630 --> 00:18:07.920 align:middle line:84%
unlocked for us
out of these two.

00:18:07.920 --> 00:18:11.490 align:middle line:84%
So it just does whatever
it wants with it.

00:18:11.490 --> 00:18:12.830 align:middle line:90%
Great question.

00:18:12.830 --> 00:18:13.430 align:middle line:90%
Super.

00:18:13.430 --> 00:18:15.240 align:middle line:90%
So keep playing with the limits.

00:18:15.240 --> 00:18:17.030 align:middle line:84%
We're a little
bit behind in time

00:18:17.030 --> 00:18:20.880 align:middle line:84%
because we're really
asking great questions.

00:18:20.880 --> 00:18:23.900 align:middle line:84%
So I'm going to hold
off a little bit on some

00:18:23.900 --> 00:18:29.550 align:middle line:84%
until we can get a little
bit further into some things.

00:18:29.550 --> 00:18:33.750 align:middle line:90%
So yeah, question.

00:18:33.750 --> 00:18:34.290 align:middle line:90%
Go ahead.

00:18:34.290 --> 00:18:35.580 align:middle line:90%
AUDIENCE: How do you remove?

00:18:35.580 --> 00:18:37.080 align:middle line:84%
MICHAEL CUTHBERT:
How do you remove?

00:18:37.080 --> 00:18:41.930 align:middle line:84%
Well, you'll be able to-- you
can either remove the thing,

00:18:41.930 --> 00:18:45.500 align:middle line:84%
and it will find it, Or you can
remove something at an offset.

00:18:45.500 --> 00:18:49.790 align:middle line:84%
And fortunately, all
of these other things

00:18:49.790 --> 00:18:52.460 align:middle line:84%
will be-- all
these other options

00:18:52.460 --> 00:18:57.260 align:middle line:84%
will be revealed to
you in the reading

00:18:57.260 --> 00:19:00.110 align:middle line:84%
before next time
we meet together,

00:19:00.110 --> 00:19:03.900 align:middle line:84%
which is the user's
guide chapter on streams.

00:19:03.900 --> 00:19:06.660 align:middle line:84%
So I think that remove
is mentioned in there.

00:19:06.660 --> 00:19:08.850 align:middle line:84%
It can be a little bit more
complicated, as I said,

00:19:08.850 --> 00:19:15.530 align:middle line:84%
so I want to hold that
off for just a little bit.

00:19:15.530 --> 00:19:19.530 align:middle line:84%
Let me do another little
thing for a second,

00:19:19.530 --> 00:19:24.620 align:middle line:84%
and we'll jump to some ways
that we can make our life easier

00:19:24.620 --> 00:19:26.480 align:middle line:84%
by not doing for
thing and thing,

00:19:26.480 --> 00:19:28.650 align:middle line:84%
than for next thing and
thing, next thing in fixing

00:19:28.650 --> 00:19:30.210 align:middle line:90%
the previous thing.

00:19:30.210 --> 00:19:35.440 align:middle line:84%
Obviously, we're going
to have some other ideas.

00:19:35.440 --> 00:19:40.410 align:middle line:84%
So this is one notion, one way
a score might be represented

00:19:40.410 --> 00:19:43.560 align:middle line:90%
in Music21 with two parts.

00:19:43.560 --> 00:19:50.370 align:middle line:84%
And so within the score in this,
its score's length is how much?

00:19:50.370 --> 00:19:51.227 align:middle line:90%
Just shout it out.

00:19:51.227 --> 00:19:51.810 align:middle line:90%
AUDIENCE: Two.

00:19:51.810 --> 00:19:52.800 align:middle line:90%
AUDIENCE: Two.

00:19:52.800 --> 00:19:54.160 align:middle line:90%
MICHAEL CUTHBERT: Two or?

00:19:54.160 --> 00:19:54.500 align:middle line:90%
AUDIENCE: Three.

00:19:54.500 --> 00:19:56.792 align:middle line:84%
MICHAEL CUTHBERT: Three,
because we have this metadata.

00:19:56.792 --> 00:19:59.170 align:middle line:84%
And so I've put underneath
is the offset of everything.

00:19:59.170 --> 00:20:03.670 align:middle line:84%
Both parts start at the
beginning of the score.

00:20:03.670 --> 00:20:05.260 align:middle line:90%
So they have offset 0.

00:20:05.260 --> 00:20:08.850 align:middle line:84%
Within part one, there
are two, I'm calling,

00:20:08.850 --> 00:20:13.560 align:middle line:90%
measures measure 1a, measure 2a.

00:20:13.560 --> 00:20:17.880 align:middle line:84%
Their offsets are at 0
and 4, which makes sense

00:20:17.880 --> 00:20:22.405 align:middle line:84%
because somewhere in here,
there's a 4/4 time signature.

00:20:22.405 --> 00:20:26.130 align:middle line:90%


00:20:26.130 --> 00:20:29.080 align:middle line:84%
Notice, though, that when
we're looking at measure two,

00:20:29.080 --> 00:20:34.660 align:middle line:84%
measure two's offset is 4, but
we start again with offset 0.

00:20:34.660 --> 00:20:39.000 align:middle line:84%
So if you want to know how many
quarter notes into the piece

00:20:39.000 --> 00:20:47.970 align:middle line:84%
quarter note 9 happens, you'd
have to add 2 plus 4 plus 0.

00:20:47.970 --> 00:20:50.550 align:middle line:84%
Fortunately, adding 0
is easy, so you get, ah,

00:20:50.550 --> 00:20:52.810 align:middle line:84%
it's 6 quarter notes
into the piece.

00:20:52.810 --> 00:20:57.450 align:middle line:84%
So this is one, the
representation that's happening.

00:20:57.450 --> 00:21:01.650 align:middle line:84%
Now, when you iterate over the
score for all size-- use el,

00:21:01.650 --> 00:21:02.925 align:middle line:90%
element--

00:21:02.925 --> 00:21:05.680 align:middle line:84%
thing, things comes
off the tongue better,

00:21:05.680 --> 00:21:07.420 align:middle line:90%
but el is quicker to type.

00:21:07.420 --> 00:21:12.180 align:middle line:84%
And when you do this, you'll
see that-- we've already

00:21:12.180 --> 00:21:16.740 align:middle line:84%
seen you get the metadata,
you get part one,

00:21:16.740 --> 00:21:20.710 align:middle line:84%
and then you get part
two, and that's all.

00:21:20.710 --> 00:21:24.000 align:middle line:84%
So you get the three
things that are there.

00:21:24.000 --> 00:21:26.890 align:middle line:84%
The more powerful way
to do this is something

00:21:26.890 --> 00:21:31.190 align:middle line:84%
called recurse, the
recurse method on here.

00:21:31.190 --> 00:21:35.840 align:middle line:84%
And what this does is it
goes through the first thing,

00:21:35.840 --> 00:21:38.300 align:middle line:84%
and then if there's anything
inside the metadata,

00:21:38.300 --> 00:21:41.330 align:middle line:84%
which there isn't-- it's not a
container-- it would go into it.

00:21:41.330 --> 00:21:44.680 align:middle line:84%
Then part one is
a container class.

00:21:44.680 --> 00:21:46.490 align:middle line:84%
All containers are
called streams,

00:21:46.490 --> 00:21:49.630 align:middle line:84%
but the general term in
computational music theory

00:21:49.630 --> 00:21:51.260 align:middle line:90%
is the container.

00:21:51.260 --> 00:21:55.430 align:middle line:84%
And then within this container,
we have another container,

00:21:55.430 --> 00:21:58.700 align:middle line:84%
and it will go through these
things that are not containers.

00:21:58.700 --> 00:22:02.230 align:middle line:84%
Sometimes these are called
leaves, the leaf node,

00:22:02.230 --> 00:22:05.600 align:middle line:84%
like in a graph, the thing
that has no descendants on it.

00:22:05.600 --> 00:22:07.840 align:middle line:84%
And then it will go
through the second one.

00:22:07.840 --> 00:22:12.070 align:middle line:84%
Then it jumps back to part
two and goes through each one,

00:22:12.070 --> 00:22:13.160 align:middle line:90%
and tells you that.

00:22:13.160 --> 00:22:16.580 align:middle line:84%
So that's going to
make life a lot easier.

00:22:16.580 --> 00:22:18.323 align:middle line:90%
Let's recurse through.

00:22:18.323 --> 00:22:21.370 align:middle line:90%


00:22:21.370 --> 00:22:23.170 align:middle line:90%
Can I move over here?

00:22:23.170 --> 00:22:26.620 align:middle line:90%
Let's recurse through Bach.

00:22:26.620 --> 00:22:31.940 align:middle line:84%
For el in Bach dot
recurse, print.

00:22:31.940 --> 00:22:33.856 align:middle line:90%
Let's do el and el's offset.

00:22:33.856 --> 00:22:38.010 align:middle line:90%


00:22:38.010 --> 00:22:38.510 align:middle line:90%
Oops.

00:22:38.510 --> 00:22:41.560 align:middle line:84%
And now I have to get
my scrolling back.

00:22:41.560 --> 00:22:44.050 align:middle line:90%
Here we go.

00:22:44.050 --> 00:22:46.820 align:middle line:84%
So now, we're seeing
there's the metadata.

00:22:46.820 --> 00:22:48.320 align:middle line:90%
There's the soprano part.

00:22:48.320 --> 00:22:53.050 align:middle line:84%
If we were writing a program,
we could keep track of what part

00:22:53.050 --> 00:22:55.970 align:middle line:84%
we're in at a certain point, and
every time we see a new part,

00:22:55.970 --> 00:22:56.710 align:middle line:90%
do something.

00:22:56.710 --> 00:22:59.030 align:middle line:84%
And then we see, oh,
we're at measures zero.

00:22:59.030 --> 00:22:59.870 align:middle line:90%
Here we go.

00:22:59.870 --> 00:23:04.730 align:middle line:84%
Here's all the different things
to measure one, measure two.

00:23:04.730 --> 00:23:09.520 align:middle line:84%
And if I scroll far enough,
eventually, we should see--

00:23:09.520 --> 00:23:13.270 align:middle line:90%
here we go-- part alto.

00:23:13.270 --> 00:23:17.140 align:middle line:90%
So that's pretty good.

00:23:17.140 --> 00:23:19.210 align:middle line:84%
All this information
about what's

00:23:19.210 --> 00:23:22.670 align:middle line:84%
its offset and things,
this can be done,

00:23:22.670 --> 00:23:25.790 align:middle line:84%
also gotten in a way
that just prints.

00:23:25.790 --> 00:23:27.560 align:middle line:90%
It's not useful for parsing.

00:23:27.560 --> 00:23:28.940 align:middle line:90%
I would not say parse this.

00:23:28.940 --> 00:23:35.950 align:middle line:84%
But if you do Bach dot show
text, and it just gives you,

00:23:35.950 --> 00:23:40.990 align:middle line:84%
basically, the same information
as that routine, but nicely

00:23:40.990 --> 00:23:43.420 align:middle line:90%
formatted.

00:23:43.420 --> 00:23:49.220 align:middle line:84%
So I'll give a second where the
current offset is given first,

00:23:49.220 --> 00:23:56.140 align:middle line:84%
and then the next thing also
puts everything like this.

00:23:56.140 --> 00:24:00.800 align:middle line:90%
Questions on this part?

00:24:00.800 --> 00:24:03.820 align:middle line:84%
Now your computer
science question.

00:24:03.820 --> 00:24:08.900 align:middle line:84%
Recurse is what type
of graph search?

00:24:08.900 --> 00:24:10.130 align:middle line:90%
Don't shout it out yet.

00:24:10.130 --> 00:24:11.180 align:middle line:90%
We'll let everyone think.

00:24:11.180 --> 00:24:15.460 align:middle line:84%
There are a number of ways
of searching through a graph

00:24:15.460 --> 00:24:17.000 align:middle line:90%
or iterating through a graph.

00:24:17.000 --> 00:24:21.560 align:middle line:90%
What kind would we call this?

00:24:21.560 --> 00:24:22.440 align:middle line:90%
I'll give you a hint.

00:24:22.440 --> 00:24:26.790 align:middle line:84%
The second word
is usually first.

00:24:26.790 --> 00:24:28.110 align:middle line:90%
That wasn't much of a hint.

00:24:28.110 --> 00:24:32.990 align:middle line:84%
So raise your hand if you're
confident that the answer

00:24:32.990 --> 00:24:38.330 align:middle line:84%
to this now, and go like
this if you're not confident

00:24:38.330 --> 00:24:39.930 align:middle line:90%
that you know the answer.

00:24:39.930 --> 00:24:40.430 align:middle line:90%
Great.

00:24:40.430 --> 00:24:42.960 align:middle line:84%
Could you talk with
the person next to you,

00:24:42.960 --> 00:24:45.290 align:middle line:84%
and especially if you
have a couple people who

00:24:45.290 --> 00:24:47.840 align:middle line:84%
aren't so confident,
and share your answer

00:24:47.840 --> 00:24:50.335 align:middle line:84%
and see if you're
in the same boat?

00:24:50.335 --> 00:24:53.030 align:middle line:90%


00:24:53.030 --> 00:24:57.620 align:middle line:84%
Who is now a little bit
less-- is still unconfident?

00:24:57.620 --> 00:25:00.920 align:middle line:84%
Who didn't come to an
agreement on your thing?

00:25:00.920 --> 00:25:03.560 align:middle line:84%
You guys are still
in disagreement.

00:25:03.560 --> 00:25:04.830 align:middle line:90%
No, you're in agreement.

00:25:04.830 --> 00:25:06.210 align:middle line:90%
Good, good.

00:25:06.210 --> 00:25:09.860 align:middle line:90%
So let's all shout it out.

00:25:09.860 --> 00:25:11.930 align:middle line:90%
The kind of search is a--

00:25:11.930 --> 00:25:12.740 align:middle line:90%
AUDIENCE: Depth.

00:25:12.740 --> 00:25:14.970 align:middle line:84%
MICHAEL CUTHBERT: First
search, a depth first search.

00:25:14.970 --> 00:25:15.470 align:middle line:90%
Good.

00:25:15.470 --> 00:25:19.680 align:middle line:84%
So we're always going to
be following the leftmost--

00:25:19.680 --> 00:25:23.960 align:middle line:84%
I should do this in different
colors so it's easier to see.

00:25:23.960 --> 00:25:28.250 align:middle line:84%
The leftmost node that
we haven't yet seen,

00:25:28.250 --> 00:25:32.010 align:middle line:84%
and doing something with that,
and then going back up, here,

00:25:32.010 --> 00:25:34.260 align:middle line:90%
going back up, down.

00:25:34.260 --> 00:25:38.990 align:middle line:84%
Does that seem to fit other
people's computer science

00:25:38.990 --> 00:25:39.690 align:middle line:90%
things?

00:25:39.690 --> 00:25:42.950 align:middle line:84%
I have neither a
concentration minor, major,

00:25:42.950 --> 00:25:44.760 align:middle line:90%
or PhD in computer science.

00:25:44.760 --> 00:25:46.513 align:middle line:84%
So please, if I get
something wrong,

00:25:46.513 --> 00:25:48.680 align:middle line:84%
you all shout to me because
you've done more of that

00:25:48.680 --> 00:25:50.830 align:middle line:90%
than I have.

00:25:50.830 --> 00:25:51.330 align:middle line:90%
Great.

00:25:51.330 --> 00:25:52.890 align:middle line:90%
So we have depth first search.

00:25:52.890 --> 00:25:55.790 align:middle line:84%
What are some of the things
anybody knows from other things

00:25:55.790 --> 00:25:58.170 align:middle line:84%
that depth first
searches are good for?

00:25:58.170 --> 00:26:01.880 align:middle line:84%
And what are some of the things
that they're not good at?

00:26:01.880 --> 00:26:04.885 align:middle line:84%
So good for anybody
who wants to say.

00:26:04.885 --> 00:26:08.950 align:middle line:90%


00:26:08.950 --> 00:26:09.450 align:middle line:90%
Don't worry.

00:26:09.450 --> 00:26:13.637 align:middle line:90%
It's a safe space.

00:26:13.637 --> 00:26:14.970 align:middle line:90%
AUDIENCE: Shortest path problem?

00:26:14.970 --> 00:26:16.637 align:middle line:84%
MICHAEL CUTHBERT:
Shortest path problem.

00:26:16.637 --> 00:26:17.333 align:middle line:90%
Good.

00:26:17.333 --> 00:26:18.250 align:middle line:90%
Shortest path problem.

00:26:18.250 --> 00:26:19.710 align:middle line:90%
Anybody, do you want to explain?

00:26:19.710 --> 00:26:22.170 align:middle line:84%
Or anybody else want to explain
what that is for those who

00:26:22.170 --> 00:26:22.670 align:middle line:90%
haven't?

00:26:22.670 --> 00:26:25.110 align:middle line:90%


00:26:25.110 --> 00:26:28.480 align:middle line:84%
Shortest path between two
nodes, how to get there.

00:26:28.480 --> 00:26:29.780 align:middle line:90%
You might not want to do.

00:26:29.780 --> 00:26:31.280 align:middle line:84%
Something else it
might be good for?

00:26:31.280 --> 00:26:35.730 align:middle line:90%


00:26:35.730 --> 00:26:36.240 align:middle line:90%
Yeah.

00:26:36.240 --> 00:26:38.365 align:middle line:84%
AUDIENCE: It's just when
you're in a scenario where

00:26:38.365 --> 00:26:41.840 align:middle line:84%
you think you want to look
over every possible object.

00:26:41.840 --> 00:26:42.840 align:middle line:90%
MICHAEL CUTHBERT: Great.

00:26:42.840 --> 00:26:46.240 align:middle line:84%
In a scenario where you want to
look at every possible object.

00:26:46.240 --> 00:26:48.450 align:middle line:84%
Now, there's other
search methods

00:26:48.450 --> 00:26:54.340 align:middle line:84%
that also have that property,
but this one has that property.

00:26:54.340 --> 00:26:57.030 align:middle line:84%
So it's already a lot better
than for thing and thing

00:26:57.030 --> 00:26:58.620 align:middle line:84%
than thing and thing,
thing and thing.

00:26:58.620 --> 00:27:01.300 align:middle line:84%
You know that you're going
to get to every point.

00:27:01.300 --> 00:27:04.731 align:middle line:84%
What's something that it
might not be good for,

00:27:04.731 --> 00:27:06.660 align:middle line:84%
or that another
search method might

00:27:06.660 --> 00:27:08.255 align:middle line:90%
be a better way of doing it?

00:27:08.255 --> 00:27:12.870 align:middle line:90%


00:27:12.870 --> 00:27:13.423 align:middle line:90%
Yeah.

00:27:13.423 --> 00:27:15.840 align:middle line:84%
AUDIENCE: In the case of breadth
first search versus depth

00:27:15.840 --> 00:27:18.480 align:middle line:84%
first search, if
something's close by,

00:27:18.480 --> 00:27:19.740 align:middle line:90%
there's not a lot of it.

00:27:19.740 --> 00:27:23.370 align:middle line:90%
Or the tree is super deep.

00:27:23.370 --> 00:27:25.273 align:middle line:90%
But the answer is super close.

00:27:25.273 --> 00:27:26.190 align:middle line:90%
MICHAEL CUTHBERT: Yep.

00:27:26.190 --> 00:27:28.648 align:middle line:84%
AUDIENCE: Depth first search
will search through every one.

00:27:28.648 --> 00:27:30.270 align:middle line:84%
Or to go to the
depths of the tree.

00:27:30.270 --> 00:27:30.900 align:middle line:90%
MICHAEL CUTHBERT: The tree.

00:27:30.900 --> 00:27:32.310 align:middle line:84%
AUDIENCE: Just to check
in the first couple.

00:27:32.310 --> 00:27:33.310 align:middle line:90%
MICHAEL CUTHBERT: Great.

00:27:33.310 --> 00:27:33.880 align:middle line:90%
Super, super.

00:27:33.880 --> 00:27:36.340 align:middle line:84%
And we should say
what we're comparing.

00:27:36.340 --> 00:27:37.840 align:middle line:84%
There's lots and
lots of searches,

00:27:37.840 --> 00:27:41.200 align:middle line:84%
but the two key ones, we
have depth first search,

00:27:41.200 --> 00:27:42.630 align:middle line:90%
and it's compared to what?

00:27:42.630 --> 00:27:43.380 align:middle line:90%
AUDIENCE: Breadth.

00:27:43.380 --> 00:27:45.005 align:middle line:84%
MICHAEL CUTHBERT:
Breadth first search.

00:27:45.005 --> 00:27:46.990 align:middle line:84%
Yep, the breakfast
search as I always say.

00:27:46.990 --> 00:27:48.820 align:middle line:90%
Breadth first search.

00:27:48.820 --> 00:27:51.390 align:middle line:84%
So that one, what
are we going to do

00:27:51.390 --> 00:27:53.920 align:middle line:84%
if we want to breadth
first search in here?

00:27:53.920 --> 00:27:56.490 align:middle line:90%
What are we going to see first?

00:27:56.490 --> 00:27:58.600 align:middle line:84%
What's the first node
we're going to visit?

00:27:58.600 --> 00:27:59.220 align:middle line:90%
AUDIENCE: SC.

00:27:59.220 --> 00:28:00.790 align:middle line:90%
MICHAEL CUTHBERT: SC, the score.

00:28:00.790 --> 00:28:01.290 align:middle line:90%
Good.

00:28:01.290 --> 00:28:03.790 align:middle line:84%
So, so far, it's exactly the
same as the depth first search.

00:28:03.790 --> 00:28:05.840 align:middle line:84%
Second node we're going
to see in this side?

00:28:05.840 --> 00:28:06.660 align:middle line:90%
AUDIENCE: Part one.

00:28:06.660 --> 00:28:08.035 align:middle line:84%
MICHAEL CUTHBERT:
Part one, good.

00:28:08.035 --> 00:28:08.550 align:middle line:90%
Third node?

00:28:08.550 --> 00:28:09.150 align:middle line:90%
AUDIENCE: Part two.

00:28:09.150 --> 00:28:10.275 align:middle line:90%
MICHAEL CUTHBERT: Part two.

00:28:10.275 --> 00:28:11.430 align:middle line:90%
So we're already different.

00:28:11.430 --> 00:28:12.630 align:middle line:90%
Next node?

00:28:12.630 --> 00:28:13.540 align:middle line:90%
[INTERPOSING VOICES]

00:28:13.540 --> 00:28:14.030 align:middle line:90%
MICHAEL CUTHBERT: Was one.

00:28:14.030 --> 00:28:14.530 align:middle line:90%
Yep.

00:28:14.530 --> 00:28:17.020 align:middle line:84%
AUDIENCE: For one, isn't
BFS better for shortest path

00:28:17.020 --> 00:28:20.035 align:middle line:90%
searching, rather than DFS?

00:28:20.035 --> 00:28:22.160 align:middle line:84%
AUDIENCE: It depends on
how you're doing your path.

00:28:22.160 --> 00:28:24.890 align:middle line:84%
If you're looking for
distance one minus path,

00:28:24.890 --> 00:28:27.200 align:middle line:84%
and you want to find the
first one that gets you there,

00:28:27.200 --> 00:28:27.783 align:middle line:90%
that's better.

00:28:27.783 --> 00:28:31.515 align:middle line:84%
But you're doing positive
length distances in DFS.

00:28:31.515 --> 00:28:34.318 align:middle line:90%


00:28:34.318 --> 00:28:36.610 align:middle line:84%
MICHAEL CUTHBERT: I'm trying
to remember the exact what

00:28:36.610 --> 00:28:38.350 align:middle line:90%
I remember, which one of these.

00:28:38.350 --> 00:28:40.027 align:middle line:84%
AUDIENCE: A star
would be even better.

00:28:40.027 --> 00:28:42.610 align:middle line:84%
MICHAEL CUTHBERT: Yeah, so we'll
get to these particular types

00:28:42.610 --> 00:28:43.893 align:middle line:90%
of searches later.

00:28:43.893 --> 00:28:45.310 align:middle line:84%
Controversy in the
class, I'll try

00:28:45.310 --> 00:28:47.650 align:middle line:90%
to remember exactly which one.

00:28:47.650 --> 00:28:48.760 align:middle line:90%
Do we have a--

00:28:48.760 --> 00:28:52.990 align:middle line:84%
but yeah, I'll trust that we'll
solve that because we're not

00:28:52.990 --> 00:28:57.170 align:middle line:84%
going to be doing shortest
path yet in this class.

00:28:57.170 --> 00:29:00.130 align:middle line:84%
But we'll see that there's
certain advantages to one

00:29:00.130 --> 00:29:01.040 align:middle line:90%
versus the other.

00:29:01.040 --> 00:29:05.680 align:middle line:84%
The other thing, so what's a
musical thing that we want to--

00:29:05.680 --> 00:29:07.030 align:middle line:90%
how about this?

00:29:07.030 --> 00:29:14.620 align:middle line:84%
Do all parts start with
the same key signature?

00:29:14.620 --> 00:29:17.590 align:middle line:90%
Breadth first or depth first?

00:29:17.590 --> 00:29:20.510 align:middle line:84%
Which one is going to be
fastest to get you your answer?

00:29:20.510 --> 00:29:21.737 align:middle line:90%
[INTERPOSING VOICES]

00:29:21.737 --> 00:29:23.570 align:middle line:84%
MICHAEL CUTHBERT: I
heard depth and breadth.

00:29:23.570 --> 00:29:25.180 align:middle line:90%
Who's on depth?

00:29:25.180 --> 00:29:26.590 align:middle line:90%
Who's on breadth?

00:29:26.590 --> 00:29:27.370 align:middle line:90%
Yep.

00:29:27.370 --> 00:29:28.010 align:middle line:90%
OK, good.

00:29:28.010 --> 00:29:30.670 align:middle line:84%
So we're going to want to
have both types of searches

00:29:30.670 --> 00:29:32.710 align:middle line:90%
available.

00:29:32.710 --> 00:29:37.870 align:middle line:84%
So recurse will
give you always a--

00:29:37.870 --> 00:29:42.400 align:middle line:84%
what do you call it--
the depth first search.

00:29:42.400 --> 00:29:45.440 align:middle line:84%
There's another one that
we're going to have.

00:29:45.440 --> 00:29:49.420 align:middle line:84%
And you're going to see
it's the flatten operation.

00:29:49.420 --> 00:29:50.920 align:middle line:84%
And you're going
to see it sometimes

00:29:50.920 --> 00:29:54.262 align:middle line:84%
in my old slides I haven't
figured out how to update,

00:29:54.262 --> 00:29:55.190 align:middle line:90%
dot flat.

00:29:55.190 --> 00:29:58.960 align:middle line:90%
But it used to be a property.

00:29:58.960 --> 00:30:02.210 align:middle line:84%
That is to say, you didn't
need the calls called flat.

00:30:02.210 --> 00:30:05.080 align:middle line:84%
Now it's a method
called flatten, I think.

00:30:05.080 --> 00:30:06.650 align:middle line:90%
There were two reasons for this.

00:30:06.650 --> 00:30:09.860 align:middle line:90%
One, if anybody has a new--

00:30:09.860 --> 00:30:13.190 align:middle line:84%
uses an IDE, like
VS Code or PyCharm,

00:30:13.190 --> 00:30:16.520 align:middle line:84%
or something like that, which
I highly encourage you to do--

00:30:16.520 --> 00:30:21.230 align:middle line:84%
it's nothing elite to
use VIM anymore in life--

00:30:21.230 --> 00:30:26.553 align:middle line:84%
then a lot of those will now
go through and call and check

00:30:26.553 --> 00:30:28.470 align:middle line:84%
every one of the properties
at a certain point

00:30:28.470 --> 00:30:29.850 align:middle line:90%
so it can repeat for you.

00:30:29.850 --> 00:30:35.930 align:middle line:84%
And flat ended up being for a
very, very large score, very

00:30:35.930 --> 00:30:37.320 align:middle line:90%
space and time sensitive.

00:30:37.320 --> 00:30:39.690 align:middle line:84%
And so once I
upgraded to a thing,

00:30:39.690 --> 00:30:43.410 align:middle line:84%
I realized, OK, that can't
work anymore, that flat.

00:30:43.410 --> 00:30:44.330 align:middle line:90%
So we had to do this.

00:30:44.330 --> 00:30:47.360 align:middle line:84%
I also wanted to make
it a few more letters

00:30:47.360 --> 00:30:51.180 align:middle line:84%
so that people would stop
calling flat instead of recurse,

00:30:51.180 --> 00:30:52.980 align:middle line:84%
just because it
was less to type.

00:30:52.980 --> 00:30:56.370 align:middle line:84%
So now they're much
more equal, flatten.

00:30:56.370 --> 00:30:59.450 align:middle line:84%
And what flatten
does is it gives you

00:30:59.450 --> 00:31:03.110 align:middle line:84%
the option of doing
everything first

00:31:03.110 --> 00:31:06.780 align:middle line:84%
that's at the same
offset of everything.

00:31:06.780 --> 00:31:08.240 align:middle line:90%
So we start with--

00:31:08.240 --> 00:31:10.440 align:middle line:84%
I think I have an
animation on this--

00:31:10.440 --> 00:31:13.010 align:middle line:90%
the metadata, again.

00:31:13.010 --> 00:31:19.970 align:middle line:84%
Let me get one clef,
next clef, both the time

00:31:19.970 --> 00:31:22.560 align:middle line:84%
signatures, everything
that's at the same point.

00:31:22.560 --> 00:31:24.710 align:middle line:84%
When you have a half
note here, we'll

00:31:24.710 --> 00:31:28.920 align:middle line:84%
get both quarter notes before
getting to the other thing.

00:31:28.920 --> 00:31:32.870 align:middle line:84%
The other thing that flatten
does that's different

00:31:32.870 --> 00:31:37.852 align:middle line:84%
is you'll see the offsets are
now, because it's flattened,

00:31:37.852 --> 00:31:44.150 align:middle line:84%
they're now all relative
to the start of the score.

00:31:44.150 --> 00:31:49.800 align:middle line:84%
So because of this, they're
implemented in different ways.

00:31:49.800 --> 00:31:53.780 align:middle line:84%
Recurse the breadth
first search just has

00:31:53.780 --> 00:31:57.450 align:middle line:84%
a little pointer that's going
around, figuring out where I am,

00:31:57.450 --> 00:32:00.680 align:middle line:84%
figuring out how to go back up
to the next hierarchy level,

00:32:00.680 --> 00:32:02.340 align:middle line:90%
and walk around, and do this.

00:32:02.340 --> 00:32:06.850 align:middle line:84%
So it's very, very fast and
not very memory intensive.

00:32:06.850 --> 00:32:10.050 align:middle line:84%
The flatten, on the
other hand, in order

00:32:10.050 --> 00:32:12.540 align:middle line:84%
to compute where
everything should be

00:32:12.540 --> 00:32:15.520 align:middle line:84%
and which one is actually
coming next into this hierarchy,

00:32:15.520 --> 00:32:18.060 align:middle line:84%
and for historical
reasons, flatten

00:32:18.060 --> 00:32:21.900 align:middle line:84%
will take that same
score and put it

00:32:21.900 --> 00:32:28.180 align:middle line:84%
all into a new score object,
a new thing, but with--

00:32:28.180 --> 00:32:31.080 align:middle line:84%
it also removes all
the parts and stuff.

00:32:31.080 --> 00:32:33.820 align:middle line:84%
Flatten, there are
no parts or anything.

00:32:33.820 --> 00:32:36.790 align:middle line:84%
There's just the things, just
the leaf nodes at the end.

00:32:36.790 --> 00:32:40.720 align:middle line:84%
So you'll get the clef, the
other clef, the time signature,

00:32:40.720 --> 00:32:47.850 align:middle line:84%
the other time signature, and so
on, all in a new stream object.

00:32:47.850 --> 00:32:50.640 align:middle line:84%
And this is the
first time when I

00:32:50.640 --> 00:32:53.460 align:middle line:84%
was saying that a note
might have more than one

00:32:53.460 --> 00:32:57.240 align:middle line:84%
offset, because
this is the same.

00:32:57.240 --> 00:32:58.170 align:middle line:90%
Oops.

00:32:58.170 --> 00:33:02.470 align:middle line:84%
This quarter note here is the
same as that quarter note there.

00:33:02.470 --> 00:33:06.653 align:middle line:84%
So dot offset will be
changing as this happens.

00:33:06.653 --> 00:33:09.210 align:middle line:90%


00:33:09.210 --> 00:33:12.640 align:middle line:84%
This is something that
will occasionally bite you,

00:33:12.640 --> 00:33:14.970 align:middle line:90%
but usually not.

00:33:14.970 --> 00:33:18.100 align:middle line:84%
Which offset does it tell
we need to put dot offset?

00:33:18.100 --> 00:33:22.590 align:middle line:84%
It tells you whatever the
offset is in the last stream

00:33:22.590 --> 00:33:28.260 align:middle line:84%
that you iterated over
that has that object in it.

00:33:28.260 --> 00:33:31.355 align:middle line:90%
So we call that the active site.

00:33:31.355 --> 00:33:34.080 align:middle line:90%


00:33:34.080 --> 00:33:38.045 align:middle line:84%
So it tells you the
offset in its active site.

00:33:38.045 --> 00:33:40.800 align:middle line:90%


00:33:40.800 --> 00:33:44.430 align:middle line:84%
You will find that
it's often you're

00:33:44.430 --> 00:33:48.420 align:middle line:84%
looking at something in
a flattened stream that

00:33:48.420 --> 00:33:50.530 align:middle line:90%
should say flattened up there.

00:33:50.530 --> 00:33:54.840 align:middle line:84%
And you want to know something
about, oh, Professor Cuthbert

00:33:54.840 --> 00:33:59.430 align:middle line:84%
said, get me all of the
notes between offset 5 and 7,

00:33:59.430 --> 00:34:02.740 align:middle line:84%
and tell me what
measure they're in.

00:34:02.740 --> 00:34:03.550 align:middle line:90%
Shoot.

00:34:03.550 --> 00:34:08.199 align:middle line:84%
We've gotten all things 5 and 7
from the beginning of the score.

00:34:08.199 --> 00:34:10.449 align:middle line:84%
The problem is we've
lost all the measure

00:34:10.449 --> 00:34:11.690 align:middle line:90%
information over here.

00:34:11.690 --> 00:34:15.310 align:middle line:84%
So there is a property on
all streams, dot derivation,

00:34:15.310 --> 00:34:18.219 align:middle line:84%
dot origin, which
will take you back

00:34:18.219 --> 00:34:21.260 align:middle line:84%
to the original, the
place where it came from,

00:34:21.260 --> 00:34:22.639 align:middle line:90%
so the pre flattened stream.

00:34:22.639 --> 00:34:26.770 align:middle line:84%
And that's something you're
going to be working with a lot.

00:34:26.770 --> 00:34:28.929 align:middle line:84%
This is an ontological
choice I've

00:34:28.929 --> 00:34:33.130 align:middle line:84%
made on how things are related,
how flattened versions of scores

00:34:33.130 --> 00:34:38.260 align:middle line:84%
have a derivation to the
origin of the original score.

00:34:38.260 --> 00:34:42.590 align:middle line:84%
Now I'll take
questions on anything.

00:34:42.590 --> 00:34:43.550 align:middle line:90%
It's pretty confusing.

00:34:43.550 --> 00:34:44.600 align:middle line:90%
It's a lot to jump in.

00:34:44.600 --> 00:34:45.230 align:middle line:90%
Yeah, Adam.

00:34:45.230 --> 00:34:48.280 align:middle line:84%
AUDIENCE: Last time, what was
BOEHME in the German anthem

00:34:48.280 --> 00:34:49.017 align:middle line:90%
encoding?

00:34:49.017 --> 00:34:50.350 align:middle line:90%
MICHAEL CUTHBERT: What was what?

00:34:50.350 --> 00:34:52.909 align:middle line:84%
AUDIENCE: At the very, very
top, I said it was the composer.

00:34:52.909 --> 00:34:54.076 align:middle line:90%
MICHAEL CUTHBERT: Oh, Bohem.

00:34:54.076 --> 00:34:56.139 align:middle line:84%
OK, so we're jumping
quite a bit back.

00:34:56.139 --> 00:35:00.150 align:middle line:84%
It's the location of Bohemian,
originally, a Bohemian song.

00:35:00.150 --> 00:35:04.120 align:middle line:90%


00:35:04.120 --> 00:35:07.190 align:middle line:84%
That was a pop quiz to
see what I remembered.

00:35:07.190 --> 00:35:07.690 align:middle line:90%
Great.

00:35:07.690 --> 00:35:10.370 align:middle line:90%


00:35:10.370 --> 00:35:15.640 align:middle line:84%
Any other questions on this
material specifically, and then

00:35:15.640 --> 00:35:16.363 align:middle line:90%
on anything?

00:35:16.363 --> 00:35:23.350 align:middle line:90%


00:35:23.350 --> 00:35:31.600 align:middle line:84%
OK, well, let's start by having
a little bit of programming

00:35:31.600 --> 00:35:33.730 align:middle line:90%
exercise time.

00:35:33.730 --> 00:35:40.150 align:middle line:84%
We have this Bach
chorale BWV 66.6.

00:35:40.150 --> 00:35:41.390 align:middle line:90%
Are there more?

00:35:41.390 --> 00:35:42.280 align:middle line:90%
Yep, go ahead.

00:35:42.280 --> 00:35:44.660 align:middle line:84%
AUDIENCE: So does flatten
mutate the object?

00:35:44.660 --> 00:35:47.950 align:middle line:84%
MICHAEL CUTHBERT:
So flatten mutates--

00:35:47.950 --> 00:35:52.150 align:middle line:84%
yes, it mutates something
on every object called

00:35:52.150 --> 00:35:55.220 align:middle line:84%
sites that keeps track
of where things are,

00:35:55.220 --> 00:35:58.400 align:middle line:90%
but it does not change a thing.

00:35:58.400 --> 00:36:00.770 align:middle line:84%
There were some
choices that, now

00:36:00.770 --> 00:36:03.955 align:middle line:84%
that Music21 is 20
years old almost,

00:36:03.955 --> 00:36:06.330 align:middle line:84%
there are some things that I
would have done differently.

00:36:06.330 --> 00:36:09.590 align:middle line:84%
And I think it's probably
time for somebody who's

00:36:09.590 --> 00:36:12.290 align:middle line:84%
younger and more
ambitious and wants

00:36:12.290 --> 00:36:16.080 align:middle line:84%
to do something for the next 20
years to come up with things,

00:36:16.080 --> 00:36:19.730 align:middle line:84%
because I did not listen to
our great software engineering

00:36:19.730 --> 00:36:24.110 align:middle line:84%
Professor Peter Jackson's
warnings against mutability

00:36:24.110 --> 00:36:26.160 align:middle line:84%
in objects as well
as I should have.

00:36:26.160 --> 00:36:29.070 align:middle line:84%
And now, I'm trying to
make more things immutable.

00:36:29.070 --> 00:36:31.760 align:middle line:84%
But you will find
that a lot of things

00:36:31.760 --> 00:36:35.270 align:middle line:84%
will, by default, not
mutate, but then can.

00:36:35.270 --> 00:36:36.810 align:middle line:90%
And objects can be mutated.

00:36:36.810 --> 00:36:37.950 align:middle line:90%
So that's a great question.

00:36:37.950 --> 00:36:40.730 align:middle line:84%
Everyone knows mutable
versus immutable objects.

00:36:40.730 --> 00:36:42.200 align:middle line:90%
You can change, you can not.

00:36:42.200 --> 00:36:43.940 align:middle line:90%
Lists are--

00:36:43.940 --> 00:36:44.910 align:middle line:90%
AUDIENCE: Mutable.

00:36:44.910 --> 00:36:46.760 align:middle line:84%
MICHAEL CUTHBERT: What is the
equivalent of a list in Python

00:36:46.760 --> 00:36:47.623 align:middle line:90%
that is immutable?

00:36:47.623 --> 00:36:48.290 align:middle line:90%
AUDIENCE: Tuple.

00:36:48.290 --> 00:36:49.710 align:middle line:90%
MICHAEL CUTHBERT: Tuple, good.

00:36:49.710 --> 00:36:50.520 align:middle line:90%
You all say tuple.

00:36:50.520 --> 00:36:52.710 align:middle line:84%
Here I always learned
it as tuple, but tuple.

00:36:52.710 --> 00:36:53.780 align:middle line:90%
Great.

00:36:53.780 --> 00:36:55.760 align:middle line:90%
Super.

00:36:55.760 --> 00:36:59.960 align:middle line:84%
So any other questions before
I go on to my question for you

00:36:59.960 --> 00:37:02.960 align:middle line:90%
about Bach?

00:37:02.960 --> 00:37:09.120 align:middle line:84%
OK, here is the question
for you to answer.

00:37:09.120 --> 00:37:10.920 align:middle line:84%
And let's do this
in groups of two,

00:37:10.920 --> 00:37:13.800 align:middle line:84%
because it's much more
fun to be talking to.

00:37:13.800 --> 00:37:19.760 align:middle line:84%
Does Bach use more
ascending notes

00:37:19.760 --> 00:37:28.650 align:middle line:84%
or descending notes, descending
notes, or about the same?

00:37:28.650 --> 00:37:32.960 align:middle line:84%
You might think the piece
doesn't start off, Hallelujah,

00:37:32.960 --> 00:37:36.630 align:middle line:84%
and end all [DEEP MUMBLING],
and it doesn't go the opposite,

00:37:36.630 --> 00:37:39.750 align:middle line:84%
so it must be about the
same maybe, but we'll see.

00:37:39.750 --> 00:37:42.500 align:middle line:90%
So talk.

00:37:42.500 --> 00:37:45.950 align:middle line:84%
Everyone know who they're
going to be paired up with?

00:37:45.950 --> 00:37:46.700 align:middle line:90%
See pairs.

00:37:46.700 --> 00:37:49.500 align:middle line:84%
It's easier if you're
sitting on think, sit paired.

00:37:49.500 --> 00:37:50.000 align:middle line:90%
Great.

00:37:50.000 --> 00:37:53.990 align:middle line:84%
So start talking about
how are you going to do

00:37:53.990 --> 00:37:56.100 align:middle line:90%
this and what which type of--

00:37:56.100 --> 00:37:57.850 align:middle line:84%
AUDIENCE: I think I
have a quick question.

00:37:57.850 --> 00:38:00.787 align:middle line:90%
Why does flattening show?

00:38:00.787 --> 00:38:01.870 align:middle line:90%
MICHAEL CUTHBERT: Flatten?

00:38:01.870 --> 00:38:03.090 align:middle line:90%
Why does flatten show?

00:38:03.090 --> 00:38:05.838 align:middle line:90%
[INTERPOSING VOICES]

00:38:05.838 --> 00:38:08.370 align:middle line:84%
MICHAEL CUTHBERT:
Because it's able to--

00:38:08.370 --> 00:38:12.070 align:middle line:84%
ah, because recurse
is not a stream.

00:38:12.070 --> 00:38:14.310 align:middle line:84%
Yeah, so I should
say, recurse just

00:38:14.310 --> 00:38:16.510 align:middle line:84%
gives you an
iterator around that.

00:38:16.510 --> 00:38:20.610 align:middle line:84%
You could do recurse
thing, and then there's

00:38:20.610 --> 00:38:22.790 align:middle line:84%
a dot stream that
you can put onto it,

00:38:22.790 --> 00:38:24.040 align:middle line:90%
and that'll give you a stream.

00:38:24.040 --> 00:38:26.200 align:middle line:84%
But it's just going to give you
the same thing you started with,

00:38:26.200 --> 00:38:27.220 align:middle line:90%
because yeah.

00:38:27.220 --> 00:38:29.252 align:middle line:90%
[INTERPOSING VOICES]

00:38:29.252 --> 00:38:30.460 align:middle line:90%
MICHAEL CUTHBERT: No, no, no.

00:38:30.460 --> 00:38:31.510 align:middle line:90%
Then do it then.

00:38:31.510 --> 00:38:32.330 align:middle line:90%
Yeah, thank you.

00:38:32.330 --> 00:38:32.830 align:middle line:90%
Thank you.

00:38:32.830 --> 00:38:34.530 align:middle line:84%
Always say, we're
going to talk first

00:38:34.530 --> 00:38:37.012 align:middle line:84%
about how to do it then
implement, but talk.

00:38:37.012 --> 00:38:38.850 align:middle line:90%
[INTERPOSING VOICES]

00:38:38.850 --> 00:38:40.260 align:middle line:90%
MICHAEL CUTHBERT: It's in class.

00:38:40.260 --> 00:38:42.960 align:middle line:84%
I don't care however
you'd like to do it.

00:38:42.960 --> 00:38:45.820 align:middle line:84%
But always start talking
then implementing.

00:38:45.820 --> 00:38:48.930 align:middle line:90%


00:38:48.930 --> 00:38:51.690 align:middle line:84%
OK I'm hearing the
discussion start

00:38:51.690 --> 00:38:53.800 align:middle line:84%
dying down and
hearing some clicks.

00:38:53.800 --> 00:38:56.610 align:middle line:84%
You can keep talking, but
just an informal poll.

00:38:56.610 --> 00:39:03.690 align:middle line:84%
Which groups are
on team flatten?

00:39:03.690 --> 00:39:05.740 align:middle line:90%
We got one, two, three.

00:39:05.740 --> 00:39:06.460 align:middle line:90%
Good, good.

00:39:06.460 --> 00:39:09.430 align:middle line:84%
Which groups are on team
recurse, is the best way?

00:39:09.430 --> 00:39:10.800 align:middle line:90%
Good, good, good.

00:39:10.800 --> 00:39:13.980 align:middle line:84%
And which groups are in team
for thing, and thing, and thing,

00:39:13.980 --> 00:39:16.620 align:middle line:90%
and thing, and thing?

00:39:16.620 --> 00:39:18.520 align:middle line:84%
No, just there was a
smile with that one.

00:39:18.520 --> 00:39:20.260 align:middle line:90%
So keep going.

00:39:20.260 --> 00:39:23.020 align:middle line:84%
There's ways to
keep working on it.

00:39:23.020 --> 00:39:26.380 align:middle line:84%
I think you'll find there's one
that's better than the other.

00:39:26.380 --> 00:39:29.610 align:middle line:84%
But we'll figure out
which one that is.

00:39:29.610 --> 00:39:31.710 align:middle line:90%
[INTERPOSING VOICES]

00:39:31.710 --> 00:39:34.805 align:middle line:90%


00:39:34.805 --> 00:39:36.930 align:middle line:84%
MICHAEL CUTHBERT: And if
you're lucky to be sitting

00:39:36.930 --> 00:39:39.130 align:middle line:84%
next to a group that's
on the different team,

00:39:39.130 --> 00:39:41.280 align:middle line:84%
maybe talk across
groups and figure out.

00:39:41.280 --> 00:39:46.570 align:middle line:84%
We'll dialogue across
religions and political views.

00:39:46.570 --> 00:39:49.630 align:middle line:90%
[INTERPOSING VOICES]

00:39:49.630 --> 00:39:51.930 align:middle line:84%
MICHAEL CUTHBERT: I'm going
to interrupt for one second

00:39:51.930 --> 00:39:54.580 align:middle line:84%
to say something
that I've heard.

00:39:54.580 --> 00:39:56.973 align:middle line:90%
Just a second.

00:39:56.973 --> 00:39:57.890 align:middle line:90%
Yeah, just one second.

00:39:57.890 --> 00:40:00.550 align:middle line:84%
Can I interrupt for one second
to say something I have heard

00:40:00.550 --> 00:40:01.720 align:middle line:90%
from two different groups?

00:40:01.720 --> 00:40:03.520 align:middle line:90%
Matthew.

00:40:03.520 --> 00:40:05.770 align:middle line:84%
Introduced for two
different groups.

00:40:05.770 --> 00:40:07.760 align:middle line:84%
I have heard this,
something like, oh,

00:40:07.760 --> 00:40:08.780 align:middle line:90%
but think of the memory.

00:40:08.780 --> 00:40:11.810 align:middle line:84%
We're going to have to keep a
reference to the previous note.

00:40:11.810 --> 00:40:14.900 align:middle line:84%
What is to keep a reference
to the previous note?

00:40:14.900 --> 00:40:17.830 align:middle line:84%
What is the big O
memory consideration

00:40:17.830 --> 00:40:20.420 align:middle line:90%
that we're thinking about?

00:40:20.420 --> 00:40:20.920 align:middle line:90%
AUDIENCE: 1?

00:40:20.920 --> 00:40:21.420 align:middle line:90%
AUDIENCE: 1?

00:40:21.420 --> 00:40:22.810 align:middle line:90%
MICHAEL CUTHBERT: 1.

00:40:22.810 --> 00:40:23.870 align:middle line:90%
Do we care about?

00:40:23.870 --> 00:40:25.750 align:middle line:90%
0 of 1 memory?

00:40:25.750 --> 00:40:26.330 align:middle line:90%
AUDIENCE: No.

00:40:26.330 --> 00:40:27.800 align:middle line:90%
MICHAEL CUTHBERT: No, we do not.

00:40:27.800 --> 00:40:28.300 align:middle line:90%
Good.

00:40:28.300 --> 00:40:29.510 align:middle line:90%
Keep going with that.

00:40:29.510 --> 00:40:31.150 align:middle line:84%
Just wanted to make
sure that we had

00:40:31.150 --> 00:40:34.450 align:middle line:84%
that we don't care about 0
of 1 operations very often.

00:40:34.450 --> 00:40:35.727 align:middle line:90%
Occasionally.

00:40:35.727 --> 00:40:37.060 align:middle line:90%
AUDIENCE: Is it just this piece?

00:40:37.060 --> 00:40:38.477 align:middle line:84%
MICHAEL CUTHBERT:
Just this piece.

00:40:38.477 --> 00:40:39.331 align:middle line:90%
Oh.

00:40:39.331 --> 00:40:40.480 align:middle line:90%
It was just this.

00:40:40.480 --> 00:40:45.970 align:middle line:84%
I just heard, is it just
this piece or all of Bach?

00:40:45.970 --> 00:40:48.050 align:middle line:84%
Just this piece is
what I'm asking for,

00:40:48.050 --> 00:40:58.790 align:middle line:84%
but you could do for
chorale in corpus dot--

00:40:58.790 --> 00:41:01.215 align:middle line:90%
[INTERPOSING VOICES]

00:41:01.215 --> 00:41:08.740 align:middle line:90%


00:41:08.740 --> 00:41:14.040 align:middle line:84%
MICHAEL CUTHBERT: So you, Derek
and Vincent, if you wanted to,

00:41:14.040 --> 00:41:16.960 align:middle line:84%
there is a for loop
you can do above it.

00:41:16.960 --> 00:41:20.680 align:middle line:84%
And since we've unlocked
corpus, that will give you all.

00:41:20.680 --> 00:41:21.590 align:middle line:90%
Looking good.

00:41:21.590 --> 00:41:22.780 align:middle line:90%
Looking good.

00:41:22.780 --> 00:41:26.270 align:middle line:84%
So if anybody's finished
and has gotten a thing,

00:41:26.270 --> 00:41:29.060 align:middle line:84%
oh, a couple questions
once you have that.

00:41:29.060 --> 00:41:31.070 align:middle line:90%
They're not exactly the same.

00:41:31.070 --> 00:41:31.880 align:middle line:90%
I'll say that.

00:41:31.880 --> 00:41:35.690 align:middle line:84%
And what are some features in
the chorale that explain that?

00:41:35.690 --> 00:41:43.070 align:middle line:84%
The other thing you could do is
do this for all 360 chorales.

00:41:43.070 --> 00:41:46.480 align:middle line:90%
[INTERPOSING VOICES]

00:41:46.480 --> 00:41:49.925 align:middle line:90%


00:41:49.925 --> 00:41:52.050 align:middle line:84%
MICHAEL CUTHBERT: That's
a lowercase C in chorales.

00:41:52.050 --> 00:41:55.100 align:middle line:90%
[INTERPOSING VOICES]

00:41:55.100 --> 00:41:59.480 align:middle line:90%


00:41:59.480 --> 00:42:02.670 align:middle line:84%
MICHAEL CUTHBERT: Corpus
dot corrals dot Iterator.

00:42:02.670 --> 00:42:12.140 align:middle line:84%
Just before we go, who
is still on team flatten?

00:42:12.140 --> 00:42:13.710 align:middle line:90%
You used flatten a little bit?

00:42:13.710 --> 00:42:14.382 align:middle line:90%
OK.

00:42:14.382 --> 00:42:17.750 align:middle line:84%
And actually, it will say,
who used flatten anywhere

00:42:17.750 --> 00:42:18.800 align:middle line:90%
in the score?

00:42:18.800 --> 00:42:22.070 align:middle line:84%
And who used recurse
anywhere in their score?

00:42:22.070 --> 00:42:22.770 align:middle line:90%
OK.

00:42:22.770 --> 00:42:29.300 align:middle line:84%
I'm curious, how did flatten
work for getting this?

00:42:29.300 --> 00:42:31.590 align:middle line:84%
AUDIENCE: We had to say
change or first times flatten,

00:42:31.590 --> 00:42:33.830 align:middle line:90%
and it's the same for ascending.

00:42:33.830 --> 00:42:35.520 align:middle line:84%
And then for descending,
we're off by 2.

00:42:35.520 --> 00:42:36.770 align:middle line:90%
MICHAEL CUTHBERT: Interesting.

00:42:36.770 --> 00:42:40.160 align:middle line:84%
I'll be curious to
see how that happened.

00:42:40.160 --> 00:42:41.930 align:middle line:90%
Great.

00:42:41.930 --> 00:42:44.130 align:middle line:84%
So I think we're
wrapping up a bit.

00:42:44.130 --> 00:42:47.060 align:middle line:90%
You can keep working, obviously.

00:42:47.060 --> 00:42:47.790 align:middle line:90%
What is it?

00:42:47.790 --> 00:42:50.580 align:middle line:84%
Item 9 on your thing,
sound to score,

00:42:50.580 --> 00:42:53.900 align:middle line:84%
it's one of my favorite things
to teach in class because it's

00:42:53.900 --> 00:42:54.870 align:middle line:90%
really, really fun.

00:42:54.870 --> 00:42:58.430 align:middle line:84%
But I have made a video so we
can save some time outside.

00:42:58.430 --> 00:43:00.230 align:middle line:90%
And that, I'll add that.

00:43:00.230 --> 00:43:03.650 align:middle line:84%
That's about a 10
minute to watch.

00:43:03.650 --> 00:43:07.260 align:middle line:84%
Trying to make it quite a
bit easier on this weekend.

00:43:07.260 --> 00:43:08.820 align:middle line:84%
Try to make it a
little bit lighter,

00:43:08.820 --> 00:43:12.530 align:middle line:84%
so it's just some
interesting added things

00:43:12.530 --> 00:43:13.680 align:middle line:90%
that are happening there.

00:43:13.680 --> 00:43:16.550 align:middle line:84%
And for the first
time, I'm going

00:43:16.550 --> 00:43:21.170 align:middle line:84%
to really recommend that you
read the Music21 user's guide

00:43:21.170 --> 00:43:22.230 align:middle line:90%
chapters.

00:43:22.230 --> 00:43:25.045 align:middle line:84%
There's an optional one,
Chapter 26 at the end.

00:43:25.045 --> 00:43:27.170 align:middle line:84%
You don't need to read it
because it's a little bit

00:43:27.170 --> 00:43:27.750 align:middle line:90%
complex.

00:43:27.750 --> 00:43:29.850 align:middle line:84%
But if you do read it
and get through it,

00:43:29.850 --> 00:43:31.550 align:middle line:84%
there are some
tips in there that

00:43:31.550 --> 00:43:34.370 align:middle line:84%
can make some aspects
of the problem set

00:43:34.370 --> 00:43:37.650 align:middle line:90%
3 a little bit easier.

00:43:37.650 --> 00:43:41.845 align:middle line:84%
So any other questions
on what we did?

00:43:41.845 --> 00:43:42.780 align:middle line:90%
One last thing.

00:43:42.780 --> 00:43:44.750 align:middle line:90%
One last thing on this.

00:43:44.750 --> 00:43:47.340 align:middle line:84%
I always recommend
and I really, really

00:43:47.340 --> 00:43:49.690 align:middle line:90%
recommend a readable code.

00:43:49.690 --> 00:43:50.800 align:middle line:90%
Write readable code.

00:43:50.800 --> 00:43:53.880 align:middle line:84%
Write code so that you
can do this collaboration

00:43:53.880 --> 00:43:55.150 align:middle line:90%
and give it to your friends.

00:43:55.150 --> 00:43:56.410 align:middle line:90%
Write things like that.

00:43:56.410 --> 00:44:01.350 align:middle line:84%
But one year a while
back, the class

00:44:01.350 --> 00:44:05.970 align:middle line:84%
did decide to go code golfing
on this particular thing

00:44:05.970 --> 00:44:11.610 align:middle line:84%
to see who could write the
shortest code to do all this.

00:44:11.610 --> 00:44:14.340 align:middle line:90%


00:44:14.340 --> 00:44:14.890 align:middle line:90%
Oops, sorry.

00:44:14.890 --> 00:44:16.270 align:middle line:84%
AUDIENCE: Why did they
do that to the eyes?

00:44:16.270 --> 00:44:17.770 align:middle line:84%
MICHAEL CUTHBERT:
Because back then,

00:44:17.770 --> 00:44:20.520 align:middle line:84%
we were using Piazza for
a discussion board, which

00:44:20.520 --> 00:44:21.850 align:middle line:90%
used a proportional font.

00:44:21.850 --> 00:44:25.590 align:middle line:84%
So using eyes made it-- also,
it makes it a little bit more

00:44:25.590 --> 00:44:26.260 align:middle line:90%
inscrutable.

00:44:26.260 --> 00:44:28.120 align:middle line:90%
So never write code like this.

00:44:28.120 --> 00:44:32.430 align:middle line:84%
But I do believe that
that works if you want it.

00:44:32.430 --> 00:44:37.990 align:middle line:84%
And your prof won, but see
if you can beat that one.

00:44:37.990 --> 00:44:38.950 align:middle line:90%
Thanks, everybody.

00:44:38.950 --> 00:44:40.500 align:middle line:90%
[LAUGH]

00:44:40.500 --> 00:44:46.000 align:middle line:90%