Menu
About me Kontakt

Drum Machine - written in... Excel. Create music in a spreadsheet (film - 15 minutes)

Dylan Tallchief is a creator who intertwines technology and music in an innovative way. In his latest YouTube video, he shares an impressive project – a drum machine created in Excel. While many may see Excel as just a tool for calculations, not everyone realizes it can also be used to create sounds and music. The video, which has already garnered 681651 views, demonstrates how easily spreadsheet cells can be utilized to construct something resembling a complex drum kit. Dylan illustrates how placing an 'X' in any cell corresponds to assigning a sound, making this project even more fascinating.

Dylan emphasizes two play buttons that allow users to create different rhythmic patterns. Users can change the speed and pitch of sounds, enabling them to tailor their tracks to their preferences. Interacting with the drum machine is incredibly straightforward, and the available options allow for unlimited song arrangement possibilities. Moreover, Dylan discusses MIDI, explaining how he can send sounds to other programs like FL Studio or Ableton, making this project a multifunctional tool for musicians.

The construction of the drum machine in Excel serves as a perfect testament to the idea that limitations often exist only in one's imagination. Dylan details his process of achieving sounds, highlighting the challenges associated with programming and coding in Visual Basic for Applications (VBA). He speaks of the need for testing, debugging, and striving for optimization, showcasing his dedication and passion for music and programming. This endeavor not only results in an innovative project but also serves as an inspiration for anyone dreaming of creating their own music in an unconventional manner.

The drum machine's interface, while appearing complex, is user-friendly for those with a basic understanding of these technologies. Viewers can easily implement their own sound samples, sure to attract many creative music enthusiasts. Dylan emphasizes that anyone can quickly create their own tracks, making this project even more accessible. It's worth noting that drum machines like this can serve various functions, enhancing the creative process for musicians.

In conclusion, it is essential to note that Dylan Tallchief's video not only gained popularity but also captured the attention of many musicians and tech enthusiasts. At the time of writing this article, the view count stands at 681651, with likes numbering 19872. This is a testament to Dylan's vision of creating unique musical experiences in unexpected ways winning over fans. So, for anyone interested in more unconventional approaches to music creation, his Excel drum machine project will surely provide not just entertainment but also inspiration to experiment further in the world of sound.

Toggle timeline summary

  • 00:30 Discussion on the meme about making a song in Excel and how its worksheet resembles patterns in DAWs.
  • 00:57 Mention of a ray tracing demo created in Excel, highlighting the capabilities of Excel.
  • 01:09 Introduction to using Excel for a drum machine, starting with play buttons and pattern inputs.
  • 01:19 Explanation of the drum machine's behind-the-scenes workings and the controls available.
  • 01:45 Details on managing notes and drum patterns, including adjusting pitch and velocity.
  • 02:05 Introducing pattern management in Excel: naming, copying, and pasting patterns.
  • 02:59 Explaining important settings such as BPM and device selection for the drum machine.
  • 03:11 Clarification of using MIDI instead of audio samples for greater flexibility.
  • 04:23 Instruction on connecting to MIDI devices and using virtual MIDI ports with FL Studio.
  • 05:23 Overview of loop settings and program assignments for different drum sounds.
  • 06:12 Discussion on swing settings and sequence arrangements for variability in patterns.
  • 07:33 Reflection on the history of drum machines developed in Excel and the search for user-friendly alternatives.
  • 08:51 Introduction to coding aspects within Excel relating to VBA for creating sequences.
  • 11:52 Explore methods of timing and syncing beats within the Excel drum machine.
  • 13:11 Personal account of working on the project over two weeks and future developments.
  • 13:41 Acknowledgement of patrons who supported the project and expressed gratitude.

Transcription

🔪🔪🔪🔪 You may have seen that that meme of someone making a song in Excel. It makes a lot of sense. The worksheet form of Excel does resemble a lot of patterns and clips in DAWs. I wouldn't say that's necessarily a reason why Is it because I saw a meme Recently, there was someone who made a ray tracing demo in Excel. If you can do that, then you can pretty much do anything in Excel at that point, as you can see. Hell yeah. So I'll run through how this works in case you want to download it and use it yourself. And then afterwards I'll kind of go into the behind the scenes workings of the drum machine. So we have two play buttons. The main one, I would say it's just play pattern everywhere you see a cell. You can just put an X down on the side. You have like these little plus points. It will unfold hidden rows where you can like change the velocity and pitch of things. The number 60 is the default C5 that FL Studio plays notes at. So anything higher is going to be sound high pitch. Anything lower is going to sound lower pitch. And if you have nothing here, what it will do is just look at the side. It's nicest way because it means you don't have to write out the velocity and pitch for every single note. And if you click one up there, you'll minimize everything or you can click the two and everything unfolds. The names don't do anything, so you can just name it wherever you want to. On the left side, we have patterns with different names, different losses, different everything. But then at the bottom we have open, which is essentially for infinite amount of patterns. You could open up pattern 10. These ones, once you go above seven, like they don't have any names because they just haven't been assigned yet. So the pretty empty looking here, let's say you wanted to quickly add some names there and other notes where you can copy stuff and paste things. You can go to pattern one. Hey, let's get pattern one. I want to copy this to pattern 10. Open up number 10, paste that. Whoa. The nice thing about these buttons is that if you're playing it, then you can change the pattern at any time. However, if you like edit whilst it's playing, then it just gets stuck. It just stops all scripts. So don't do that. If you do though, you can just like press play again. Let's say we want to get rid of everything because we don't like it anymore. Bam. We're clear. Then we have some options up here. These are very important. BPM. That's self-explanatory. 200. You know, reasonable tempos, even 200 safe, even 300. You're probably fine, but just don't do anything stupid. Device. So this is important because we're not really playing audio samples in this drum machine. I did try it. That was the original intention and it almost worked. This is, this is kind of the beginning of my whole coding problems. Even if I had gone that route, it would have been a little awkward because if I'm using certain samples, you're not going to have those samples. So we have to like link back to them. See the benefit of it being MIDI now is that I can send it to where I want and it's very easy to swap out samples. So that's what device is here for device. We'll send it to a MIDI port on the computer, even though it sends MIDI by default device. One should be the Microsoft GS wavetable since that's already on your computer by default, you don't need any hardware because if you just use one, then you can just play MIDI sounds and each note, instead of it being like an actual pitch, it just chooses a different drum sample. So 35 kick and 38 is a type of snare. There's different snares. Which makes it feel like its own standalone program. I like that. But if you do have a device, then you can send it to those places. So I'll kind of explain that right now. You'll probably want to start at two and go up. So if you have an interface, whatever number your interface is on, then you can play this and the MIDI will be sent to the interface, that MIDI will go out. And if you have like an actual drum machine or synths or whatever, you can plug it in and you'll be playing it from Excel. What if you want to send it to Ableton or FL studio? You want to try a virtual MIDI port. I think I would advise loop MIDI, but loop B one, it's also a possibility when you have a loop port open, then one of the numbers will be one of the ports. And the nice thing about loop MIDI is that you can even see when data's coming in. So, you know, it's working, you know, it's receiving. So then you just need to go into FL studio. You want to go to your MIDI settings. So you're like, wow, a lot of MIDI devices and that's loop B. Make sure it's enabled. You don't need to send it to an actual port. Now the notes will go to FL studio. Next part is loops on these settings. Pretty self-explanatory. I actually just removed prog mode because I realized it was kind of pointless. For every track, it will send it to a different program. So this is program one, two, three, four, five, six, seven, eight. When you send a note to program one, whatever is in this position, the top position is going to play. If you're sending a note to program two, then the clap will play. And if you like swap these around, the hat will play instead. So it's just like a top down order. That's why the names don't really matter. All it is, is the position. This doesn't care what channel it is, but for Ableton, it's the opposite way around. Here you can see all the notes going down to channel eight and then repeating again. So what do you want to do is then select the input to channel one. You also want it to tell it to set that to input to receive MIDI. Otherwise it just kind of ignores it and then you're done and then you can put a sample there. Then we have swing. My swing setup is pretty janky. I will admit, essentially it's just, if you put it to one, you'll get some swing. If you put it to two, you'll get a lot of swing. There is a sort of arrangement sequence list. You can have multiple sequences. This is just one, two, three, four. So if I play that. You also have this open button. So essentially you can also have infinite sequences. I wouldn't put it really high though. Cause I did that once like to 5,000 and it actually crashed the program. That's just an Excel thing. Then I guess it plays through one to four. Once it gets to four, it will just stay at four. So you can have like remaining loops left over. It will just stay unless you type in loop. There you go. Then once he gets to four, it'll just start all over again. Or instead of typing loop, you can type just L that will also loop. I put that one in there for the time savers. I want to see what you can do with this. You can essentially with this whole sequencer, make a full song. I bet it would be tedious, but you can do stuff. You can make this because you can use any drum samples. You can use 808s. You can even use synths. There's velocity, there's pitch. You can just draw in melodies. I'm not even the first person to come up with the idea of doing a drum machine. Whilst working on this, I did look to see if anybody else had done something similar. Like back in 2005, someone did this, but the code just doesn't work anymore because it was written for like 32 bit applications. And then I found essentially a whole DAW built in Excel with individual sequences and arrangements. However, the user friendliness is not very high on this. And even the latest version wouldn't open and work properly. So I had to go to like a really old version. And I could like see how it worked, which was very, very important. Took like a couple of days just to understand what is going on in the code. So let's start to really reveal the inner workings of this. First off, how it saves. This whole space copies it to another worksheet over here. Let's say I have, I want to open pattern 10. This is 24 cells high. So what I have to do is times 10 by 24. That's where this pattern will get stored to and retrieved from when you want to open it again. This is what Excel is made for, for storing sheets of data. So it kind of makes sense to use it this way as well. I think it's time for VBA. It's VBA time, is it? Oh yeah. If you are good at coding, there's probably things that will make you cringe. Go to Excel options, customize ribbon and turn on the Excel tab here. Then this will pop up developer along all these options. And you can just open visual basic and then you see the scripts. But the main one is this sec for sequence. This is long. This is how many 1200 lines. So I started off with option explicit. This is actually kind of important. If you want to store information like a number or a word, then usually store them in a thing called a variable. What you should do is declare a variable right at the top. And I wasn't doing that for a lot of them. It will still work without, like sometimes you don't need to say I'm making it a variable. I can just do it without declaring it and it will still work. However, I sent it to someone else and they couldn't run it because I didn't declare a lot of these variables. So if you have option, option explicit, then you must declare them or else the code just won't run. It's kind of like a safety feature essentially. Then it comes to these, if windows 64 thingies, you can use things outside of Excel. That was how I was playing the sounds at first. This was using the, the WinMM windows multimedia DLL. It wouldn't play multiple sounds at once. So that was not an option. And then we have the big list of variables that I'm using. A lot of them, you can have functions in VBA, but you're just writing as sub. If you've ever used JavaScript, it kind of just works the same way. I'm creating a big loop. That's just for 16 steps. And once it gets to 16 steps, then another function plays called looper that was like, okay, well, are there any more loops left if there are, well, then we'll play again to get it to have rhythm. You want it to have pauses. Cause if I play this just without any pauses, it would play it like instantly. It would go, I have to like trigger out each step, what that's going to be. So what it does, it takes 60 because there are 60 seconds in a minute, 60 divided by the value from, from this cell, but actually one in milliseconds. So then I times it by a thousand and then I divide it by four. There's four steps for every beats. However, this started to make problems because let's say if I told the program to wait for a hundred milliseconds, it works, but it didn't feel exactly right. I would play it along with a metronome in FL studio, slowly over time, they would start to desync. And the reason is, is that the code takes time. There's like a little bit of delay from every action it has to do. Moving the colors about all that slows it down and increases the delay as it got bigger and bigger to like 20 and 30 milliseconds between each beat. So waiting a little bit longer and over time that will desync. My first idea was to split up the code a lot more. This was all running from one big function. I thought if it has to run through all those lines of code, then before it gets to loop around all over again, what if I split them apart? So they work individually. Essentially what, what happens is like, if it's running through a code and it calls a function, it basically runs through that whole function and then goes back and continues on, they don't work in parallel at all. I looked in the other version and what they were using was a timer system, this windows API thing called time get time. So that the moment your computer starts, it like starts counting. It just gets higher and higher and higher and higher. So if you wanted to wait a hundred milliseconds, like you add that to get time and then get time will get higher and higher until it reaches the time you want it to wait to. And the cool thing about that is that. Let's say you need to wait a hundred milliseconds and the code takes delays 30 milliseconds. Then instead of just waiting another hundred, it would actually just wait the 70 instead. It balances itself out. Things were way better in time after that. Well, not perfect though. The timer method that only counts in milliseconds and not half a millisecond. So I needed like something, a higher resolution timer. I found another timer. Someone made a timer that works on fractions of a millisecond, but I knew how to take part of it that I wanted to use and then put it into the code. Essentially. I'm just a script kitty. I just look for stuff. If it works. Oh, cool. Everything you see in sec for the most part, I've written myself. If it's copied over and over again, there's a good chance that I wrote that. Um, yeah, I think that's everything I needed to say. I worked like almost exclusively on this for two weeks. It was kind of addicting to make it better and problem solve issues that I have bug testing, all that sort of stuff. And I won't be surprised if you can find some that I didn't find before, but what are, what I will want to probably work on next is like an arrangement view and then actually turn it into an actual DAW. Just like the meme, exactly like the meme. And I'm making, I'm not making any promises on this. If you want to see more weird stuff like this, you know what to do. Thank you. My patrons subscribers without them, this drum machine wouldn't exist. This is where the hard earned dollars are going towards their funding drum machines being created in Excel, but I'm, I'm super thankful for them. I don't just work in Excel, but also in Apple studio and Ableton. And if you're interested, if you're interested in lessons, I teach lessons.