1 00:00:00,480 --> 00:00:03,480 foreign 2 00:00:11,420 --> 00:00:18,359 who has sent in a 3 00:00:15,059 --> 00:00:21,380 introduction to beat making with python 4 00:00:18,359 --> 00:00:21,380 and foxdot 5 00:00:26,840 --> 00:00:32,640 hey everyone I'm sangushnan and thank 6 00:00:30,660 --> 00:00:35,520 you for coming to my talk which is beat 7 00:00:32,640 --> 00:00:37,500 making with python and Foxton so during 8 00:00:35,520 --> 00:00:40,620 the course of this talk I will introduce 9 00:00:37,500 --> 00:00:43,860 Fox Dot and how you can you know use the 10 00:00:40,620 --> 00:00:46,020 flexibility of python to make really 11 00:00:43,860 --> 00:00:49,079 good music and in the process we will 12 00:00:46,020 --> 00:00:51,539 also you know write some code make some 13 00:00:49,079 --> 00:00:53,219 good music with code and you know it'll 14 00:00:51,539 --> 00:00:54,960 end with like a really cool song that 15 00:00:53,219 --> 00:00:57,239 I'm going to demo in the end so stick 16 00:00:54,960 --> 00:00:58,440 around it's going to be fun so before I 17 00:00:57,239 --> 00:00:59,940 get started with this talk I just want 18 00:00:58,440 --> 00:01:01,559 to acknowledge some of the other really 19 00:00:59,940 --> 00:01:04,140 cool talks that were given in the same 20 00:01:01,559 --> 00:01:06,240 topic which kind of inspired me to 21 00:01:04,140 --> 00:01:10,140 explore Fox Dot and also give this talk 22 00:01:06,240 --> 00:01:12,360 uh so shout out to Ryan kirkbride whose 23 00:01:10,140 --> 00:01:15,659 talk was at pycon UK and a shout out to 24 00:01:12,360 --> 00:01:18,240 Jessica Garson who saw picon talk was in 25 00:01:15,659 --> 00:01:20,220 2019. so these two are really cool talks 26 00:01:18,240 --> 00:01:21,840 so even after this talk if you feel 27 00:01:20,220 --> 00:01:23,040 inspired to kind of you know know more 28 00:01:21,840 --> 00:01:24,960 about it and learn more about it you 29 00:01:23,040 --> 00:01:28,920 should check out both of their talks 30 00:01:24,960 --> 00:01:30,960 cool so here are some mandatory links 31 00:01:28,920 --> 00:01:33,780 that I want to attach uh so the first 32 00:01:30,960 --> 00:01:35,340 one is to my repo which has all the 33 00:01:33,780 --> 00:01:37,140 slides and the code that I'm going to 34 00:01:35,340 --> 00:01:39,479 demo during the course of this talk and 35 00:01:37,140 --> 00:01:42,180 the second two optional links uh are to 36 00:01:39,479 --> 00:01:45,720 my Instagram and my SoundCloud where I 37 00:01:42,180 --> 00:01:48,960 uh kind of upload my Live code music to 38 00:01:45,720 --> 00:01:51,479 uh so I would appreciate any feedback 39 00:01:48,960 --> 00:01:54,240 positive negative what you think let me 40 00:01:51,479 --> 00:01:57,720 know uh good 41 00:01:54,240 --> 00:02:00,420 what is live coding code live coding is 42 00:01:57,720 --> 00:02:03,240 uh like this really awesome improvised 43 00:02:00,420 --> 00:02:06,659 performance art where you write code and 44 00:02:03,240 --> 00:02:11,039 use live coded tools uh like Fox dot you 45 00:02:06,659 --> 00:02:13,440 also have tools like Hydra p5.js Sonic 46 00:02:11,039 --> 00:02:16,200 Pi title Cycles you use all these 47 00:02:13,440 --> 00:02:20,220 amazing live coding tools uh to actually 48 00:02:16,200 --> 00:02:22,620 create music and visuals by writing code 49 00:02:20,220 --> 00:02:24,540 that's kind of projected on a screen so 50 00:02:22,620 --> 00:02:28,319 people can actually see what you're 51 00:02:24,540 --> 00:02:31,260 doing and as you do it live people kind 52 00:02:28,319 --> 00:02:33,180 of interact with it so uh it's a it's a 53 00:02:31,260 --> 00:02:35,819 really Niche it started off as this 54 00:02:33,180 --> 00:02:38,280 really Niche thing but now there are 55 00:02:35,819 --> 00:02:40,560 like live coding communities around the 56 00:02:38,280 --> 00:02:42,420 world and the movement is only getting 57 00:02:40,560 --> 00:02:47,040 like a lot bigger 58 00:02:42,420 --> 00:02:49,260 so what is foxtrot uh Fox start is a 59 00:02:47,040 --> 00:02:52,319 live coding environment uh where you can 60 00:02:49,260 --> 00:02:56,280 actually write python to make code so 61 00:02:52,319 --> 00:02:59,120 what fox dot kind of lets you do is it 62 00:02:56,280 --> 00:03:02,459 it gives you uh like a 63 00:02:59,120 --> 00:03:04,980 computerized synthesizer uh or what is a 64 00:03:02,459 --> 00:03:08,280 synthesizer how much time do you have uh 65 00:03:04,980 --> 00:03:09,900 synthesizer is not it's just an 66 00:03:08,280 --> 00:03:11,760 electronic musical instrument that kind 67 00:03:09,900 --> 00:03:14,940 of looks like a keyboard but it has a 68 00:03:11,760 --> 00:03:16,140 bunch of like you know uh tuner knobs uh 69 00:03:14,940 --> 00:03:18,840 where you can actually generate 70 00:03:16,140 --> 00:03:21,420 waveforms uh and you can tune those 71 00:03:18,840 --> 00:03:23,940 waveforms to sound different so you have 72 00:03:21,420 --> 00:03:25,920 sine waves you have square waves you 73 00:03:23,940 --> 00:03:27,720 have Sawtooth waveforms and all of these 74 00:03:25,920 --> 00:03:29,280 waveforms just sound different and you 75 00:03:27,720 --> 00:03:31,140 can use synthesizer to just create all 76 00:03:29,280 --> 00:03:34,200 these different waveforms so it becomes 77 00:03:31,140 --> 00:03:36,959 like an infinite musical instrument you 78 00:03:34,200 --> 00:03:39,480 know you can do like a lot of things and 79 00:03:36,959 --> 00:03:42,900 fox dot gives you the power of a 80 00:03:39,480 --> 00:03:44,580 synthesizer uh with python so you can 81 00:03:42,900 --> 00:03:46,379 just write python to code up whatever 82 00:03:44,580 --> 00:03:48,659 you would do with your synthesizer which 83 00:03:46,379 --> 00:03:51,900 is awesome uh but how is foxtrot doing 84 00:03:48,659 --> 00:03:54,900 it it's doing git with the help of this 85 00:03:51,900 --> 00:03:58,140 other really amazing software called 86 00:03:54,900 --> 00:04:00,299 super collider uh and it what fox dot is 87 00:03:58,140 --> 00:04:03,659 is just an abstraction on top of super 88 00:04:00,299 --> 00:04:05,640 collider uh with like a GUI it has its 89 00:04:03,659 --> 00:04:07,860 own IDE but in there this is an 90 00:04:05,640 --> 00:04:10,560 abstraction on super collider uh and 91 00:04:07,860 --> 00:04:12,900 super collider is the real hero uh it is 92 00:04:10,560 --> 00:04:14,939 an amazing platform which is made up of 93 00:04:12,900 --> 00:04:16,919 like an audio server it has its own 94 00:04:14,939 --> 00:04:18,720 interpreted programming language which 95 00:04:16,919 --> 00:04:21,299 is also called super collider and it 96 00:04:18,720 --> 00:04:23,220 also comes up with its own editor and it 97 00:04:21,299 --> 00:04:25,139 has a whole bunch of plugins that you 98 00:04:23,220 --> 00:04:27,000 can install you can build your own 99 00:04:25,139 --> 00:04:29,220 synthesizer with super collider it's 100 00:04:27,000 --> 00:04:32,340 like super powerful and it's it it's 101 00:04:29,220 --> 00:04:34,440 also the base of a lot of uh live coding 102 00:04:32,340 --> 00:04:37,560 tools like you know foxtor title Cycles 103 00:04:34,440 --> 00:04:40,440 uh Sonic Pi all of these kind of use 104 00:04:37,560 --> 00:04:42,360 super collider uh it's also like 105 00:04:40,440 --> 00:04:45,360 free and open source so 106 00:04:42,360 --> 00:04:48,479 it's awesome that's awesome uh good so 107 00:04:45,360 --> 00:04:51,060 how do you install Fox start uh first 108 00:04:48,479 --> 00:04:52,740 you need python which I'm guessing all 109 00:04:51,060 --> 00:04:54,900 of you would already have in your laptop 110 00:04:52,740 --> 00:04:57,360 apart from python you also need Super 111 00:04:54,900 --> 00:04:59,940 collider so you just go on to the 112 00:04:57,360 --> 00:05:02,820 website of super collider downloads 113 00:04:59,940 --> 00:05:04,800 install uh the latest version so 3.8 or 114 00:05:02,820 --> 00:05:07,320 above and then you also need tick enter 115 00:05:04,800 --> 00:05:11,220 which is the GUI which kind of opens up 116 00:05:07,320 --> 00:05:13,800 of fox.ui and along with that you also 117 00:05:11,220 --> 00:05:16,440 just pip install foxtort uh and after 118 00:05:13,800 --> 00:05:18,000 you have everything set up you open up 119 00:05:16,440 --> 00:05:20,040 super collider super collider opens up 120 00:05:18,000 --> 00:05:23,460 an interface and over there you just 121 00:05:20,040 --> 00:05:26,220 install uh this package called Fox dot 122 00:05:23,460 --> 00:05:28,500 uh and then so packages or extensions in 123 00:05:26,220 --> 00:05:31,560 super collider is called coax so you 124 00:05:28,500 --> 00:05:33,240 just do quarks.install fox Dot and then 125 00:05:31,560 --> 00:05:36,180 you just do a fox dot dot start which 126 00:05:33,240 --> 00:05:39,180 starts like a server which means now you 127 00:05:36,180 --> 00:05:42,000 have Fox dot plugin installed and ready 128 00:05:39,180 --> 00:05:44,400 to connect on super collider and now all 129 00:05:42,000 --> 00:05:47,039 you have to do is open your terminal and 130 00:05:44,400 --> 00:05:49,080 just go python hyphen M fox dot or type 131 00:05:47,039 --> 00:05:51,960 Fox Dot if you're not in a virtual 132 00:05:49,080 --> 00:05:53,520 environment and then you get you get 133 00:05:51,960 --> 00:05:55,919 this like nice IDE where you can write 134 00:05:53,520 --> 00:05:57,780 python code to play around with 135 00:05:55,919 --> 00:06:00,500 uh so 136 00:05:57,780 --> 00:06:05,039 it kind of looks 137 00:06:00,500 --> 00:06:06,780 something like this so this is the ID 138 00:06:05,039 --> 00:06:09,360 that pops up when I do you know python 139 00:06:06,780 --> 00:06:11,100 fnm Foxton 140 00:06:09,360 --> 00:06:15,660 cool 141 00:06:11,100 --> 00:06:18,120 so uh the basic of kind of everything in 142 00:06:15,660 --> 00:06:19,860 Fox dot is a player right a player is 143 00:06:18,120 --> 00:06:23,160 what you can use to play anything you 144 00:06:19,860 --> 00:06:25,620 want uh so we can define a player say 145 00:06:23,160 --> 00:06:27,180 let's say P1 and you define a player 146 00:06:25,620 --> 00:06:29,940 object and you can name a player 147 00:06:27,180 --> 00:06:32,160 whatever you want it and then you can 148 00:06:29,940 --> 00:06:35,400 hook it up to things so over here we are 149 00:06:32,160 --> 00:06:38,639 hoving it up to like a synthesizer uh 150 00:06:35,400 --> 00:06:40,979 it's like straight up and our synth is 151 00:06:38,639 --> 00:06:43,020 called profit so we have P1 which is a 152 00:06:40,979 --> 00:06:44,759 player we're hooking it up to profit and 153 00:06:43,020 --> 00:06:47,460 we are playing zero one two three which 154 00:06:44,759 --> 00:06:49,080 are the notes uh that have to play and 155 00:06:47,460 --> 00:06:51,720 then we can just stop this player by 156 00:06:49,080 --> 00:06:52,560 just doing P1 dot stop that's it super 157 00:06:51,720 --> 00:06:55,440 easy 158 00:06:52,560 --> 00:06:57,240 uh and then you can do like print synth 159 00:06:55,440 --> 00:06:58,860 devs to actually get like the list of 160 00:06:57,240 --> 00:07:00,960 synthesizers that are available for you 161 00:06:58,860 --> 00:07:03,120 so it's not just profit you have like 162 00:07:00,960 --> 00:07:05,340 pads you have saw you have like a bunch 163 00:07:03,120 --> 00:07:08,039 of the sizes that bunch of synthesizers 164 00:07:05,340 --> 00:07:10,500 you can play around with in foxtrot 165 00:07:08,039 --> 00:07:12,900 so actually let's come to the notes you 166 00:07:10,500 --> 00:07:17,400 know you see zero one two three here so 167 00:07:12,900 --> 00:07:20,340 what do these mean right uh so uh so 168 00:07:17,400 --> 00:07:23,220 over here the number zero uh is actually 169 00:07:20,340 --> 00:07:27,900 the first or the root node which is C 170 00:07:23,220 --> 00:07:31,199 and it's followed by d e f g a b uh and 171 00:07:27,900 --> 00:07:34,319 going back by one will uh give you the 172 00:07:31,199 --> 00:07:36,960 notes that are below middle C so -2 is 173 00:07:34,319 --> 00:07:39,900 the a that's actually below the middle C 174 00:07:36,960 --> 00:07:42,780 so think of it like a piano where you 175 00:07:39,900 --> 00:07:44,759 know uh node 0 is the middle C and then 176 00:07:42,780 --> 00:07:46,800 you can count the white keys up or the 177 00:07:44,759 --> 00:07:50,039 white keys down right 178 00:07:46,800 --> 00:07:52,259 so what about the Black Keys uh so you 179 00:07:50,039 --> 00:07:54,360 can actually just you know it's actually 180 00:07:52,259 --> 00:07:57,180 very intuitive 0.5 is going to be C 181 00:07:54,360 --> 00:08:00,180 sharp and 1.5 is going to be like you 182 00:07:57,180 --> 00:08:02,520 know uh the black key over here uh so 183 00:08:00,180 --> 00:08:04,020 it's like super in intuitive where you 184 00:08:02,520 --> 00:08:05,639 just represent your piano as just 185 00:08:04,020 --> 00:08:08,639 integers 186 00:08:05,639 --> 00:08:11,580 cool uh so now that we have a player uh 187 00:08:08,639 --> 00:08:13,259 players have a bunch of attributes uh so 188 00:08:11,580 --> 00:08:17,280 actually to describe this better I'm 189 00:08:13,259 --> 00:08:19,680 going to move ahead to my uh 190 00:08:17,280 --> 00:08:21,960 editor 191 00:08:19,680 --> 00:08:24,000 cool so we have defined a player and we 192 00:08:21,960 --> 00:08:25,979 have defined you have we have hooked up 193 00:08:24,000 --> 00:08:28,400 the synth to the player and I'm going to 194 00:08:25,979 --> 00:08:28,400 just play it 195 00:08:28,639 --> 00:08:34,800 and now I stopped it uh so very cool so 196 00:08:32,159 --> 00:08:36,959 it's just playing c d e f right which is 197 00:08:34,800 --> 00:08:38,159 the c major scale so I can just switch 198 00:08:36,959 --> 00:08:41,580 the scale and I can play a different 199 00:08:38,159 --> 00:08:43,800 scale if I want to uh so these are all 200 00:08:41,580 --> 00:08:45,480 the available synthesizers which I don't 201 00:08:43,800 --> 00:08:47,519 think is going to be really clear to you 202 00:08:45,480 --> 00:08:50,220 uh but yeah it has like a whole bunch of 203 00:08:47,519 --> 00:08:51,660 exercises that you can use uh it's not 204 00:08:50,220 --> 00:08:53,100 just going to be profit so I can just do 205 00:08:51,660 --> 00:08:54,680 pluck 206 00:08:53,100 --> 00:08:56,580 and 207 00:08:54,680 --> 00:08:59,220 it's gonna sound different it's a 208 00:08:56,580 --> 00:09:01,800 different deciser 209 00:08:59,220 --> 00:09:03,480 good uh so now coming up to player 210 00:09:01,800 --> 00:09:05,760 attributes that we just saw on the slide 211 00:09:03,480 --> 00:09:07,080 before so uh a player is going to have 212 00:09:05,760 --> 00:09:10,440 like a bunch of attributes that you can 213 00:09:07,080 --> 00:09:12,480 pass that can control things when uh 214 00:09:10,440 --> 00:09:15,240 synth is playing right like these knobs 215 00:09:12,480 --> 00:09:16,680 that you tune uh cool so here are some 216 00:09:15,240 --> 00:09:18,480 of the player attributes there are a lot 217 00:09:16,680 --> 00:09:19,500 of them as I showed you on the slide but 218 00:09:18,480 --> 00:09:22,260 these are some of them I'm going to 219 00:09:19,500 --> 00:09:23,640 explore the first one is notes of course 220 00:09:22,260 --> 00:09:25,800 it's going to be integers so it's going 221 00:09:23,640 --> 00:09:27,300 to be like you know D E F so I'm just 222 00:09:25,800 --> 00:09:30,120 playing these notes and then it's going 223 00:09:27,300 --> 00:09:32,940 to be the duration which here is one so 224 00:09:30,120 --> 00:09:35,760 it gives like our a 1B duration in 225 00:09:32,940 --> 00:09:38,160 between all these notes uh but what do 226 00:09:35,760 --> 00:09:40,860 you mean by like a 1p duration uh that 227 00:09:38,160 --> 00:09:43,500 is decided by the BPM which I am setting 228 00:09:40,860 --> 00:09:45,360 here as 120 which is like the tempo so 229 00:09:43,500 --> 00:09:46,440 there's going to be like 120 beats per 230 00:09:45,360 --> 00:09:50,040 minute that's what they're going to be 231 00:09:46,440 --> 00:09:52,760 playing uh and here is the octave so if 232 00:09:50,040 --> 00:09:58,680 I play this 233 00:09:52,760 --> 00:10:00,540 so it's octave 4 I make it octave 5. 234 00:09:58,680 --> 00:10:03,120 it's gonna be it's gonna be one octave 235 00:10:00,540 --> 00:10:04,740 higher so there are like a bunch of 236 00:10:03,120 --> 00:10:06,540 these parameters that I can tune so like 237 00:10:04,740 --> 00:10:08,160 there's going to be delay where you know 238 00:10:06,540 --> 00:10:10,860 how much should I wait before I play and 239 00:10:08,160 --> 00:10:13,560 I go I can also mention my route uh and 240 00:10:10,860 --> 00:10:15,899 a lot of other things so this is like a 241 00:10:13,560 --> 00:10:17,940 really powerful way uh to just play a 242 00:10:15,899 --> 00:10:19,920 synthesizer any synthesizer by just 243 00:10:17,940 --> 00:10:22,200 writing code and passing an array and 244 00:10:19,920 --> 00:10:24,540 passing parameters so how you write 245 00:10:22,200 --> 00:10:27,360 python you can just use the same way to 246 00:10:24,540 --> 00:10:30,420 make music I find that really amazing uh 247 00:10:27,360 --> 00:10:32,519 cool uh but actually the basis of making 248 00:10:30,420 --> 00:10:34,500 music is going to be patterns right 249 00:10:32,519 --> 00:10:36,720 patterns are super important when you're 250 00:10:34,500 --> 00:10:40,019 making music 251 00:10:36,720 --> 00:10:42,300 cool and uh Fox dot offers like a lot of 252 00:10:40,019 --> 00:10:44,040 ways where you can create patterns uh 253 00:10:42,300 --> 00:10:45,360 because it's just a list right so there 254 00:10:44,040 --> 00:10:47,160 are a bunch of intuitive ways where you 255 00:10:45,360 --> 00:10:49,440 can create patterns so you can do a 256 00:10:47,160 --> 00:10:51,600 shuffle a reverse swap a rotate a 257 00:10:49,440 --> 00:10:55,500 stretch trim you can also say like you 258 00:10:51,600 --> 00:10:59,220 know in this pattern for every three uh 259 00:10:55,500 --> 00:11:02,040 beats just reverse it you know and for 260 00:10:59,220 --> 00:11:04,740 like Fox dot can do all that so let's 261 00:11:02,040 --> 00:11:07,140 say I have this player and I have to 262 00:11:04,740 --> 00:11:08,700 play zero one two three zero one two 263 00:11:07,140 --> 00:11:10,500 three as notes and I don't want to type 264 00:11:08,700 --> 00:11:12,240 all of this out so I'm just going to 265 00:11:10,500 --> 00:11:13,500 Define like a pattern object and I'm 266 00:11:12,240 --> 00:11:15,540 going to say you know what play from 267 00:11:13,500 --> 00:11:18,540 zero to three like how you would do list 268 00:11:15,540 --> 00:11:21,959 slicing it's the same thing it's python 269 00:11:18,540 --> 00:11:24,600 list uh so on top of python list you can 270 00:11:21,959 --> 00:11:27,300 also do a shuffle which is going to just 271 00:11:24,600 --> 00:11:29,459 randomly Shuffle uh whatever notes that 272 00:11:27,300 --> 00:11:31,500 you have and you're going to also be 273 00:11:29,459 --> 00:11:33,480 able to do this every operation you know 274 00:11:31,500 --> 00:11:36,600 so let's say I want eight but after 275 00:11:33,480 --> 00:11:38,040 every your three bars I want to just 276 00:11:36,600 --> 00:11:40,320 like reverse it 277 00:11:38,040 --> 00:11:41,820 so I can just do that also like so the 278 00:11:40,320 --> 00:11:43,920 third one is going to be reverse the 279 00:11:41,820 --> 00:11:46,200 first two is going to be like one to 280 00:11:43,920 --> 00:11:48,300 eight one to eight and then eight to one 281 00:11:46,200 --> 00:11:50,640 so one to eight one two eight eight one 282 00:11:48,300 --> 00:11:52,320 so you know after every three iterations 283 00:11:50,640 --> 00:11:54,120 you just reverse it 284 00:11:52,320 --> 00:11:56,940 and there is also like other things you 285 00:11:54,120 --> 00:11:59,579 can do swap I can I can rotate I can 286 00:11:56,940 --> 00:12:01,560 stretch I can trim and I can another 287 00:11:59,579 --> 00:12:04,019 very cool thing is I can also call a 288 00:12:01,560 --> 00:12:06,120 Lambda function uh so what I can do is I 289 00:12:04,019 --> 00:12:08,940 can just say you know what pads I have 290 00:12:06,120 --> 00:12:11,579 pads my synth here is my pattern which 291 00:12:08,940 --> 00:12:15,740 is going to be eight notes so and I'm I 292 00:12:11,579 --> 00:12:19,380 say like you know what uh if 293 00:12:15,740 --> 00:12:21,480 the if if my note is an even number 294 00:12:19,380 --> 00:12:23,700 which means is divisible by 2 then 295 00:12:21,480 --> 00:12:25,500 increase it by like an octave 296 00:12:23,700 --> 00:12:27,120 it's like a very weird function and I 297 00:12:25,500 --> 00:12:28,500 can just write a Lambda function for it 298 00:12:27,120 --> 00:12:35,760 and I can display it 299 00:12:28,500 --> 00:12:38,880 [Music] 300 00:12:35,760 --> 00:12:40,800 cool I really like that uh so you can do 301 00:12:38,880 --> 00:12:43,260 this gives you like a lot of power 302 00:12:40,800 --> 00:12:46,019 because it's just Python and you can 303 00:12:43,260 --> 00:12:48,540 write really complex functions which you 304 00:12:46,019 --> 00:12:50,279 can execute by just mapping it across 305 00:12:48,540 --> 00:12:52,800 your pattern so you can create really 306 00:12:50,279 --> 00:12:54,420 cool patterns out of it uh but how do 307 00:12:52,800 --> 00:12:57,060 you make sure like the pattern sounds 308 00:12:54,420 --> 00:13:00,300 good right so you can do that by playing 309 00:12:57,060 --> 00:13:04,260 the scale uh so scales give you like a 310 00:13:00,300 --> 00:13:06,540 blueprint or a pattern uh of how node 311 00:13:04,260 --> 00:13:08,100 should be ordered right so what we 312 00:13:06,540 --> 00:13:09,540 played initially the keyboard that I 313 00:13:08,100 --> 00:13:12,360 showed you with just the white keys were 314 00:13:09,540 --> 00:13:14,339 zero one two three men c d e f g a b c 315 00:13:12,360 --> 00:13:16,440 that's like the c major scale right 316 00:13:14,339 --> 00:13:18,420 which is like the default scale uh in 317 00:13:16,440 --> 00:13:21,000 like western music and it's also the 318 00:13:18,420 --> 00:13:23,220 default scale in Fox dot but you can 319 00:13:21,000 --> 00:13:25,560 also switch your skill which means you 320 00:13:23,220 --> 00:13:28,139 can start from a different note and the 321 00:13:25,560 --> 00:13:30,240 Order of your notes is also going to be 322 00:13:28,139 --> 00:13:32,639 different so your zero one two three is 323 00:13:30,240 --> 00:13:34,380 not always going to be cdef it's going 324 00:13:32,639 --> 00:13:37,620 to change depending on what scale you're 325 00:13:34,380 --> 00:13:38,180 on so let's say I am playing the lydian 326 00:13:37,620 --> 00:13:43,880 scale 327 00:13:38,180 --> 00:13:47,160 [Music] 328 00:13:43,880 --> 00:13:50,459 so this is a much different scale than 329 00:13:47,160 --> 00:13:52,380 what uh the c major scale is and scales 330 00:13:50,459 --> 00:13:55,019 can also be used to represent emotions 331 00:13:52,380 --> 00:13:57,060 uh so we would just say maybe a major 332 00:13:55,019 --> 00:14:00,060 scale sounds really happy to you A minor 333 00:13:57,060 --> 00:14:02,160 scale might sound somber or like sad but 334 00:14:00,060 --> 00:14:04,620 actually that's debatable it depends on 335 00:14:02,160 --> 00:14:06,300 how you play the scale you can make a 336 00:14:04,620 --> 00:14:08,579 minor scale sound really happy by just 337 00:14:06,300 --> 00:14:11,339 playing the notes in the right order uh 338 00:14:08,579 --> 00:14:14,220 but scales have emotions associated with 339 00:14:11,339 --> 00:14:18,060 it inherently uh so you can use scales 340 00:14:14,220 --> 00:14:22,320 to control uh the those emotions that 341 00:14:18,060 --> 00:14:24,120 you evoke with your music uh uh but you 342 00:14:22,320 --> 00:14:25,500 know what let's say like for me 343 00:14:24,120 --> 00:14:27,720 personally I don't really know a lot of 344 00:14:25,500 --> 00:14:29,880 Music Theory so I'm oblivious as to like 345 00:14:27,720 --> 00:14:32,040 you know how do I play notes uh so what 346 00:14:29,880 --> 00:14:33,839 I do is I actually 347 00:14:32,040 --> 00:14:36,720 look at all of the scales that are there 348 00:14:33,839 --> 00:14:39,360 right and I just pick a scale and I 349 00:14:36,720 --> 00:14:41,699 create melodies by actually randomizing 350 00:14:39,360 --> 00:14:45,600 my choice uh over a loop so I just say 351 00:14:41,699 --> 00:14:48,300 you know what pick a random note uh in a 352 00:14:45,600 --> 00:14:50,760 particular octave uh in a Dorian scale 353 00:14:48,300 --> 00:14:54,180 and just randomize my duration between 354 00:14:50,760 --> 00:14:55,310 zero to one right and 355 00:14:54,180 --> 00:15:02,720 oh 356 00:14:55,310 --> 00:15:05,639 [Music] 357 00:15:02,720 --> 00:15:07,740 this is just a Melody it's a Melody that 358 00:15:05,639 --> 00:15:09,720 I just it's just random Melodies and 359 00:15:07,740 --> 00:15:12,079 it's going to be random every time you 360 00:15:09,720 --> 00:15:12,079 play it 361 00:15:16,820 --> 00:15:24,240 nice so this is awesome so you can just 362 00:15:20,399 --> 00:15:27,300 randomize things and play notes and 363 00:15:24,240 --> 00:15:28,980 rather than doing this random.choice uh 364 00:15:27,300 --> 00:15:30,120 across with the list comprehension we 365 00:15:28,980 --> 00:15:34,079 can actually do 366 00:15:30,120 --> 00:15:36,899 a random pattern so Fox dot also has you 367 00:15:34,079 --> 00:15:38,579 know a abstractions for things that you 368 00:15:36,899 --> 00:15:40,339 would commonly do so rather than doing 369 00:15:38,579 --> 00:15:42,480 this you can just type a random pattern 370 00:15:40,339 --> 00:15:44,760 among four notes just pick something 371 00:15:42,480 --> 00:15:46,380 random and what I'm doing here is I'm 372 00:15:44,760 --> 00:15:47,940 changing synth every time I'm playing 373 00:15:46,380 --> 00:15:50,100 and I'm taking from the list of sense 374 00:15:47,940 --> 00:15:52,019 definitions so every time I play this 375 00:15:50,100 --> 00:15:54,430 I'm going to have a different synth so 376 00:15:52,019 --> 00:15:59,230 let's try it out 377 00:15:54,430 --> 00:15:59,230 [Music] 378 00:16:00,540 --> 00:16:03,720 so every time I play it it's going to 379 00:16:01,920 --> 00:16:06,180 play the same kind of notes but in like 380 00:16:03,720 --> 00:16:07,800 a different sense so again I'm 381 00:16:06,180 --> 00:16:10,980 increasing the possibilities of 382 00:16:07,800 --> 00:16:12,959 Randomness here and you can just make 383 00:16:10,980 --> 00:16:16,139 just layer it on top of each other and 384 00:16:12,959 --> 00:16:19,680 you can make really cool stuff uh right 385 00:16:16,139 --> 00:16:21,480 awesome so now we know what patterns are 386 00:16:19,680 --> 00:16:23,639 now we know how to play notes now we 387 00:16:21,480 --> 00:16:25,260 know how to play since now we also know 388 00:16:23,639 --> 00:16:28,380 some of the attributes randomizations 389 00:16:25,260 --> 00:16:30,420 Melodies and stuff uh and now comes one 390 00:16:28,380 --> 00:16:33,060 of the one of my most favorite Parts 391 00:16:30,420 --> 00:16:36,000 about Fox Dot and why I think foxtrot is 392 00:16:33,060 --> 00:16:38,600 as powerful as it is which is time 393 00:16:36,000 --> 00:16:38,600 variables 394 00:16:38,779 --> 00:16:44,699 so time variables are kind of are these 395 00:16:43,380 --> 00:16:46,920 variables that you define by just 396 00:16:44,699 --> 00:16:48,660 defining a variable you pass a list of 397 00:16:46,920 --> 00:16:52,079 values and you pass a list of durations 398 00:16:48,660 --> 00:16:54,120 and these values change after a pretty 399 00:16:52,079 --> 00:16:56,639 predefined number of Beats which is set 400 00:16:54,120 --> 00:16:58,259 by the duration right so let's say I 401 00:16:56,639 --> 00:17:00,300 have this a which I'm defining as a 402 00:16:58,259 --> 00:17:03,180 variable which is going to be 0 and 4 403 00:17:00,300 --> 00:17:05,699 and my duration is 2. so after every 404 00:17:03,180 --> 00:17:07,439 second beat uh my variable is going to 405 00:17:05,699 --> 00:17:11,040 switch to four so it's going to be 0 406 00:17:07,439 --> 00:17:14,459 after 2 beats four right so I can 407 00:17:11,040 --> 00:17:16,799 actually do this uh to do live coding 408 00:17:14,459 --> 00:17:19,319 because that's what live coding is you 409 00:17:16,799 --> 00:17:22,860 know progressively change things as time 410 00:17:19,319 --> 00:17:24,660 moves ahead so time variables kind of 411 00:17:22,860 --> 00:17:26,579 let you do these things you can do this 412 00:17:24,660 --> 00:17:29,280 to create like you know uh chord 413 00:17:26,579 --> 00:17:31,860 progressions uh way or if you want to 414 00:17:29,280 --> 00:17:34,740 like uh switch to a new scale after like 415 00:17:31,860 --> 00:17:36,780 uh every 16 beats or every 8 Bits you 416 00:17:34,740 --> 00:17:39,600 can to do these things like that by time 417 00:17:36,780 --> 00:17:42,539 variables uh which I think is like 418 00:17:39,600 --> 00:17:46,020 really awesome so let's check out how we 419 00:17:42,539 --> 00:17:48,360 do that uh cool so let's say that we 420 00:17:46,020 --> 00:17:50,460 have defined this variable uh where the 421 00:17:48,360 --> 00:17:54,539 integers are going to be 0 5 1 2 which 422 00:17:50,460 --> 00:17:57,480 are notes uh but 0 will play 423 00:17:54,539 --> 00:17:59,460 uh after two beats five after one beat 424 00:17:57,480 --> 00:18:01,140 one after two beats and three after one 425 00:17:59,460 --> 00:18:03,059 beat so these are gonna be like the 426 00:18:01,140 --> 00:18:04,919 durations after which the variable 427 00:18:03,059 --> 00:18:07,320 should trigger you know these things 428 00:18:04,919 --> 00:18:09,559 these notes so if I'm going to just play 429 00:18:07,320 --> 00:18:09,559 this 430 00:18:13,390 --> 00:18:16,429 [Music] 431 00:18:16,460 --> 00:18:20,700 so you hear notes kind of played 432 00:18:18,840 --> 00:18:22,980 multiple times because there's like gap 433 00:18:20,700 --> 00:18:25,200 between those beats and the ones that 434 00:18:22,980 --> 00:18:27,000 kind of play more frequently you're 435 00:18:25,200 --> 00:18:29,460 going to hear them multiple times right 436 00:18:27,000 --> 00:18:31,620 like say five and three are what you're 437 00:18:29,460 --> 00:18:33,360 hearing you know multiple times uh so 438 00:18:31,620 --> 00:18:34,980 this is just a simple way to tune time 439 00:18:33,360 --> 00:18:38,220 variables but there are also like 440 00:18:34,980 --> 00:18:41,220 Advanced uh time variables like you have 441 00:18:38,220 --> 00:18:44,400 linear uh variables where you can 442 00:18:41,220 --> 00:18:47,640 actually linearly increase the value uh 443 00:18:44,400 --> 00:18:49,980 by just doing a linvar of zero to one uh 444 00:18:47,640 --> 00:18:52,080 for I think eight bars so you can just 445 00:18:49,980 --> 00:18:54,720 increase it gradually from zero to one 446 00:18:52,080 --> 00:18:57,720 you know uh so let's say I'm playing 447 00:18:54,720 --> 00:19:00,240 notes three to five and I want to just 448 00:18:57,720 --> 00:19:02,520 linearly increase you know as I go to 449 00:19:00,240 --> 00:19:06,440 eight Beats from zero to one it's gonna 450 00:19:02,520 --> 00:19:06,440 sound something like this 451 00:19:13,580 --> 00:19:17,520 I kind of think this sounds like an 452 00:19:15,900 --> 00:19:19,679 ambulance like an effect of like you 453 00:19:17,520 --> 00:19:21,299 know a thing that's kind of moving in 454 00:19:19,679 --> 00:19:23,280 front of you and the fact that you can 455 00:19:21,299 --> 00:19:24,600 do this with uh linear variables is like 456 00:19:23,280 --> 00:19:27,600 super cool then you don't have to kind 457 00:19:24,600 --> 00:19:30,120 of manually you know have a for Loop for 458 00:19:27,600 --> 00:19:32,700 I in every iteration of the particular 459 00:19:30,120 --> 00:19:34,559 beat linearly increase incremented by 460 00:19:32,700 --> 00:19:35,760 some value and then again decrement is 461 00:19:34,559 --> 00:19:37,679 like you don't have to do all that and 462 00:19:35,760 --> 00:19:39,419 you can just do a linware and foxtort 463 00:19:37,679 --> 00:19:42,900 inherently handles that for you I think 464 00:19:39,419 --> 00:19:45,840 that's pretty cool uh cool uh so again 465 00:19:42,900 --> 00:19:49,080 time variables awesome utilities but 466 00:19:45,840 --> 00:19:51,720 what I think also makes uh foxtrot 467 00:19:49,080 --> 00:19:53,280 really powerful is the ability to use 468 00:19:51,720 --> 00:19:55,080 samples 469 00:19:53,280 --> 00:19:57,900 uh 470 00:19:55,080 --> 00:20:01,580 so foxdot has inherently like a bunch of 471 00:19:57,900 --> 00:20:01,580 samples that you can use out of the box 472 00:20:02,580 --> 00:20:10,080 cool uh so you come to samples when uh 473 00:20:07,860 --> 00:20:13,260 we have just explored these nodes and we 474 00:20:10,080 --> 00:20:15,000 want to add some Juju to our music uh 475 00:20:13,260 --> 00:20:16,980 that's when we come to samples and fox 476 00:20:15,000 --> 00:20:20,520 dot has like a bunch of samples that we 477 00:20:16,980 --> 00:20:22,980 just printed right now uh so I think you 478 00:20:20,520 --> 00:20:27,120 cannot see a lot of all these samples uh 479 00:20:22,980 --> 00:20:29,940 but you can have uh things like a kick a 480 00:20:27,120 --> 00:20:33,419 snare a hi-hat a random voice some 481 00:20:29,940 --> 00:20:34,260 random noise a metal clanking uh you 482 00:20:33,419 --> 00:20:38,039 know 483 00:20:34,260 --> 00:20:40,440 you know just random noises uh so what 484 00:20:38,039 --> 00:20:43,220 you can do now is let's say I want to 485 00:20:40,440 --> 00:20:43,220 play a kick 486 00:20:44,280 --> 00:20:48,840 right 487 00:20:45,419 --> 00:20:51,140 uh let's say I want to play a cake and a 488 00:20:48,840 --> 00:20:51,140 snare 489 00:20:53,340 --> 00:20:57,559 cool now I want to add a hi-hat 490 00:21:00,600 --> 00:21:05,299 now let's add another hi-hat 491 00:21:12,900 --> 00:21:19,200 so this is actually the 4x4 4 on the 492 00:21:16,799 --> 00:21:22,320 floor disco beat that you hear in like a 493 00:21:19,200 --> 00:21:25,200 lot of disco songs uh from the 80s and 494 00:21:22,320 --> 00:21:28,440 even now actually uh but then a 4x4 495 00:21:25,200 --> 00:21:30,179 doesn't play as it is so right now we 496 00:21:28,440 --> 00:21:32,580 have just played one players but you can 497 00:21:30,179 --> 00:21:34,380 actually layer uh players on top of each 498 00:21:32,580 --> 00:21:37,260 other and you can have two players so 499 00:21:34,380 --> 00:21:40,320 let's say D1 is playing four by four and 500 00:21:37,260 --> 00:21:42,539 with D2 I want to add like some magic 501 00:21:40,320 --> 00:21:44,159 you know add some layers to a four 502 00:21:42,539 --> 00:21:46,080 fourth to a generic four by four beat 503 00:21:44,159 --> 00:21:47,100 right so let me just try to do some of 504 00:21:46,080 --> 00:21:50,220 that 505 00:21:47,100 --> 00:21:53,360 so 4x4 B I'm adding 506 00:21:50,220 --> 00:21:53,360 an open symbol 507 00:22:07,679 --> 00:22:14,100 so you can you can just add some layers 508 00:22:10,980 --> 00:22:16,919 on top of beads and just keep on adding 509 00:22:14,100 --> 00:22:19,620 layers and removing them and that's what 510 00:22:16,919 --> 00:22:21,059 makes foxtrot so powerful and amazing to 511 00:22:19,620 --> 00:22:23,159 make beats 512 00:22:21,059 --> 00:22:25,080 cool so this is just these are just 513 00:22:23,159 --> 00:22:26,640 really simple beats right so I want to 514 00:22:25,080 --> 00:22:29,400 do I want to go a little bit more 515 00:22:26,640 --> 00:22:32,580 complex right so you have these uh 516 00:22:29,400 --> 00:22:34,260 brackets round brackets so you use these 517 00:22:32,580 --> 00:22:36,620 round brackets when you want to play 518 00:22:34,260 --> 00:22:40,919 things as if they were one character 519 00:22:36,620 --> 00:22:43,260 which doesn't really make sense maybe uh 520 00:22:40,919 --> 00:22:45,679 so let me just sonically show you how 521 00:22:43,260 --> 00:22:45,679 that works 522 00:22:52,860 --> 00:22:59,600 so you have okay I've got something 523 00:22:56,820 --> 00:22:59,600 weird you have 524 00:22:59,659 --> 00:23:05,400 right uh so if you want to do 525 00:23:03,659 --> 00:23:06,780 right so let's say you have this one 526 00:23:05,400 --> 00:23:07,919 note and you have two nodes here and 527 00:23:06,780 --> 00:23:10,320 there you don't want to play them 528 00:23:07,919 --> 00:23:12,419 linearly you want to play them uh like 529 00:23:10,320 --> 00:23:13,679 they were individual notes right so 530 00:23:12,419 --> 00:23:16,320 that's what you can do with a round 531 00:23:13,679 --> 00:23:17,940 bracket uh so let me just show you how 532 00:23:16,320 --> 00:23:20,480 it happens and now that you I think 533 00:23:17,940 --> 00:23:20,480 you'll get it 534 00:23:21,840 --> 00:23:25,520 this is before this is after 535 00:23:30,600 --> 00:23:35,460 so uh this is how you can just create 536 00:23:32,880 --> 00:23:39,200 patterns uh without even 537 00:23:35,460 --> 00:23:41,940 with just minimal amount of code right 538 00:23:39,200 --> 00:23:43,919 and another bracket that you can use 539 00:23:41,940 --> 00:23:45,600 brackets are what it uses to actually 540 00:23:43,919 --> 00:23:47,640 create these patterns there's actually 541 00:23:45,600 --> 00:23:50,039 also this square bracket and square 542 00:23:47,640 --> 00:23:52,980 bracket can be used to play things twice 543 00:23:50,039 --> 00:23:55,140 as fast uh so let's say I have these two 544 00:23:52,980 --> 00:23:57,000 hi-hats that play at normal pace and 545 00:23:55,140 --> 00:23:59,900 three of these hi-hats that play kind of 546 00:23:57,000 --> 00:23:59,900 double the speed 547 00:24:01,260 --> 00:24:08,580 cool so this kind of thinks sounds like 548 00:24:05,159 --> 00:24:11,780 a trap beat right so I'm gonna add some 549 00:24:08,580 --> 00:24:11,780 drum to it 550 00:24:12,059 --> 00:24:20,210 foreign 551 00:24:14,250 --> 00:24:20,210 [Music] 552 00:24:20,600 --> 00:24:28,679 stuff and uh make it like a trap beat 553 00:24:24,120 --> 00:24:30,179 cool uh so now that we explored uh you 554 00:24:28,679 --> 00:24:33,480 know round bracket and square bracket 555 00:24:30,179 --> 00:24:35,520 there is also these uh conical brackets 556 00:24:33,480 --> 00:24:38,460 that you can use to play multiple 557 00:24:35,520 --> 00:24:42,360 sequences uh using just one string so 558 00:24:38,460 --> 00:24:45,260 let's say you have this beat right 559 00:24:42,360 --> 00:24:45,260 and you have this beat 560 00:24:46,919 --> 00:24:49,679 so they sound really well together right 561 00:24:48,539 --> 00:24:51,539 but you have to write two different 562 00:24:49,679 --> 00:24:52,980 lines to actually execute them and if 563 00:24:51,539 --> 00:24:56,580 you want to play them in the same line 564 00:24:52,980 --> 00:24:58,380 you can just use these brackets and just 565 00:24:56,580 --> 00:25:00,900 write them together and they will play 566 00:24:58,380 --> 00:25:03,320 independently as you know two separate 567 00:25:00,900 --> 00:25:03,320 sequences 568 00:25:05,100 --> 00:25:08,720 now to add some Juju to it 569 00:25:13,980 --> 00:25:22,080 cool uh this is how you kind of make uh 570 00:25:17,580 --> 00:25:25,140 beats in uh Fox dot so you can just add 571 00:25:22,080 --> 00:25:29,400 more complex patterns rhythms notes 572 00:25:25,140 --> 00:25:32,100 beats bass and all of this is 573 00:25:29,400 --> 00:25:33,419 is what makes up a live coded musical 574 00:25:32,100 --> 00:25:36,000 performance 575 00:25:33,419 --> 00:25:38,940 now that we covered most of it let's 576 00:25:36,000 --> 00:25:42,659 actually make a cover right uh so I'm 577 00:25:38,940 --> 00:25:44,279 going to set my BPM to 120 uh and I'm 578 00:25:42,659 --> 00:25:46,260 going to play like 579 00:25:44,279 --> 00:25:48,919 a basic 580 00:25:46,260 --> 00:25:48,919 drum beat 581 00:25:49,919 --> 00:25:56,820 cool so now uh I have my base that I 582 00:25:54,000 --> 00:25:59,720 have already defined my notes for 583 00:25:56,820 --> 00:25:59,720 I'm going to play it 584 00:26:09,419 --> 00:26:12,419 foreign 585 00:26:46,039 --> 00:26:53,279 good uh 586 00:26:49,200 --> 00:26:55,860 all right uh this is me uh thank you so 587 00:26:53,279 --> 00:26:57,720 much for attending this talk I hope you 588 00:26:55,860 --> 00:27:00,179 had fun I hope you learned something new 589 00:26:57,720 --> 00:27:01,860 and I hope you explore foxtrot to make 590 00:27:00,179 --> 00:27:03,659 some music of your own and if you do 591 00:27:01,860 --> 00:27:08,120 please share it with me I would love to 592 00:27:03,659 --> 00:27:08,120 hear it uh and uh thank you so much 593 00:27:16,159 --> 00:27:21,740 thank you thank you if you've enjoyed 594 00:27:19,740 --> 00:27:24,360 this talk uh you'll be able to find 595 00:27:21,740 --> 00:27:26,580 sengashnan on the Discord to ask any 596 00:27:24,360 --> 00:27:28,500 questions that you have 597 00:27:26,580 --> 00:27:31,980 we've got a bit of a break but then 598 00:27:28,500 --> 00:27:34,880 coming up down in room c will be the 599 00:27:31,980 --> 00:27:34,880 lightning talks