[00:00.000 --> 00:03.760] Yeah, I travel all over the world giving talks and workshops. [00:03.780 --> 00:11.760] That's one of the things I do a lot and I give soldering workshops. [00:12.240 --> 00:13.580] How many people here have soldered? [00:15.000 --> 00:15.640] Awesome. [00:16.200 --> 00:17.180] Soldering is great. [00:17.400 --> 00:30.880] It's one of the things that's a life force and I do little ones starting way back when and big ones including here at HOPE and I wrote a comic book about how to solder and see the title? [00:31.280 --> 00:32.200] It's true. [00:32.500 --> 00:34.220] It's easy and anyone can learn. [00:34.400 --> 00:37.420] Come on to the Hardware Hacking Village and you can learn too. [00:37.680 --> 00:51.800] I have a lot of kits that I've made to teach people who've never soldered before how to solder well and these are just a few of them and even people who know how to solder can have fun doing these. [00:52.080 --> 01:01.020] My latest kit is ArduTouch Music Synthesizer Kit because it didn't seem to be any kits around that made really awesome noises. [01:02.520 --> 01:04.820] The hardware for this is quite simple. [01:05.020 --> 01:14.180] It's just Arduino in the corner which is really just a microcontroller on a board, a little audio amp and speaker and then touch keyboard with a couple of pots and buttons. [01:14.400 --> 01:15.200] That's really it. [01:15.360 --> 01:25.960] The hardware is simple but the the firmware, the controlling software took me over two years to make with a brilliant firmware engineer friend of mine. [01:27.040 --> 01:38.320] But I've started started with a very alpha version of this doing workshops around the world and these are just three of many from a couple years ago to present. [01:38.840 --> 01:44.880] Most recently at hackerspace in Zagreb, Croatia. [01:46.020 --> 01:47.340] But now it's mature. [01:48.860 --> 01:51.460] I'm about to have the latest release on my GitHub. [01:51.860 --> 01:53.600] But this is good for learning to solder. [01:53.780 --> 01:57.400] It's also really good for learning how to program your own music synthesizers. [01:57.640 --> 01:58.780] I have good documentation. [01:58.780 --> 02:15.580] And you can also, if you want to learn how to do your own digital signal processing, which is the fancy phrase for how to do cool things with digital and analog world and convert back and forth and in this case make cool sounds, noise and music. [02:16.000 --> 02:18.260] Nasty noises, great stuff, whatever. [02:18.440 --> 02:19.780] So I love stuff like this. [02:20.500 --> 02:24.400] And here's just a little demo, hopefully the audio and video. [02:38.420 --> 02:39.340] Cool noises. [02:39.740 --> 02:39.740] Cool noises. [02:40.560 --> 02:41.000] Cool noises. [02:41.000 --> 02:41.500] And even music. [02:42.700 --> 02:48.260] So this is the synthesizer it comes with. [02:49.540 --> 02:55.680] The microcontroller comes pre-programmed and you can reprogram it with a lot of very, very different synthesizers. [02:55.800 --> 02:58.320] And I'll have just some brief demos at the very end as well. [02:58.620 --> 03:18.160] But just, I wanted to just put this in some context, not that this matches up to what I'm going to show, but one of the early forms of electronic music is from this guy, Leon Fairman, who made the thing that is really well known mostly for bad Hollywood movies about sci-fi from the 50s. [03:18.500 --> 03:22.480] But it's a great instrument and you can be a virtuoso on it. [03:22.600 --> 03:28.100] There's going to be a talk and a performance, rather, tonight by Amanda. [03:28.380 --> 03:32.080] I forget her last name, but she's amazing and she's going to give a workshop as well. [03:34.580 --> 03:39.840] And one of my... I've been into this stuff since I was a little kid and making my own music synthesizers. [03:40.020 --> 03:49.380] My professor at the University of Illinois, where a lot of really amazing early music synthesizer and electronic music came from, made his own in 1964. [03:50.000 --> 03:54.280] And here he is just a few months ago, a little older than when I remember. [03:54.280 --> 03:56.500] It's been a long time since I've been in university. [03:56.720 --> 04:01.020] But just playing an emulator of it in a museum at the university. [04:01.680 --> 04:07.500] And one of my kind of musical acrobat heroes, Keith Emerson from long ago. [04:07.640 --> 04:10.260] I know a lot of people think it's pretentious, but whatever. [04:10.380 --> 04:11.140] It was the 70s. [04:11.180 --> 04:12.060] I love this stuff. [04:12.280 --> 04:17.260] So he played a Moog synthesizer, which was an analog synthesizer. [04:17.260 --> 04:23.960] And when these early digital ones came along that were really cheap, this was like 70 bucks in 1979. [04:24.320 --> 04:25.500] And it worked. [04:25.680 --> 04:27.280] It was cheesy sounds, but it worked. [04:27.460 --> 04:29.280] And then Yamaha came up with this. [04:29.360 --> 04:32.680] And of course, I bought one used for really cheap. [04:32.860 --> 04:33.620] I got lucked out. [04:33.740 --> 04:35.540] And this has great noises. [04:35.540 --> 04:37.160] And this is totally digital. [04:37.700 --> 04:43.340] But even before that, I made my own digital music synthesizer and it was my master's thesis. [04:44.680 --> 04:48.000] And so I've been fascinated with this stuff ever since. [04:48.220 --> 04:52.620] And this is way easier to use than my master's thesis. [04:53.540 --> 04:54.940] But it works. [04:54.940 --> 05:01.000] And you solder it together and you can get all those sounds in more of that earlier demo video I showed you. [05:02.560 --> 05:09.740] But there's really two kind of main ways of doing music synthesis and generating your own with making circuits. [05:09.740 --> 05:13.200] One is analog, like this mini Moog from 1970. [05:13.400 --> 05:15.600] My roommate had one in college. [05:16.020 --> 05:18.040] And it was way fun to play with. [05:18.280 --> 05:21.100] But nowadays, for less... that was $2,000. [05:21.580 --> 05:25.280] And this is like 70 bucks. [05:26.320 --> 05:28.060] Teenage engineering pocket operator. [05:28.320 --> 05:29.780] They have a bunch of cool things. [05:30.040 --> 05:31.280] There's a lot of stuff out there. [05:33.000 --> 05:39.180] So analog, they start with a bunch of simple, basic waveforms. [05:39.300 --> 05:43.260] Sine, square, triangle, sawtooth, which looks kind of like the tooth of a saw. [05:43.780 --> 05:51.120] And then you can have knobs to change and mix and filter them to muck with the sound in all sorts of fun ways. [05:51.700 --> 05:53.440] But I'm talking about digital here. [05:53.560 --> 05:54.640] That's what my thing is. [05:54.640 --> 06:01.840] It's using microcontrollers, computer chips, in order to do amazing things to generate sound. [06:02.600 --> 06:03.740] And hopefully music. [06:04.000 --> 06:04.860] And hopefully noise. [06:05.060 --> 06:06.240] Because noise is cool, too. [06:06.680 --> 06:08.920] So digital, it's all about bits. [06:09.380 --> 06:11.320] And you break the analog world. [06:11.500 --> 06:12.300] That's what we live in. [06:12.380 --> 06:15.120] The analog world where everything's kind of smooth and continuous. [06:15.420 --> 06:16.780] And you break it down into little bits. [06:16.900 --> 06:19.520] And then you muck with it in all sorts of interesting ways. [06:19.520 --> 06:24.360] And then you put it back together so it's back in the analog world where it can affect our lives. [06:24.600 --> 06:25.780] Hopefully in better ways. [06:26.700 --> 06:30.300] So there's a lot of different kinds of digital synthesis. [06:32.000 --> 06:35.520] And I'm going to talk about one form, which I'll show third. [06:35.760 --> 06:37.920] But additive is really interesting. [06:38.100 --> 06:40.860] You can take a whole bunch of the simple sine waves. [06:40.920 --> 06:43.800] These smooth ones, like the one in the top there. [06:43.800 --> 06:49.300] Add it with other sine waves of various frequencies and volumes, amplitudes. [06:49.860 --> 06:53.120] And you can get whatever waveform you want. [06:53.380 --> 07:00.500] And this is one that shows that adding some sine waves together get things that start approximating a square wave. [07:00.640 --> 07:05.420] And if you add enough of them together, you get something indistinguishable from a square wave. [07:05.840 --> 07:10.020] Another kind, which the DX7 had, is FM. [07:10.020 --> 07:12.800] And that gets just crazy noises. [07:13.120 --> 07:15.760] And you can have things that sound like bells and trumpets. [07:15.980 --> 07:21.600] And that's just changing the frequency back and forth really, really fast with sine waves or other waveforms. [07:22.700 --> 07:27.320] What I... and my ArduTouch uses both of those kinds as well. [07:27.520 --> 07:30.600] But primarily, I'm going to talk about wavetable. [07:31.200 --> 07:35.540] Because this is an easy way to start learning about digital signal processing. [07:37.580 --> 07:49.640] So, I don't know if any of you, when you were a kid or even when you're an adult, take a turntable with vinyl records and you can spin it around and make the thing go faster or slower or even backwards. [07:50.320 --> 07:52.380] You can do that as well with tapes. [07:52.800 --> 07:55.960] When you go faster, of course, the pitch gets higher and faster. [07:56.180 --> 07:59.920] And when you slow it down, it gets really slow and low. [08:00.680 --> 08:02.460] You can do that with a tape as well. [08:02.600 --> 08:08.220] And wavetable synthesis is kind of like that, except it's digital, a digital form of that. [08:08.580 --> 08:13.460] The waveform is in memory instead and you can play it back from memory faster and slower. [08:13.700 --> 08:14.860] That's one way you can do it. [08:15.840 --> 08:17.580] So, let's see how to do that. [08:17.760 --> 08:21.760] So, we have... starting with some waveform. [08:21.760 --> 08:24.760] This is just a simple sine wave, one cycle of one. [08:25.060 --> 08:26.220] And it's smooth. [08:26.520 --> 08:28.600] You can see it's all the... [08:28.600 --> 08:31.120] There's so many points, you can't see their points. [08:31.260 --> 08:33.900] That's like how our processing works in our brain. [08:34.020 --> 08:35.180] All these sounds are coming out. [08:35.280 --> 08:36.580] They're pushing on our eardrums. [08:36.660 --> 08:38.440] We're processing it in an analog way. [08:38.920 --> 08:39.760] Everything's smooth. [08:40.400 --> 08:43.780] We can't use this on a computer. [08:43.860 --> 08:45.740] We have to break it down into bits. [08:45.740 --> 08:49.440] And what we can do is slice it up with all these vertical slices. [08:50.600 --> 08:54.200] In practice, we want to have many, many more vertical slices. [08:54.420 --> 08:56.040] But I'm just having here a simple... [08:56.040 --> 08:57.760] Break it up into ten slices. [08:58.540 --> 09:02.000] And at each slice, there's a value. [09:02.360 --> 09:04.040] And I can put a dot there. [09:04.300 --> 09:11.640] So, it starts at zero and goes sort of two-thirds up and then almost the top and down and back up and around. [09:11.920 --> 09:16.980] And you can figure out the values of those and break them down. [09:16.980 --> 09:19.340] And then you can put them in a table. [09:19.980 --> 09:23.480] Each one of those dots with its value is called a sample. [09:24.020 --> 09:25.340] That's the technical term. [09:25.860 --> 09:28.180] But it's really just the value of each slice. [09:29.120 --> 09:31.500] And doing this is called sampling. [09:32.000 --> 09:33.880] So, we sampled the waveform. [09:34.060 --> 09:34.700] We put it there. [09:34.860 --> 09:37.480] And in practice, with computers, what we do is put that... [09:37.480 --> 09:40.220] It's exactly the same thing except now... [09:40.220 --> 09:41.200] Oh, yeah. [09:41.300 --> 09:41.960] It's called sampling. [09:41.960 --> 09:44.840] Now, it's the same thing except we put it in memory. [09:45.140 --> 09:46.980] So, I have ten memory locations. [09:47.300 --> 09:47.920] Zero through nine. [09:48.140 --> 09:49.080] And I've got values. [09:49.820 --> 09:56.180] So, that is a sampled one cycle of a sine wave with ten samples. [09:56.560 --> 09:57.180] Ten slices. [09:58.420 --> 09:59.280] Is this making sense? [09:59.520 --> 10:00.820] It's not too hard, I hope? [10:01.820 --> 10:02.280] Cool. [10:02.820 --> 10:05.740] So, you don't have to have a simple waveform like a sine wave. [10:05.740 --> 10:08.700] And you can have way more than ten values in memory. [10:08.880 --> 10:13.060] But you can have complex waveforms. [10:13.180 --> 10:15.820] And that's like a teeny little bit of a piano sound. [10:16.100 --> 10:18.320] And put that in memory. [10:19.000 --> 10:21.680] And that's digitizing the waveform. [10:22.320 --> 10:26.940] But that is called digital to analog conversion. [10:26.940 --> 10:28.100] What I just described. [10:28.520 --> 10:30.260] And so, we start with the waveform. [10:30.580 --> 10:31.840] We do analog to digital. [10:31.840 --> 10:38.760] And we end up with all the values in memory which are that waveform. [10:39.120 --> 10:39.940] Kind of. [10:40.140 --> 10:41.440] As the computer sees it. [10:42.220 --> 10:45.600] To get it back into our real world, we've got to do the opposite. [10:46.100 --> 10:47.580] Analog to digital conversion. [10:48.080 --> 10:50.760] So, I have another diagram which looks very similar but backwards. [10:51.500 --> 10:51.980] Oh. [10:52.140 --> 10:52.540] A to D. [10:52.680 --> 10:52.840] Sorry. [10:54.580 --> 10:57.840] So, A slash D is the abbreviation. [10:58.560 --> 11:00.280] Analog to digital conversion. [11:01.880 --> 11:03.860] So, to play it back, we do the opposite. [11:04.160 --> 11:05.740] And here's the opposite. [11:05.940 --> 11:07.100] We have values in memory. [11:07.100 --> 11:09.420] We do one value at a time. [11:09.580 --> 11:11.220] Feed it to this black box here. [11:11.360 --> 11:13.200] Call it digital to analog converter. [11:13.440 --> 11:15.460] And out comes this analog signal. [11:15.640 --> 11:21.060] Something that we can put into a spiffy amplifier and make lots of noise and sound and music. [11:21.660 --> 11:22.140] Okay. [11:22.460 --> 11:25.720] So, this is called D slash A. [11:26.120 --> 11:29.740] That's what most people into this stuff call it. [11:30.160 --> 11:31.840] And so, D to A. [11:32.640 --> 11:35.500] But what's inside of this D to A box? [11:35.760 --> 11:39.640] Oh, I forgot to mention also, let me go back here with A to D. [11:40.280 --> 11:42.540] Inside of that black box, it can be a chip. [11:42.540 --> 11:49.680] Or it can usually, nowadays, even in really cheap microcontrollers, built into the microcontroller itself. [11:50.960 --> 11:56.280] And so, you can do this process with hardly any work at all. [11:56.440 --> 12:00.060] Just a little bit of firmware and controlling software. [12:00.400 --> 12:02.440] So, to do D to A, it's really similar. [12:02.440 --> 12:09.420] This can be a chip or it can be this other form called PWM. [12:09.960 --> 12:12.540] The chip is really cool and it works great. [12:12.540 --> 12:15.820] But it's expensive to have a good one. [12:16.600 --> 12:22.360] This thing called PWM is what I use with my RG Touch synthesizer. [12:22.480 --> 12:23.620] And a lot of people use it. [12:23.820 --> 12:25.200] And it's free. [12:25.200 --> 12:30.960] It takes time to write the controlling software, the firmware it's called in a microcontroller. [12:31.400 --> 12:32.140] Computer chips. [12:32.580 --> 12:33.820] So, let's see how this works. [12:34.280 --> 12:39.300] So, I'll tell you what PWM actually means at the end of this. [12:39.460 --> 12:41.280] So, a square wave is a square. [12:41.700 --> 12:46.220] It's on for half the time, off for half the time, on, off, on, off, on, off. [12:46.300 --> 12:50.500] Whatever rate it is, it's always on half the time and off half the time. [12:53.160 --> 12:57.600] And this would be half the time on. [12:57.600 --> 13:03.460] So, it has half the energy from if the signal were just high all the time. [13:04.080 --> 13:04.740] All right? [13:04.820 --> 13:13.560] We can make this, though, not a square wave, half and half, but a pulse wave, where it's on for some time and off for the rest. [13:13.820 --> 13:18.920] And it can be 25% on, 75% off, or whatever percentage we want. [13:18.920 --> 13:22.500] So, here's just a bunch of different ones. [13:22.780 --> 13:24.180] And they don't have to be round numbers, either. [13:24.320 --> 13:34.000] They can be absolutely any ratio we want, which means we can have whatever energy we want compared to if it's on all the time. [13:35.500 --> 13:36.020] Okay? [13:36.020 --> 13:40.500] So, this is called PWM. [13:40.700 --> 13:49.120] Because we can vary the width between zero on, 100% off, or all the way up to 100% on, zero off. [13:49.260 --> 13:50.300] And anything in between. [13:50.740 --> 13:57.840] In electronics, when you change the value of something over time, the fancy word is modulation. [13:57.840 --> 14:05.000] So, this is modulating the on time, or modulating the amount of energy over time. [14:05.260 --> 14:08.560] And we're varying that with pulse widths. [14:08.680 --> 14:10.180] So, pulse width modulation. [14:10.780 --> 14:19.900] So, this is what we do for our D to A in order to convert the numbers into an analog signal by taking... [14:19.900 --> 14:21.660] Let me go back to that table. [14:23.220 --> 14:30.060] The numbers from here, and converting that just into a percentage on, off, for pulse waves. [14:30.540 --> 14:34.160] Going through our... and that's actually in the microcontroller, the D to A. [14:34.480 --> 14:35.540] And then we get the signal. [14:35.680 --> 14:37.740] We can put it into an amplifier and make noise. [14:38.060 --> 14:39.060] And wonderful stuff. [14:39.440 --> 14:40.160] Even music. [14:40.800 --> 14:44.220] Although, according to John Cage, everything's music. [14:45.400 --> 14:46.660] And I think that's cool. [14:47.220 --> 14:49.060] So, um... [14:51.140 --> 14:52.100] But, um... [14:52.100 --> 14:55.060] In practice, um... [14:55.960 --> 14:59.420] Things are a little bit different than in that theory I just told you. [14:59.420 --> 15:11.680] What we want is for these numbers to go into our D to A, which is pulse width modulation, and out comes a perfect replication of what we recorded earlier with analog to digital. [15:12.600 --> 15:14.740] Doesn't work that way, unfortunately. [15:16.020 --> 15:21.420] Because it's digitized, and when we bring it back to the analog world, it's going to be funky. [15:21.760 --> 15:24.580] We get this sort of staircase effect. [15:26.100 --> 15:30.260] That's what the signal would look like, which is a bit different than that. [15:32.180 --> 15:50.680] So, fortunately, according to theory, all we need is a perfect low-pass filter between our black box D to A converter, in this case pulse width modulation, go through the perfect low-pass filter, and we get this perfect waveform exactly what we recorded earlier. [15:52.080 --> 15:54.160] Perfect doesn't exist in our world. [15:54.780 --> 15:56.860] Have you noticed our world isn't perfect? [15:57.320 --> 15:59.360] Whatever that would mean, it's not it. [15:59.940 --> 16:00.500] So, um... [16:01.340 --> 16:02.220] They don't exist. [16:02.460 --> 16:12.980] But we can have a really cheap low-pass filter, and then we get this thing that looks very sine wave-like, but it's kind of wiggly and ugly. [16:15.340 --> 16:24.640] So, what we do to fix that problem is instead of having just 10 samples, we can have many, many, many more, and it's a better and better approximation. [16:25.260 --> 16:37.020] And so, if we have, say, 256 instead of 10, then we get this, which to our eyeballs is indistinguishable from the original signal. [16:37.020 --> 16:47.880] Our ears are a bit more sensitive when it comes to things, so we can hear some of the strange artifacts of digital, which is why digital is never quite as good as really, really good analog. [16:48.200 --> 16:49.360] But it's still really cool. [16:49.560 --> 16:50.720] We can do lots of stuff with it. [16:51.840 --> 17:01.380] So, what we want is lots more samples, and also it's more accurate if our table of numbers, all the samples, have more bits. [17:01.920 --> 17:08.320] So, if we have 8-bit bytes, that's less accurate, but it's still really good. [17:08.320 --> 17:12.120] If we have 16-bit words for each sample, that's even better. [17:15.000 --> 17:27.360] So, that is how we get from the analog world to having it in a computer, and then once it's in the computer, we can muck with it, and then send it out in the D to A to get actual sound and music. [17:28.400 --> 17:30.400] But, what pitch is it? [17:30.900 --> 17:44.620] And by pitch, that's frequency, is a fancy electronic word, but pitch is a musical note, all the way from way down low in the low part of the keyboard, all the way up to the high part of the keyboard, and you don't even need a keyboard. [17:44.620 --> 17:46.500] It's just pitch, musical sounds. [17:47.660 --> 17:51.400] So, to talk about pitch, I have to get into a bit of math. [17:52.100 --> 17:53.420] Are we okay with math? [17:55.700 --> 17:56.260] Sorry. [17:58.420 --> 18:03.580] So, this isn't too complicated, but, you know, hopefully you'll just get a feel for this. [18:03.820 --> 18:10.600] So, you can have the sampling rate when you do the analog to digital conversion. [18:10.600 --> 18:17.680] We have, while we're actually recording in real time, we can break it up into the signal into slices at very fast speeds. [18:18.540 --> 18:21.340] And with a cheap microcontroller, not so fast. [18:21.340 --> 18:25.600] But with R2 touch, it was at 15,000 times a second. [18:25.620 --> 18:43.780] If we have a sine wave, say, with 256 memory locations, 256 samples, and it got stored in there 15,000th of a second a piece, that's a 15,000 times a second sample rate, or 15 kilohertz sample rate. [18:46.720 --> 18:58.960] So, for that, if we go through all the values of one sine wave, 15th of a second each, then we go through the complete cycle in... [18:58.960 --> 19:03.340] We can do that in 58.6 times a second. [19:04.760 --> 19:14.860] So, that's the note we would get with the sampling rate given at the rate that the R2 touch is possible to do. [19:15.880 --> 19:17.720] That's a low note. [19:18.700 --> 19:23.560] That's a pitch which is not even one in our standard musical scale. [19:24.360 --> 19:28.840] It's a little bit near A sharp. [19:29.200 --> 19:30.840] The second to lowest A sharp. [19:31.360 --> 19:33.140] Not the most useful pitch. [19:33.860 --> 19:37.340] We want to have whatever pitch we want, not just be stuck with one. [19:37.520 --> 19:38.760] So, we have to change that. [19:40.280 --> 19:46.640] If you remember, we had the tape loop thing, and there was a speed control so we can speed it up and slow it down. [19:46.640 --> 19:51.400] That's one way to change the pitch, and we can change the pitch to be whatever we want that way. [19:51.680 --> 20:00.080] You can go through the table that way and get whatever pitch you want, but 1 15th of a second is the fastest we can go through those. [20:00.220 --> 20:07.920] So, the highest note we could get in that method would be 58.6, like about A sharp on the lowest of the keyboard. [20:08.240 --> 20:09.280] Not so cool. [20:09.540 --> 20:13.220] So, another way to do it is to skip samples. [20:14.080 --> 20:18.800] And that's actually called interpolating. [20:21.840 --> 20:22.460] Interpolating. [20:22.720 --> 20:24.280] Let me show you how that works. [20:24.520 --> 20:28.060] So, let's say we want to have exactly an A. [20:28.360 --> 20:35.180] And in musical theory, A in modern music is defined as 440 hertz. [20:35.800 --> 20:37.800] So, 440 times a second. [20:38.460 --> 20:39.520] That's an A. [20:40.040 --> 20:41.260] We want that. [20:41.260 --> 20:59.020] At 15,000 samples per second, 15 kilohertz sample rate, divide that from 440, and we get 34.09 steps that we have to skip in our table each time in order to get that speed. [20:59.320 --> 21:01.960] 440 times a second for the complete cycle. [21:02.160 --> 21:04.100] Again and again, 440 times a second. [21:06.080 --> 21:09.360] How do we do 34.09 memory locations? [21:10.900 --> 21:12.060] That's not so easy. [21:12.300 --> 21:13.320] It's not so hard though. [21:13.580 --> 21:14.860] We can do some tricks. [21:16.800 --> 21:19.780] So, this is where interpolation comes in. [21:20.180 --> 21:21.780] That's a mathematical term. [21:22.020 --> 21:22.880] Sorry about the math. [21:23.060 --> 21:23.920] But it's not so hard. [21:24.060 --> 21:24.960] Just bear with me here. [21:24.960 --> 21:27.380] So, the first sample is just location zero. [21:27.720 --> 21:34.960] The next sample is 34.09 locations later. [21:35.340 --> 21:37.700] We can't do 34.09. [21:38.000 --> 21:39.640] We can do 34. [21:39.680 --> 21:41.300] We can do 35. [21:41.300 --> 22:02.060] But what we want is to take the values that are in these memory locations, whatever's in 34, add it to what's in 35, and take some kind of weighted difference that's .09 away from 34 and pretty far away from 35. [22:02.380 --> 22:03.500] So, really close to 34. [22:03.700 --> 22:10.320] We can do this as accurately as we want with a microcontroller using fixed point mathematics arithmetic. [22:11.560 --> 22:20.620] So, the next one is going to be 34.09 later than 34.09 to get to 68.18. [22:21.580 --> 22:29.860] And again, we do a weighted average between 68 and 69 to get the proper value and we feed that into the D to A. [22:30.160 --> 22:44.580] And then for the next sample, the fourth one, we add 34.09 to the last one and we get 102.27, that's between 102 and 103, a weighted average of that, send that into the D to A, and et cetera, et cetera. [22:44.780 --> 22:49.840] Eventually, we get to the seventh sample and... [22:53.000 --> 22:55.640] Oh, that one's supposed to be down at the bottom, sorry. [22:56.860 --> 23:05.120] And then we add 34.09 and we get 272.72. [23:05.360 --> 23:17.440] And we only have 256 memory locations, so we've got to wrap up to the beginning and then go to what turns out to be 16.72 and we do a weighted average. [23:17.580 --> 23:23.380] And we just keep going and going and going and then we get this really nice sine wave if we put it through our low-pass filter. [23:25.780 --> 23:28.960] And yeah, that's really all there is to that. [23:30.500 --> 23:38.000] So that's somewhat complicated to code, even if that all made total sense to you. [23:38.100 --> 23:48.140] It's somewhat complicated to code and you're doing this all in real time and have to keep up with it and not run out of time and have a glitch in your sound unintentionally. [23:48.300 --> 23:50.280] All the glitches in sound can be really nice. [23:50.480 --> 23:55.880] But if you don't want to do it, you know, it's a bit tricky to do. [23:56.060 --> 24:03.560] So with my R2 Touch, I made the controlling software, the firmware, which is in an Arduino. [24:04.580 --> 24:07.800] And Arduino programs are called sketches. [24:08.900 --> 24:14.340] That's because Arduinos were made for non-geeky artists and non-geeky artists they thought would be afraid of the word program. [24:14.720 --> 24:17.460] So it's not a program, it's a sketch, because art is sketch. [24:17.860 --> 24:19.100] But it's a program. [24:19.600 --> 24:27.040] And so the R2 Touch program, the sketch, I made it easy for people to do all of this so you don't even have to think about it. [24:27.460 --> 24:32.760] But it's really interesting to read my documentation in the comments because it teaches you how this all works. [24:33.120 --> 24:36.420] And, of course, everything I do is open source, so you can hack on it. [24:36.540 --> 24:38.800] And if you do anything cool, just, you know, let me know. [24:40.680 --> 24:46.920] So with the R2 Touch, all you have to do is create oscillators, and that's just a couple lines of code. [24:47.120 --> 24:51.780] And an oscillator can be square waves, sine waves, complex waveforms, whatever you want. [24:52.160 --> 24:58.920] And then that can happen when you press keys on the keyboard, or it can just do it when you do the knobs or press buttons. [24:59.380 --> 25:04.800] And then that makes these sort of static-sounding waveforms. [25:04.800 --> 25:06.760] They're just not changing. [25:06.920 --> 25:10.440] When you push the key, it's on, and it stays the same. [25:10.440 --> 25:12.700] As long as you're pressing the key and you let go of the key, it's off. [25:13.040 --> 25:20.560] So we have what's called dynamics, which alter that sound over time. [25:21.240 --> 25:24.360] And that's what makes sounds interesting. [25:25.120 --> 25:32.100] Like on a piano keyboard, you don't push a key, push that button, and it's just on. [25:32.960 --> 25:37.560] When you push the key, it goes ding and decays over time. [25:37.720 --> 25:45.500] And the sound actually has different harmonics and different richness that changes even as you're holding the key and it kind of decays. [25:45.500 --> 25:54.560] The dynamics in a music synthesizer can add those kind of things to it, so you have a really interesting sound. [25:57.300 --> 25:58.740] And, yeah. [25:59.080 --> 26:06.180] All that's kind of complicated to code, but that's really easy in my sketch from Arduino. [26:07.100 --> 26:11.340] So the oscillators have these waveforms and others. [26:11.740 --> 26:18.040] The dynamics can do lots and lots of different things, including ADSR, which I'll talk about next. [26:19.320 --> 26:23.440] And tremolo, which is making the... [26:23.440 --> 26:24.680] Well, I actually have some slides for that. [26:24.780 --> 26:26.020] So let me show you what these things are. [26:26.240 --> 26:29.380] So ADSR is what I described with a piano. [26:30.000 --> 26:33.360] When you press the key, it goes up really fast. [26:33.360 --> 26:41.280] Loudness goes up really fast and then down really fast and then decays slowly over time as long as you're holding the button, holding the key. [26:41.540 --> 26:43.140] And then when you let go, it decays quickly. [26:43.680 --> 26:45.300] So this is what's happening here. [26:45.440 --> 26:50.740] Attack is when you hit the key, decay happens as long as you're holding the key. [26:50.900 --> 26:55.980] After it decays, you keep holding the key, it can sustain the volume for a while. [26:56.100 --> 26:58.080] You let go and it decays quickly. [26:58.780 --> 27:06.880] So that's ADSR, and with ArduTouch and other synthesizer software out there, this is really standard. [27:07.140 --> 27:10.160] And this is called a sound envelope. [27:10.960 --> 27:14.780] So the envelope is the volume over time. [27:14.920 --> 27:20.920] And you can do some really interesting kind of effects by making the attack decay, sustain, release. [27:21.180 --> 27:26.080] Instead of like over several seconds long, you can make it fractions of a second and repeat and repeat and repeat. [27:26.080 --> 27:29.100] And then you get these bizarre sounds, which is really cool. [27:29.760 --> 27:35.140] So tremolo is changing the volume somewhat quickly. [27:35.960 --> 27:40.000] And you can do that with sine waves, square waves, triangle waves, or whatever. [27:40.380 --> 27:41.920] And at whatever rate you like. [27:42.200 --> 27:44.460] So it can be kind of like... [27:48.500 --> 27:49.680] Whatever rate you want. [27:49.820 --> 27:52.240] And it can be on-off, on-off, so it's... [27:52.240 --> 27:56.260] And if you make that really fast, then you get also really cool stuff. [27:57.900 --> 28:01.020] Portamento is the glide between one note and the other. [28:01.380 --> 28:03.900] And that first demo I showed you, that was there. [28:04.100 --> 28:05.160] So you can hit a note... [28:05.700 --> 28:06.740] And then go up here. [28:06.960 --> 28:08.120] Instead of going... [28:09.280 --> 28:11.260] It can go... [28:14.560 --> 28:15.900] And that's the glide. [28:16.060 --> 28:17.580] Portamento is the musical term. [28:18.320 --> 28:19.980] That can go really fast. [28:20.100 --> 28:20.860] It can also repeat. [28:21.000 --> 28:25.460] And if you can do that really fast at fractions of a second, that's called FM synthesis. [28:26.480 --> 28:30.380] And you get all those crazy sounds you can get on the DX7 and more. [28:31.660 --> 28:36.980] Envelopes, you can do not just attack decay, sustain release, but some of those other things I was talking about. [28:38.140 --> 28:40.480] Just mucking with the volume over time. [28:41.040 --> 28:47.560] Filters, like some examples of a filter that most people have heard of is treble and bass controls. [28:47.860 --> 28:53.080] But those can change automatically with your program control over time to get lots and lots of interesting things. [28:53.700 --> 28:56.560] A bass is kind of like a low-pass filter. [28:56.700 --> 28:58.620] It passes low frequencies, but not high. [28:58.940 --> 29:00.800] Treble is like high-pass filters. [29:01.000 --> 29:02.420] It lasts high through, but not low. [29:02.620 --> 29:04.760] You can also have a band-pass filter. [29:04.760 --> 29:09.580] So some pitches in the middle come through, and the others not much at all. [29:09.700 --> 29:15.980] And if you slide that window back and forth, and you do that really fast, then you can get trippy sounds. [29:17.000 --> 29:19.280] So at RD Touch, we have the ways to do that. [29:19.440 --> 29:21.120] And some of those I call effects. [29:21.180 --> 29:24.100] It's just messing with the sound in all sorts of ways. [29:24.760 --> 29:28.560] And all of that is just done with some simple lines of code. [29:29.720 --> 29:31.520] It's all Arduino-compatible. [29:31.680 --> 29:34.920] And Arduino, like I said, it's designed for non-geeky artists. [29:36.900 --> 29:42.220] And if you have code that's written well and commented, other people can learn from it. [29:42.260 --> 29:47.680] And I've got a bunch of examples that come with my Arduino library. [29:47.680 --> 29:52.140] And so you can download all this for free from my website or my GitHub. [29:52.680 --> 29:55.920] And now I've given it all to Microsoft. [29:56.100 --> 29:56.260] Yay! [29:56.760 --> 30:11.820] So if you follow examples one through nine, that's a way to learn how to program your own synthesizers using my code. [30:11.820 --> 30:17.700] I have some really cool synthesizers that make great sounds and music and noise. [30:18.180 --> 30:19.500] But you can make your own. [30:19.700 --> 30:22.900] And if you do something, please share it with me and you can do cool things. [30:23.480 --> 30:33.600] So the library has a bunch of low-level things that are the tricky things, but make high-level just function calls available. [30:33.900 --> 30:37.200] And you can just hack on the stuff that I made or come up with your own. [30:37.200 --> 30:41.780] And it's really easy to manipulate these things to make crazy sounds. [30:43.940 --> 30:51.440] So I have just lots and lots of things for mucking with the sound. [30:51.840 --> 30:57.360] Lots of waveforms, some really interesting complex ones as well. [30:58.160 --> 31:03.360] You can, with this sketch, this one makes a sawtooth. [31:03.360 --> 31:09.920] This is the complete synthesizer for making, when you press keys, to get sawtooth sound. [31:10.340 --> 31:11.600] One sawtooth wave. [31:12.360 --> 31:13.960] And you can make any note. [31:14.100 --> 31:15.320] You can go up and down octaves. [31:15.360 --> 31:18.720] You can play with the buttons, with the pot to make a different volume. [31:20.520 --> 31:21.880] And not much else. [31:22.040 --> 31:27.000] But you can see there's only a few lines of codes and a bunch of it is comments. [31:27.400 --> 31:28.440] Not even code. [31:28.900 --> 31:34.440] And you don't have to understand everything about C++, which is what Arduino uses. [31:34.620 --> 31:37.240] Even though they don't call it that because it's made for non-geeky artists. [31:37.420 --> 31:38.820] And they change the word to call it wiring. [31:39.240 --> 31:40.140] But it's C++. [31:41.800 --> 31:44.080] But it's just a few lines of C++ code. [31:44.160 --> 31:45.200] And you don't have to understand it. [31:45.260 --> 31:46.400] You just use it. [31:46.920 --> 31:48.560] And the comments tell you what to do. [31:48.560 --> 31:50.180] And if you follow through the examples. [31:50.180 --> 31:51.340] This is example eight. [31:52.600 --> 31:56.340] This will make enough sense so you can just try it yourself. [31:56.520 --> 31:57.000] Hack on it. [31:57.080 --> 31:57.640] See what happens. [31:58.280 --> 31:59.380] Can't do anything wrong. [31:59.740 --> 32:00.980] Well, it might not work too well. [32:01.060 --> 32:01.980] But it won't hurt anything. [32:02.080 --> 32:03.000] It won't damage anything. [32:03.380 --> 32:06.720] Maybe your roommate's sensibilities. [32:07.060 --> 32:09.360] But, yeah. [32:09.500 --> 32:14.240] So it's really, really easy from this total basic one to add tremolo, portamento. [32:14.260 --> 32:15.380] Those things I was talking about. [32:15.540 --> 32:16.680] Envelopes, filters, effects. [32:16.680 --> 32:18.760] And there's some really interesting effects as well. [32:18.880 --> 32:20.340] As well as cooler waveforms. [32:21.340 --> 32:22.920] Here's another demo. [32:25.280 --> 32:26.640] This one makes a drone. [32:27.640 --> 32:29.400] And you can play on top of it. [32:30.220 --> 32:33.660] And I make sure that you can't press a wrong note. [32:35.480 --> 32:37.320] And this is an Indian scale. [32:37.700 --> 32:38.600] Well, Indian-ish. [32:38.840 --> 32:41.120] So it's kind of exotic sounding. [32:44.250 --> 32:46.430] It's kind of minor, but it's not. [32:50.130 --> 32:54.190] And this has different presets as well for having different drones and different scale. [32:55.070 --> 32:57.290] And I'm always making these better, too. [32:57.790 --> 33:00.310] And that one's kind of beautiful, even though it's dark. [33:00.310 --> 33:01.690] But I like dark, too. [33:01.690 --> 33:05.870] So this one is nasty. [33:06.850 --> 33:08.370] It's called Zoid. [33:14.240 --> 33:17.140] And you can muck with the pots to make things different. [33:18.300 --> 33:20.600] You can do buttons to do presets. [33:24.230 --> 33:27.290] And yeah, do that on an analog synthesizer. [33:28.430 --> 33:30.050] I still like it a lot better. [33:30.230 --> 33:30.550] But still. [33:31.350 --> 33:33.070] You can do lots of cool things. [33:33.950 --> 33:35.690] This demo goes on for a while. [33:35.890 --> 33:36.470] Let me... [33:36.470 --> 33:37.110] Oh! [33:37.610 --> 33:39.470] You can control it in full-screen mode. [33:42.870 --> 33:43.910] Now, so... [33:43.910 --> 33:48.430] At just 30 more seconds, you can see some cool sounds it makes. [33:50.370 --> 33:51.490] Here's a preset. [33:55.800 --> 33:57.380] It's almost a bit of light. [34:03.580 --> 34:05.500] Drive everyone crazy at this point. [34:06.820 --> 34:10.320] So any kids out there, if your parents are being mean... [34:15.880 --> 34:20.120] Or an upstairs neighbor who's having too much sex. [34:25.820 --> 34:29.080] So anyways, all these different presets, I think you get the idea there. [34:30.460 --> 34:30.960] So... [34:30.960 --> 34:34.280] Again, all this is on GitHub. [34:35.000 --> 34:35.760] Play with it. [34:35.820 --> 34:36.360] Do what you want. [34:36.500 --> 34:38.400] If you do something interesting, please let me know. [34:38.400 --> 34:39.820] I'll share it with everyone else. [34:41.260 --> 34:45.860] And yeah, I've got a bunch of these kits on the mezzanine. [34:46.720 --> 34:52.320] But all day, all night, I'll teach anyone to solder on the mezzanine. [34:52.320 --> 34:54.140] Please come if you like. [34:54.720 --> 34:58.120] And a bunch of other people have their kits there as well. [34:58.280 --> 35:06.200] And there's also some free blinky badge kits from Hackaday, Supply Frame, and Tindy. [35:06.420 --> 35:07.740] They're all kind of one company. [35:07.880 --> 35:11.080] So you can grab those and learn to solder for free with those. [35:11.520 --> 35:14.120] The other kits, we have to charge for the materials. [35:14.580 --> 35:15.080] So... [35:15.080 --> 35:17.740] But anyways, that's what I had to say. [35:27.870 --> 35:34.670] Yeah, so if you've got any questions, comments, derisions... [35:35.350 --> 35:38.110] Is there any support for MIDI? [35:38.410 --> 35:39.010] Microphone. [35:39.530 --> 35:41.350] Right now, there's no support for MIDI. [35:41.530 --> 35:47.930] So I'm working on another version of this to have more cool functions. [35:47.930 --> 35:53.010] This is using the cheapest version of Arduino because I wanted this to be as cheap as possible. [35:53.170 --> 35:55.210] Eventually, I want it to be like a $25 kit. [35:55.590 --> 35:57.610] Right now, I have to charge $30 for it. [35:58.870 --> 36:04.570] But by getting parts in volume, I can maybe bring it down to $25. [36:04.910 --> 36:12.490] And because of that, I use the cheapest Arduino kind of microcontroller, which only has so many input-output pins. [36:12.490 --> 36:16.010] And I don't have enough pins left over for MIDI. [36:16.290 --> 36:23.370] But if we take away the keyboard, then you can put in a MIDI instead of the keyboard. [36:24.130 --> 36:28.130] And there's open-source MIDI for Arduino already there. [36:28.290 --> 36:30.450] So it could be hackable. [36:30.450 --> 36:48.130] But if you take the Arduino code and just switch out another spiffier microcontroller, one that has lots and lots of input-output pins and one that goes faster and one that has 32-bit things instead of 8-bit memory locations, you can get super high-quality sound. [36:48.370 --> 36:53.010] And this is really nice sound for this really cheap thing, but we can get way, way better. [36:54.370 --> 36:57.350] And that has lots of input-output pins, so we can have MIDI. [36:57.690 --> 37:00.490] And it's Arduino-compatible, a bunch of these chips. [37:00.630 --> 37:10.110] So with just changing one file, the lowest-level stuff, I should be able to have MIDI plus lots of other cool functions. [37:10.650 --> 37:13.310] But that's not next week. [37:14.790 --> 37:20.530] So in between travel time is when I'm doing this, along with the help of my friend Bill, who's just always playing with this stuff. [37:23.940 --> 37:29.620] On the one slide, you had the multiple sine waves that added together to make a different thing. [37:30.160 --> 37:34.100] Can you do that with the PWM recreation of the sine wave? [37:34.240 --> 37:35.960] Or would you even want to do that? [37:36.020 --> 37:37.700] Would that be advantageous in any way? [37:37.860 --> 37:40.720] And would that be like multiple PWM layers or something? [37:41.060 --> 37:43.740] Yeah, so the PWM, you can... [37:44.200 --> 37:47.900] It's just whatever value you put in, it's a D-to-A converter. [37:47.900 --> 37:51.440] So you put in values, and it can be random just to get... [37:51.940 --> 37:52.420] Whatever. [37:52.840 --> 37:54.540] It can be a nice sine wave. [37:55.220 --> 37:58.620] It can be nasty sounds and pleasant sounds. [37:58.840 --> 37:59.040] Whatever. [37:59.260 --> 38:00.340] It can be complex sounds. [38:00.340 --> 38:01.780] It can be a recording of a piano. [38:02.280 --> 38:03.620] Whatever you want. [38:03.780 --> 38:13.900] But you can also have, sort of underneath the scene, say, here's the value for a sine wave of this volume at this frequency. [38:13.900 --> 38:19.640] And you calculate those values with the wavetable of a sine wave. [38:19.760 --> 38:28.120] And now with the same wavetable of that sine wave, you can say, okay, well, I'm going to have a sine wave of a different volume amplitude and a different frequency. [38:28.420 --> 38:33.360] And then you can add those values together and then send it to the D-to-A. [38:34.780 --> 38:42.820] And do that for every memory location that you need to do to get those two sine waves of different volumes, different amplitudes, and different frequencies. [38:43.120 --> 38:48.460] And then you get two sine waves added together coming out of your D-to-A, which you amplify and put through a speaker. [38:49.240 --> 38:53.660] Or put through whatever effects you want, like guitar effects pedals or whatever. [38:54.220 --> 39:02.300] You can do that with 3, 5, 20, whatever, however many sine waves you want to get whatever waveform you like. [39:03.360 --> 39:09.100] Adding sine waves together to create whatever waveform you want is done with Fourier analysis. [39:09.620 --> 39:12.280] That's a dead mathematician from France. [39:12.900 --> 39:14.580] But he left that for us. [39:14.820 --> 39:17.680] So, yeah, so we can do that. [39:18.140 --> 39:21.940] And you can also do FM as well as wavetable. [39:22.960 --> 39:23.460] Thanks. [39:23.840 --> 39:23.940] Yeah. [39:24.940 --> 39:25.860] Hey, how are you? [39:26.200 --> 39:26.420] Hey. [39:26.540 --> 39:29.460] Just like to say, there's a really beautiful piece of hardware you built there. [39:29.460 --> 39:31.300] It looks very Buchla-inspired. [39:32.080 --> 39:33.460] You know, you can see that in it. [39:33.680 --> 39:36.960] Is there a quick and easy way to implement CV? [39:37.240 --> 39:39.780] I mean, I know you'd mentioned that there's no MIDI support. [39:40.120 --> 39:47.380] But perhaps there are other easier ways to, you know, get access to controlling it. [39:47.760 --> 39:50.200] Have you thought any bit about that? [39:50.660 --> 39:54.400] You can mix digital and analog. [39:54.400 --> 39:59.020] So the first digital synthesizers weren't really digital. [39:59.180 --> 40:00.620] They were digitally controlled analog. [40:01.000 --> 40:01.120] Yeah. [40:01.400 --> 40:04.060] And so you can have control voltages. [40:04.700 --> 40:10.960] So all the different modules in like a mini Moog or even the big Moog like Emerson was playing. [40:12.300 --> 40:17.120] Those are all controlled with different amount of voltages that change over time. [40:17.120 --> 40:20.280] And all of those can be connected from oscillators and all these. [40:20.360 --> 40:22.100] And you see those patch cords to do it. [40:22.700 --> 40:23.440] That's a pain. [40:23.600 --> 40:28.600] But if you come up with a patch you like, it takes a long time to create that patch. [40:28.720 --> 40:30.300] But then you want to do a different sound. [40:30.400 --> 40:32.980] You take all those away and then do a different one. [40:33.060 --> 40:33.800] And it takes a while. [40:33.980 --> 40:40.520] And if you've got a live performance to do, you don't want to bore the audience by taking all these down. [40:40.520 --> 40:41.920] And then like, what did I do with that? [40:42.040 --> 40:42.720] Oh, here's a chart. [40:42.880 --> 40:44.040] And it's like, it takes five minutes. [40:44.560 --> 40:44.940] So... [40:46.300 --> 40:46.680] Yeah. [40:46.820 --> 40:47.600] Well, that's an option. [40:48.500 --> 40:53.560] But, you know, you can have digital control of all these things and have them configure themselves. [40:54.180 --> 40:54.560] And... [40:54.560 --> 40:57.180] But you don't need to have analog to do that. [40:57.340 --> 41:04.600] You can have control voltages controlling external analog things. [41:04.600 --> 41:06.800] And you can have them on the board and whatever. [41:06.800 --> 41:10.480] So, I have not done that since high school. [41:10.920 --> 41:12.700] But I did do that in high school. [41:13.020 --> 41:18.880] I took some oscillator chips that make analog outputs. [41:18.880 --> 41:25.660] And I controlled them digitally with a D to A converter being my voltage control. [41:27.900 --> 41:30.940] So, it's fun to do, but I haven't done that since high school. [41:30.940 --> 41:37.000] I meant just to, you know, get input into the device so that you could not have to... [41:37.000 --> 41:38.060] Oh, yeah. [41:38.180 --> 41:50.120] And so, you can have a knob with a voltage control and then you can have an A to D looking at that to have the firmware, the sketch in this case, do different things depending on that. [41:50.480 --> 41:53.940] Or, rather than a control voltage, you can just have... [41:56.380 --> 41:58.740] Well, I guess that's what I do with my knobs. [41:59.040 --> 42:00.520] There's a voltage on there. [42:00.640 --> 42:02.440] And as you change the knob, the voltage changes. [42:02.440 --> 42:06.180] And that's how I tell where the position of the knob is. [42:06.320 --> 42:09.020] And depending on the position of the knob, I can do different things. [42:09.320 --> 42:10.160] Change the volume. [42:10.540 --> 42:11.600] Change different patterns. [42:11.780 --> 42:12.400] Change the waveform. [42:12.580 --> 42:15.380] Or I can use the buttons to cycle through things. [42:16.140 --> 42:17.040] Things like that. [42:19.140 --> 42:21.180] Yeah, I know you said you were input restricted. [42:21.600 --> 42:25.760] But I was wondering if you have done anything, any kind of adaptation to use it as a vocoder? [42:26.680 --> 42:27.980] Oh, that'd be fun too. [42:28.360 --> 42:32.300] So, the vocoder, that's making an envelope. [42:33.500 --> 42:39.020] Just like ADSR, except the envelope is determined by the sound of your voice. [42:39.300 --> 42:41.580] Or you can put another instrument in there. [42:41.580 --> 42:49.400] And then the sound that the synthesizer's making takes on qualities of your voice or another instrument. [42:50.380 --> 42:51.780] And that'd be a cool thing to do. [42:51.900 --> 42:54.820] And the Arduino does have A to D converters built in. [42:54.960 --> 42:56.720] But I'm using all of those pins already. [42:56.960 --> 42:58.740] But you can make trade-offs. [42:59.440 --> 43:02.280] You know, that's the trade-offs when you have something really inexpensive. [43:02.400 --> 43:08.080] You trade off functionality and quality for the resources available and cost. [43:08.880 --> 43:10.700] But that'd be a fun thing to do. [43:11.840 --> 43:17.020] So, if you're not using control voltage, is each key attached to a different pin? [43:17.900 --> 43:19.100] Yeah, so this is... [43:19.100 --> 43:23.960] So, ArduTouch is named that because it's Arduino compatible and it's a touch keyboard. [43:24.320 --> 43:27.260] You don't have to have the touch keyboard, but that's what I have. [43:27.360 --> 43:29.080] And so, the way you can... [43:29.940 --> 43:31.560] There's not a real button there. [43:31.720 --> 43:37.060] Just like a touch screen on your rectangles in your pocket. [43:38.680 --> 43:40.420] It works with capacitance. [43:41.400 --> 43:43.440] This is part of electronics. [43:44.160 --> 43:48.680] And I'll go over that if anyone's interested in my Arduino for total newbies workshop. [43:49.020 --> 43:52.640] Where I'll go through everything you need to know to play with this kind of stuff. [43:52.820 --> 43:55.880] And that's 3 o'clock to 6.30 tomorrow. [43:56.440 --> 43:57.280] But, yeah. [43:57.440 --> 43:59.500] When you touch something, it adds capacitance. [43:59.800 --> 44:01.880] And you stop touching, it takes capacitance away. [44:01.880 --> 44:03.460] And you can detect that. [44:03.640 --> 44:06.060] And that's how you can say, oh, someone's pushing a button. [44:06.340 --> 44:10.500] If someone's pushing a key, I should play this frequency or do this action. [44:12.080 --> 44:14.200] And that's what I do there. [44:15.320 --> 44:16.140] Does that answer your question? [44:16.320 --> 44:16.960] Yeah, I guess so. [44:17.040 --> 44:23.920] I'm just trying to figure out if you could, like, melt off those pads and then attach them to, like, a different keyboard sort? [44:23.920 --> 44:24.500] Yeah. [44:24.980 --> 44:25.420] Like a switch? [44:25.680 --> 44:29.220] That would be a way to save a bunch of pins. [44:29.520 --> 44:31.720] But you trade it off by having a bunch of switches. [44:32.200 --> 44:32.500] Yeah. [44:32.880 --> 44:38.640] Which makes more soldering or more solderless breadboard wiring and adds some cost. [44:38.860 --> 44:39.960] But if you do... [44:39.960 --> 44:40.760] I could do that. [44:40.940 --> 44:41.160] Yeah. [44:41.200 --> 44:47.420] So if you have a bunch of switches, then you can use less than 13 input pins to do that. [44:47.560 --> 44:49.040] Because you can multiplex them. [44:49.380 --> 44:51.840] Just like keyboards on your laptop are multiplexed. [44:51.840 --> 44:53.620] There aren't an input for each one. [44:53.780 --> 44:55.500] They do it with mux. [44:55.900 --> 44:57.140] So, yeah. [44:57.220 --> 44:58.040] You can definitely do that. [44:58.140 --> 44:59.180] And then you got extra pins. [44:59.460 --> 45:05.800] And a friend of mine who I recently met when I was in Zagreb, Croatia, he did exactly that. [45:06.320 --> 45:06.520] Cool. [45:06.520 --> 45:09.920] So he has extra pins, which he's going to do something with I don't know what yet. [45:10.620 --> 45:10.960] Thanks. [45:11.220 --> 45:11.320] Yeah. [45:13.020 --> 45:14.040] This has been great. [45:14.240 --> 45:14.560] Thank you. [45:15.060 --> 45:18.720] Could you use the Mega for the additional pins? [45:18.720 --> 45:23.120] And is there an easy migration strategy from the ArgyTouch to the Mega? [45:23.340 --> 45:25.040] Because they're not that much more expensive. [45:25.520 --> 45:25.740] Oh, yeah. [45:25.860 --> 45:26.800] It's super easy. [45:26.940 --> 45:28.820] All you have to do is use a Mega instead. [45:29.540 --> 45:31.400] So, this... [45:32.400 --> 45:37.100] The ArgyTouch library that I have is designed for the Arduino Uno. [45:37.640 --> 45:41.860] So, if it works with the Uno, it can work for more powerful Arduinos as well. [45:42.360 --> 45:44.740] And it can work on any Arduino. [45:44.740 --> 45:52.680] It's just that my board has the touch keyboard and a little kind of cheap and not so great little amplifier and speaker. [45:54.400 --> 45:57.100] And a couple of knobs and a couple of buttons. [45:57.820 --> 46:03.540] You can easily add those if you're into soldered spread boards or soldering. [46:03.820 --> 46:06.080] Create that of your own with any Arduino. [46:06.760 --> 46:10.040] If you use an Arduino Uno, it'll be exactly like the ArgyTouch. [46:10.040 --> 46:13.540] If you use Arduino Mega, it can be exactly like the ArgyTouch. [46:13.540 --> 46:17.100] But you have all these extra input-output pins that you can do whatever you want with. [46:18.420 --> 46:19.380] So, yeah. [46:19.540 --> 46:20.400] You can definitely do that. [46:20.520 --> 46:26.960] And you don't have to do anything except change the setting on your Arduino software to say, I'm using an Arduino Mega instead of an Arduino Uno. [46:29.440 --> 46:30.480] Is that all the questions? [46:33.420 --> 46:33.880] Cool. [46:34.180 --> 46:35.400] Well, we're out of time anyways. [46:35.700 --> 46:36.900] So, great. [46:37.120 --> 46:37.760] Thanks, everybody.