WEBVTT

00:00.000 --> 00:05.000
[Automatic captions by Autotekst using OpenAI Whisper V3. May contain recognition errors.]

00:08.635 --> 00:10.976
and open Sonic Pi, and that will bring you here.

00:13.917 --> 00:14.418
Mostly.

00:15.158 --> 00:20.721
If your Sonic Pi environment doesn't look exactly like this, it's probably because some other things are on.

00:20.981 --> 00:22.321
Maybe the information is on.

00:23.242 --> 00:25.463
Maybe the help section is on, quite likely.

00:27.384 --> 00:29.565
Maybe something about the preferences is on, et cetera.

00:30.985 --> 00:34.347
All of these kind of inlays can be found on your right.

00:38.320 --> 00:43.586
So if you can click on these various things, then you will find where these things individually are.

00:45.308 --> 00:50.835
There is a scope, an oscilloscope, that can help you hear what we are listening to and so on.

00:53.092 --> 00:56.433
Now, underneath these buttons, there is the scope for me.

00:56.514 --> 00:58.915
But if you've switched off your scope, then it may not be there.

00:59.535 --> 01:00.555
And then there is a log.

01:01.076 --> 01:04.737
And this is a log of all the things that are running in Sonic Pi.

01:06.538 --> 01:14.962
You might be familiar with this in any coding environment, where there is a log of what is running, for example, the console in web programming and so on.

01:16.119 --> 01:19.921
Then underneath that, again, there is this thing called queues.

01:20.081 --> 01:30.107
Queues are the instructions that are being sent to the sound engine by Sonic Pi that will help you understand how your code is flowing.

01:30.807 --> 01:40.633
So if you write different blocks and they're doing different things at different points of time, then it is here in queues that you will understand which block is running currently.

01:41.932 --> 01:47.998
So as you can see from all of the different types of music that I was playing before, there was a snare loop that was running.

01:48.198 --> 01:51.121
Occasionally there was a synth, etc.

01:51.321 --> 01:52.983
So this is where you learn about that.

01:53.823 --> 01:58.448
And then at the very bottom, there is a thing called linked metronome and global time warp.

01:59.509 --> 02:06.816
And this is where it kind of knows what is your main tempo that you're working with.

02:08.593 --> 02:11.174
And for me, currently it is 60.

02:11.674 --> 02:23.759
I think for most of you, it might be 60 with zero milliseconds, which means that for Sonic Pi, one unit of time is gonna be one beat in 60 beats per minute.

02:23.779 --> 02:24.539
Does that make sense?

02:25.340 --> 02:26.400
And this will be important.

02:26.480 --> 02:31.942
We'll see when we start telling Sonic Pi how long to do things for, et cetera.

02:32.662 --> 02:35.143
So we're gonna start with something really quick and easy.

02:35.324 --> 02:36.304
We're gonna say play.

02:39.013 --> 02:41.695
Now we're going to put down a number, 50.

02:45.638 --> 02:57.686
And if you say, play 50, and you have a MacBook, then you can press Command and R to play this, like so.

03:01.208 --> 03:06.211
If you press Command and R many times, then you can

03:08.630 --> 03:09.710
run it very many times.

03:12.851 --> 03:14.871
That's pretty simple.

03:14.891 --> 03:16.712
So what is 50, it seems like?

03:17.572 --> 03:18.212
It's a note.

03:19.752 --> 03:29.294
And the values of those notes are things that you can tell Sonic Pi what values they are, and it plays them in order.

03:29.954 --> 03:32.955
So if we make another line and say play 60,

03:35.632 --> 03:38.373
it plays both of them together without stopping in the middle.

03:40.395 --> 03:54.682
This is because this is not a traditional coding environment where it's running a Von Neumann type of, or it probably is, but obviously the distance between two lines is so small that it's going to sound simultaneous anyway.

03:56.883 --> 04:01.265
So when you run it in the log, you can see that both notes beep at the same time.

04:02.006 --> 04:03.486
So we said play something.

04:07.706 --> 04:15.930
The way to make it pause for just a second is to say sleep for one beat.

04:16.650 --> 04:23.174
If I do that, it says one time.

04:23.914 --> 04:25.795
So far, we're playing notes.

04:26.015 --> 04:31.218
Then we're asking the machine to sleep for one beat and then play a new note.

04:35.217 --> 04:37.858
And we can keep doing this for a long time.

04:40.599 --> 04:44.760
Remember that if you don't ask it to sleep, it's going to play both of those things at the same time.

04:49.462 --> 04:55.785
This is a really inconvenient way to write melodies, obviously, because it's very annoying.

04:56.465 --> 05:01.027
So what we're going to do, especially if you want to play this over and over again,

05:02.384 --> 05:05.345
You want it to loop.

05:07.946 --> 05:10.267
The way to loop something is to say loop do.

05:13.069 --> 05:15.990
Once you loop something, you also have to end it.

05:16.910 --> 05:17.811
Solipi is really nice.

05:17.951 --> 05:22.392
I did not indent a single thing right now and it just auto indents usually.

05:24.573 --> 05:26.354
If it doesn't, you can press tab.

05:29.475 --> 05:30.436
Let me try to play this.

05:41.838 --> 05:45.158
Command S is how you stop it, sorry.

05:47.139 --> 05:48.139
Put everyone in a loop.

05:48.959 --> 05:52.300
Command R and Command S. So these are your friends for today.

05:53.660 --> 05:56.601
That's how you hear something and then you stop a buffer from playing something.

05:56.981 --> 06:00.342
Especially if it's looped, then it's gonna play for a long time.

06:01.242 --> 06:04.363
Now, did you notice something else that happened in this loop?

06:12.583 --> 06:13.043
I'll tell you.

06:13.183 --> 06:21.586
There are four plays, but the fourth play plays simultaneously with the first one because it's looping and there is no sleep instruction.

06:21.606 --> 06:33.951
Four and a half.

06:34.531 --> 06:35.211
That's very nice.

06:35.611 --> 06:36.152
Kind of cool.

06:36.372 --> 06:36.732
I like it.

06:38.089 --> 06:43.531
Now, what you can also do is to make something loop a certain number of times.

06:45.532 --> 06:52.074
So what we're going to do is say times, then decide how many times we want this to play.

06:52.194 --> 06:52.414
Two.

06:52.835 --> 06:53.275
Two times.

06:54.915 --> 06:55.195
Okay?

06:56.796 --> 06:57.516
Two times do.

06:58.417 --> 07:01.918
And I'm going to make it a little bit shorter because it's quite long right now.

07:10.788 --> 07:13.424
So it stops automatically after two times.

07:16.053 --> 07:45.333
so now we have a strange little melody and you know how to manipulate it because this works in beats so currently we have one two three four five small parts right so it's two and a half beats that repeat in this way uh and that's a simple melody but we all know that your what you're listening to is a type of synth because this is not just a melody it's played on something

07:47.374 --> 07:53.232
So we're gonna change that by saying use synth.

07:55.959 --> 08:16.447
Now, in SonicPy, there are certain sound commands, like useSynth whenever you're using a sample, whenever you're using a reverb, and so on, where you're using an inbuilt part of SonicPy's functionality, in which case you say useSynth colon piano, for example.

08:18.728 --> 08:19.068
And now...

08:19.685 --> 08:26.290
to your point piano will be pink because everything that's an inbuilt functionality of SonicPy will get the color pink.

08:27.591 --> 08:28.972
Does that make sense?

08:31.574 --> 08:40.780
Now another thing is that to call an inbuilt functionality of SonicPy you're going to have to use colon so if you don't then it doesn't recognize what you mean by piano.

08:50.208 --> 08:52.789
Now how do you know what other synths you can use?

08:53.949 --> 08:57.190
Well, it has a really nice suggestion box, this software.

08:57.690 --> 09:08.413
So you can press colon and then press a letter, for example, and it can tell you different suggestions of the things that it has, if you want to use those.

09:08.513 --> 09:10.414
This is going to be awful, I'm sorry.

09:14.972 --> 09:15.172
Yes.

09:17.395 --> 09:19.497
Or great, depending upon who you ask.

09:21.579 --> 09:25.403
So that's how you use a synth.

09:25.503 --> 09:28.026
We also want to use an fx, maybe.

09:28.667 --> 09:29.227
It'll be nice.

09:30.929 --> 09:32.911
So we're going to say with fx.

09:34.870 --> 09:38.872
Now, you might ask me, why is it use synth and not with effects?

09:39.393 --> 09:43.355
Not with synth or with or use effects.

09:45.036 --> 09:48.038
And the reason for that is that's just how it is.

09:51.660 --> 09:51.900
Yes.

09:53.381 --> 09:59.485
So with effects, I think it makes sense because you use a synth, but the sound is with an effect.

09:59.525 --> 10:02.927
So I think it makes sense, but it's one of those things that you have to get used to.

10:02.947 --> 10:03.567
The two can be called.

10:05.891 --> 10:07.972
Yeah, independently and complement each other.

10:08.512 --> 10:21.680
So with fx, I don't know, compressor, it tells you that there is a runtime error because with fx must be called with a do end block.

10:22.300 --> 10:23.341
What is a do end block?

10:23.641 --> 10:25.022
Well, you already wrote one.

10:25.122 --> 10:25.942
It's the yellow one.

10:27.083 --> 10:34.307
It means that you cannot use a with fx block without saying do.

10:35.586 --> 10:39.429
And immediately when you do that, your code is indented.

10:41.510 --> 10:43.131
Now what we need is another end.

10:43.571 --> 10:43.812
Come on.

10:43.832 --> 10:44.552
Does that make sense?

10:52.037 --> 10:53.938
So that was a compressor piano.

10:53.958 --> 10:57.701
This was a little bit boring, so I'm going to put a big reverb probably.

10:59.921 --> 11:02.762
A little bit nicer.

11:02.922 --> 11:10.607
Why does this happen is because with FX is where you want to use an effect on a certain patch of your code.

11:11.127 --> 11:15.910
So maybe you don't want all the sounds that you make to have an FX.

11:16.070 --> 11:18.491
That's a bit weird.

11:19.852 --> 11:21.693
That's how we patch sound as well.

11:21.733 --> 11:22.434
You don't put...

11:23.434 --> 11:47.831
the same kind of effect patches on literally everything but you choose pick and choose and that's why you want that to be in a contained control condition so you'd say with fx do and end here and then everything that's inside it will be there but this is also possible right

11:54.102 --> 12:16.518
so now what happens is just the last notes last two notes they don't have reverb it's just the first note that has reverb so all of these things are possible now what if I hate all of the synths that sony pi is providing me and I need samples

12:44.540 --> 12:47.982
The way to call, now this is pink and it comes with a colon in the beginning.

12:48.202 --> 12:49.022
What does that tell you?

12:49.582 --> 12:55.485
That ambiquire is something that exists within SonicPy and that you can call it by a colon, right?

12:55.885 --> 12:57.245
So how do you call a sample?

12:57.365 --> 12:58.306
You just say sample.

13:01.345 --> 13:22.713
and then it tells you all of these samples that exist within sonic pie that are really cool there is so many of them so you can really do some serious drum stuff with sonic pie which is a great thing i think i'm gonna

13:30.700 --> 13:34.121
So that was loop weirdo is what happened.

13:34.242 --> 13:36.943
Already, your sound is quite complex.

13:37.103 --> 13:37.983
There is a lot happening.

13:38.984 --> 13:42.345
And that's very nice for us because we like that.

13:44.366 --> 13:54.490
What I'm going to do is that I wanted to play one sample out of a couple of samples, maybe, and not the same sample every time.

13:54.510 --> 13:55.871
So I'm going to create an array.

13:57.406 --> 13:58.467
I'm going to call it sounds.

14:00.568 --> 14:05.412
And then I'm going to call it like a normal array is called with square brackets.

14:06.273 --> 14:15.620
I'm going to put some sounds there.

14:17.682 --> 14:22.025
Notice how everything that follows a colon is pink.

14:24.696 --> 14:25.917
So here are some of my sounds.

14:26.577 --> 14:34.363
If I play this now, my sounds don't play, because they're not actually called.

14:34.563 --> 14:36.324
They just exist in an array.

14:37.945 --> 14:39.386
But I haven't called them yet.

14:40.807 --> 14:48.493
But I will call them by saying sample, because it's going to be a sample.

14:49.453 --> 14:50.854
Choose sounds.

15:03.075 --> 15:07.659
So that little glitch thing in the beginning was this sound, actually.

15:08.860 --> 15:12.383
But if I play this multiple times, then you'll hear it quite properly.

15:13.203 --> 15:13.964
Let's do that.

15:18.647 --> 15:30.977
So now instead of writing sample choose sounds, sample choose sounds, I'm just going to say I wanted to do this eight times, OK?

15:32.876 --> 15:49.763
And then what do I want it to do is play eight samples for me, and... Pretty funky.

15:52.465 --> 15:55.506
Yes?

15:56.506 --> 15:57.127
From the array.

15:59.388 --> 16:01.369
You can also use index, IDX.

16:02.129 --> 16:02.269
Yeah.

16:04.129 --> 16:09.890
You can also use, there are many commands for random numbers as well, like to pick randoms.

16:10.630 --> 16:13.771
We'll go through them when we're picking notes one more time.

16:15.691 --> 16:19.992
Now, you might ask me, what samples exist here?

16:21.692 --> 16:27.093
You can click on this delta called help and go to samples.

16:28.413 --> 16:32.334
And this is a comprehensive list of all of the samples.

16:34.522 --> 16:35.742
You can listen to them.

16:39.943 --> 16:40.684
Pretty epic.

16:42.524 --> 16:43.384
Some of them are long.

16:46.245 --> 16:47.165
Which is a classic.

16:48.305 --> 16:49.246
Some of them are very short.

16:53.107 --> 16:54.247
Some of them are kind of cute.

17:03.641 --> 17:09.456
And some of them are kind of specific.

17:10.899 --> 17:11.801
Some of them are ambient.

17:14.488 --> 17:17.829
So there's a huge bank to choose from, which is quite fun.

17:18.009 --> 17:21.910
I think, uh, the selection of things in Sonic Pi is quite fun.

17:22.930 --> 17:25.011
Uh, and there's a lot that you can do with it.

17:25.291 --> 17:34.653
So we'll come back to working with specific samples, but this is to say that you can populate your sounds array right now, any which way you like.

17:35.774 --> 17:39.435
Now, these notes are also kind of boring.

17:39.875 --> 17:40.815
I wanted to play

17:42.956 --> 17:45.578
many notes out of a selection, for example.

17:46.499 --> 17:53.744
So I'm going to ask it to play around and between 50 and 85.

17:53.784 --> 17:53.904
Now,

18:08.891 --> 18:17.789
The loop weirdo sample overlaps with the two times do thing, and that's because you ask it to sleep for 0.5 beats, that's half a beat.

18:19.389 --> 18:23.172
but you don't tell it to cut it off after half a beat.

18:23.292 --> 18:28.196
So the actual length of sample is longer than how long you're asking it to sleep.

18:28.276 --> 18:38.303
And that is why it sounds non-sequential because it's actually playing it in sequence, but it doesn't mute the sample because we haven't instructed it to mute it after 0.5.

18:40.370 --> 18:43.954
Now, I'm going to remove all of this.

18:44.274 --> 18:48.699
And I just wanted to play a long sequence of this.

18:48.719 --> 18:53.844
So I'm going to move it in the beginning because I want to listen to it first.

18:55.245 --> 18:58.449
And I don't want the rest of these things so much, actually, right now.

18:58.469 --> 19:00.451
So I'm going to clean it up a little bit.

19:23.806 --> 19:24.646
MIDI notes, yeah.

19:25.566 --> 19:33.228
So it picked quite random sounding 12 notes from the whole selection and it tried to make something out of them.

19:35.488 --> 19:39.409
One other thing that I want to quickly get through is that you can also

19:41.019 --> 19:47.101
give commands that tell the synth about the behavior.

19:47.341 --> 19:53.642
So those are attack, release, decay, and so on, right where you declare what notes you want it to play.

19:56.363 --> 20:01.124
So notice that these piano ones are very quick.

20:02.004 --> 20:03.525
You can make it worse for yourself.

20:05.625 --> 20:07.926
This actually sounds lovely, like a pizzicato.

20:10.214 --> 20:14.739
Another thing that you can do is to ask it to play.

20:16.218 --> 20:45.420
choose we already know what choose does what does choose do it chooses things from an array we don't have an array currently because play is gonna operate a synth not play a sample right so in order to play a sample you have to write sample in order to generate a sound using a synth you have to write play so play choose then we pick an array and then you just write the notes of your choice in it

20:46.598 --> 21:03.382
okay these are the notes of my choice and I want it to play this as well first maybe actually yeah and then sleep

21:21.519 --> 21:22.959
So what is happening right now?

21:23.359 --> 21:36.043
You have a shorter note accompanied by a longer note that has the form of the shape of the note is very, very short of the longer note.

21:36.083 --> 21:40.844
So you get this like because the release time of the second note is really, really short.

21:42.313 --> 21:43.454
It's a nice figure, I think.

21:43.494 --> 21:53.321
So you can experiment with different values of the sound shape itself and the beat characteristics to give you some really interesting figures in Sonic Pi.

21:53.361 --> 21:56.463
I think that's a nice thing that I like about it.

21:58.844 --> 22:00.105
You can do this again.

22:00.125 --> 22:02.807
I want it to be...

22:04.685 --> 22:32.102
lower maybe without sleep this time so i wanted to play like some bassy stuff so 20 250 maybe he's not playing these separately why

22:40.718 --> 22:43.499
It was, it's just that the base notes are even shorter.

22:44.019 --> 22:44.759
They just sound like .

22:52.101 --> 22:54.221
So this is quite sleepy music.

22:54.261 --> 22:55.922
This could be a music box music.

22:55.962 --> 23:02.243
I think we need to lift our spirits a little bit at this point in time by making some chaos.

23:03.063 --> 23:06.324
For which, what I'm going to do is I like this code.

23:07.064 --> 23:08.745
I'm going to use it for something later on.

23:09.662 --> 23:12.063
So at the bottom, you will see 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.

23:15.764 --> 23:19.325
Those are called buffers, and we have 10 of them.

23:20.385 --> 23:27.207
It means that we can write 10 different pieces of code, and we can be real chaotic.

23:38.987 --> 23:45.490
because we can run 10 different types of things that we've written at the same time or at different times.

23:45.570 --> 23:52.834
And this is a nice tool because if you want to start something at some point of time, et cetera, then you can do it really easily.

23:54.435 --> 23:57.476
How are you going to save your washing machine music, et cetera?

23:58.997 --> 24:02.879
It says record over here, and that means that it will record.

24:03.099 --> 24:04.920
So up top over there.

24:08.613 --> 24:37.853
it says if you hover on it it says start recording to a wave audio file and if you do that then you can record the beautiful music that you're going to create and that's really nice because it's easy to do and that's why i like this interface because you can actually make something uh not all compositions have to be thought of as you know piano style and musical instruments and things like that sometimes we think like this and you can make a little piece and then you can save it

24:38.653 --> 24:54.840
So what we're going to do now is to move to your next empty buffer, which is probably going to be one for you, if you've not written anything in it, because I'm going to save whatever I've written in preparation for tonight.

24:56.200 --> 25:06.745
And then what we're going to do is to make a nice drum sample before we do some synth stuff.

25:08.698 --> 25:11.660
So for that, I'm going to load a sample.

25:20.507 --> 25:24.569
And the sample is going to be drum heavy kick.

25:25.780 --> 25:30.084
Now, we're going to do a different type of loop now.

25:30.464 --> 25:34.367
So, so far, what we did was two types of loops.

25:35.288 --> 25:37.670
The first one was called loop.

25:39.151 --> 25:41.213
And the second one was called times loop.

25:41.293 --> 25:43.695
So, we said 12 dot times do.

25:44.635 --> 25:48.839
We're going to do something new now, which is called live loop.

25:52.140 --> 26:18.167
do and you know when you're writing like this that you need an end and you need an indent and then you can fill it up with stuff which I'm gonna fill it up with a sample same sample that we loaded drum heavy kick like so

26:21.593 --> 26:22.795
Make it sleep for half a beat.

26:28.724 --> 26:29.145
Two times.

26:48.976 --> 26:56.223
Now, I did something sneaky just now, which was that instead of say live loops do, I had to say colon something.

26:56.283 --> 27:00.987
This is because each live loop in SonicPy needs a unique identifier.

27:01.667 --> 27:03.709
It's so that it can be called later on.

27:05.247 --> 27:13.410
And in none of your buffers, or in at least the buffers that are playing, no two live loops can have the same identifier.

27:14.030 --> 27:16.571
So you need to keep track of what loop you've written.

27:16.731 --> 27:20.192
If it's called drums, then you will not be able to write another drums loop.

27:20.332 --> 27:21.333
It will simply not play.

27:21.873 --> 27:24.093
So this is your live loop.

27:24.133 --> 27:25.454
What do you notice in it?

27:59.329 --> 28:02.350
is that you can change things on the fly and they get changed.

28:03.250 --> 28:04.430
And the sync never comes off.

28:04.470 --> 28:05.911
It never starts a new play.

28:05.931 --> 28:06.871
So that's a live loop.

28:07.431 --> 28:16.754
That's pretty nice when you're doing coding for Algorave or you're running a set, you're being DJ for the night.

28:17.434 --> 28:23.076
Then you can run a live loop or several because then you have control of kind of how to change things within them.

28:23.136 --> 28:27.737
So what we did just now was to change parameters of how the sample is played.

28:33.450 --> 28:35.491
And then you kind of create a little bit of a beat.

28:35.671 --> 28:37.231
That's pretty nice.

28:39.192 --> 28:43.114
Now we're going to create a different live loop because we're going to add some synths to this.

28:54.795 --> 28:58.277
So again, I say live loop, and then first I have to give it a name.

28:58.397 --> 29:02.159
So I say colon synths, because I intend to write some synths in it.

29:02.940 --> 29:09.284
And then I say end first, and then indent, because that's how you can make sure that your code is going to run properly.

29:10.144 --> 29:11.765
And then I'm going to use some synths.

29:13.146 --> 29:13.847
Use synth.

29:16.208 --> 29:17.989
Pulse synth this time.

29:19.030 --> 29:22.832
And then I also want to tell it what types of...

29:24.830 --> 29:26.391
synth defaults it should use.

29:27.492 --> 29:33.856
And I wanted to use amplitude of 1, cutoff of 80.

29:37.238 --> 29:37.919
Something like this.

29:37.939 --> 29:40.140
And then I wanted to play some notes.

29:40.300 --> 29:43.242
Play 30, sleep.

29:45.604 --> 29:48.906
Sleep a little bit.

29:49.566 --> 29:49.967
Play 38.

29:53.886 --> 29:54.687
Sleep a little bit.

29:56.788 --> 29:57.389
Quarter note.

29:58.129 --> 30:05.495
So what's going to happen now when you're going to listen to the sample, how fast is the synth compared to the drum?

30:06.376 --> 30:08.637
The drums are sleeping for 0.5.

30:08.697 --> 30:09.698
That's half a beat.

30:10.559 --> 30:12.500
But the synths are sleeping for 0.25.

30:13.301 --> 30:14.542
That's a quarter of a beat.

30:15.663 --> 30:17.704
So the synths are going to be playing twice as fast.

30:19.242 --> 30:19.362
so

30:38.143 --> 30:46.990
So very simple things, very small changes in code, exactly works like a DJ platform and does very nice and effective things.

30:47.751 --> 30:48.011
All right.

30:48.451 --> 30:55.357
What we're going to do now is to make a complicated sound because we don't like any of the resident synthesizers.

30:56.117 --> 31:05.185
But while we're doing that, we're also going to learn to write a function which is defined by the command define.

31:08.294 --> 31:09.515
Then we are going to call it something.

31:09.575 --> 31:19.619
I'm going to call this one bell because that's nice.

31:24.721 --> 31:27.942
And then I'm going to put some synth commands.

31:29.302 --> 31:30.303
Synth triangle.

31:45.320 --> 31:47.348
Oh, it's going to take me forever to find pipe.

31:55.006 --> 32:01.469
So mod n passes kind of the value of n through the function defined.

32:01.509 --> 32:04.951
So it works in exactly the same way that we pass a variable to a function.

32:05.791 --> 32:16.616
And mod n is going to pass this variable name into this function, which allows us to do certain operations with this, like so.

32:18.497 --> 32:23.199
And we're going to then play our little synth, because then we can

32:27.211 --> 32:28.232
listen to how it sounds.

32:28.992 --> 32:30.033
Currently, it sounds like this.

32:30.053 --> 32:36.416
So it's not much, because it's basically the sound of just one synth.

32:36.477 --> 32:43.981
But this is to demonstrate that once you've defined a function with a name, then you can call that name to play a note.

32:46.202 --> 32:52.846
Now, we're going to add to this so that we can make basically like additive synthesis.

32:53.887 --> 32:55.948
We want to make several different.

32:57.392 --> 32:59.113
things sound at the same time.

33:00.594 --> 33:03.915
So we're going to do some operations.

33:07.337 --> 33:18.082
So what it's going to do is to add all of these values in order to make a new kind of sound that will play all of these synths at the same time.

33:18.163 --> 33:23.505
So what it's really trying to do is kind of additive synthesis, where

33:25.203 --> 33:49.135
it's uh yeah you're giving it specific values of really let's listen to this sound now so it's much more complex rounded kind of different from everything that we heard so far kind of nice uh okay

33:50.633 --> 33:52.554
But we want it to be a little more complex.

33:52.674 --> 33:55.335
It has currently a very low release time.

33:55.375 --> 34:01.198
We want it to have a little bit of a reverberate-y sound.

34:01.218 --> 34:03.739
So I'm going to call a synth again.

34:03.759 --> 34:09.201
I'm just going to copy some of these because I want another complex-ish sound.

34:10.922 --> 34:13.804
And this time, I'm going to have sine waves.

34:14.004 --> 34:16.725
I want the reverberation to not be jarring.

34:24.972 --> 34:32.356
Now already if I play it, it's similar, but with some other additional characteristics.

34:32.476 --> 34:34.677
But I'm going to give these huge release times.

34:39.339 --> 34:42.981
So again, release time of 2, that's 2 beats.

34:43.001 --> 34:46.003
0.5, that's 1 beat, and so on.

34:49.865 --> 34:50.485
That's nice.

34:52.226 --> 34:53.766
Now it has a longer kind of...

34:55.244 --> 35:19.120
resonant body that we just added because we're trying to create this like complex synth we're trying to make a bell sound upper harmonics they're kind of missing I think this is kind of not that great so we need more like 24 maybe some of them are not like perfect

35:22.602 --> 35:23.182
Does that make sense?

35:23.762 --> 35:37.345
So it has these upper resonant harmonics, but they're not exactly, they're kind of just around the area so that we have like a little bit of like a fight between those sound waves.

35:40.866 --> 35:41.486
That's pretty cool.

35:41.606 --> 35:47.468
Kind of sounds like a, you know, one of those like bowls type of thing.

35:49.168 --> 35:49.908
Is it long enough?

35:51.849 --> 35:52.069
Yeah.

35:53.149 --> 35:56.670
Could be longer, could be weirder, probably.

35:59.430 --> 36:05.312
Could be a lot richer, obviously, because currently all of the sine waves are a lot higher.

36:06.192 --> 36:08.412
You can do crazy things to it, of course.

36:12.473 --> 36:16.554
That's kind of like an old brass type of a thing.

36:17.494 --> 36:22.135
And then, of course, you can do, not all of them need to be so high.

36:26.839 --> 36:28.660
OK, that was kind of fake sounding.

36:28.861 --> 36:32.043
I didn't like that.

36:32.524 --> 36:37.367
But maybe that's nice.

36:37.508 --> 36:39.089
We need something more.

36:39.109 --> 36:47.616
I feel like maybe like a lower harmonic type of thing, because these are kind of high.

36:47.676 --> 36:51.379
They're nice, but I feel like it needs one more.

36:53.157 --> 36:57.399
So we're going to add two more synths and make them quite low.

36:59.140 --> 37:07.103
Minus something like this, close to where we were at.

37:12.906 --> 37:13.846
That's kind of cool.

37:14.366 --> 37:15.247
I kind of like it.

37:16.267 --> 37:18.888
Not excessively, but yeah.

37:20.686 --> 37:23.927
And then, remember when we did this play thing?

37:25.347 --> 37:27.868
You can import the same loop here.

37:28.908 --> 37:30.449
And we can make a little bell melody.

37:32.569 --> 37:43.112
So instead of use synth piano, I'm going to do bell choose and bell random.

37:47.310 --> 37:50.112
Now, if I didn't do anything, it would play those in a loop.

37:50.232 --> 37:57.335
But there is a runtime error, which is that it thinks that I have given it two arguments when it expected one.

37:58.156 --> 38:00.497
I'm just going to tell it one number, maybe.

38:09.081 --> 38:13.064
This was the effect of the reverb do, but it also stops playing after one, so.

38:24.976 --> 38:33.407
so far it's playing three of these notes 12 times so you can add it to a loop you can do what you want with it so this is how you do additive synthesis

38:36.508 --> 38:39.531
There are many types of synths, obviously, available.

38:39.551 --> 38:42.574
You can change these tri signs out for.

38:43.035 --> 38:46.238
So currently, we're only using triangle ones in sign tones.

38:46.258 --> 38:52.164
You can swap them out for anything you like and create very complex sounds on this.

38:53.385 --> 38:58.770
They also have kind of many default values, instructions that Sonic Pi already knows.

38:59.531 --> 39:18.360
which you can you know change around manipulate and create really rich kind of sounds i think i'm going to show you a nice example called monday blues by the guy who developed sonic pi you can go a bit higher

39:39.819 --> 39:42.864
so it starts slow because you have two live loops

39:44.028 --> 39:52.490
And they go on for six times and eight times, which means that while the first loop is kind of going to go again, the second loop starts somewhere in the middle.

39:53.250 --> 39:58.592
And then it's kind of stacked in a way that it kind of comes in.

39:59.712 --> 40:01.352
It's only based on two samples.

40:01.792 --> 40:04.413
So you load those samples beforehand, so it runs really quickly.

40:05.939 --> 40:13.424
And then you have this kind of patch where you play the synth melody, which runs in this kind of control condition.

40:14.465 --> 40:25.452
So instead of using a complex sound that he wrote, like we did with the bell just now, he's using parameters of the synth.

40:26.710 --> 40:31.192
and modifying them in order to get kind of this nice saw sound that he wants.

40:32.272 --> 40:33.933
And then using some of those.

40:34.333 --> 40:45.637
Now here there is this thing called notes and there is a ring of notes so that each note is played a fixed number of times in both octaves.

40:45.677 --> 40:49.298
So that's why you hear the right?

40:49.778 --> 40:51.299
So that is programmed here.

40:52.967 --> 40:56.731
where n again is the note that is going to be passed through here.

40:57.472 --> 41:08.705
And instead of writing each note twice, you can get a control condition where you play a ring of notes and then do specific operations every time with every single note.

41:09.366 --> 41:09.887
Does that make sense?

41:09.907 --> 41:12.069
So you can play with this in a multiple...

41:12.950 --> 41:31.747
ways you can have an arpeggiation based on a note plus eight seven whatever every single time and then finally there is like a drum sample start so this is kind of a way of thinking about these coding blocks compositionally you will need help because

41:32.888 --> 41:35.692
I don't know what exists residentially in Sonic Pi.

41:36.233 --> 41:46.768
So don't be afraid to click on help and check out samples, effects, synths, because there's a lot of them that you can use.

