WEBVTT

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

00:00:01.988 --> 00:00:04.473 align:middle line:90%
[RUSTLING]

00:00:04.473 --> 00:00:06.461 align:middle line:90%
[CLICKING]

00:00:06.461 --> 00:00:09.410 align:middle line:90%


00:00:09.410 --> 00:00:10.910 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: Hello.

00:00:10.910 --> 00:00:14.700 align:middle line:84%
Within the music21 corpus,
there is another subcorpus,

00:00:14.700 --> 00:00:16.920 align:middle line:90%
which is a pretty useful one.

00:00:16.920 --> 00:00:20.670 align:middle line:84%
And that is the corpus of the
complete chorales of JS Bach.

00:00:20.670 --> 00:00:24.300 align:middle line:84%
And really thankful
to Margaret Greentree,

00:00:24.300 --> 00:00:29.430 align:middle line:84%
who contributed all of these
before her untimely passing.

00:00:29.430 --> 00:00:33.900 align:middle line:84%
So within music21, let's
go ahead and import corpus

00:00:33.900 --> 00:00:35.700 align:middle line:84%
because that's going
to be pretty useful.

00:00:35.700 --> 00:00:39.710 align:middle line:90%
And we can have--

00:00:39.710 --> 00:00:41.210 align:middle line:84%
within the corpus,
there's something

00:00:41.210 --> 00:00:43.790 align:middle line:90%
called corpus.chorales.

00:00:43.790 --> 00:00:45.540 align:middle line:90%
And see that there?

00:00:45.540 --> 00:00:49.340 align:middle line:84%
And there's something called
the corpus chorales iterator

00:00:49.340 --> 00:00:51.330 align:middle line:90%
which will go through this.

00:00:51.330 --> 00:00:57.200 align:middle line:84%
And so we can say for chorale
in the corpus chorale iterator,

00:00:57.200 --> 00:01:01.260 align:middle line:90%
print chorale.metadata.

00:01:01.260 --> 00:01:04.870 align:middle line:84%
That's the data about the
data-- the data about the piece.

00:01:04.870 --> 00:01:07.120 align:middle line:90%
And we can print its title.

00:01:07.120 --> 00:01:08.160 align:middle line:90%
And it's going through.

00:01:08.160 --> 00:01:10.290 align:middle line:84%
And it's a little bit
slow because it's actually

00:01:10.290 --> 00:01:13.690 align:middle line:84%
parsing them along
the way as it's going.

00:01:13.690 --> 00:01:14.800 align:middle line:90%
That'll take some time.

00:01:14.800 --> 00:01:18.730 align:middle line:84%
So you can go ahead and
interrupt that while it's going.

00:01:18.730 --> 00:01:22.510 align:middle line:84%
So not every chorale
has four parts.

00:01:22.510 --> 00:01:24.090 align:middle line:90%
The size we want to do--

00:01:24.090 --> 00:01:29.160 align:middle line:90%
if len chorale --

00:01:29.160 --> 00:01:30.700 align:middle line:90%
I'll learn to spell it--

00:01:30.700 --> 00:01:35.250 align:middle line:84%
len(chorale.parts) not
equals 4, we'll continue.

00:01:35.250 --> 00:01:36.490 align:middle line:90%
Then let's do this.

00:01:36.490 --> 00:01:41.410 align:middle line:84%
Let's print
chorale.metadata.title.

00:01:41.410 --> 00:01:46.600 align:middle line:84%
And we'll say that we just
put a colon at the end.

00:01:46.600 --> 00:01:49.920 align:middle line:90%
And then for i in range 4--

00:01:49.920 --> 00:01:52.020 align:middle line:90%
0, 1, 2, 3--

00:01:52.020 --> 00:01:57.330 align:middle line:90%
p equals chorale.parts ( i ).

00:01:57.330 --> 00:02:09.370 align:middle line:84%
Print ( i ) and then the
length of p.flat.notes.

00:02:09.370 --> 00:02:11.180 align:middle line:84%
Recurse would be
a little faster,

00:02:11.180 --> 00:02:13.070 align:middle line:90%
but we'll have to do that.

00:02:13.070 --> 00:02:16.770 align:middle line:84%
And we'll say the
end of that is--

00:02:16.770 --> 00:02:20.140 align:middle line:90%


00:02:20.140 --> 00:02:23.170 align:middle line:84%
we'll put a comma space,
something like that.

00:02:23.170 --> 00:02:25.900 align:middle line:84%
And now we can go
through-- oops.

00:02:25.900 --> 00:02:28.750 align:middle line:90%
We'll interrupt that.

00:02:28.750 --> 00:02:33.920 align:middle line:84%
I think it's probably useful
to print a new line afterwards.

00:02:33.920 --> 00:02:37.340 align:middle line:84%
And we can see how
the various parts are.

00:02:37.340 --> 00:02:39.760 align:middle line:84%
And you could imagine that
you can go through this

00:02:39.760 --> 00:02:45.040 align:middle line:84%
and play with it and have
some interesting things

00:02:45.040 --> 00:02:50.240 align:middle line:84%
on which parts have more notes
and which parts have fewer notes

00:02:50.240 --> 00:02:52.510 align:middle line:90%
and so on.

00:02:52.510 --> 00:02:54.070 align:middle line:84%
Some of the things
that we could do

00:02:54.070 --> 00:02:55.720 align:middle line:84%
with a complete
corpus of chorales

00:02:55.720 --> 00:03:00.560 align:middle line:84%
are look at the types of motion,
Where do climaxes appear?

00:03:00.560 --> 00:03:07.380 align:middle line:90%
Where can we find repeats?

00:03:07.380 --> 00:03:09.320 align:middle line:84%
What are the kinds
of time signatures

00:03:09.320 --> 00:03:10.320 align:middle line:90%
that appear in chorales?

00:03:10.320 --> 00:03:14.420 align:middle line:84%
basically all the things
that you guys did in problem

00:03:14.420 --> 00:03:18.050 align:middle line:84%
set 3, which is just
wonderful, or problem

00:03:18.050 --> 00:03:20.510 align:middle line:84%
set-- yeah, to talk
about what you can

00:03:20.510 --> 00:03:21.840 align:middle line:90%
do with the corpus chorales.

00:03:21.840 --> 00:03:23.850 align:middle line:90%
So this is the chorale corpus.

00:03:23.850 --> 00:03:27.860 align:middle line:84%
If you want to quickly
go through and just find

00:03:27.860 --> 00:03:34.040 align:middle line:84%
particular ones, you can
say that the return type

00:03:34.040 --> 00:03:37.750 align:middle line:90%
is something else, filename.

00:03:37.750 --> 00:03:42.680 align:middle line:90%


00:03:42.680 --> 00:03:48.560 align:middle line:84%
And this will allow you to
pass them in to the converter.

00:03:48.560 --> 00:03:55.940 align:middle line:90%
If 11 in chorale.

00:03:55.940 --> 00:04:01.413 align:middle line:84%
RealChorale equals
corpus.parse chorale.

00:04:01.413 --> 00:04:10.800 align:middle line:90%


00:04:10.800 --> 00:04:13.720 align:middle line:84%
And there are all the
chorales with 11 in the name.

00:04:13.720 --> 00:04:17.440 align:middle line:84%
So these are just some things
that you could be working with.

00:04:17.440 --> 00:04:19.740 align:middle line:90%
And you can even--

00:04:19.740 --> 00:04:25.020 align:middle line:84%
this is a small enough number,
we can show each of them.

00:04:25.020 --> 00:04:26.800 align:middle line:84%
And it'll take a
little bit of time,

00:04:26.800 --> 00:04:32.940 align:middle line:84%
but we'll start getting to see
all the chorales in a piece.

00:04:32.940 --> 00:04:35.700 align:middle line:84%
Our friends at Intel,
bum bum bum bum,

00:04:35.700 --> 00:04:39.990 align:middle line:84%
have created a tutorial on
how you can use Bach chorales

00:04:39.990 --> 00:04:43.440 align:middle line:84%
and work through the
iterators and explore the data

00:04:43.440 --> 00:04:46.230 align:middle line:84%
and begin looking on
emotion recognition

00:04:46.230 --> 00:04:49.530 align:middle line:84%
and so on from the Bach
chorales and even do

00:04:49.530 --> 00:04:52.685 align:middle line:84%
artificial intelligence
and plot various things--

00:04:52.685 --> 00:04:54.060 align:middle line:84%
we'll show you
this in a second--

00:04:54.060 --> 00:04:56.380 align:middle line:90%
and pitch throughout time.

00:04:56.380 --> 00:04:58.000 align:middle line:90%
Very short video.

00:04:58.000 --> 00:04:59.990 align:middle line:90%
Thanks for watching.

00:04:59.990 --> 00:05:06.000 align:middle line:90%