WEBVTT

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

00:00:02.455 --> 00:00:04.419 align:middle line:90%
[RUSTLING]

00:00:04.419 --> 00:00:07.365 align:middle line:90%
[CLICKING]

00:00:07.365 --> 00:00:10.270 align:middle line:90%


00:00:10.270 --> 00:00:12.020 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: Today, we're

00:00:12.020 --> 00:00:16.490 align:middle line:84%
going to do two really
important things that I really

00:00:16.490 --> 00:00:19.490 align:middle line:84%
want to get through
today, and the first one

00:00:19.490 --> 00:00:24.450 align:middle line:84%
involves the final
project for the class.

00:00:24.450 --> 00:00:28.950 align:middle line:84%
So what I'm going to ask you
to do is to take a minute,

00:00:28.950 --> 00:00:31.970 align:middle line:84%
and after I tell you what
you're going to be doing,

00:00:31.970 --> 00:00:34.650 align:middle line:90%
find a partner.

00:00:34.650 --> 00:00:39.690 align:middle line:84%
If we're not and even number,
you can do one group of three.

00:00:39.690 --> 00:00:44.390 align:middle line:84%
But I prefer groups of two have
tended to work a lot better,

00:00:44.390 --> 00:00:48.200 align:middle line:84%
that you're going to be willing
to work on a project starting

00:00:48.200 --> 00:00:51.690 align:middle line:84%
next week and start thinking
about what you would like to do.

00:00:51.690 --> 00:00:56.570 align:middle line:84%
It can be anything related
to music theory and analysis

00:00:56.570 --> 00:00:59.590 align:middle line:84%
in the symbolic
domain, that is to say,

00:00:59.590 --> 00:01:03.220 align:middle line:84%
working with notes and
scores, not primarily working

00:01:03.220 --> 00:01:06.550 align:middle line:90%
with audio or things like that.

00:01:06.550 --> 00:01:10.780 align:middle line:84%
Would you want to do that, take
Eran Egozy's amazing classes

00:01:10.780 --> 00:01:14.260 align:middle line:84%
where you can do great
projects on audio.

00:01:14.260 --> 00:01:17.810 align:middle line:84%
And it can be a
research type problem.

00:01:17.810 --> 00:01:20.850 align:middle line:84%
You can try to solve
a research problem.

00:01:20.850 --> 00:01:23.950 align:middle line:84%
It can be more of a business
development and entrepreneurship

00:01:23.950 --> 00:01:28.330 align:middle line:84%
type problem, trying to build
a product that does something

00:01:28.330 --> 00:01:32.830 align:middle line:84%
interesting with music theory,
or it can be a creative project.

00:01:32.830 --> 00:01:34.970 align:middle line:84%
I mentioned at the
beginning of the semester,

00:01:34.970 --> 00:01:38.440 align:middle line:84%
but I want to say it
again, the only restriction

00:01:38.440 --> 00:01:41.150 align:middle line:84%
besides primarily
symbolically based

00:01:41.150 --> 00:01:44.390 align:middle line:84%
is that, if you are
doing a creative project,

00:01:44.390 --> 00:01:48.072 align:middle line:84%
I don't want it to be
based on deep learning AI.

00:01:48.072 --> 00:01:52.150 align:middle line:84%
And the reason for that
is as a safety for y'all.

00:01:52.150 --> 00:01:56.440 align:middle line:84%
I've allowed it in the past,
and it hasn't worked very well.

00:01:56.440 --> 00:02:02.980 align:middle line:84%
And we will do a lecture on
AI later on, or a topic on AI,

00:02:02.980 --> 00:02:05.310 align:middle line:84%
and then I'll be able to
explain a little bit more

00:02:05.310 --> 00:02:08.940 align:middle line:84%
on what the constraint
that tends to make those

00:02:08.940 --> 00:02:11.700 align:middle line:90%
projects not work very well.

00:02:11.700 --> 00:02:14.460 align:middle line:84%
So has anybody
already been thinking

00:02:14.460 --> 00:02:16.293 align:middle line:84%
over the course of the
semester of something

00:02:16.293 --> 00:02:17.377 align:middle line:90%
that you're interested in?

00:02:17.377 --> 00:02:19.830 align:middle line:84%
I'm not going to ask you to
say it, but I'm just curious.

00:02:19.830 --> 00:02:22.570 align:middle line:84%
Who's been thinking a little
bit, a little bit, a little bit?

00:02:22.570 --> 00:02:25.110 align:middle line:90%
OK, so some over here.

00:02:25.110 --> 00:02:29.580 align:middle line:84%
So let's take 10
minutes, five minutes

00:02:29.580 --> 00:02:31.960 align:middle line:84%
to find somebody that
you'd like to work with.

00:02:31.960 --> 00:02:34.290 align:middle line:90%
So let's all stand up.

00:02:34.290 --> 00:02:35.630 align:middle line:90%
OK we'll get to--

00:02:35.630 --> 00:02:39.040 align:middle line:90%


00:02:39.040 --> 00:02:41.680 align:middle line:84%
no, actually, your
computers are mostly closed.

00:02:41.680 --> 00:02:44.580 align:middle line:84%
So let me just remind
us a little bit

00:02:44.580 --> 00:02:48.357 align:middle line:84%
of the partitive topic for
the week and talk about some

00:02:48.357 --> 00:02:48.940 align:middle line:90%
of the things.

00:02:48.940 --> 00:02:50.470 align:middle line:90%
Yes, yes, it's down.

00:02:50.470 --> 00:02:51.520 align:middle line:90%
Thank you.

00:02:51.520 --> 00:02:54.180 align:middle line:90%
Just shout when you get that.

00:02:54.180 --> 00:02:57.440 align:middle line:84%
I did remember to turn the
signal back on, but yep.

00:02:57.440 --> 00:03:00.230 align:middle line:90%
Thank you.

00:03:00.230 --> 00:03:04.910 align:middle line:84%
So we're going to talk about
some of the other things

00:03:04.910 --> 00:03:06.680 align:middle line:84%
that we were talking
about last class

00:03:06.680 --> 00:03:08.310 align:middle line:90%
with algorithmic composition.

00:03:08.310 --> 00:03:11.750 align:middle line:84%
So first off, who now
has been able to access

00:03:11.750 --> 00:03:14.390 align:middle line:90%
the ILLIAC suite and recording?

00:03:14.390 --> 00:03:15.450 align:middle line:90%
OK, great, super.

00:03:15.450 --> 00:03:19.010 align:middle line:84%
So we're in a better
position there.

00:03:19.010 --> 00:03:25.820 align:middle line:84%
We talked about whether or
not the ILLIAC suite was more

00:03:25.820 --> 00:03:29.070 align:middle line:84%
written to create music
that sounded like a human,

00:03:29.070 --> 00:03:33.090 align:middle line:84%
or whether it was created
to do something very new.

00:03:33.090 --> 00:03:35.550 align:middle line:84%
And what did we come
to this consensus?

00:03:35.550 --> 00:03:39.260 align:middle line:90%
Anyone want to throw that out?

00:03:39.260 --> 00:03:40.100 align:middle line:90%
Or what did you--

00:03:40.100 --> 00:03:41.610 align:middle line:84%
AUDIENCE: 30 towards
seeing something new?

00:03:41.610 --> 00:03:42.290 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: What's that?

00:03:42.290 --> 00:03:44.220 align:middle line:84%
70/30 toward doing
something new.

00:03:44.220 --> 00:03:45.690 align:middle line:90%
Yeah, yeah, something like that.

00:03:45.690 --> 00:03:49.340 align:middle line:84%
Some percentage, some
mixture of some parts of what

00:03:49.340 --> 00:03:52.380 align:middle line:84%
they were trying to do
really was about, hey,

00:03:52.380 --> 00:03:53.880 align:middle line:90%
this is something humans do.

00:03:53.880 --> 00:03:55.880 align:middle line:84%
Let's see if it can
computer can do it.

00:03:55.880 --> 00:03:58.780 align:middle line:84%
And then there was some
moments, like the one

00:03:58.780 --> 00:04:00.760 align:middle line:84%
with the algorithmic
pudding of claps

00:04:00.760 --> 00:04:03.880 align:middle line:84%
and hitting the violins
and stuff like that

00:04:03.880 --> 00:04:08.190 align:middle line:84%
at different points, which was
a little bit more computery.

00:04:08.190 --> 00:04:12.590 align:middle line:84%
We also talked about Markov
chains in the last class,

00:04:12.590 --> 00:04:15.310 align:middle line:84%
and we'll get a little
bit later on into some

00:04:15.310 --> 00:04:18.430 align:middle line:84%
of the more sophisticated
statistical learning

00:04:18.430 --> 00:04:23.090 align:middle line:84%
that people are doing
today with AI learning.

00:04:23.090 --> 00:04:25.490 align:middle line:84%
But a lot of it is
very, very similar.

00:04:25.490 --> 00:04:29.810 align:middle line:84%
It's just a lot faster,
a lot bigger than things.

00:04:29.810 --> 00:04:32.620 align:middle line:84%
But I want to talk
about some things,

00:04:32.620 --> 00:04:35.285 align:middle line:90%
and we'll to get to that later.

00:04:35.285 --> 00:04:36.410 align:middle line:90%
Pretend I didn't show that.

00:04:36.410 --> 00:04:42.100 align:middle line:84%
So there's two ways
that we can distinguish

00:04:42.100 --> 00:04:43.610 align:middle line:90%
algorithmic composition.

00:04:43.610 --> 00:04:46.210 align:middle line:84%
One of them is whether
it's deterministic

00:04:46.210 --> 00:04:50.590 align:middle line:84%
or if it has a random chance in
it, whether or not every time

00:04:50.590 --> 00:04:53.430 align:middle line:84%
you play the piece
or run the piece,

00:04:53.430 --> 00:04:56.840 align:middle line:84%
it will be a different piece
or it will be the same.

00:04:56.840 --> 00:04:58.560 align:middle line:90%
So I want to start by giving--

00:04:58.560 --> 00:05:02.450 align:middle line:84%
I'm going to go pretty
egotistically with two pieces

00:05:02.450 --> 00:05:03.360 align:middle line:90%
that I've written.

00:05:03.360 --> 00:05:05.068 align:middle line:84%
The first one is not
even really a piece,

00:05:05.068 --> 00:05:06.840 align:middle line:84%
but it's kind of a
little demonstration.

00:05:06.840 --> 00:05:09.980 align:middle line:84%
It starts with a
demo that you might

00:05:09.980 --> 00:05:13.640 align:middle line:84%
have seen in a science class
or physics class, where

00:05:13.640 --> 00:05:17.700 align:middle line:84%
all the balls are moving
at different lengths,

00:05:17.700 --> 00:05:24.440 align:middle line:84%
but they do some interesting
optical illusion effects

00:05:24.440 --> 00:05:27.750 align:middle line:90%
at various times.

00:05:27.750 --> 00:05:28.250 align:middle line:90%
ASMR.

00:05:28.250 --> 00:05:43.993 align:middle line:90%


00:05:43.993 --> 00:05:46.410 align:middle line:84%
AUDIENCE: Is there supposed
to be music in the background?

00:05:46.410 --> 00:05:48.368 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: No, no music yet.

00:05:48.368 --> 00:06:01.400 align:middle line:90%


00:06:01.400 --> 00:06:04.010 align:middle line:84%
OK, so I thought,
what if there was

00:06:04.010 --> 00:06:05.910 align:middle line:90%
a musical equivalent of this?

00:06:05.910 --> 00:06:08.030 align:middle line:84%
What if we could write
a computer program that

00:06:08.030 --> 00:06:13.070 align:middle line:84%
had 12 lines, or eight lines,
or something like that, that all

00:06:13.070 --> 00:06:16.340 align:middle line:84%
started in phase, and then
slowly got out of phase,

00:06:16.340 --> 00:06:18.630 align:middle line:84%
and came back together
like the pendulum?

00:06:18.630 --> 00:06:23.850 align:middle line:84%
And so this is a little
bit what I came up with.

00:06:23.850 --> 00:06:27.308 align:middle line:90%
[MUSICAL NOTES]

00:06:27.308 --> 00:06:58.950 align:middle line:90%


00:06:58.950 --> 00:07:03.690 align:middle line:84%
OK, I can't even follow
my own score properly.

00:07:03.690 --> 00:07:05.935 align:middle line:90%
So what's that?

00:07:05.935 --> 00:07:07.560 align:middle line:84%
AUDIENCE: With the
double dotted 16th--

00:07:07.560 --> 00:07:09.727 align:middle line:84%
MICHAEL SCOTT ASATO CUTHBERT:
16th rest, yeah, yeah.

00:07:09.727 --> 00:07:12.430 align:middle line:84%
So sometimes when you're making
an algorithmic composition,

00:07:12.430 --> 00:07:16.410 align:middle line:84%
maybe you want to think a
little bit about the notation,

00:07:16.410 --> 00:07:18.300 align:middle line:84%
or maybe even better
just to hear it

00:07:18.300 --> 00:07:20.260 align:middle line:84%
without seeing the
notation at all.

00:07:20.260 --> 00:07:24.840 align:middle line:84%
So one of the questions is, if
the computer is just setting it

00:07:24.840 --> 00:07:28.860 align:middle line:84%
up so that each note comes in
at a slightly different time

00:07:28.860 --> 00:07:30.870 align:middle line:84%
from the previous one,
what kinds of things

00:07:30.870 --> 00:07:35.776 align:middle line:84%
does the composer have for her,
or his or their creativity?

00:07:35.776 --> 00:07:40.110 align:middle line:90%


00:07:40.110 --> 00:07:41.200 align:middle line:90%
Yeah, go ahead Jason.

00:07:41.200 --> 00:07:43.140 align:middle line:84%
AUDIENCE: Which notes,
which pitches show up?

00:07:43.140 --> 00:07:44.740 align:middle line:84%
MICHAEL SCOTT ASATO CUTHBERT: So
pitching which pitches show up.

00:07:44.740 --> 00:07:45.430 align:middle line:90%
Good, good.

00:07:45.430 --> 00:07:48.020 align:middle line:90%
Cause that could, in fact--

00:07:48.020 --> 00:07:50.330 align:middle line:90%
let me do it.

00:07:50.330 --> 00:07:52.870 align:middle line:90%
Here is with, instead of using--

00:07:52.870 --> 00:07:54.950 align:middle line:84%
I think I used eight
notes out of the octave.

00:07:54.950 --> 00:07:57.650 align:middle line:90%
Here is all 12 notes.

00:07:57.650 --> 00:08:01.094 align:middle line:90%
[MUSICAL NOTES]

00:08:01.094 --> 00:08:08.980 align:middle line:90%


00:08:08.980 --> 00:08:10.990 align:middle line:84%
And that sounds a
little bit more familiar

00:08:10.990 --> 00:08:13.510 align:middle line:90%
and maybe a little bit closer.

00:08:13.510 --> 00:08:16.845 align:middle line:84%
Why might I not have wanted
to use this as my main piece?

00:08:16.845 --> 00:08:19.994 align:middle line:90%
[MUSICAL NOTES]

00:08:19.994 --> 00:08:22.678 align:middle line:90%


00:08:22.678 --> 00:08:25.220 align:middle line:84%
It has something to do with the
duration of the piece for me,

00:08:25.220 --> 00:08:28.340 align:middle line:84%
that it ended up being
a little bit too long.

00:08:28.340 --> 00:08:30.860 align:middle line:84%
So yeah, definitely
what notes we use.

00:08:30.860 --> 00:08:34.045 align:middle line:90%
[MUSICAL NOTES]

00:08:34.045 --> 00:08:34.960 align:middle line:90%


00:08:34.960 --> 00:08:39.100 align:middle line:84%
We can even go to weird things
that a human can't usually

00:08:39.100 --> 00:08:41.253 align:middle line:90%
play on a piano.

00:08:41.253 --> 00:08:44.557 align:middle line:90%
[MUSICAL NOTES]

00:08:44.557 --> 00:08:46.930 align:middle line:90%


00:08:46.930 --> 00:08:50.500 align:middle line:84%
So this is 19 tone
division of the octave.

00:08:50.500 --> 00:08:53.160 align:middle line:84%
Let's you use a few
more notes per octave.

00:08:53.160 --> 00:08:55.780 align:middle line:90%
[MUSICAL NOTES]

00:08:55.780 --> 00:08:57.400 align:middle line:90%
Oh, blanking.

00:08:57.400 --> 00:08:58.820 align:middle line:90%
It stops the music.

00:08:58.820 --> 00:08:59.320 align:middle line:90%
Good.

00:08:59.320 --> 00:08:59.820 align:middle line:90%
Yeah.

00:08:59.820 --> 00:09:01.100 align:middle line:90%
AUDIENCE: How do you go to 19?

00:09:01.100 --> 00:09:02.810 align:middle line:84%
I would think it would
be 24 or something?

00:09:02.810 --> 00:09:04.268 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: Yeah.

00:09:04.268 --> 00:09:06.610 align:middle line:84%
Sorry, it's a little digression,
but it's kind of cool

00:09:06.610 --> 00:09:08.180 align:middle line:90%
if anybody's interested in it.

00:09:08.180 --> 00:09:15.260 align:middle line:84%
A 19 tone division of the octave
has two pretty cool properties.

00:09:15.260 --> 00:09:20.470 align:middle line:84%
One is that it has major and
minor triads that are very, very

00:09:20.470 --> 00:09:23.110 align:middle line:84%
close to acoustically--
or major and minor thirds

00:09:23.110 --> 00:09:26.510 align:middle line:84%
very close to
acoustically correct,

00:09:26.510 --> 00:09:29.860 align:middle line:84%
while also having perfect
fourths and perfect fifths

00:09:29.860 --> 00:09:30.740 align:middle line:90%
are pretty good.

00:09:30.740 --> 00:09:32.510 align:middle line:90%
So that's one reason.

00:09:32.510 --> 00:09:36.310 align:middle line:84%
The other reason for it is
a lot of 19 tone piano--

00:09:36.310 --> 00:09:39.850 align:middle line:84%
a lot of 19 tone music is
written for two piano duets

00:09:39.850 --> 00:09:46.790 align:middle line:84%
where you keep the five black
keys the same between each

00:09:46.790 --> 00:09:50.870 align:middle line:84%
of the pianos, and then
you retune the white keys

00:09:50.870 --> 00:09:55.927 align:middle line:84%
so that you have a separate
note for each of them.

00:09:55.927 --> 00:09:56.510 align:middle line:90%
Is that right?

00:09:56.510 --> 00:09:59.700 align:middle line:90%
5, 7, 7, 7, 14, and 5?

00:09:59.700 --> 00:10:01.452 align:middle line:90%
Yeah.

00:10:01.452 --> 00:10:02.160 align:middle line:90%
I can't remember.

00:10:02.160 --> 00:10:04.890 align:middle line:84%
It's been a long time since
I wrote for 19 tone piano.

00:10:04.890 --> 00:10:08.090 align:middle line:84%
They don't like tuning our
pianos for that very much.

00:10:08.090 --> 00:10:12.800 align:middle line:84%
But yeah, so it makes it a
little bit more human there.

00:10:12.800 --> 00:10:14.695 align:middle line:90%
Other choices you could do?

00:10:14.695 --> 00:10:20.390 align:middle line:90%


00:10:20.390 --> 00:10:22.100 align:middle line:90%
Instruments.

00:10:22.100 --> 00:10:25.640 align:middle line:84%
You could do how long
it goes, whether it's

00:10:25.640 --> 00:10:27.390 align:middle line:90%
going to be slower, faster.

00:10:27.390 --> 00:10:30.700 align:middle line:84%
So these are some
things we can do.

00:10:30.700 --> 00:10:36.210 align:middle line:84%
So then we'll get into
non-deterministic things.

00:10:36.210 --> 00:10:38.130 align:middle line:90%
And so let's code one up first.

00:10:38.130 --> 00:10:41.930 align:middle line:84%
So go and grab it before I
get to particular pieces that

00:10:41.930 --> 00:10:42.625 align:middle line:90%
are like that.

00:10:42.625 --> 00:10:47.090 align:middle line:90%


00:10:47.090 --> 00:10:49.580 align:middle line:84%
So let's try some of the
things that we might do

00:10:49.580 --> 00:10:52.920 align:middle line:84%
and see how aesthetically
interesting it is.

00:10:52.920 --> 00:10:53.870 align:middle line:90%
Oops.

00:10:53.870 --> 00:10:55.880 align:middle line:90%
Where'd that go?

00:10:55.880 --> 00:10:56.725 align:middle line:90%
Is that over here?

00:10:56.725 --> 00:10:59.420 align:middle line:90%


00:10:59.420 --> 00:11:03.720 align:middle line:84%
OK, gotta look, move this
over as much as I can.

00:11:03.720 --> 00:11:05.480 align:middle line:90%
OK, good.

00:11:05.480 --> 00:11:10.440 align:middle line:84%
Great, so what's the module
you hope I've unlocked?

00:11:10.440 --> 00:11:11.640 align:middle line:90%
It's not part of Music21.

00:11:11.640 --> 00:11:13.640 align:middle line:84%
It's part of Python,
in order to do

00:11:13.640 --> 00:11:15.392 align:middle line:90%
non-deterministic composition.

00:11:15.392 --> 00:11:16.100 align:middle line:90%
AUDIENCE: Random.

00:11:16.100 --> 00:11:17.642 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: Random.

00:11:17.642 --> 00:11:19.880 align:middle line:90%
Great, so let's import random.

00:11:19.880 --> 00:11:24.260 align:middle line:84%
And for now, let's just import
everything from Music21.

00:11:24.260 --> 00:11:25.152 align:middle line:90%
Yep, that's good.

00:11:25.152 --> 00:11:25.860 align:middle line:90%
You can see that.

00:11:25.860 --> 00:11:28.640 align:middle line:90%
Good.

00:11:28.640 --> 00:11:33.170 align:middle line:84%
Who has worked with the
random module before?

00:11:33.170 --> 00:11:35.490 align:middle line:90%
No?

00:11:35.490 --> 00:11:37.100 align:middle line:90%
There's basically everybody.

00:11:37.100 --> 00:11:43.827 align:middle line:84%
You know that random
dot random gives you--

00:11:43.827 --> 00:11:44.910 align:middle line:90%
AUDIENCE: Between 0 and 1.

00:11:44.910 --> 00:11:46.650 align:middle line:84%
MICHAEL SCOTT ASATO CUTHBERT:
Between 0 and 1, yep.

00:11:46.650 --> 00:11:47.530 align:middle line:90%
Oh, shoot.

00:11:47.530 --> 00:11:49.050 align:middle line:90%
No, that's not the same as--

00:11:49.050 --> 00:11:50.910 align:middle line:90%
I might have mistyped.

00:11:50.910 --> 00:11:55.722 align:middle line:84%
I have it here, and it
says it should be 0.23.

00:11:55.722 --> 00:11:56.430 align:middle line:90%
Good, good, good.

00:11:56.430 --> 00:12:00.370 align:middle line:84%
We all know that random-- so in
a lot of languages, of course,

00:12:00.370 --> 00:12:04.030 align:middle line:84%
you'll do, in order to
get between 0 and 100,

00:12:04.030 --> 00:12:06.218 align:middle line:84%
say, you would just
multiply by 100.

00:12:06.218 --> 00:12:07.510 align:middle line:90%
Oh, we did pretty well on that.

00:12:07.510 --> 00:12:09.780 align:middle line:90%
Played the lottery today.

00:12:09.780 --> 00:12:11.410 align:middle line:90%
You just multiply by 100.

00:12:11.410 --> 00:12:17.800 align:middle line:84%
Python also has this
randint from 1 to 100.

00:12:17.800 --> 00:12:22.720 align:middle line:84%
And this is one of the
older modules in Python.

00:12:22.720 --> 00:12:29.040 align:middle line:84%
So it has a little
bit of inconsistency

00:12:29.040 --> 00:12:35.070 align:middle line:84%
with the rest of
Python, in that, well,

00:12:35.070 --> 00:12:37.260 align:middle line:84%
if I do this three
times on average,

00:12:37.260 --> 00:12:42.330 align:middle line:84%
I should be able to see the
inconsistency that it includes

00:12:42.330 --> 00:12:43.390 align:middle line:90%
the final number.

00:12:43.390 --> 00:12:46.870 align:middle line:84%
So if you do range
1 to 100 in Python,

00:12:46.870 --> 00:12:49.660 align:middle line:84%
your last one will be
99 in most languages.

00:12:49.660 --> 00:12:53.040 align:middle line:90%
But this one will include that.

00:12:53.040 --> 00:12:57.870 align:middle line:84%
Really useful-- this might
be all review for somebody--

00:12:57.870 --> 00:13:03.070 align:middle line:84%
is that you can
do random choice.

00:13:03.070 --> 00:13:06.670 align:middle line:84%
So if you have a list of
things or any other algorithm,

00:13:06.670 --> 00:13:10.420 align:middle line:84%
you can randomly
choose one from that.

00:13:10.420 --> 00:13:16.230 align:middle line:84%
And you can do a
weighed choice in this,

00:13:16.230 --> 00:13:21.690 align:middle line:90%
simply by putting in something--

00:13:21.690 --> 00:13:24.960 align:middle line:84%
oops, I hit the wrong
key-- putting in something

00:13:24.960 --> 00:13:26.045 align:middle line:90%
a lot of times.

00:13:26.045 --> 00:13:29.310 align:middle line:90%


00:13:29.310 --> 00:13:32.200 align:middle line:84%
Probably, if you're going
to do this 10,000 by 10,000,

00:13:32.200 --> 00:13:35.140 align:middle line:84%
there's other more efficient
algorithms you can do for this.

00:13:35.140 --> 00:13:38.230 align:middle line:90%


00:13:38.230 --> 00:13:42.080 align:middle line:84%
Questions on randomness
outside of music?

00:13:42.080 --> 00:13:45.100 align:middle line:84%
By the way, there's a
way that you can set it

00:13:45.100 --> 00:13:48.010 align:middle line:84%
up so that it's random
at first, but then you

00:13:48.010 --> 00:13:51.040 align:middle line:84%
can reconstruct your
randomness by doing

00:13:51.040 --> 00:13:53.830 align:middle line:84%
what's called a deterministic
seed, which I'll often

00:13:53.830 --> 00:13:56.815 align:middle line:84%
do when I'm writing
compositions,

00:13:56.815 --> 00:13:58.940 align:middle line:84%
so that if there's something
I really, really like,

00:13:58.940 --> 00:14:02.070 align:middle line:84%
I can reconstruct up until
the point I didn't like it.

00:14:02.070 --> 00:14:05.090 align:middle line:90%


00:14:05.090 --> 00:14:08.290 align:middle line:84%
So let's write, first off,
what we call a random walk

00:14:08.290 --> 00:14:09.410 align:middle line:90%
composition.

00:14:09.410 --> 00:14:12.850 align:middle line:84%
So we're just going to start by
doing something pretty stupid

00:14:12.850 --> 00:14:14.060 align:middle line:90%
and try to make it better.

00:14:14.060 --> 00:14:17.500 align:middle line:84%
So we're going to randomly
walk around the scale.

00:14:17.500 --> 00:14:18.590 align:middle line:90%
We'll start.

00:14:18.590 --> 00:14:22.360 align:middle line:84%
Let's create
something that's going

00:14:22.360 --> 00:14:26.380 align:middle line:84%
to be a useful,
helpful function, which

00:14:26.380 --> 00:14:27.470 align:middle line:90%
I'll call it Multishow.

00:14:27.470 --> 00:14:30.110 align:middle line:84%
You can skip the annotations
while you're doing this.

00:14:30.110 --> 00:14:32.950 align:middle line:84%
So what this does is just
going to take in a stream

00:14:32.950 --> 00:14:39.930 align:middle line:84%
and show it as both
an image and MIDI.

00:14:39.930 --> 00:14:42.640 align:middle line:90%


00:14:42.640 --> 00:14:43.140 align:middle line:90%
Bach.

00:14:43.140 --> 00:14:45.530 align:middle line:84%
We'll just do our favorite
Bach piece just to demo.

00:14:45.530 --> 00:14:50.540 align:middle line:90%
BWV 66.6, multishow, Bach.

00:14:50.540 --> 00:14:55.630 align:middle line:84%
This I find helpful for anytime
I'm working with something.

00:14:55.630 --> 00:14:58.610 align:middle line:84%
It always takes a lot
longer when I'm projecting

00:14:58.610 --> 00:15:03.860 align:middle line:84%
and the first time, but you
get the score and then below.

00:15:03.860 --> 00:15:06.480 align:middle line:84%
That never looks
right on the video.

00:15:06.480 --> 00:15:08.486 align:middle line:90%
Oops.

00:15:08.486 --> 00:15:11.930 align:middle line:90%
[MUSIC PLAYING]

00:15:11.930 --> 00:15:15.471 align:middle line:90%
Yep, that's the piece we know.

00:15:15.471 --> 00:15:17.580 align:middle line:84%
So that's just a useful,
helpful function.

00:15:17.580 --> 00:15:27.770 align:middle line:84%
So one of the parts of
pitches that I find really

00:15:27.770 --> 00:15:30.620 align:middle line:84%
helpful for not being
completely random

00:15:30.620 --> 00:15:33.260 align:middle line:84%
here is this thing
that would have

00:15:33.260 --> 00:15:37.220 align:middle line:84%
been really helpful on that
problem set where you had

00:15:37.220 --> 00:15:39.510 align:middle line:84%
to determine the
number of lines,

00:15:39.510 --> 00:15:43.550 align:middle line:84%
the generic intervals between
notes, if you remember that.

00:15:43.550 --> 00:15:46.520 align:middle line:84%
That's something called
diatonic note number,

00:15:46.520 --> 00:15:47.820 align:middle line:90%
or diatonic note num.

00:15:47.820 --> 00:15:52.710 align:middle line:84%
And this is a concept that I
was really, really surprised.

00:15:52.710 --> 00:15:54.600 align:middle line:84%
I was like, somebody
must have named this,

00:15:54.600 --> 00:15:57.000 align:middle line:84%
and it didn't seem to
have a name before.

00:15:57.000 --> 00:16:01.842 align:middle line:84%
It's simply, just
like MIDI has--

00:16:01.842 --> 00:16:03.800 align:middle line:84%
I don't think I went over
this in class, right?

00:16:03.800 --> 00:16:07.010 align:middle line:84%
No, I don't think so--
that C4, middle C,

00:16:07.010 --> 00:16:12.920 align:middle line:84%
is arbitrarily assigned
to MIDI number 60,

00:16:12.920 --> 00:16:18.090 align:middle line:84%
arbitrarily assigned middle
C to diatonic note number--

00:16:18.090 --> 00:16:20.138 align:middle line:90%
that's MIDI 60--

00:16:20.138 --> 00:16:21.720 align:middle line:90%
29.

00:16:21.720 --> 00:16:24.030 align:middle line:84%
Neither of these are
completely arbitrary.

00:16:24.030 --> 00:16:25.260 align:middle line:90%
There's a reason for them.

00:16:25.260 --> 00:16:27.510 align:middle line:90%
And the notion is that all.

00:16:27.510 --> 00:16:32.170 align:middle line:84%
Cs, C sharps, et cetera,
have diatonic note num 29.

00:16:32.170 --> 00:16:37.410 align:middle line:84%
So C sharp, and that
just tells you--

00:16:37.410 --> 00:16:42.930 align:middle line:84%
C double sharp,
yep, so on, C flat.

00:16:42.930 --> 00:16:44.070 align:middle line:90%
Great.

00:16:44.070 --> 00:16:47.310 align:middle line:84%
And so this is helpful for
writing diatonic music,

00:16:47.310 --> 00:16:51.100 align:middle line:84%
that you can just manipulate the
diatonic note number of a note

00:16:51.100 --> 00:16:56.257 align:middle line:84%
and you don't have to worry
making it sound a little bit

00:16:56.257 --> 00:16:57.090 align:middle line:90%
better or something.

00:16:57.090 --> 00:16:59.160 align:middle line:84%
We should have a
pentatonic note number,

00:16:59.160 --> 00:17:03.430 align:middle line:84%
also, because that makes it
even better to do something.

00:17:03.430 --> 00:17:05.310 align:middle line:90%
So what I'm going to do is--

00:17:05.310 --> 00:17:11.910 align:middle line:84%
and then we can just do n dot
pitch, dot diatonic note num,

00:17:11.910 --> 00:17:20.520 align:middle line:84%
plus equals 4, and move
things around that way.

00:17:20.520 --> 00:17:25.260 align:middle line:84%
If you haven't seen it yet, one
of the things in Music21 that's

00:17:25.260 --> 00:17:29.880 align:middle line:84%
not so good is that you'll
often need to copy things,

00:17:29.880 --> 00:17:31.630 align:middle line:84%
so we'll get to that
in just a little bit.

00:17:31.630 --> 00:17:33.640 align:middle line:90%
But I'm going to import, copy.

00:17:33.640 --> 00:17:39.580 align:middle line:84%
And if you've never
used this copy n--

00:17:39.580 --> 00:17:40.080 align:middle line:90%
oops.

00:17:40.080 --> 00:17:41.040 align:middle line:90%
Copy is a module.

00:17:41.040 --> 00:17:42.060 align:middle line:90%
Copy dot copy.

00:17:42.060 --> 00:17:46.350 align:middle line:90%


00:17:46.350 --> 00:17:49.570 align:middle line:84%
So I did turn n into a
g, and so now it's a g.

00:17:49.570 --> 00:17:51.270 align:middle line:90%
There's two things.

00:17:51.270 --> 00:17:55.830 align:middle line:84%
Who has used the copy
module in Python before?

00:17:55.830 --> 00:17:56.620 align:middle line:90%
No, not too many.

00:17:56.620 --> 00:17:57.520 align:middle line:90%
OK, good.

00:17:57.520 --> 00:18:00.450 align:middle line:84%
So because for
the most part, you

00:18:00.450 --> 00:18:04.058 align:middle line:84%
might just want to just
create another note

00:18:04.058 --> 00:18:05.100 align:middle line:90%
if you wanted to do that.

00:18:05.100 --> 00:18:06.540 align:middle line:90%
Don't need to type that.

00:18:06.540 --> 00:18:09.430 align:middle line:84%
But you can also
copy an existing one.

00:18:09.430 --> 00:18:15.420 align:middle line:84%
And what you'll use much more
is something called deep copy.

00:18:15.420 --> 00:18:18.180 align:middle line:84%
And the difference, you can
see that copying the note

00:18:18.180 --> 00:18:20.410 align:middle line:90%
gives you a note that's g.

00:18:20.410 --> 00:18:22.660 align:middle line:84%
Deep copying gives
it a note that's g.

00:18:22.660 --> 00:18:27.450 align:middle line:84%
The difference is
that, well, here.

00:18:27.450 --> 00:18:30.730 align:middle line:90%
Easier to show than tell.

00:18:30.730 --> 00:18:40.390 align:middle line:84%
And c is going to be the copy of
n, and we'll say dc is the d--

00:18:40.390 --> 00:18:42.290 align:middle line:90%
my computer just froze.

00:18:42.290 --> 00:18:43.330 align:middle line:90%
There we go.

00:18:43.330 --> 00:18:45.360 align:middle line:90%
dc is the deep copy of n.

00:18:45.360 --> 00:18:49.030 align:middle line:90%


00:18:49.030 --> 00:18:51.670 align:middle line:84%
The difference is,
so here, we'll just

00:18:51.670 --> 00:18:56.200 align:middle line:84%
make sure that they're all here,
they're all, yep, three notes.

00:18:56.200 --> 00:19:03.970 align:middle line:84%
Difference is if we take
n's pitch diatonic note num

00:19:03.970 --> 00:19:17.260 align:middle line:84%
and go up 4 more, that the
copy of n also changes,

00:19:17.260 --> 00:19:21.980 align:middle line:84%
whereas the deep
copy doesn't change.

00:19:21.980 --> 00:19:27.790 align:middle line:84%
And so what some people might
think of this as, you end up

00:19:27.790 --> 00:19:30.790 align:middle line:84%
working with arrays in
a lot of other languages

00:19:30.790 --> 00:19:32.800 align:middle line:84%
and stuff that copying
an array, you still

00:19:32.800 --> 00:19:34.970 align:middle line:84%
have references to
the internal pointers.

00:19:34.970 --> 00:19:38.350 align:middle line:84%
So anything that is
itself an object,

00:19:38.350 --> 00:19:46.660 align:middle line:84%
like n.pitch and nc.pitch
will still be the same

00:19:46.660 --> 00:19:48.495 align:middle line:90%
under a shallow or normal copy.

00:19:48.495 --> 00:19:54.520 align:middle line:90%


00:19:54.520 --> 00:19:59.080 align:middle line:84%
But with a deep copy,
they're different.

00:19:59.080 --> 00:20:01.960 align:middle line:90%
Deep copies, pitch.

00:20:01.960 --> 00:20:05.200 align:middle line:84%
So you'll find when
you're manipulating things

00:20:05.200 --> 00:20:07.750 align:middle line:84%
and you get to a particular
point in the score,

00:20:07.750 --> 00:20:11.410 align:middle line:84%
and now you want to add
something else that's

00:20:11.410 --> 00:20:13.840 align:middle line:84%
a manipulation of what came
before, you'll want to make

00:20:13.840 --> 00:20:16.180 align:middle line:90%
a deep copy of it beforehand.

00:20:16.180 --> 00:20:17.090 align:middle line:90%
Does that make sense?

00:20:17.090 --> 00:20:18.490 align:middle line:90%
Cool?

00:20:18.490 --> 00:20:19.100 align:middle line:90%
Any questions?

00:20:19.100 --> 00:20:19.390 align:middle line:90%
Yeah.

00:20:19.390 --> 00:20:21.265 align:middle line:84%
AUDIENCE: What did you
show in the last part?

00:20:21.265 --> 00:20:24.585 align:middle line:84%
It's like the pitch is going
to be different by definition?

00:20:24.585 --> 00:20:26.460 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: Oh, sure, sure.

00:20:26.460 --> 00:20:29.580 align:middle line:84%
I think it's a little bit hard
because this is this part here.

00:20:29.580 --> 00:20:32.000 align:middle line:84%
So when you make a
shallow copy and you

00:20:32.000 --> 00:20:36.870 align:middle line:84%
change some nested
structure within there,

00:20:36.870 --> 00:20:41.690 align:middle line:84%
like a pitch or a
duration, it will not be--

00:20:41.690 --> 00:20:43.320 align:middle line:90%
they're all shared.

00:20:43.320 --> 00:20:47.898 align:middle line:84%
So what you do is
think of it as--

00:20:47.898 --> 00:20:48.440 align:middle line:90%
I don't know.

00:20:48.440 --> 00:20:50.390 align:middle line:84%
What's something
else that's not so?

00:20:50.390 --> 00:20:53.480 align:middle line:90%
So n is a note and n has--

00:20:53.480 --> 00:20:55.070 align:middle line:90%
I wish I had set this before.

00:20:55.070 --> 00:21:03.020 align:middle line:84%
ID equals note, and dot pitch
equals some of a pitch dot pitch

00:21:03.020 --> 00:21:03.520 align:middle line:90%
object.

00:21:03.520 --> 00:21:07.160 align:middle line:90%


00:21:07.160 --> 00:21:15.320 align:middle line:84%
And dot duration, let's say, dur
is some kind of duration object.

00:21:15.320 --> 00:21:21.930 align:middle line:84%
When you do a shallow
copy and c will be nc's ID

00:21:21.930 --> 00:21:32.000 align:middle line:84%
equals n's ID, and nc's
pitch equals nc, n's pitch.

00:21:32.000 --> 00:21:34.530 align:middle line:90%


00:21:34.530 --> 00:21:39.550 align:middle line:84%
And so since ID is just a
string or something like that,

00:21:39.550 --> 00:21:44.280 align:middle line:84%
once it's copied over, they have
no connection to each other.

00:21:44.280 --> 00:21:47.610 align:middle line:84%
But since we've
copied the pitch over,

00:21:47.610 --> 00:21:51.870 align:middle line:84%
and it's a complex object
when you change something

00:21:51.870 --> 00:21:56.220 align:middle line:84%
on this, when this
manipulates, this manipulates.

00:21:56.220 --> 00:22:03.330 align:middle line:84%
So with a deep copy, what
you do is dc dot pitch.

00:22:03.330 --> 00:22:04.180 align:middle line:90%
Hold that.

00:22:04.180 --> 00:22:06.970 align:middle line:84%
First let's do a deep
copy of the pitch.

00:22:06.970 --> 00:22:08.790 align:middle line:84%
And so you keep
going down and you

00:22:08.790 --> 00:22:11.765 align:middle line:84%
make sure that nothing is
connected between the two.

00:22:11.765 --> 00:22:14.660 align:middle line:90%


00:22:14.660 --> 00:22:17.020 align:middle line:84%
AUDIENCE: So this also is
slightly misleading, right?

00:22:17.020 --> 00:22:20.190 align:middle line:84%
Because there's nothing that
actually says nc.pitch pitch

00:22:20.190 --> 00:22:22.360 align:middle line:90%
is equal to n.pitch.

00:22:22.360 --> 00:22:24.720 align:middle line:90%
In fact, that's the whole point.

00:22:24.720 --> 00:22:27.070 align:middle line:84%
If it did, that would be an
example of deep copy, right?

00:22:27.070 --> 00:22:28.445 align:middle line:84%
MICHAEL SCOTT
ASATO CUTHBERT: No,

00:22:28.445 --> 00:22:30.970 align:middle line:84%
because you're referencing
the same object in point.

00:22:30.970 --> 00:22:33.750 align:middle line:84%
So when you say n dot
pitch, it's actually

00:22:33.750 --> 00:22:35.910 align:middle line:84%
thinking in the
computer, oh, that

00:22:35.910 --> 00:22:41.430 align:middle line:84%
is the complex object being
stored at some random memory

00:22:41.430 --> 00:22:42.437 align:middle line:90%
location somewhere.

00:22:42.437 --> 00:22:44.520 align:middle line:84%
AUDIENCE: OK, so it's still
pointing to the label.

00:22:44.520 --> 00:22:44.820 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: So it's still

00:22:44.820 --> 00:22:46.030 align:middle line:90%
pointing to the same label.

00:22:46.030 --> 00:22:47.380 align:middle line:90%
Yeah, so exactly.

00:22:47.380 --> 00:22:51.840 align:middle line:84%
For people who know that
kind of terminology,

00:22:51.840 --> 00:22:54.150 align:middle line:84%
it's pointing to the same
label, whereas this one

00:22:54.150 --> 00:22:56.130 align:middle line:84%
goes to the label,
and copies everything

00:22:56.130 --> 00:23:00.120 align:middle line:90%
and makes a new pointer.

00:23:00.120 --> 00:23:03.160 align:middle line:84%
So that ends up being
pretty important.

00:23:03.160 --> 00:23:07.710 align:middle line:84%
And if anybody wants to make
their final project making

00:23:07.710 --> 00:23:10.350 align:middle line:84%
Music21 faster, you
could find places

00:23:10.350 --> 00:23:12.990 align:middle line:84%
that we deep copy
more than we have to

00:23:12.990 --> 00:23:18.280 align:middle line:84%
because that's the slowest
thing in what's happening.

00:23:18.280 --> 00:23:19.820 align:middle line:90%
Too much of an aside.

00:23:19.820 --> 00:23:21.380 align:middle line:90%
Back to some music.

00:23:21.380 --> 00:23:21.940 align:middle line:90%
Great.

00:23:21.940 --> 00:23:25.220 align:middle line:84%
So we'll get back to our
random walk composition

00:23:25.220 --> 00:23:28.660 align:middle line:90%
once I find where this went.

00:23:28.660 --> 00:23:30.850 align:middle line:90%
Yeah, here we go.

00:23:30.850 --> 00:23:34.340 align:middle line:84%
Great, so we're going to be
copying things pretty soon.

00:23:34.340 --> 00:23:36.680 align:middle line:90%
But first, let's just create.

00:23:36.680 --> 00:23:40.840 align:middle line:84%
We'll create a generic stream,
which we rarely do nowadays.

00:23:40.840 --> 00:23:42.830 align:middle line:84%
Maybe we want to make
it a part or something.

00:23:42.830 --> 00:23:44.930 align:middle line:84%
But generic stream
will work pretty well.

00:23:44.930 --> 00:23:50.740 align:middle line:84%
And let's just say for i in
range 30, let's just append

00:23:50.740 --> 00:23:53.230 align:middle line:90%
30 random notes.

00:23:53.230 --> 00:23:56.720 align:middle line:90%
Or no, let's do this.

00:23:56.720 --> 00:24:00.130 align:middle line:90%
No, let's start on c, current.

00:24:00.130 --> 00:24:01.640 align:middle line:90%
Well, we'll just call it cur.

00:24:01.640 --> 00:24:04.330 align:middle line:84%
That's the current
diatonic note number.

00:24:04.330 --> 00:24:07.300 align:middle line:84%
When we're coding fast,
we don't need my obsession

00:24:07.300 --> 00:24:08.180 align:middle line:90%
with long variables.

00:24:08.180 --> 00:24:13.750 align:middle line:84%
So we'll say note equals
note dot note, and pitch

00:24:13.750 --> 00:24:19.300 align:middle line:84%
diatonic note num
equals the current one.

00:24:19.300 --> 00:24:21.280 align:middle line:90%
And that works pretty well.

00:24:21.280 --> 00:24:22.795 align:middle line:90%
Stream, append.

00:24:22.795 --> 00:24:24.500 align:middle line:90%
AUDIENCE: It's called cur now.

00:24:24.500 --> 00:24:25.990 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: Sorry, thank you.

00:24:25.990 --> 00:24:27.282 align:middle line:90%
That's why I shouldn't do that.

00:24:27.282 --> 00:24:27.890 align:middle line:90%
Thank you.

00:24:27.890 --> 00:24:29.630 align:middle line:90%
Please, always just do that.

00:24:29.630 --> 00:24:30.460 align:middle line:90%
I appreciate that.

00:24:30.460 --> 00:24:31.793 align:middle line:90%
Big help.

00:24:31.793 --> 00:24:33.460 align:middle line:84%
And we'll just say
we're going to choose

00:24:33.460 --> 00:24:37.130 align:middle line:84%
between going down a step,
going up a step, and so on.

00:24:37.130 --> 00:24:39.800 align:middle line:84%
So our first note
will always be--

00:24:39.800 --> 00:24:40.300 align:middle line:90%
AUDIENCE: C.

00:24:40.300 --> 00:24:41.960 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: C, C4.

00:24:41.960 --> 00:24:43.890 align:middle line:90%
And now let's multi-show that.

00:24:43.890 --> 00:24:46.570 align:middle line:90%


00:24:46.570 --> 00:24:50.810 align:middle line:84%
Pretty boring piece,
but here we go.

00:24:50.810 --> 00:24:53.120 align:middle line:84%
Oh, this one went
down this time.

00:24:53.120 --> 00:24:56.431 align:middle line:90%
[MUSICAL NOTES]

00:24:56.431 --> 00:24:58.330 align:middle line:90%


00:24:58.330 --> 00:24:58.840 align:middle line:90%
Et cetera.

00:24:58.840 --> 00:25:00.530 align:middle line:90%
Anybody's more interesting?

00:25:00.530 --> 00:25:02.290 align:middle line:90%
Anyone's go up?

00:25:02.290 --> 00:25:05.140 align:middle line:90%
Anyone's just hit Play?

00:25:05.140 --> 00:25:06.280 align:middle line:90%
Yeah.

00:25:06.280 --> 00:25:08.890 align:middle line:90%
So not a great piece.

00:25:08.890 --> 00:25:10.450 align:middle line:84%
The easiest thing
I could do to make

00:25:10.450 --> 00:25:12.350 align:middle line:84%
it a little bit
better, by the way,

00:25:12.350 --> 00:25:15.490 align:middle line:84%
would be to make my number
of notes I attach be--

00:25:15.490 --> 00:25:16.530 align:middle line:90%
what do you call it?

00:25:16.530 --> 00:25:19.071 align:middle line:90%
A multiple of 4.

00:25:19.071 --> 00:25:19.830 align:middle line:90%
But OK.

00:25:19.830 --> 00:25:21.860 align:middle line:84%
So let's move on to do
some things that are

00:25:21.860 --> 00:25:24.590 align:middle line:90%
a little bit more interesting.

00:25:24.590 --> 00:25:28.490 align:middle line:84%
Maybe we could do
something like this.

00:25:28.490 --> 00:25:31.170 align:middle line:84%
I'm going to copy and
paste a lot on this,

00:25:31.170 --> 00:25:35.660 align:middle line:84%
so we can go ahead and just
tweak what we're doing.

00:25:35.660 --> 00:25:38.430 align:middle line:84%
You, in fact, probably don't
even need to copy and paste.

00:25:38.430 --> 00:25:40.530 align:middle line:84%
You can just keep tweaking
the same cell forever.

00:25:40.530 --> 00:25:43.190 align:middle line:84%
So what's something we should do
to make this a little bit more

00:25:43.190 --> 00:25:44.130 align:middle line:90%
interesting?

00:25:44.130 --> 00:25:49.310 align:middle line:90%


00:25:49.310 --> 00:25:50.660 align:middle line:90%
Rhythm.

00:25:50.660 --> 00:25:51.390 align:middle line:90%
Great.

00:25:51.390 --> 00:25:57.068 align:middle line:84%
So let's have each note and
dot duration, dot something.

00:25:57.068 --> 00:25:57.985 align:middle line:90%
What do we want to do?

00:25:57.985 --> 00:26:04.700 align:middle line:90%


00:26:04.700 --> 00:26:07.280 align:middle line:84%
AUDIENCE: I'm just thinking
about something for--

00:26:07.280 --> 00:26:08.490 align:middle line:90%
it wasn't for a duration.

00:26:08.490 --> 00:26:09.170 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: OK, then hold

00:26:09.170 --> 00:26:12.390 align:middle line:84%
it when we get-- let's finish
the duration, and then yeah,

00:26:12.390 --> 00:26:14.240 align:middle line:90%
then we'll get to it.

00:26:14.240 --> 00:26:14.870 align:middle line:90%
John?

00:26:14.870 --> 00:26:20.000 align:middle line:84%
AUDIENCE: A choice for 4s
to choose a quarter, a half,

00:26:20.000 --> 00:26:21.780 align:middle line:90%
eighth, n for the duration.

00:26:21.780 --> 00:26:23.280 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: Great.

00:26:23.280 --> 00:26:25.100 align:middle line:90%
So random choice.

00:26:25.100 --> 00:26:26.810 align:middle line:84%
While I start typing
this out, what

00:26:26.810 --> 00:26:34.760 align:middle line:84%
goes after the n dot duration
dot quarter, half, eighth?

00:26:34.760 --> 00:26:39.080 align:middle line:84%
Anyone remember
what this is called?

00:26:39.080 --> 00:26:39.750 align:middle line:90%
It's unhelpful.

00:26:39.750 --> 00:26:41.460 align:middle line:90%
It's called the type.

00:26:41.460 --> 00:26:43.010 align:middle line:84%
The type quarter
length, we would

00:26:43.010 --> 00:26:48.030 align:middle line:84%
have to say we could put
it in as one, two, half.

00:26:48.030 --> 00:26:50.300 align:middle line:90%
Yep.

00:26:50.300 --> 00:26:55.296 align:middle line:84%
Let's see if that makes
it a little bit nicer.

00:26:55.296 --> 00:26:58.790 align:middle line:90%
[MUSICAL NOTES]

00:26:58.790 --> 00:27:01.520 align:middle line:90%
It's actually already nicer.

00:27:01.520 --> 00:27:03.390 align:middle line:84%
Usually, this
doesn't help as much.

00:27:03.390 --> 00:27:06.950 align:middle line:90%
[MUSICAL NOTES]

00:27:06.950 --> 00:27:08.720 align:middle line:90%


00:27:08.720 --> 00:27:11.610 align:middle line:84%
Next improvement I'm just
going to keep going on this.

00:27:11.610 --> 00:27:12.420 align:middle line:90%
Yeah.

00:27:12.420 --> 00:27:14.850 align:middle line:84%
AUDIENCE: You can
make it [INAUDIBLE].

00:27:14.850 --> 00:27:15.630 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: What's that?

00:27:15.630 --> 00:27:16.950 align:middle line:84%
AUDIENCE: You can
make it go up a third.

00:27:16.950 --> 00:27:17.615 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: Cool.

00:27:17.615 --> 00:27:19.780 align:middle line:84%
Yep, it can go up a
third or down a third.

00:27:19.780 --> 00:27:23.975 align:middle line:84%
Now, do we want to make it a
weighed probability at all?

00:27:23.975 --> 00:27:27.210 align:middle line:90%


00:27:27.210 --> 00:27:28.710 align:middle line:90%
So how much more do we want it?

00:27:28.710 --> 00:27:32.740 align:middle line:84%
Up a third is minus 2, because
we're thinking in computer

00:27:32.740 --> 00:27:34.830 align:middle line:84%
think, not in
music theory think.

00:27:34.830 --> 00:27:36.506 align:middle line:90%
So that would be unweighed.

00:27:36.506 --> 00:27:40.170 align:middle line:90%


00:27:40.170 --> 00:27:46.620 align:middle line:84%
And how do we want to weigh this
to make it feel more musical?

00:27:46.620 --> 00:27:48.460 align:middle line:84%
AUDIENCE: Higher weight
on stepwise motion?

00:27:48.460 --> 00:27:50.793 align:middle line:84%
MICHAEL SCOTT ASATO CUTHBERT:
Higher weight on stepwise.

00:27:50.793 --> 00:27:52.320 align:middle line:90%


00:27:52.320 --> 00:27:54.930 align:middle line:90%
Negative 1, negative 1, 1, 1.

00:27:54.930 --> 00:27:57.005 align:middle line:90%
OK, let's try that.

00:27:57.005 --> 00:28:01.912 align:middle line:90%


00:28:01.912 --> 00:28:05.398 align:middle line:90%
[MUSICAL NOTES]

00:28:05.398 --> 00:28:12.370 align:middle line:90%


00:28:12.370 --> 00:28:13.950 align:middle line:90%
Hey, there's our first step.

00:28:13.950 --> 00:28:16.790 align:middle line:90%
[MUSICAL NOTES]

00:28:16.790 --> 00:28:17.690 align:middle line:90%
Not so good.

00:28:17.690 --> 00:28:19.390 align:middle line:84%
OK, so we still
need some things.

00:28:19.390 --> 00:28:20.660 align:middle line:90%
That's definite improvement.

00:28:20.660 --> 00:28:21.790 align:middle line:90%
Thank you.

00:28:21.790 --> 00:28:23.640 align:middle line:90%
Another thing to improve.

00:28:23.640 --> 00:28:27.550 align:middle line:90%


00:28:27.550 --> 00:28:28.223 align:middle line:90%
Yeah, Jason.

00:28:28.223 --> 00:28:30.640 align:middle line:84%
AUDIENCE: Decrease the weight
on staying on the same note?

00:28:30.640 --> 00:28:31.570 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: Decrease the weight

00:28:31.570 --> 00:28:32.737 align:middle line:90%
on staying on the same note.

00:28:32.737 --> 00:28:35.680 align:middle line:84%
OK, so what we can
do is the easiest way

00:28:35.680 --> 00:28:38.090 align:middle line:84%
when you're programming really
fast in front of a class--

00:28:38.090 --> 00:28:40.560 align:middle line:90%
do that-- is cut and paste.

00:28:40.560 --> 00:28:42.560 align:middle line:84%
Don't do this in your
actual things you turn in.

00:28:42.560 --> 00:28:46.070 align:middle line:84%
But cut and paste and
just delete that 0.

00:28:46.070 --> 00:28:46.650 align:middle line:90%
Is that good?

00:28:46.650 --> 00:28:52.750 align:middle line:90%


00:28:52.750 --> 00:28:54.890 align:middle line:84%
Yeah, it already looks
a little bit better.

00:28:54.890 --> 00:28:58.690 align:middle line:84%
Next, let's do another
improvement on rhythm.

00:28:58.690 --> 00:28:59.740 align:middle line:90%
Yeah.

00:28:59.740 --> 00:29:02.050 align:middle line:84%
AUDIENCE: It's more
likely you have

00:29:02.050 --> 00:29:05.912 align:middle line:90%
a note starting on beat one.

00:29:05.912 --> 00:29:07.370 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: Good.

00:29:07.370 --> 00:29:09.850 align:middle line:84%
So we want to try
to weigh it somehow

00:29:09.850 --> 00:29:14.440 align:middle line:84%
so that we have notes that
start on the downbeat more.

00:29:14.440 --> 00:29:17.810 align:middle line:84%
Talk with your neighbor on
how you might implement that.

00:29:17.810 --> 00:29:19.072 align:middle line:90%
[INTERPOSING VOICES]

00:29:19.072 --> 00:29:21.530 align:middle line:84%
MICHAEL SCOTT ASATO CUTHBERT:
OK, let's come back together.

00:29:21.530 --> 00:29:22.202 align:middle line:90%
Anybody?

00:29:22.202 --> 00:29:24.085 align:middle line:90%
[INTERPOSING VOICES]

00:29:24.085 --> 00:29:25.460 align:middle line:84%
MICHAEL SCOTT
ASATO CUTHBERT: OK.

00:29:25.460 --> 00:29:29.598 align:middle line:84%
Let's jump in, well, and we'll
try to program it together

00:29:29.598 --> 00:29:30.890 align:middle line:90%
because we'll do this in class.

00:29:30.890 --> 00:29:32.680 align:middle line:84%
Somebody I haven't
heard from yet

00:29:32.680 --> 00:29:36.000 align:middle line:84%
want to give a suggestion
who hasn't unspoken?

00:29:36.000 --> 00:29:38.770 align:middle line:90%


00:29:38.770 --> 00:29:39.453 align:middle line:90%
Yeah?

00:29:39.453 --> 00:29:40.870 align:middle line:84%
AUDIENCE: We can
try to keep track

00:29:40.870 --> 00:29:43.910 align:middle line:84%
of an offset, and then based on
that offset, have a different--

00:29:43.910 --> 00:29:45.310 align:middle line:84%
MICHAEL SCOTT ASATO CUTHBERT:
So have a different probability

00:29:45.310 --> 00:29:46.250 align:middle line:90%
based on the offset.

00:29:46.250 --> 00:29:51.320 align:middle line:84%
What offsets in currently with
the default time signature 4/4?

00:29:51.320 --> 00:29:53.360 align:middle line:84%
Why do we make that
default very hegemonic.

00:29:53.360 --> 00:30:00.743 align:middle line:84%
But what offsets
represent the downbeat?

00:30:00.743 --> 00:30:07.250 align:middle line:90%


00:30:07.250 --> 00:30:08.060 align:middle line:90%
AUDIENCE: Zero.

00:30:08.060 --> 00:30:09.080 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: Zero definitely

00:30:09.080 --> 00:30:10.080 align:middle line:90%
represents a downbeat.

00:30:10.080 --> 00:30:11.840 align:middle line:90%
What other offsets?

00:30:11.840 --> 00:30:14.550 align:middle line:84%
So have we been creating
measures, by the way.

00:30:14.550 --> 00:30:16.140 align:middle line:90%
First off, let's look at that.

00:30:16.140 --> 00:30:20.540 align:middle line:84%
So we've kind of
taking advantage

00:30:20.540 --> 00:30:24.000 align:middle line:84%
of Music21 or something
creating measures for us.

00:30:24.000 --> 00:30:26.390 align:middle line:84%
So our offsets, we
start with zero,

00:30:26.390 --> 00:30:27.900 align:middle line:90%
and then we're just appending.

00:30:27.900 --> 00:30:30.113 align:middle line:90%
So what's our next downbeat?

00:30:30.113 --> 00:30:33.260 align:middle line:90%


00:30:33.260 --> 00:30:34.122 align:middle line:90%
AUDIENCE: Four.

00:30:34.122 --> 00:30:35.580 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: Good.

00:30:35.580 --> 00:30:38.780 align:middle line:84%
And somebody else, what's
our general formula we're

00:30:38.780 --> 00:30:43.700 align:middle line:90%
going to find for downbeat?

00:30:43.700 --> 00:30:46.130 align:middle line:90%
AUDIENCE: 0 mod 4?

00:30:46.130 --> 00:30:48.950 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: Yeah, we

00:30:48.950 --> 00:30:55.402 align:middle line:84%
could check if the
offset is mod 4 is 0.

00:30:55.402 --> 00:31:00.560 align:middle line:84%
So we'll get to, before
we do that, so let's

00:31:00.560 --> 00:31:04.560 align:middle line:90%
say, what's our current offset.

00:31:04.560 --> 00:31:05.990 align:middle line:84%
So one of the
things we can do is

00:31:05.990 --> 00:31:09.390 align:middle line:84%
we can keep track of
our current offset.

00:31:09.390 --> 00:31:11.570 align:middle line:84%
Now, we're going
to wish we had--

00:31:11.570 --> 00:31:12.720 align:middle line:90%
0.0.

00:31:12.720 --> 00:31:15.690 align:middle line:84%
Now we're going to wish we had
done this as quarter lengths.

00:31:15.690 --> 00:31:21.600 align:middle line:84%
So I'm going to rewrite
this as quarter length.

00:31:21.600 --> 00:31:22.100 align:middle line:90%
Why?

00:31:22.100 --> 00:31:24.260 align:middle line:84%
Because it's easier to add
quarter lengths than it

00:31:24.260 --> 00:31:24.930 align:middle line:90%
is types.

00:31:24.930 --> 00:31:29.930 align:middle line:90%


00:31:29.930 --> 00:31:32.300 align:middle line:90%
So 1, 2, 0.5.

00:31:32.300 --> 00:31:40.056 align:middle line:84%
And we'll just say ql
equals random.choice.

00:31:40.056 --> 00:31:43.430 align:middle line:90%


00:31:43.430 --> 00:31:48.105 align:middle line:84%
So what we can do
is, well, now, I'm

00:31:48.105 --> 00:31:50.480 align:middle line:84%
just going to make sure that
I still have a current thing

00:31:50.480 --> 00:31:57.530 align:middle line:90%
and cur_offset plus equals ql.

00:31:57.530 --> 00:32:01.680 align:middle line:84%
So I haven't done anything to
adjust our probability yet.

00:32:01.680 --> 00:32:03.320 align:middle line:84%
Just making sure
that this works.

00:32:03.320 --> 00:32:04.570 align:middle line:90%
Yep, it it's still generating.

00:32:04.570 --> 00:32:08.310 align:middle line:84%
So how can we use this to
implement the great suggestion

00:32:08.310 --> 00:32:12.540 align:middle line:84%
that we want to have things
that fit on the downbeat

00:32:12.540 --> 00:32:15.040 align:middle line:90%
more often do something else?

00:32:15.040 --> 00:32:26.160 align:middle line:84%
So we'll say, is on downbeat
equals cur_offset present zero.

00:32:26.160 --> 00:32:29.850 align:middle line:90%
You got to say, bools on.

00:32:29.850 --> 00:32:31.150 align:middle line:90%
Here we say true.

00:32:31.150 --> 00:32:32.500 align:middle line:90%
This is the easiest way.

00:32:32.500 --> 00:32:38.160 align:middle line:84%
If cur offset 0
equals 0, else false.

00:32:38.160 --> 00:32:39.280 align:middle line:90%
You can do it.

00:32:39.280 --> 00:32:41.340 align:middle line:84%
You can realize that
Boolean expression will

00:32:41.340 --> 00:32:46.650 align:middle line:84%
be reduce itself, but I like to
be explicit when I'm thinking.

00:32:46.650 --> 00:32:50.190 align:middle line:84%
So now we know if something
is on the downbeat.

00:32:50.190 --> 00:32:51.986 align:middle line:84%
How do we want to
do it differently?

00:32:51.986 --> 00:32:56.070 align:middle line:90%


00:32:56.070 --> 00:32:57.920 align:middle line:90%
Do you need to brainstorm?

00:32:57.920 --> 00:33:02.380 align:middle line:90%


00:33:02.380 --> 00:33:03.080 align:middle line:90%
Thanks, Adam.

00:33:03.080 --> 00:33:06.640 align:middle line:84%
I want to hear from
some more voices,

00:33:06.640 --> 00:33:10.210 align:middle line:90%
even though you're doing great.

00:33:10.210 --> 00:33:10.953 align:middle line:90%
Vanessa, yeah.

00:33:10.953 --> 00:33:12.370 align:middle line:84%
AUDIENCE: On the
downbeat, you can

00:33:12.370 --> 00:33:15.997 align:middle line:84%
use the formally chosen
borderline pitch, and then--

00:33:15.997 --> 00:33:18.580 align:middle line:84%
MICHAEL SCOTT ASATO CUTHBERT:
And if it's not on the downbeat?

00:33:18.580 --> 00:33:19.880 align:middle line:84%
AUDIENCE: You leave it
as what it was before.

00:33:19.880 --> 00:33:20.440 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: You leave it

00:33:20.440 --> 00:33:21.830 align:middle line:90%
as what it was before.

00:33:21.830 --> 00:33:24.550 align:middle line:90%
Let's try that.

00:33:24.550 --> 00:33:25.430 align:middle line:90%
Oh, yeah.

00:33:25.430 --> 00:33:30.640 align:middle line:84%
So we have a last ql, so we'll
define ql outside of here,

00:33:30.640 --> 00:33:35.230 align:middle line:84%
will be pretty
Pythonic, equals--

00:33:35.230 --> 00:33:37.460 align:middle line:90%
we'll say our last one is 1.

00:33:37.460 --> 00:33:39.550 align:middle line:90%
We're actually not going to.

00:33:39.550 --> 00:33:42.020 align:middle line:84%
Because we will always
start on the downbeat,

00:33:42.020 --> 00:33:43.313 align:middle line:90%
ql will be defined.

00:33:43.313 --> 00:33:44.980 align:middle line:84%
But let's do good
programming techniques

00:33:44.980 --> 00:33:46.190 align:middle line:90%
and define it outside.

00:33:46.190 --> 00:33:46.690 align:middle line:90%
Good.

00:33:46.690 --> 00:33:52.373 align:middle line:84%
So if is on, if
not is on downbeat.

00:33:52.373 --> 00:33:57.730 align:middle line:90%


00:33:57.730 --> 00:33:59.110 align:middle line:90%
Let's see if that--

00:33:59.110 --> 00:34:01.300 align:middle line:84%
otherwise, we're
just going to stay

00:34:01.300 --> 00:34:04.000 align:middle line:90%
on whatever we were on before.

00:34:04.000 --> 00:34:04.790 align:middle line:90%
Let's see.

00:34:04.790 --> 00:34:06.737 align:middle line:90%
Think it through first.

00:34:06.737 --> 00:34:07.820 align:middle line:90%
Did I get something wrong?

00:34:07.820 --> 00:34:09.810 align:middle line:84%
AUDIENCE: ql will have
a not defined error.

00:34:09.810 --> 00:34:13.270 align:middle line:90%


00:34:13.270 --> 00:34:14.000 align:middle line:90%
Oh, sorry.

00:34:14.000 --> 00:34:14.960 align:middle line:84%
MICHAEL SCOTT ASATO CUTHBERT:
Yep, that's what we do.

00:34:14.960 --> 00:34:16.752 align:middle line:84%
That's why I was talking
about defining it.

00:34:16.752 --> 00:34:18.040 align:middle line:90%
Good catch, though.

00:34:18.040 --> 00:34:22.969 align:middle line:84%
Always don't know crashed 787
because of not defined errors.

00:34:22.969 --> 00:34:24.940 align:middle line:90%
That's a famous story.

00:34:24.940 --> 00:34:28.780 align:middle line:84%
OK, so let's make
sure that we're not

00:34:28.780 --> 00:34:32.000 align:middle line:84%
going to end up permanently
syncopated or something.

00:34:32.000 --> 00:34:36.920 align:middle line:84%
We start on the downbeat,
and then we choose between--

00:34:36.920 --> 00:34:43.219 align:middle line:84%
maybe I should put these in some
of a logical order 2, 1, 0.5.

00:34:43.219 --> 00:34:46.130 align:middle line:84%
We randomly choose between
half note, quarter note,

00:34:46.130 --> 00:34:48.469 align:middle line:84%
and eighth note, and
we're on the downbeat,

00:34:48.469 --> 00:34:51.500 align:middle line:84%
and so we're going to
stay on that for a bit.

00:34:51.500 --> 00:34:55.179 align:middle line:84%
We'll always end up back on
a downbeat at some point.

00:34:55.179 --> 00:34:56.270 align:middle line:90%
We start on a downbeat.

00:34:56.270 --> 00:35:03.200 align:middle line:84%
We choose 2, 1, 0.5 in
this particular piece.

00:35:03.200 --> 00:35:04.410 align:middle line:90%
Who votes yes?

00:35:04.410 --> 00:35:06.526 align:middle line:84%
Who votes we might be
permanently syncopated?

00:35:06.526 --> 00:35:14.750 align:middle line:90%


00:35:14.750 --> 00:35:18.770 align:middle line:84%
Spend more time reading
code than writing code.

00:35:18.770 --> 00:35:21.950 align:middle line:84%
AUDIENCE: It looks like we
might, yeah, because it always

00:35:21.950 --> 00:35:27.470 align:middle line:84%
switches the quarter length
if we're not on the downbeat.

00:35:27.470 --> 00:35:29.720 align:middle line:84%
MICHAEL SCOTT ASATO CUTHBERT:
Oh, did I do that wrong?

00:35:29.720 --> 00:35:32.360 align:middle line:84%
Do we want to keep
it-- we wanted

00:35:32.360 --> 00:35:35.300 align:middle line:90%
to-- do I have a misplaced not?

00:35:35.300 --> 00:35:38.582 align:middle line:84%
So that's what we
wanted a little bit.

00:35:38.582 --> 00:35:41.220 align:middle line:84%
If we're on the downbeat, we
can change to a new rhythm.

00:35:41.220 --> 00:35:44.480 align:middle line:90%
If we're not, we can't.

00:35:44.480 --> 00:35:45.890 align:middle line:90%
I think let's run.

00:35:45.890 --> 00:35:49.193 align:middle line:90%
Let's generate this.

00:35:49.193 --> 00:35:51.125 align:middle line:90%
AUDIENCE: [INAUDIBLE].

00:35:51.125 --> 00:35:53.000 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: Yeah, so what's

00:35:53.000 --> 00:35:54.290 align:middle line:90%
the consequence of this?

00:35:54.290 --> 00:35:55.597 align:middle line:90%
Somebody else.

00:35:55.597 --> 00:35:58.796 align:middle line:90%
[MUSICAL NOTES]

00:35:58.796 --> 00:35:59.263 align:middle line:90%


00:35:59.263 --> 00:36:00.680 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: Yep.

00:36:00.680 --> 00:36:03.013 align:middle line:84%
AUDIENCE: It's the same type
of notes that are changing.

00:36:03.013 --> 00:36:05.013 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: It's the same type

00:36:05.013 --> 00:36:06.377 align:middle line:90%
of notes every measure.

00:36:06.377 --> 00:36:06.960 align:middle line:90%
You know what?

00:36:06.960 --> 00:36:08.210 align:middle line:90%
I'm going to change that over.

00:36:08.210 --> 00:36:10.650 align:middle line:84%
Oh, no, no, we can't determine
the length of the piece.

00:36:10.650 --> 00:36:13.530 align:middle line:90%
So we might have that.

00:36:13.530 --> 00:36:18.480 align:middle line:84%
Yeah, every measure will always
have the same type of thing.

00:36:18.480 --> 00:36:19.760 align:middle line:90%
This is kind of nice for--

00:36:19.760 --> 00:36:21.500 align:middle line:84%
a lot of my junior
high etude books

00:36:21.500 --> 00:36:23.820 align:middle line:84%
were like this, that you
only switched rhythms.

00:36:23.820 --> 00:36:27.450 align:middle line:84%
But maybe what's one way that we
can switch a little bit better,

00:36:27.450 --> 00:36:28.130 align:middle line:90%
more often?

00:36:28.130 --> 00:36:31.680 align:middle line:84%
We could just say, we
should rename our variables,

00:36:31.680 --> 00:36:34.320 align:middle line:84%
but maybe this will
feel much more unified.

00:36:34.320 --> 00:36:37.520 align:middle line:84%
We'll just do it
on every two notes.

00:36:37.520 --> 00:36:40.950 align:middle line:90%
[MUSICAL NOTES]

00:36:40.950 --> 00:36:49.280 align:middle line:90%


00:36:49.280 --> 00:36:50.220 align:middle line:90%
OK, that's enough.

00:36:50.220 --> 00:36:53.040 align:middle line:84%
That's already
becoming more unified.

00:36:53.040 --> 00:36:58.570 align:middle line:84%
So what are some things that
we could hack into this?

00:36:58.570 --> 00:37:03.622 align:middle line:84%
We're done for a little bit,
but what are some things

00:37:03.622 --> 00:37:05.705 align:middle line:84%
that we can make it sound
a little bit more human?

00:37:05.705 --> 00:37:10.740 align:middle line:90%


00:37:10.740 --> 00:37:11.490 align:middle line:90%
AUDIENCE: Harmony.

00:37:11.490 --> 00:37:12.640 align:middle line:84%
MICHAEL SCOTT ASATO
CUTHBERT: We can add harmony.

00:37:12.640 --> 00:37:13.140 align:middle line:90%
Good.

00:37:13.140 --> 00:37:15.100 align:middle line:84%
We could add random
or appropriate.

00:37:15.100 --> 00:37:16.210 align:middle line:90%
Probably more appropriate.

00:37:16.210 --> 00:37:16.918 align:middle line:90%
Yeah, Jason.

00:37:16.918 --> 00:37:18.960 align:middle line:84%
AUDIENCE: We could allow
it to occasionally break

00:37:18.960 --> 00:37:21.330 align:middle line:84%
these rules by, well,
probably by random chance.

00:37:21.330 --> 00:37:23.580 align:middle line:84%
MICHAEL SCOTT ASATO CUTHBERT:
So certain random chance

00:37:23.580 --> 00:37:24.580 align:middle line:90%
that we break the rules.

00:37:24.580 --> 00:37:26.920 align:middle line:84%
Yeah, one of the things here,
I'm not going to do this.

00:37:26.920 --> 00:37:29.760 align:middle line:84%
But I gave a particular
random chance

00:37:29.760 --> 00:37:35.400 align:middle line:84%
that something might go up
an octave in another time

00:37:35.400 --> 00:37:42.210 align:middle line:84%
when I did this, and there was
some danger in allowing that.

00:37:42.210 --> 00:37:44.890 align:middle line:84%
This is a particular
problem with MuseScore,

00:37:44.890 --> 00:37:48.570 align:middle line:84%
that if you overflow
256, it jumps.

00:37:48.570 --> 00:37:52.860 align:middle line:84%
It's unsigned, which is kind of
cool that the world of notation

00:37:52.860 --> 00:37:54.450 align:middle line:90%
wraps around.

00:37:54.450 --> 00:37:56.550 align:middle line:90%
But yeah.

00:37:56.550 --> 00:38:00.930 align:middle line:84%
So I obviously was
allowing this one random--

00:38:00.930 --> 00:38:03.990 align:middle line:84%
seven is an octave if
you're adding to it

00:38:03.990 --> 00:38:05.620 align:middle line:90%
to happen a little too often.

00:38:05.620 --> 00:38:08.320 align:middle line:84%
So that can be a
danger, but it happens.

00:38:08.320 --> 00:38:11.038 align:middle line:90%
Thanks for having that.

00:38:11.038 --> 00:38:13.330 align:middle line:84%
Yeah, so those are some of
the other things you can do.

00:38:13.330 --> 00:38:16.260 align:middle line:84%
Maybe we want to
sound a little less--

00:38:16.260 --> 00:38:18.095 align:middle line:90%
I'm going to start doing this.

00:38:18.095 --> 00:38:19.720 align:middle line:84%
I just need to not
make it full screen.

00:38:19.720 --> 00:38:21.450 align:middle line:84%
You can make it a
little bit less human

00:38:21.450 --> 00:38:24.330 align:middle line:84%
and make it do these
weird microtones, or not

00:38:24.330 --> 00:38:27.410 align:middle line:84%
less human, but
less traditional.

00:38:27.410 --> 00:38:29.430 align:middle line:90%
And where'd that go?

00:38:29.430 --> 00:38:31.210 align:middle line:90%
Here we can hear it.

00:38:31.210 --> 00:38:32.800 align:middle line:90%
These, unfortunately--

00:38:32.800 --> 00:38:36.104 align:middle line:90%
[MUSICAL NOTES]

00:38:36.104 --> 00:38:41.310 align:middle line:90%


00:38:41.310 --> 00:38:45.240 align:middle line:84%
So there are ways that you
can do some things that

00:38:45.240 --> 00:38:48.430 align:middle line:84%
allow you to be more
experimental if you want,

00:38:48.430 --> 00:38:49.750 align:middle line:90%
or less experimental.

00:38:49.750 --> 00:38:52.030 align:middle line:90%
Great.

00:38:52.030 --> 00:38:54.410 align:middle line:90%
So we'll keep playing with that.

00:38:54.410 --> 00:38:56.230 align:middle line:84%
What you'll probably
realize, one

00:38:56.230 --> 00:39:00.520 align:middle line:84%
of the things we're building up
to, so you're given a problem

00:39:00.520 --> 00:39:02.210 align:middle line:90%
set 7.8, as I said.

00:39:02.210 --> 00:39:04.250 align:middle line:90%
It's not in 7/8 time.

00:39:04.250 --> 00:39:06.670 align:middle line:90%
That would be too lopsided.

00:39:06.670 --> 00:39:11.470 align:middle line:84%
But what it is, is it gives
you some work with scales

00:39:11.470 --> 00:39:12.950 align:middle line:90%
and with Roman numerals.

00:39:12.950 --> 00:39:16.730 align:middle line:84%
And then there's two parts for
you to do an open ended thing.

00:39:16.730 --> 00:39:19.510 align:middle line:84%
One is, we're going to be
asking you, in the first half

00:39:19.510 --> 00:39:22.360 align:middle line:84%
to write a Roman
numeral analyzer just

00:39:22.360 --> 00:39:26.200 align:middle line:90%
for triads in major.

00:39:26.200 --> 00:39:29.230 align:middle line:84%
And it's just going to
be for block chords.

00:39:29.230 --> 00:39:30.410 align:middle line:90%
I'll give you three notes.

00:39:30.410 --> 00:39:33.110 align:middle line:84%
You tell me what
Roman numeral it is.

00:39:33.110 --> 00:39:36.090 align:middle line:90%
If you're a little bit behind--

00:39:36.090 --> 00:39:36.590 align:middle line:90%
sorry.

00:39:36.590 --> 00:39:39.700 align:middle line:84%
If it's been a while since
you've done Roman numeral

00:39:39.700 --> 00:39:43.430 align:middle line:84%
analysis or you feel a little
bit weak on it, collaborate.

00:39:43.430 --> 00:39:45.260 align:middle line:90%
Talk with other people on that.

00:39:45.260 --> 00:39:47.890 align:middle line:84%
Make sure that you're really
clear what a diminished triad

00:39:47.890 --> 00:39:49.880 align:middle line:90%
and all that things is.

00:39:49.880 --> 00:39:52.320 align:middle line:84%
So grab somebody before
you leave the room.

00:39:52.320 --> 00:39:55.070 align:middle line:84%
And then there's a
little open ended thing

00:39:55.070 --> 00:39:58.020 align:middle line:84%
where I just ask you, do
something a little bit more.

00:39:58.020 --> 00:40:00.060 align:middle line:84%
Maybe you have something
that works in minor.

00:40:00.060 --> 00:40:01.950 align:middle line:84%
Maybe you have it do
it seventh chords.

00:40:01.950 --> 00:40:04.280 align:middle line:84%
Maybe you work in jazz
and popular music,

00:40:04.280 --> 00:40:06.170 align:middle line:84%
and you think Roman
numerals, oh, that's

00:40:06.170 --> 00:40:07.530 align:middle line:90%
only for classical music.

00:40:07.530 --> 00:40:09.830 align:middle line:84%
I'm going to have it
do chord symbols, CDM,

00:40:09.830 --> 00:40:11.970 align:middle line:90%
and things like that instead.

00:40:11.970 --> 00:40:15.510 align:middle line:84%
So whatever you want, there'll
be just a small part of it.

00:40:15.510 --> 00:40:16.635 align:middle line:90%
I should have it open.

00:40:16.635 --> 00:40:18.260 align:middle line:84%
In fact, I think I--
no, I only have it

00:40:18.260 --> 00:40:19.380 align:middle line:90%
with all the answers open.

00:40:19.380 --> 00:40:21.245 align:middle line:90%
Never mind.

00:40:21.245 --> 00:40:28.130 align:middle line:84%
And then, the last part is, I
want an algorithmic composition

00:40:28.130 --> 00:40:30.020 align:middle line:90%
that you like.

00:40:30.020 --> 00:40:31.590 align:middle line:90%
It can be multi-part.

00:40:31.590 --> 00:40:33.780 align:middle line:84%
It could be single part
if it's interesting.

00:40:33.780 --> 00:40:36.650 align:middle line:84%
It could be with chords,
without chords, but just

00:40:36.650 --> 00:40:40.440 align:middle line:84%
something where you've done some
of interesting music theory.

00:40:40.440 --> 00:40:42.680 align:middle line:84%
I'll say that what
we've given here

00:40:42.680 --> 00:40:45.980 align:middle line:84%
is the quintessential
D minus so far.

00:40:45.980 --> 00:40:48.990 align:middle line:84%
Try to go better than,
maybe it's a D. Actually,

00:40:48.990 --> 00:40:51.300 align:middle line:84%
but at this point, we're
getting a little bit better.

00:40:51.300 --> 00:40:53.670 align:middle line:84%
Don't spend the
entire semester on it.

00:40:53.670 --> 00:40:56.690 align:middle line:84%
This is not meant to
be the gigantic project

00:40:56.690 --> 00:40:58.700 align:middle line:90%
that you take forever on.

00:40:58.700 --> 00:41:02.150 align:middle line:84%
The only restriction
I'm giving is

00:41:02.150 --> 00:41:04.850 align:middle line:84%
that I'd like it to
be about a minute

00:41:04.850 --> 00:41:09.270 align:middle line:84%
long, not two minutes
long, not 12 minutes long,

00:41:09.270 --> 00:41:11.300 align:middle line:90%
because I have to--

00:41:11.300 --> 00:41:13.890 align:middle line:84%
if everybody turns in a
10 minute composition,

00:41:13.890 --> 00:41:16.850 align:middle line:84%
then I'll be listening to
algorithmic compositions

00:41:16.850 --> 00:41:19.070 align:middle line:90%
forever.

00:41:19.070 --> 00:41:22.850 align:middle line:84%
So if you can do that, that's
going to be that main part.

00:41:22.850 --> 00:41:26.180 align:middle line:84%
Any questions about what
we did with playing around

00:41:26.180 --> 00:41:28.183 align:middle line:84%
with algorithmic
compositions today?

00:41:28.183 --> 00:41:35.846 align:middle line:90%


00:41:35.846 --> 00:41:39.500 align:middle line:84%
Then I'm going to be a little
egotistical for a second

00:41:39.500 --> 00:41:46.500 align:middle line:84%
and talk about one of my
first algorithmic compositions

00:41:46.500 --> 00:41:50.580 align:middle line:84%
that, at some point,
people were performing.

00:41:50.580 --> 00:41:52.950 align:middle line:84%
And it's a piece for this
group called the Bang

00:41:52.950 --> 00:41:55.020 align:middle line:84%
on a Can All-Stars,
which some of you

00:41:55.020 --> 00:41:58.060 align:middle line:84%
might recognize the
clarinetist is Evan Ziporyn.

00:41:58.060 --> 00:42:01.390 align:middle line:84%
So another professor who's
here, who does a lot of things.

00:42:01.390 --> 00:42:04.930 align:middle line:84%
And it was based
on Markov chains.

00:42:04.930 --> 00:42:07.980 align:middle line:84%
So the notion of
what I wanted was

00:42:07.980 --> 00:42:12.300 align:middle line:84%
some kind of a melody that
was a little bit boring--

00:42:12.300 --> 00:42:14.890 align:middle line:84%
not boring, but just
undistinguished.

00:42:14.890 --> 00:42:17.650 align:middle line:84%
Except it had these
weird bumps in it,

00:42:17.650 --> 00:42:19.810 align:middle line:84%
some things that sounded
a little bit weird,

00:42:19.810 --> 00:42:24.270 align:middle line:84%
like this opening
tritone, and then

00:42:24.270 --> 00:42:26.010 align:middle line:90%
some of these weird gestures.

00:42:26.010 --> 00:42:28.600 align:middle line:84%
And so some things that you'd
hear enough times, you're like,

00:42:28.600 --> 00:42:31.530 align:middle line:84%
OK, I know that that's
what the piece is about.

00:42:31.530 --> 00:42:34.067 align:middle line:90%
And try to see if this is--

00:42:34.067 --> 00:42:35.400 align:middle line:90%
I can't remember when it's from.

00:42:35.400 --> 00:42:36.460 align:middle line:90%
2005.

00:42:36.460 --> 00:42:39.720 align:middle line:84%
It was a little bit pre-deep
learning and things, so just

00:42:39.720 --> 00:42:42.210 align:middle line:84%
probability theory,
whether or not

00:42:42.210 --> 00:42:45.750 align:middle line:84%
the Markov chain would do
something interesting things

00:42:45.750 --> 00:42:46.390 align:middle line:90%
with this.

00:42:46.390 --> 00:42:48.420 align:middle line:84%
And then one of the
things I really wanted

00:42:48.420 --> 00:42:51.300 align:middle line:84%
was someplace like
an old record player

00:42:51.300 --> 00:42:56.050 align:middle line:84%
that would get stuck in a loop
and need to be jumped out of it.

00:42:56.050 --> 00:43:01.050 align:middle line:84%
So I have a few places where
the same thing happens over,

00:43:01.050 --> 00:43:02.200 align:middle line:90%
and over, and over again.

00:43:02.200 --> 00:43:04.075 align:middle line:84%
If you're thinking about
what we were talking

00:43:04.075 --> 00:43:07.650 align:middle line:84%
about at the end of last class
about the probability of B,

00:43:07.650 --> 00:43:12.600 align:middle line:84%
given A, the next note,
or we could say n2,

00:43:12.600 --> 00:43:17.940 align:middle line:84%
given n1, this is-- what
order or Markov chain

00:43:17.940 --> 00:43:20.250 align:middle line:90%
are we talking about here?

00:43:20.250 --> 00:43:22.930 align:middle line:84%
First order, based
on one previous note.

00:43:22.930 --> 00:43:25.440 align:middle line:84%
I used a bunch of different
orders in this piece,

00:43:25.440 --> 00:43:28.720 align:middle line:84%
depending on how random
I wanted it to be.

00:43:28.720 --> 00:43:33.540 align:middle line:84%
I wanted that, when
you got to that note A,

00:43:33.540 --> 00:43:36.330 align:middle line:84%
that the probability,
given A, was

00:43:36.330 --> 00:43:40.300 align:middle line:84%
very high that you
would do another A.

00:43:40.300 --> 00:43:42.980 align:middle line:90%
So I weighed the probability.

00:43:42.980 --> 00:43:46.700 align:middle line:84%
So the probability of an A,
given an A, was, I don't know,

00:43:46.700 --> 00:43:48.770 align:middle line:90%
something like 0.9 or something.

00:43:48.770 --> 00:43:51.700 align:middle line:84%
So the computer would get
stuck in this particular groove

00:43:51.700 --> 00:43:52.665 align:middle line:90%
at some points.

00:43:52.665 --> 00:43:55.270 align:middle line:90%


00:43:55.270 --> 00:43:57.980 align:middle line:90%
And we'll see.

00:43:57.980 --> 00:44:02.890 align:middle line:84%
What I would do at some points
is just keep the melody,

00:44:02.890 --> 00:44:06.410 align:middle line:84%
just keep the notes, and
let the rhythms be out.

00:44:06.410 --> 00:44:12.440 align:middle line:84%
But if this is treble clef,
that's an opening gesture of B,

00:44:12.440 --> 00:44:15.685 align:middle line:90%
F, comes back a lot B, F.

00:44:15.685 --> 00:44:17.080 align:middle line:90%
[MUSICAL NOTES]

00:44:17.080 --> 00:44:19.630 align:middle line:84%
You'll hear that a lot, and
then getting stuck in that

00:44:19.630 --> 00:44:20.600 align:middle line:90%
a groove again.

00:44:20.600 --> 00:44:21.910 align:middle line:90%
Da, da, da.

00:44:21.910 --> 00:44:24.220 align:middle line:90%
You'll hear that.

00:44:24.220 --> 00:44:27.710 align:middle line:84%
And what I did was,
back in the old days,

00:44:27.710 --> 00:44:31.430 align:middle line:84%
I just had it generate a
whole bunch of melodies,

00:44:31.430 --> 00:44:32.960 align:middle line:90%
and I kept the ones I wanted.

00:44:32.960 --> 00:44:39.130 align:middle line:84%
So I wanted to do my
computer type of thing.

00:44:39.130 --> 00:44:46.330 align:middle line:84%
One last little thing is that
I had this sort of progression

00:44:46.330 --> 00:44:51.100 align:middle line:84%
that begins one beat per
second, so 60 BPM, then moves.

00:44:51.100 --> 00:44:53.930 align:middle line:84%
There was a section at
1.5 beats per second,

00:44:53.930 --> 00:44:58.420 align:middle line:84%
2, 3, 4, and then the final
note is a dissonance that

00:44:58.420 --> 00:44:59.990 align:middle line:90%
vibrates five beats per second.

00:44:59.990 --> 00:45:02.660 align:middle line:84%
So that's kind of the little
Easter egg in the piece.

00:45:02.660 --> 00:45:05.110 align:middle line:84%
And then I took the
1.5 beats per second

00:45:05.110 --> 00:45:09.190 align:middle line:84%
and moved it, because
that's what composers do.

00:45:09.190 --> 00:45:12.610 align:middle line:90%
When the piece was premiered--

00:45:12.610 --> 00:45:17.150 align:middle line:84%
they'll never be happy with me
at the printing office again--

00:45:17.150 --> 00:45:19.750 align:middle line:84%
I gave every person
in the audience

00:45:19.750 --> 00:45:21.610 align:middle line:84%
a different set of
program notes that

00:45:21.610 --> 00:45:24.100 align:middle line:84%
began by saying the
opening of the piece

00:45:24.100 --> 00:45:25.220 align:middle line:90%
is rather straightforward.

00:45:25.220 --> 00:45:28.160 align:middle line:84%
And then I wrote about 10
pages worth of program notes,

00:45:28.160 --> 00:45:31.580 align:middle line:84%
and everyone got a Markov
chain of the program notes.

00:45:31.580 --> 00:45:33.160 align:middle line:90%
So it has something.

00:45:33.160 --> 00:45:35.590 align:middle line:84%
Kind of looks like
something, and then it

00:45:35.590 --> 00:45:39.530 align:middle line:84%
ended always with a hint of
order, no matter what they had.

00:45:39.530 --> 00:45:42.290 align:middle line:84%
So I'm just going to
be indulgent and play

00:45:42.290 --> 00:45:47.502 align:middle line:84%
a little bit of something
I wrote a while back.

00:45:47.502 --> 00:45:50.988 align:middle line:90%
[MUSIC PLAYING]

00:45:50.988 --> 00:47:18.750 align:middle line:90%


00:47:18.750 --> 00:47:21.215 align:middle line:84%
And here's where I let the
computer start taking over.

00:47:21.215 --> 00:47:24.100 align:middle line:90%


00:47:24.100 --> 00:47:27.586 align:middle line:90%
[MUSIC PLAYING]

00:47:27.586 --> 00:48:06.930 align:middle line:90%


00:48:06.930 --> 00:48:09.540 align:middle line:84%
I think I told the computer
to multiply the intervals by 2

00:48:09.540 --> 00:48:11.186 align:middle line:90%
for more leapy.

00:48:11.186 --> 00:48:14.658 align:middle line:90%
[MUSIC PLAYING]

00:48:14.658 --> 00:49:16.750 align:middle line:90%


00:49:16.750 --> 00:49:19.010 align:middle line:84%
This is completely
Markov chained here.

00:49:19.010 --> 00:49:22.482 align:middle line:90%
[MUSIC PLAYING]

00:49:22.482 --> 00:50:16.062 align:middle line:90%


00:50:16.062 --> 00:50:17.895 align:middle line:84%
You can kind of hear
where it's stuck again.

00:50:17.895 --> 00:50:21.272 align:middle line:90%
[MUSIC PLAYING]

00:50:21.272 --> 00:51:00.080 align:middle line:90%


00:51:00.080 --> 00:51:03.090 align:middle line:84%
Any time you see a two measure
repeat, the timing didn't work.

00:51:03.090 --> 00:51:06.555 align:middle line:90%
[MUSIC PLAYING]

00:51:06.555 --> 00:51:56.120 align:middle line:90%


00:51:56.120 --> 00:52:00.590 align:middle line:90%
That's 2002.

00:52:00.590 --> 00:52:02.400 align:middle line:90%
Well, thanks, everybody.

00:52:02.400 --> 00:52:04.227 align:middle line:84%
You don't need to
write that much.

00:52:04.227 --> 00:52:06.810 align:middle line:84%
Please don't write that much for
your algorithmic composition,

00:52:06.810 --> 00:52:11.330 align:middle line:84%
but feel free to have a
mixture of your own personality

00:52:11.330 --> 00:52:14.810 align:middle line:84%
and your own desires, and let
the computer do some things

00:52:14.810 --> 00:52:17.680 align:middle line:90%
that kind of inspires you.

00:52:17.680 --> 00:52:28.000 align:middle line:90%