WEBVTT

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

00:00:01.976 --> 00:00:03.952 align:middle line:90%
[RUSTLING]

00:00:03.952 --> 00:00:07.410 align:middle line:90%
[CLICKING]

00:00:07.410 --> 00:00:09.890 align:middle line:90%


00:00:09.890 --> 00:00:11.520 align:middle line:84%
MICHAEL CUTHBERT:
Hello, everybody.

00:00:11.520 --> 00:00:15.680 align:middle line:84%
Congratulations on getting
problem set one in.

00:00:15.680 --> 00:00:20.280 align:middle line:84%
Now the reward is your
first unlocking video,

00:00:20.280 --> 00:00:24.750 align:middle line:84%
so a topic part D.
This is topic 1D.

00:00:24.750 --> 00:00:28.340 align:middle line:84%
And you get to
have certain tools

00:00:28.340 --> 00:00:32.600 align:middle line:84%
that you can use to
build future problems

00:00:32.600 --> 00:00:35.390 align:middle line:84%
and solve future problems
and build future problem

00:00:35.390 --> 00:00:37.310 align:middle line:90%
sets using Music21.

00:00:37.310 --> 00:00:38.670 align:middle line:90%
So I'm in Jupiter.

00:00:38.670 --> 00:00:40.242 align:middle line:84%
You probably want
to be doing this--

00:00:40.242 --> 00:00:42.200 align:middle line:84%
well, you can do it in
Jupiter or you can do it

00:00:42.200 --> 00:00:44.520 align:middle line:90%
in your own favorite editor.

00:00:44.520 --> 00:00:49.920 align:middle line:84%
By the way, PyCharm will really
save you problems in this class.

00:00:49.920 --> 00:00:53.610 align:middle line:84%
OK, so we're going
to introduce Music21.

00:00:53.610 --> 00:00:58.920 align:middle line:84%
You can import Music21
but, nah, not really.

00:00:58.920 --> 00:01:03.550 align:middle line:84%
We're going to do from
Music21 import pitch

00:01:03.550 --> 00:01:10.340 align:middle line:84%
because you've unlocked your
first pitch object and pitch

00:01:10.340 --> 00:01:12.370 align:middle line:84%
module. pitch is
lowercase here, so it

00:01:12.370 --> 00:01:16.150 align:middle line:84%
represents a module
in Music21, and we'll

00:01:16.150 --> 00:01:17.240 align:middle line:90%
be calling things in it.

00:01:17.240 --> 00:01:21.130 align:middle line:84%
Now in the problem set, you were
probably representing pitches

00:01:21.130 --> 00:01:27.010 align:middle line:84%
as something like this or
enharmonically equivalent,

00:01:27.010 --> 00:01:28.360 align:middle line:90%
whatever.

00:01:28.360 --> 00:01:33.650 align:middle line:84%
In Music21, you'll probably
want to use our pitch object.

00:01:33.650 --> 00:01:37.690 align:middle line:84%
So the pitch object is
found in the pitch module.

00:01:37.690 --> 00:01:39.940 align:middle line:84%
The pitch module is lowercase
p and the Pitch object

00:01:39.940 --> 00:01:42.730 align:middle line:84%
is capital P. And we
can do the same thing--

00:01:42.730 --> 00:01:43.820 align:middle line:90%
A sharp four.

00:01:43.820 --> 00:01:47.780 align:middle line:84%
And in Jupiter, we can
just hit p and get that.

00:01:47.780 --> 00:01:50.440 align:middle line:84%
You can also, if you're
on the terminal, print p

00:01:50.440 --> 00:01:52.090 align:middle line:84%
and you can see the
representation is

00:01:52.090 --> 00:01:53.390 align:middle line:90%
slightly different.

00:01:53.390 --> 00:01:59.690 align:middle line:84%
OK, so let's figure out what we
know about this pitch object.

00:01:59.690 --> 00:02:01.990 align:middle line:84%
So during the
problem set, you were

00:02:01.990 --> 00:02:07.530 align:middle line:84%
creating functions that worked
on string or other list inputs.

00:02:07.530 --> 00:02:10.160 align:middle line:84%
But now that we have
an object, we're

00:02:10.160 --> 00:02:13.260 align:middle line:84%
going to be calling methods
and attributes directly on it.

00:02:13.260 --> 00:02:16.890 align:middle line:84%
So one of the attributes
of a pitch is its name.

00:02:16.890 --> 00:02:18.930 align:middle line:84%
And the name, you can
see, is a string--

00:02:18.930 --> 00:02:20.690 align:middle line:84%
that's why it has the
quotes around it--

00:02:20.690 --> 00:02:22.220 align:middle line:90%
A sharp.

00:02:22.220 --> 00:02:25.010 align:middle line:90%
Great.

00:02:25.010 --> 00:02:26.700 align:middle line:90%
Well, where is its octave?

00:02:26.700 --> 00:02:28.880 align:middle line:90%
Take a guess.

00:02:28.880 --> 00:02:30.830 align:middle line:90%
p.octave.

00:02:30.830 --> 00:02:36.470 align:middle line:84%
OK, so this is nothing
too surprising here.

00:02:36.470 --> 00:02:40.770 align:middle line:84%
Let's grab ourselves a
slightly different pitch.

00:02:40.770 --> 00:02:47.810 align:middle line:84%
We'll say b equals
pitch.Pitch B0.

00:02:47.810 --> 00:02:51.300 align:middle line:90%
Let's say B here is that B0.

00:02:51.300 --> 00:02:55.920 align:middle line:84%
And we can get the pitch
B's name, which is b,

00:02:55.920 --> 00:02:59.220 align:middle line:84%
and also get B's
step, which is also B.

00:02:59.220 --> 00:03:02.880 align:middle line:84%
So those two things look like
they do the exact same thing.

00:03:02.880 --> 00:03:06.340 align:middle line:84%
But go back to our P
object and figure out

00:03:06.340 --> 00:03:09.825 align:middle line:84%
for a second what the difference
between name and step is.

00:03:09.825 --> 00:03:21.700 align:middle line:90%


00:03:21.700 --> 00:03:26.270 align:middle line:84%
OK, did you figure out that
p's name has the sharp in it?

00:03:26.270 --> 00:03:28.340 align:middle line:90%
The p step does not.

00:03:28.340 --> 00:03:31.810 align:middle line:84%
So this says what diatonic
step, what letter name

00:03:31.810 --> 00:03:33.493 align:middle line:90%
is in the pitch itself?

00:03:33.493 --> 00:03:37.150 align:middle line:90%


00:03:37.150 --> 00:03:41.390 align:middle line:90%
And are these things mutable?

00:03:41.390 --> 00:03:44.380 align:middle line:84%
I actually made a mistake in the
4:00 to 5:00 class on the first

00:03:44.380 --> 00:03:48.320 align:middle line:84%
day and said that Music21
objects were not mutable.

00:03:48.320 --> 00:03:49.365 align:middle line:90%
They actually are.

00:03:49.365 --> 00:03:53.260 align:middle line:90%


00:03:53.260 --> 00:03:56.230 align:middle line:84%
But most of the methods
that are called on them

00:03:56.230 --> 00:03:58.820 align:middle line:90%
try to not mutate by default.

00:03:58.820 --> 00:04:00.620 align:middle line:84%
So if you want to,
you can change it.

00:04:00.620 --> 00:04:06.470 align:middle line:90%
So now p is a G sharp four.

00:04:06.470 --> 00:04:10.250 align:middle line:90%
p's octave stays at four.

00:04:10.250 --> 00:04:11.910 align:middle line:90%
How do we get that G sharp four?

00:04:11.910 --> 00:04:19.200 align:middle line:84%
You could do print p.name
plus string of p.octave

00:04:19.200 --> 00:04:20.579 align:middle line:90%
and you get that.

00:04:20.579 --> 00:04:24.360 align:middle line:84%
Or there's something
called name with octave,

00:04:24.360 --> 00:04:26.580 align:middle line:90%
which is pretty nice.

00:04:26.580 --> 00:04:30.030 align:middle line:84%
Now let's create a B
flat in octave six.

00:04:30.030 --> 00:04:35.870 align:middle line:84%
So we'll call it B flat
equals pitch.Pitch.

00:04:35.870 --> 00:04:40.340 align:middle line:90%
Take a second on what goes here.

00:04:40.340 --> 00:04:41.730 align:middle line:90%
OK, we're back.

00:04:41.730 --> 00:04:45.600 align:middle line:84%
And then we get B flat
in octave six there.

00:04:45.600 --> 00:04:49.370 align:middle line:84%
Notice, by the way,
again that we don't ever

00:04:49.370 --> 00:04:52.910 align:middle line:84%
name variables with
hyphens in them

00:04:52.910 --> 00:04:57.440 align:middle line:84%
because it's trying to
say, well, B minus flat.

00:04:57.440 --> 00:04:58.920 align:middle line:84%
Yeah, that doesn't
make any sense.

00:04:58.920 --> 00:05:01.653 align:middle line:90%
So B flat is B minus six.

00:05:01.653 --> 00:05:05.260 align:middle line:90%


00:05:05.260 --> 00:05:09.010 align:middle line:84%
And-- sorry, B--
yeah, B flat six.

00:05:09.010 --> 00:05:11.680 align:middle line:84%
Take a second and try
to figure out what

00:05:11.680 --> 00:05:14.870 align:middle line:84%
if you wanted a B natural
in octave negative six.

00:05:14.870 --> 00:05:15.930 align:middle line:90%
How would you do this?

00:05:15.930 --> 00:05:25.490 align:middle line:90%


00:05:25.490 --> 00:05:25.990 align:middle line:90%
Great.

00:05:25.990 --> 00:05:34.270 align:middle line:84%
Did you get really low
B equals pitch.Pitch B?

00:05:34.270 --> 00:05:36.140 align:middle line:90%
We said B four.

00:05:36.140 --> 00:05:43.150 align:middle line:84%
And now really low B.octave
equals negative six.

00:05:43.150 --> 00:05:50.620 align:middle line:84%
Notice that the name with
octave for this is the same as--

00:05:50.620 --> 00:05:54.660 align:middle line:84%
oops, where was it-- because
B flat's name with octave?

00:05:54.660 --> 00:05:58.330 align:middle line:90%


00:05:58.330 --> 00:06:03.700 align:middle line:84%
So probably, you're going
to want most commonly to--

00:06:03.700 --> 00:06:06.880 align:middle line:84%
when you're actually
working with your objects--

00:06:06.880 --> 00:06:12.830 align:middle line:84%
to do the two
parts separately so

00:06:12.830 --> 00:06:22.730 align:middle line:84%
that you can see the difference
between that and that.

00:06:22.730 --> 00:06:23.400 align:middle line:90%
OK.

00:06:23.400 --> 00:06:27.540 align:middle line:84%
So now we have a pitch and it's
kind of like big whoop dee doo.

00:06:27.540 --> 00:06:29.970 align:middle line:84%
You could have
done this yourself.

00:06:29.970 --> 00:06:33.840 align:middle line:84%
And why do we need to
do anything with this?

00:06:33.840 --> 00:06:38.900 align:middle line:84%
Well, let's create
another pitch,

00:06:38.900 --> 00:06:44.270 align:middle line:84%
and we'll make it a pitch
that's pretty common.

00:06:44.270 --> 00:06:47.370 align:middle line:90%
We call that middle C, right?

00:06:47.370 --> 00:06:47.870 align:middle line:90%
Great.

00:06:47.870 --> 00:06:52.020 align:middle line:84%
So here's middle C, and we
can get its midi number.

00:06:52.020 --> 00:06:54.060 align:middle line:84%
And so it knows
things like this.

00:06:54.060 --> 00:07:00.540 align:middle line:84%
If we say p.octave equals five,
now it's middle of treble clef.

00:07:00.540 --> 00:07:03.590 align:middle line:84%
And if we can figure out
what its midi number is,

00:07:03.590 --> 00:07:07.310 align:middle line:90%
that's pretty fantastic.

00:07:07.310 --> 00:07:11.920 align:middle line:84%
We can also do fun,
interesting things.

00:07:11.920 --> 00:07:13.850 align:middle line:90%
What's its name in Spanish?

00:07:13.850 --> 00:07:14.870 align:middle line:90%
What's its name?

00:07:14.870 --> 00:07:21.970 align:middle line:90%
Let's say C double flat.

00:07:21.970 --> 00:07:24.055 align:middle line:90%
Let's name it Spanish now.

00:07:24.055 --> 00:07:25.430 align:middle line:84%
I think that that's
pretty right.

00:07:25.430 --> 00:07:28.480 align:middle line:90%
What's its name in German?

00:07:28.480 --> 00:07:29.230 align:middle line:90%
OK.

00:07:29.230 --> 00:07:30.970 align:middle line:84%
It's actually a
little bit more fun

00:07:30.970 --> 00:07:32.470 align:middle line:90%
if you work with German names.

00:07:32.470 --> 00:07:37.180 align:middle line:90%


00:07:37.180 --> 00:07:41.840 align:middle line:90%
This and-- great.

00:07:41.840 --> 00:07:44.750 align:middle line:84%
That's not part of the
lecture in this class,

00:07:44.750 --> 00:07:47.830 align:middle line:90%
but kind of a fun thing to do.

00:07:47.830 --> 00:07:53.230 align:middle line:84%
We worked on the distinction
between midi and ps

00:07:53.230 --> 00:07:55.760 align:middle line:90%
in your problem set.

00:07:55.760 --> 00:07:59.235 align:middle line:84%
So let's recall what
does ps stand for.

00:07:59.235 --> 00:08:03.280 align:middle line:90%


00:08:03.280 --> 00:08:05.060 align:middle line:90%
Yeah, pitch space.

00:08:05.060 --> 00:08:07.720 align:middle line:84%
So the pitch space is
the same, in this case,

00:08:07.720 --> 00:08:09.200 align:middle line:90%
as the midi number.

00:08:09.200 --> 00:08:10.640 align:middle line:90%
They're exactly the same.

00:08:10.640 --> 00:08:16.770 align:middle line:84%
Some things we can do, though,
is let's say you set it to 70.5.

00:08:16.770 --> 00:08:18.350 align:middle line:90%
Does that have a name?

00:08:18.350 --> 00:08:18.860 align:middle line:90%
Yep.

00:08:18.860 --> 00:08:21.320 align:middle line:90%
That's kind of weird thing.

00:08:21.320 --> 00:08:24.500 align:middle line:90%
You can get its full name--

00:08:24.500 --> 00:08:25.290 align:middle line:90%
B half flat.

00:08:25.290 --> 00:08:28.920 align:middle line:84%
OK, so we're learning certain
things that we can do with this.

00:08:28.920 --> 00:08:34.350 align:middle line:84%
But p's ps is 70.5, but
midi must be around numbers.

00:08:34.350 --> 00:08:38.155 align:middle line:84%
So it's, I guess,
just B natural.

00:08:38.155 --> 00:08:41.210 align:middle line:90%


00:08:41.210 --> 00:08:46.610 align:middle line:84%
The other thing is if
we go to really low B--

00:08:46.610 --> 00:08:48.090 align:middle line:90%
was it really low B flat?

00:08:48.090 --> 00:08:48.980 align:middle line:90%
No, really low--

00:08:48.980 --> 00:08:52.250 align:middle line:90%


00:08:52.250 --> 00:08:53.480 align:middle line:90%
It was just B natural.

00:08:53.480 --> 00:08:59.670 align:middle line:84%
Really low B, and get
its octave negative six.

00:08:59.670 --> 00:09:05.540 align:middle line:90%
Get its name and get its ps.

00:09:05.540 --> 00:09:07.590 align:middle line:90%
Wow, that's extremely low.

00:09:07.590 --> 00:09:08.360 align:middle line:90%
That's, what?

00:09:08.360 --> 00:09:12.230 align:middle line:84%
Is that 109 notes
below middle C?

00:09:12.230 --> 00:09:15.340 align:middle line:84%
But its midi number
is constrained

00:09:15.340 --> 00:09:17.560 align:middle line:90%
to be between zero and 127.

00:09:17.560 --> 00:09:20.690 align:middle line:84%
OK, these are just kind of fun
things to play around with.

00:09:20.690 --> 00:09:26.050 align:middle line:84%
You can do a directory
on any Pitch object

00:09:26.050 --> 00:09:29.017 align:middle line:90%
and see some of them.

00:09:29.017 --> 00:09:30.850 align:middle line:84%
The things that are in
here, ignore the ones

00:09:30.850 --> 00:09:32.410 align:middle line:90%
with underscores for now.

00:09:32.410 --> 00:09:34.630 align:middle line:90%
We can see that--

00:09:34.630 --> 00:09:37.400 align:middle line:90%
oh, there's the frequency.

00:09:37.400 --> 00:09:39.123 align:middle line:90%
So let's create.

00:09:39.123 --> 00:09:44.500 align:middle line:90%


00:09:44.500 --> 00:09:45.970 align:middle line:84%
What's the only
one that most of us

00:09:45.970 --> 00:09:50.620 align:middle line:84%
know the frequency of
on the top of our head?

00:09:50.620 --> 00:09:51.160 align:middle line:90%
Great.

00:09:51.160 --> 00:09:52.760 align:middle line:90%
A4 is 440.

00:09:52.760 --> 00:09:54.910 align:middle line:84%
So we're-- well, an
American made this,

00:09:54.910 --> 00:09:57.570 align:middle line:84%
so it's not 442 or
anything like that.

00:09:57.570 --> 00:10:01.900 align:middle line:90%


00:10:01.900 --> 00:10:04.480 align:middle line:84%
So you'll see that
not everything we'll

00:10:04.480 --> 00:10:06.380 align:middle line:90%
be working with here.

00:10:06.380 --> 00:10:09.700 align:middle line:84%
There's certain things-- the
fundamentals and enharmonics

00:10:09.700 --> 00:10:11.730 align:middle line:84%
and stuff like that--
that we'll get to.

00:10:11.730 --> 00:10:24.900 align:middle line:84%
But let's see what some of these
are methods and not attributes.

00:10:24.900 --> 00:10:27.890 align:middle line:84%
So let's do
p.getLowerEnharmonic.

00:10:27.890 --> 00:10:31.280 align:middle line:90%


00:10:31.280 --> 00:10:33.450 align:middle line:84%
And that gives us
a G double flat.

00:10:33.450 --> 00:10:35.840 align:middle line:84%
Maybe we'll make p
an A flat, and now we

00:10:35.840 --> 00:10:37.650 align:middle line:90%
can play around with-- oh, 415.

00:10:37.650 --> 00:10:38.750 align:middle line:90%
Yep, that's lower.

00:10:38.750 --> 00:10:40.290 align:middle line:90%
Enharmonic is G sharp.

00:10:40.290 --> 00:10:47.610 align:middle line:84%
And the higher
enharmonic of A flat--

00:10:47.610 --> 00:10:50.700 align:middle line:90%
think about it in your head.

00:10:50.700 --> 00:10:51.200 align:middle line:90%
Great.

00:10:51.200 --> 00:10:54.110 align:middle line:90%
B triple flat.

00:10:54.110 --> 00:10:55.140 align:middle line:90%
OK.

00:10:55.140 --> 00:10:58.320 align:middle line:90%
By the way, p doesn't change.

00:10:58.320 --> 00:11:03.480 align:middle line:84%
That's what I said about this
being mostly non-mutable.

00:11:03.480 --> 00:11:08.210 align:middle line:84%
So we have to assign that p
triple flat to something else.

00:11:08.210 --> 00:11:14.760 align:middle line:90%
Triple flat and flat.

00:11:14.760 --> 00:11:16.290 align:middle line:90%
Yeah, it's so much.

00:11:16.290 --> 00:11:16.860 align:middle line:90%
Great.

00:11:16.860 --> 00:11:21.870 align:middle line:84%
And now we can do the
B triple flat.name.

00:11:21.870 --> 00:11:25.640 align:middle line:90%
And let's get its full name.

00:11:25.640 --> 00:11:26.140 align:middle line:90%
Great.

00:11:26.140 --> 00:11:30.000 align:middle line:90%


00:11:30.000 --> 00:11:30.670 align:middle line:90%
OK.

00:11:30.670 --> 00:11:33.030 align:middle line:84%
Going back to p, which
is this A flat four.

00:11:33.030 --> 00:11:34.470 align:middle line:84%
One of the other
things we can do

00:11:34.470 --> 00:11:37.290 align:middle line:84%
if we want to have
mutable objects,

00:11:37.290 --> 00:11:41.260 align:middle line:84%
we'll go lower enharmonic
to get the G sharp.

00:11:41.260 --> 00:11:45.450 align:middle line:84%
But let's-- we can do this
particular attribute where we

00:11:45.450 --> 00:11:50.910 align:middle line:90%
can see in place equals true.

00:11:50.910 --> 00:11:52.660 align:middle line:84%
And now it doesn't
return anything,

00:11:52.660 --> 00:11:55.450 align:middle line:84%
but p has switched
from A flat to G sharp.

00:11:55.450 --> 00:11:59.130 align:middle line:84%
So you can do things
however you would like.

00:11:59.130 --> 00:12:02.230 align:middle line:84%
Take a minute now to
explore the system.

00:12:02.230 --> 00:12:03.750 align:middle line:84%
And here are some
questions that I'd

00:12:03.750 --> 00:12:06.960 align:middle line:84%
like you to work on
while you're exploring.

00:12:06.960 --> 00:12:12.240 align:middle line:84%
Number one, what
happens if you create

00:12:12.240 --> 00:12:17.566 align:middle line:90%
a pitch without any arguments?

00:12:17.566 --> 00:12:20.420 align:middle line:90%


00:12:20.420 --> 00:12:25.250 align:middle line:84%
What happens if
you create a pitch

00:12:25.250 --> 00:12:29.305 align:middle line:90%
with a number as an argument?

00:12:29.305 --> 00:12:32.810 align:middle line:90%


00:12:32.810 --> 00:12:33.860 align:middle line:90%
Too big.

00:12:33.860 --> 00:12:44.125 align:middle line:84%
And what happens if you create a
pitch and leave off its octave?

00:12:44.125 --> 00:12:46.880 align:middle line:90%


00:12:46.880 --> 00:12:48.930 align:middle line:84%
OK, those are the
pretty fast ones.

00:12:48.930 --> 00:12:51.670 align:middle line:90%
Now a little bit more fun ones.

00:12:51.670 --> 00:12:54.200 align:middle line:90%


00:12:54.200 --> 00:13:01.336 align:middle line:84%
How are accidentals stored
on a Pitch object in Music21?

00:13:01.336 --> 00:13:05.390 align:middle line:90%


00:13:05.390 --> 00:13:08.496 align:middle line:90%
Do all notes have accidentals?

00:13:08.496 --> 00:13:11.390 align:middle line:90%


00:13:11.390 --> 00:13:13.990 align:middle line:84%
Take a few minutes and work
through that on your own.

00:13:13.990 --> 00:13:21.310 align:middle line:90%


00:13:21.310 --> 00:13:21.940 align:middle line:90%
Great.

00:13:21.940 --> 00:13:22.880 align:middle line:90%
Are you back?

00:13:22.880 --> 00:13:24.423 align:middle line:90%
Let's see what our answers are.

00:13:24.423 --> 00:13:25.840 align:middle line:84%
What happens if
you create a pitch

00:13:25.840 --> 00:13:29.590 align:middle line:90%
without any other arguments?

00:13:29.590 --> 00:13:32.890 align:middle line:84%
We get that it's a
C. And if we get what

00:13:32.890 --> 00:13:36.910 align:middle line:90%
that note's midi number is--

00:13:36.910 --> 00:13:37.760 align:middle line:90%
60.

00:13:37.760 --> 00:13:38.990 align:middle line:90%
So it's a C4.

00:13:38.990 --> 00:13:41.090 align:middle line:84%
OK, something a
little bit strange.

00:13:41.090 --> 00:13:43.740 align:middle line:84%
What if you create a pitch
with a number as its argument?

00:13:43.740 --> 00:13:46.630 align:middle line:90%


00:13:46.630 --> 00:13:47.833 align:middle line:90%
Let's say 61.

00:13:47.833 --> 00:13:51.310 align:middle line:90%


00:13:51.310 --> 00:13:52.000 align:middle line:90%
OK.

00:13:52.000 --> 00:13:54.730 align:middle line:90%
Now we get a C sharp four.

00:13:54.730 --> 00:13:57.020 align:middle line:84%
How does it know
it's not a D flat?

00:13:57.020 --> 00:13:57.550 align:middle line:90%
It doesn't.

00:13:57.550 --> 00:13:59.120 align:middle line:90%
Doesn't really know that.

00:13:59.120 --> 00:14:01.360 align:middle line:90%
Great.

00:14:01.360 --> 00:14:05.440 align:middle line:84%
Now let's see what happens
if you create a pitch

00:14:05.440 --> 00:14:07.160 align:middle line:90%
and leave off its octave.

00:14:07.160 --> 00:14:13.000 align:middle line:84%
I think we might have already
seen this, but C sharp,

00:14:13.000 --> 00:14:15.290 align:middle line:90%
we'll call this.

00:14:15.290 --> 00:14:16.690 align:middle line:90%
It's C sharp.

00:14:16.690 --> 00:14:19.640 align:middle line:90%


00:14:19.640 --> 00:14:21.720 align:middle line:90%
And notice the difference here.

00:14:21.720 --> 00:14:26.450 align:middle line:84%
There's no octave number
shown when we do this.

00:14:26.450 --> 00:14:30.687 align:middle line:84%
But when we look at its
midi, it's still 61.

00:14:30.687 --> 00:14:31.770 align:middle line:90%
Well, what does this mean?

00:14:31.770 --> 00:14:34.460 align:middle line:84%
Well, it means that
certain things,

00:14:34.460 --> 00:14:41.000 align:middle line:84%
we're going to end up treating
octave as something that's

00:14:41.000 --> 00:14:42.090 align:middle line:90%
implicit.

00:14:42.090 --> 00:14:50.690 align:middle line:84%
So here, if we just say
pitch is a C and midi is 60,

00:14:50.690 --> 00:14:54.630 align:middle line:90%
let's get its lower enharmonic.

00:14:54.630 --> 00:14:56.570 align:middle line:90%
That should be a B sharp.

00:14:56.570 --> 00:15:01.580 align:middle line:90%
We'll call it bs or B sharp.

00:15:01.580 --> 00:15:03.920 align:middle line:90%
B sharps are kind of bs.

00:15:03.920 --> 00:15:07.850 align:middle line:84%
And now let's look
at its midi number.

00:15:07.850 --> 00:15:11.330 align:middle line:84%
Oh, it's jumped all
the way up because what

00:15:11.330 --> 00:15:14.340 align:middle line:84%
it tries to do in this case
is if you give it no octave,

00:15:14.340 --> 00:15:17.420 align:middle line:84%
it tries to create everything
in the octave around middle C.

00:15:17.420 --> 00:15:20.230 align:middle line:90%
So that's kind of neat.

00:15:20.230 --> 00:15:21.430 align:middle line:90%
OK.

00:15:21.430 --> 00:15:23.510 align:middle line:84%
The next question is
a little bit harder.

00:15:23.510 --> 00:15:26.720 align:middle line:84%
How are accidentals stored
on a Pitch object in Music21?

00:15:26.720 --> 00:15:31.030 align:middle line:84%
Well let's look
at bs' accidental.

00:15:31.030 --> 00:15:34.780 align:middle line:90%
Accidentally spelled that right.

00:15:34.780 --> 00:15:38.690 align:middle line:84%
And it has this little
character on it,

00:15:38.690 --> 00:15:41.690 align:middle line:84%
which probably means it's
some sort of a object thing.

00:15:41.690 --> 00:15:47.570 align:middle line:84%
So we'll call it acc for
accidental, and see that here.

00:15:47.570 --> 00:15:51.190 align:middle line:90%
And we can get the type of it.

00:15:51.190 --> 00:15:51.920 align:middle line:90%
Oh, OK.

00:15:51.920 --> 00:15:54.920 align:middle line:90%
It is its own object.

00:15:54.920 --> 00:15:59.260 align:middle line:84%
And we can endure
the accidental to see

00:15:59.260 --> 00:16:01.660 align:middle line:90%
certain things that it knows.

00:16:01.660 --> 00:16:05.950 align:middle line:90%
Its alteration, what is that?

00:16:05.950 --> 00:16:06.860 align:middle line:90%
1.2.

00:16:06.860 --> 00:16:12.760 align:middle line:84%
That's the number of semitones
above the accidental list object

00:16:12.760 --> 00:16:13.280 align:middle line:90%
there.

00:16:13.280 --> 00:16:14.530 align:middle line:90%
Great.

00:16:14.530 --> 00:16:17.510 align:middle line:84%
And well, that's
basically the one--

00:16:17.510 --> 00:16:18.630 align:middle line:90%
I mean you can do--

00:16:18.630 --> 00:16:22.430 align:middle line:90%
I think it has a name also.

00:16:22.430 --> 00:16:23.210 align:middle line:90%
Right.

00:16:23.210 --> 00:16:25.280 align:middle line:90%
Well, that's a sharp.

00:16:25.280 --> 00:16:27.870 align:middle line:90%
Dot name equals flat.

00:16:27.870 --> 00:16:30.500 align:middle line:84%
OK, we're going to be
able to change-- oops.

00:16:30.500 --> 00:16:33.020 align:middle line:90%
Flat is string.

00:16:33.020 --> 00:16:35.180 align:middle line:90%
Does this change?

00:16:35.180 --> 00:16:36.290 align:middle line:90%
Hey, it does.

00:16:36.290 --> 00:16:42.240 align:middle line:84%
Now, acc was an attribute
on this B sharp object.

00:16:42.240 --> 00:16:46.430 align:middle line:84%
So now let's see do we change
anything about B sharp.

00:16:46.430 --> 00:16:50.210 align:middle line:90%
Hey, now it's a B flat.

00:16:50.210 --> 00:16:50.940 align:middle line:90%
Name-- great.

00:16:50.940 --> 00:16:52.260 align:middle line:90%
We can see that.

00:16:52.260 --> 00:16:55.860 align:middle line:84%
We can also do
unicode name and get--

00:16:55.860 --> 00:16:57.090 align:middle line:90%
OK, great.

00:16:57.090 --> 00:16:59.043 align:middle line:90%
So we get to see the nice flats.

00:16:59.043 --> 00:17:00.710 align:middle line:84%
If you ever want to
print something out,

00:17:00.710 --> 00:17:02.320 align:middle line:90%
you have all of that.

00:17:02.320 --> 00:17:05.030 align:middle line:90%


00:17:05.030 --> 00:17:07.910 align:middle line:90%
The last question was do all--

00:17:07.910 --> 00:17:08.550 align:middle line:90%
sorry.

00:17:08.550 --> 00:17:09.510 align:middle line:90%
Oh.

00:17:09.510 --> 00:17:10.710 align:middle line:90%
That's a mistake.

00:17:10.710 --> 00:17:14.420 align:middle line:90%
Do all pitches have accidentals?

00:17:14.420 --> 00:17:18.040 align:middle line:90%
So let's try working on that.

00:17:18.040 --> 00:17:19.960 align:middle line:90%
Accidental, obviously, it does.

00:17:19.960 --> 00:17:20.599 align:middle line:90%
Great.

00:17:20.599 --> 00:17:24.349 align:middle line:84%
But what about C
equals pitch.Pitch?

00:17:24.349 --> 00:17:26.210 align:middle line:90%
Let's make a low C here.

00:17:26.210 --> 00:17:26.740 align:middle line:90%
C2.

00:17:26.740 --> 00:17:27.369 align:middle line:90%
Great.

00:17:27.369 --> 00:17:28.520 align:middle line:90%
c.accidental.

00:17:28.520 --> 00:17:32.440 align:middle line:90%


00:17:32.440 --> 00:17:34.450 align:middle line:84%
Oh, did I forget
to print something?

00:17:34.450 --> 00:17:36.910 align:middle line:90%
Well, let's fit the alter on it.

00:17:36.910 --> 00:17:38.300 align:middle line:90%
Oh, we get an error.

00:17:38.300 --> 00:17:46.450 align:middle line:84%
So certain notes do
not have accidental.

00:17:46.450 --> 00:17:49.420 align:middle line:84%
Say, if accidental
is set to none.

00:17:49.420 --> 00:17:53.570 align:middle line:84%
But we can assign it
explicitly an accidental.

00:17:53.570 --> 00:17:58.023 align:middle line:84%
So we can call it
pitch.accidental natural.

00:17:58.023 --> 00:18:01.120 align:middle line:90%


00:18:01.120 --> 00:18:05.890 align:middle line:84%
And now we can see that
it has an accidental

00:18:05.890 --> 00:18:09.760 align:middle line:90%
with an alteration of zero.

00:18:09.760 --> 00:18:11.590 align:middle line:84%
I think this is a
good enough place

00:18:11.590 --> 00:18:13.820 align:middle line:84%
to stop for a little
bit with pitches.

00:18:13.820 --> 00:18:16.180 align:middle line:84%
Take a little break, and
I'll be right back with you

00:18:16.180 --> 00:18:18.300 align:middle line:90%
with durations.

00:18:18.300 --> 00:18:21.000 align:middle line:90%