Close
0%
0%

DrumKid: aleatoric drum machine

A lo-fi digital drum machine which uses randomness to create unpredictable beats. Runs on Arduino, with audio provided by the Mozzi library.

Public Chat
Similar projects worth following
DrumKid is an "aleatoric" drum machine, meaning it uses random numbers to determine the rhythm and sound of a drum beat. It comes in a handheld, battery-powered unit, designed for live performance. Check out the video here: https://www.youtube.com/watch?v=pyN_HQfCtoQ

Drum machine are ubiquitous in modern music, but playing them live presents a challenge. When playing electronic rhythms live, whether using a drum machine or a laptop, it can often appear that a musician is simply pressing "play" on a backing track, removing much of the perceived spontaneity of a live performance.

My drum machine, DrumKid, aims to tackle this problem by using a variety of controls to alter a drumbeat live, using randomly generated drum hits which augment the original beat. Rather than being designed as a pre-programmed backing instrument, DrumKid aims to be a playable instrument in its own right, with continuously adjustable controls that work well in a live setting. My intention was to create an engaging, interactive device that, like any musical instrument, can be mastered over time with practice.

DrumKid has the following features:

  • 4 real-time control knobs
  • 20 controllable parameters
  • Save/load function
  • Tap tempo
  • 3.5mm line/headphone output
  • Lo-fi mono 8-bit sound
  • Powered by 3xAA batteries

DrumKid is an open-source, hackable product based around an ATmega328 chip, as found in an Arduino Uno. The final product features a minimalist design consisting of a single PCB with buttons, knobs, and LEDs mounted on one side, and all other components mounted on the other side. Two laser-cut sections are used to protect the electronics.

I have made several identical fully working prototypes of DrumKid, and I am happy with the audio quality, playability, aesthetics, durability, reliability, and battery life. These prototypes have been distributed to musicians in the UK who have been giving me feedback on the current design. I am currently using this feedback to tweak the firmware and PCB layout for what I hope will be the final design. DrumKid should be available to buy in November 2019 - you can sign up to my mailing list if you want to be kept up to date.

DrumKid can also be constructed as a breadboard/stripboard project using an Arduino Uno - see the build instructions for details.

All necessary files can be found on this page and/or the DrumKid GitHub repository.

Adobe Portable Document Format - 31.67 kB - 09/30/2019 at 11:02

Preview
Download

Adobe Portable Document Format - 38.19 kB - 09/30/2019 at 10:27

Preview
Download

DrumKid BOM (bill of materials).pdf

Bill of materials for a single DrumKid unit

Adobe Portable Document Format - 52.92 kB - 09/30/2019 at 08:29

Preview
Download

drumkid laser parts.dxf

DXF file for the two laser-cut parts of DrumKid. Designed to be cut from 3mm acrylic or plywood. Adjust the drawing for your laser cutter - text should be engraved, all other lines should be cut.

AutoCAD DXF - 28.72 kB - 08/22/2019 at 09:49

Download

drumkid breadboard.png

Illustration (in Fritzing) showing how the breadboard version of DrumKid is assembled - refer to breadboard schematic for capacitor values and clearer wiring

Portable Network Graphics (PNG) - 448.21 kB - 08/22/2019 at 09:45

Preview
Download

View all 8 files

  • MIDI and sync

    Matt Bradshaw10/14/2019 at 15:10 0 comments

    After getting lots of feedback, I'm attempting to add MIDI to DrumKid. Many people have expressed a hope that DrumKid would feature the ability to synchronise with other instruments, and I've decided that MIDI is the best way to do this, because this also gives the option of using DrumKid as a MIDI controller, thereby greatly expanding its capabilities.

    (For the uninitiated, MIDI stands for "musical instrument digital interface", and is a type of serial connection which allows musical instruments to send data to each other, such as notes, timing, and other controls.)

    Outputting MIDI note data from DrumKid was very easy, and instantly convinced me that MIDI was a vital feature which had been missing all along - I was suddenly able to produce a much wider variety of sounds by triggering other drum machines' samples. However, generating synchronisation data has proven much harder. The MIDI "clock" standard requires a byte of serial data to be sent 24 times per quarter note. Had I thought about this from the outset, I probably wouldn't have designed my code around an arbitrary division of 16 pulses per quarter note, because these two divisions are basically incompatible! I was able to get my Korg synth to sync up with DrumKid, but only at lower tempos, and not with any great reliability.

    After several hours of trying to fudge the code, I decided it's time for a major rewrite. The code had become bloated and messy, and I was pushing right up against the RAM limit anyway. Now that I'm 90% sure that DrumKid will feature MIDI, I'm going to incorporate it properly, rather than as an afterthought.

    The next GitHub update might be a pretty major one!

  • The "Final" Stretch

    Matt Bradshaw09/30/2019 at 15:49 0 comments

    Well, the Hackaday Prize final deadline is tomorrow, and I think I've squeezed as much progress out of DrumKid as possible in that time! I thought it would be nice to reflect on how far the project has come since it began.

    • February
      • Started exploring the idea of converting my DrumKid web app into a physical project
      • Got some good sounds from early breadboard prototype
    • March
      • Experimented with voltage regulator chips
      • Designed V1 PCB
    • April
      • Assembled V1 PCB (which worked, but was too quiet and had noise issues)
      • Designed and 3D-printed a case
      • Decided to increase number of potentiometers
    • May
      • New stripboard prototype to diagnose problems more rapidly
      • Added filter circuit
      • Designed V2 PCB
      • Hackaday Prize mentoring session
    • June
      • Rethinking the enclosure design
      • Designed V3 PCB
    • July
      • Assembled V3 PCB, instantly found routing issue
      • Designed V4 PCB (minor revision)
      • Designed and 3D-printed front and rear panels, to be laser-cut in final version
      • Sourced test laser-cut pieces (success!)
      • Assembled V4 PCB (success!)
    • August
      • Concentrating on coding
      • Added lots of features
      • Made demo video
    • September
      • Found local laser cutter and obtained enough pieces for three new (identical) V4 prototypes
      • Did a "test run" of assembly, successfully built three new units
      • Distributed DrumKids to testers
      • Received feedback from testers
      • Started V5 PCB design

    And that takes us up to today! I'm really pleased with where I've got to, and am excited to complete the V5 PCB design over the coming days. Good luck to all the other Hackaday Prize finalists, and if anyone wants to be kept updated about DrumKid's launch later this year, please go to mattbradshawdesign.com and sign up my mailing list.

  • A Look Inside

    Matt Bradshaw09/30/2019 at 13:43 0 comments

    Here is a selection of photos showing the inside of the current version of DrumKid.

    This is what DrumKid looks like after soldering but before assembly
    This is view after removing DrumKid's rear panel - note the Arduino/ATmega328 breakout pins to allow users to modify the instrument. Also note the unpopulated spaces for capacitors - these were included in the PCB layout in case they were needed for decoupling, but only one smaller capacitor (C4) ended up being necessary - these spare footprints will be eliminated from the next PCB
    The front laser-cut panel covers the soldered leads of the components. You can also see evidence of the modification I had to make due on this prototype due to an error in the schematic (this will be fixed in the next version)
    The battery box is mounted using two countersunk machine screws, which are secured on the other side with dome nut
    And here's how it's all assembled

  • How Open Source?

    Matt Bradshaw09/30/2019 at 11:54 0 comments

    This is a brief post where I will discuss exactly how open source DrumKid is (spoiler: as open source as I was able to make it).

    My aim from the start of the DrumKid project has been to create a fully open source instrument, in terms of both hardware and software. I based the design on the Arduino platform, which is itself open source, and have shared all my schematics, CAD files, parts lists, etc under the MIT licence, so it's fair to say that the hardware side of my project is fully open source, which is great.

    The software side is a little more complex. My code (which is also shared under the MIT licence) relies on two external libraries. One library which I make some use of is the ArduinoTapTempo library, which also uses the MIT licence. However, my code is based heavily on the Mozzi audio library, which is shared under a Creative Commons Non-Commercial licence.

    Mozzi is a clever, extensive library that somehow squeezes complex audio out of an Arduino. The creator of Mozzi has (entirely fairly) released his code under this licence so that, while other people can use it to make cool projects, he reserves the right to negotiate a share of the profits if a commercial product makes use of his work.

    I have added a caveat to my GitHub license.txt file to account for Mozzi's licence

    I reached out to Mozzi's creator while I was developing DrumKid, and we quickly came to an amicable agreement about future profits, which means that DrumKid is "good to go" from a legal standpoint. However, it does leave this project in a sort of open source limbo. All the code that I have written is fully open source, and I personally have permission to use all the code that DrumKid relies on, but if anybody other than me started making and selling DrumKids, they would be in breach of Mozzi's licence (unless, of course, they also reached an agreement with its creator).

    If somebody did want to sell DrumKid clones legally, one way would be to eliminate the need for the Mozzi library by "rolling their own" - while I do make extensive use of Mozzi, I only use a small subset of its features, so it wouldn't be that difficult to write some code that performed a similar function.

    Personally, I'm happy to keep using Mozzi and pay a small fee to the developer who made DrumKid possible, but I thought this was an interesting aspect of open source culture: when money starts to get involved, things do get more complex!

  • Feedback

    Matt Bradshaw09/28/2019 at 17:23 0 comments

    Designing for other people is a lot harder than designing for yourself, which makes this project harder than almost all of my previous ones - the aim is to get DrumKid into the hands of as many musicians as possible, which means I actually have to listen to constructive criticism. I've tried to elicit feedback throughout the project, but this has ramped up recently as I approach my self-imposed deadline of making the first batch of finished DrumKids by November.

    I've now received comments from all three musicians who are currently using the latest prototype of DrumKid, so I thought this was a good point to share the feedback I've had throughout the project and how I've adapted the design based on it (or plan to in the near future).

    My main sources of feedback/criticism have been:

    • Informal feedback from friends (usually when I bring the latest prototype to the pub)
    • YouTube comments (I'm one of the few creators whose comments are nearly always nice)
    • Hackaday (comments, chat, and mentoring session)
    • E-mail (usually unsolicited but very helpful!)
    • Feedback from musicians who are currently using DrumKid

    Overall, spread over these various mediums, I've had a lot of helpful comments throughout the project! I thought it would be helpful to document them here, roughly in chronological order.

    SourceCommentResponse
    Early feedback from friendsToo much high-frequency noiseImproved the filter circuit
    Early feedback from friendsOutput is too quiet (this was with the volume on max in a noisy pub - the filter was reducing the output too much)Added an amplifier chip to boost the signal
    Early feedback from friendsThe early single-knob design was too confusing and difficult to playI agreed with this comment and redesigned DrumKid to feature four knobs instead of one
    Email and YouTube commentsDrumKid should be compatible with Eurorack synthesizers, and the different parameters should be controllable via external control voltagesCreating a DrumKid Eurorack module would be a separate, complex project, but there seems to be a lot of demand for it, so I've started making notes about a potential future design, maybe using a Teensy
    Email and YouTube commentsDrumKid should be able to synchronise its tempo with other instrumentsThis has come up quite a lot, often enough that I'm considering adding this feature to the final design, although it might delay the release by a couple of weeks
    YouTube commentIt would be good to be able to load custom sample sets (different kicks, snares, etc)Although it would be hard to make this part of the core, supported features of DrumKid, switching the samples is such an obvious customisation that I'd like to document a way for people to do it. This has made me realise that I should write a secondary "hackers' manual" for DrumKid to help people who want to customise their instrument
    TesterThere should be more different styles of basic drumbeat, such as drum 'n' bass, reggae, waltz, etcI agree with this, and will spend some time adding more beats for the next version
    Tester
    The volume knob seems to be mounted backwardsThis is true - either the KiCad footprint is wrong or I did something stupid, but I will fix this in the next version of the PCB
    TesterThere should be more than six slots to save beats inThis is probably fair. There is plenty of space in the EEPROM to save more beats, but I wanted to keep the user interface nice and simple (six buttons, six save slots) - I'm considering increasing this to six banks of six (36 slots)
    TesterThe loading process is unreliable and confusingI hadn't noticed this before, but I think there is a bug in the code, so I will investigate
    TesterThe LEDs are too brightI noticed this, too, and had already planned to reduce the brightness for the next version, which should also have the benefit of increasing battery life
    TesterBeats in non-standard time signatures have strange emphasesMy previous, slightly lazy approach...
    Read more »

  • Money Talk

    Matt Bradshaw09/23/2019 at 14:39 2 comments

    Apologies for what may be a boring post, but as my target launch date (November 2019) approaches, I'm starting to think more seriously about the financial side of my project.

    I'm currently planning to make small batches of DrumKids myself, perhaps 5 or 10 at a time. If there were to be a really big demand for DrumKid in the future, it would certainly be possible to redesign it in a way that would be more suited to mass production. There are surface-mount versions of all the components I use, and the case is not a particularly complicated shape, so it would be possible to design a version for injection moulding.

    However, this post will focus on the economics of manufacturing on a much smaller scale. The current design uses only through-hole components, partly so that I can make DrumKid without a reflow oven, partly so that I can sell DrumKid as a kit, and partly to make each one easier to repair or hack. I'm also using a laser-cut enclosure for the same reasons.

    This is my first time making anything that will be sold to the public, so it's entirely possible that I'm leaving out some major part of the calculation. With that caveat in mind, though, here are the various costs involved in making a single DrumKid unit (including both time and money as costs, since I obviously want to be paid for my time working on each unit!):

    • Materials (total £19)
      • Circuit board (£3 from China)
      • Laser-cut parts (£2 each from local maker)
      • Electrical components (£12, from three different suppliers)
      • Structural components (£2, from one supplier)
    • Assembly time (total 60 minutes)
      • Soldering (40 mins)
      • Uploading firmware (5 mins)
      • Testing (5 mins)
      • Screws etc (5 mins)
      • Bug-fixing (5 mins?)
    • Miscellaneous (total 30 mins?)
      • Postage and packing cost (can be passed on to customer)
      • Time spent packaging each unit
      • Time spent going to the post office
      • Time spent ordering parts
      • Time spent organising parts
      • Repairs (at my expense if within X years?)
    • Development costs
      • Time spent developing DrumKid (maybe 200 hours?)
      • Cost of components etc used in prototypes (approx £200)

    I have given actual values for the materials (because I can look up the prices I paid for them) and assembly time (because I kept a log of how much time each process took when I built a test batch of three units). I have only given values to the nearest GBP, since these costs will fluctuate quite a bit anyway.

    My ballpark (rounded-up) figure at the moment is £20 (or $25 USD) of materials per unit, with roughly an hour of assembly time. The other time costs are a bit harder to estimate right now, since they will depend on factors (partly) beyond my control, such as how many units I sell. My rough estimate is that ordering parts, shipping, and general organisational tasks will add perhaps 30 minutes, on average, to each unit. This means each DrumKid unit will require £20 plus 90 minutes of my time.

    This sounds pretty good so far, but I haven't yet taken the development process into account. I've spent countless hours developing DrumKid, trying out different circuits, playing with the code, soldering prototypes, researching components, etc. If I were to start the project again, perhaps I would have documented all the time I spent on development, in the same way that I fastidiously document my time when working as a freelance web developer. However, it's not as simple as adding up all the time I spent working on this project and trying to make sure I'm paid for it - a lot of my time working on DrumKid has involved learning new skills which will help enormously on future projects. Before DrumKid, I knew barely anything about PCB design, filter circuits, decoupling capacitors, or PWM audio, so I'm not sure I can strictly add the time learning those things into the "development time" column.

    Since I didn't record how much time I spent on each task, this is all moot anyway - it's just an interesting point to consider. I'm going to have a wild guess...

    Read more »

  • Warholing

    Matt Bradshaw09/20/2019 at 16:12 2 comments

    I showed my latest laser-cut plywood prototypes to a carpenter friend of mine, since I wasn't sure how to darken the wood to fit the aesthetic I was aiming for. After exploring a few options with him, I decided that using wood is perhaps more trouble than it's worth at this stage. While I would prefer to limit the amount of plastic I use, for environmental reasons, I think that perhaps it's justified in this case: it will probably be more hard-wearing, and I'm not using a huge quantity. Since I will be making DrumKid in relatively small batches myself, rather than mass-producing it, I can always re-evaluate this decision in the future.

    With this decision made, I've been using my (not very advanced) image-editing skills to try and get an idea of what the first batch of units should look like. I can independently vary the following:

    • PCB (top panel) colour
    • Small front plastic laser-cut panel colour
    • Large rear plastic laser-cut panel colour
    • LED colour

    I already know what an all-black design with white LEDs looks like:

    I'm pretty pleased with the monochrome design. It looks slicker than I imagined. However, the black solder mask actually looks slightly grey in real life, and the colouring has been slightly inconsistent between batches (the previous, unsuccessful PCB design was also ordered in black, but came out much darker). Also, my preference has always been for bright, even garish colours, and I'd like to include this part of my personality in the final design, if possible. With this in mind, I attempted to simulate a few different colour combinations.

    First, I decided to try some bold, single-colour designs. Red, green, and blue are all available solder mask colours, so I wanted to see what it would look like to match the laser-cut parts and LED colours to the solder mask:

    I quite like all three of these, but with a mild preference for red. I've also had trouble finding bright, pure-green LEDs in the past (they often look more yellow-green or fluorescent yellow), and I also worry that a green solder mask would look less stylish than another colour, since green is the traditional, "default" colour for circuit boards.

    My next idea was inspired by my favourite Lego theme: M-Tron. For the unfamiliar, M-Tron was a successor to the classic Lego space theme, with a bold colour scheme of red, white, black, and fluorescent yellow (specifically transparent fluorescent yellow). Here's an example:

    And here's my M-Tron-inspired DrumKid mock-up:

    I really like this colour combination. I could even use transparent fluorescent yellow plastic for the rear panel, showing the circuitry and giving the characteristic edge-glow effect of laser-cut coloured transparent plastic. Sadly, I can't really do the same with the front plastic section, because it would show the soldered leads of the components, which (in my opinion) are a lot less attractive than the components themselves.

    I mocked up one other design, inspired by chunky Fisher Price tape recorders - I rather like the idea of using a "toy" aesthetic, because DrumKid fits into a category of toy-like electronic instruments that have become popular in the last few years (Teenage Engineering being the foremost proponents of this style). Here are a couple of images of Fisher Price tape recorders that inspired me:

    And here's my "toy" DrumKid design:

    In the UK, we have a brand of savoury spread called Marmite, whose slogan is "you either love it or you hate it", the idea being that its taste is so strong that you can't have a neutral opinion of it (for the record, I love it). The idea is pervasive enough that "Marmite" has entered the dictionary as a word to describe something inherently polarising. I feel like my colourful ideas are, perhaps, Marmite designs, and I'm torn about whether this is a good thing....

    Read more »

  • The Problem With Kids

    Matt Bradshaw09/19/2019 at 10:16 0 comments

    I did a bit of accidental user testing recently, which has caused me to redesign part of the circuit. I met up with my cousin and his kids, who are keen musicians, so I decided to show them a prototype of DrumKid. I gave the headphones to Kid A and turned on the power. "I can hear it making noise already!" he exclaimed, before I had even started a drumbeat, and I realised instantly that I had a problem.

    As I explained in earlier project logs, using an Arduino to generate audio requires using PWM (pulse width modulation), which basically means turning one of the pins on and off very quickly to produce an audio wave. The frequency at which you turn this pin on and off must be above the human range of hearing, otherwise you will notice an unpleasant noise at this frequency.

    The library I am using to produce audio is called Mozzi, and it has a few different modes. It can use a carrier frequency of 32kHz, which is above the human range of hearing, but this requires more processing time, and wouldn't allow me to run all of DrumKid's functions. Instead, I use a more basic mode with a carrier frequency of 16kHz. This frequency is pretty much above my hearing range (I'm 34), but just about within my partner's hearing range (she's 28), so I did realise early-ish in the design process (when I showed her a prototype) that I would have to add a filter to the circuit to get rid of this noise.

    I spent quite a while researching filters, and designed a second-order low-pass filter which seemed to do the job... until I showed DrumKid to a child for the first time. It turned out that I hadn't done a good enough job of filtering the signal for people with a really good hearing range (i.e. young people), so I decided to redesign my filter, this time using a bit more science.

    I used an audio editing program called Goldwave to analyse the performance of different filters. The 16kHz spike was clear to see. I tried a few different designs, and ended up settling on a twin-T notch filter (a variation of the one recommended on the Mozzi website, which I should definitely have used to start with!). The design was tricky to get right because I was trying to satisfy several competing criteria:

    • Reduce noise to an acceptable level for people who can hear it
    • Don't filter out the "good" frequencies too much
    • Use commonly available resistor and capacitor values
    • Don't attenuate the signal too much

    I'm much happier with the signal now - it sounds indistinguishable from the previous circuit, but analysis in Goldwave shows that the carrier signal noise is much reduced. I will add a paragraph in the manual to explain the carrier signal, because it would be a good idea to do further filtering in software if you were going to record a track with DrumKid, especially if you were to pitch-shift it downwards. However, I think the improved filter circuit means that the output signal is now acceptable for the final product.

  • Multiplying

    Matt Bradshaw09/17/2019 at 18:13 0 comments

    Up until today, I've only made one successful, working DrumKid unit, which isn't much good for something I want to sell. While it's almost certain that there will be another PCB revision, I decided to make several identical DrumKid units using the current PCB version, for a few reasons:

    • I want to do some user-testing with local musicians
    • I want to see how long it takes to build each unit
    • I want to check that the design is stable, and the first unit wasn't a fluke
    • I had several of the most recent PCBs available anyway

    I checked my stock of components, and ordered the ones I was running out of. Having realised that finding each individual value of resistor and capacitor was a bottleneck when building the first unit, I organised all my components into DrumKid-specific project boxes with dividers, to speed up the build.

    Sorting the components in advance made assembly a lot easier

    I also contacted a local business who have a laser cutter, and they were happy to help me with an initial small run, as well as bigger orders in the future. I decided to cut the laser parts from plywood, since my preference is to avoid using plastic where possible, although we also made one set using some scrap transparent orange acrylic, just to try a different look.

    The view through the top of the laser cutter
    Testing a transparent orange plastic enclosure - it looks cool but I'm not convinced

    I timed the assembly process, during which I built three new DrumKid units from scratch. This involved positioning and soldering the components, mounting the battery box, uploading the firmware (Arduino sketch) to a blank chip, testing each function, and assembling the laser-cut outer enclosure.

    In total, it took just under three hours to build three units, which obviously translates to about an hour per unit. This doesn't include things like time spent ordering and sorting components, or time spent packaging a finished unit, but I might also be able to speed up assembly with practice, and by assembling larger batches at once. Overall, an hour per unit feels like a reasonable ballpark figure to estimate for the next run of units. I also switched the previous unit to have the same laser parts as the new units, just for consistency.

    I was really happy with how the units turned out. They all worked first time, and all look identical. I want to stain the wood a darker colour for aesthetic reasons - I don't think the light-coloured plywood looks very nice with the black front panel. This would slightly increase the cost and assembly time, but not by much, especially if I could stain a large number of laser parts at once.

    Soldering in progress
    Very satisfying to see four, identical, working DrumKids...
    ...but need to stain the wood to improve the aesthetics

    Here are a few thoughts after successfully multiplying DrumKid:

    • DrumKid is a viable product, even at a fairly low price point
    • The mounting holes for the potentiometer are a fraction of a millimetre too small, which adds time (and mechanical stress!) to each unit while I try and wriggle them into place - I should fix this on the next PCB
    • I'm still not 100% sure about the materials and colour scheme for the final version. I might play around in an image editor to try some different colour combinations
    • It would be good to leave a solid patch of white silkscreen on the underside of the PCB to write the serial number of future DrumKids

    And here are some of my immediate next steps in the project:

    • Stain the wooden parts in these four units to see if that makes them look better
    • Shoot footage for the Hackaday Prize final video
    • Give three units to local musicians for feedback
    • Decide on colour scheme and whether to have a fully enclosed design (vs current open-sided design)
    • Design next iteration of the PCB

  • Hackaday Prize Finalist!

    Matt Bradshaw09/11/2019 at 07:36 0 comments

    Rather excitingly, DrumKid has made it to the finals of the Hackaday Prize 2019! I got through to the semi-finals last year with my digital modular synthesizer, PolyMod, but really struggled to meet the criteria for the final - I was still using stripboard for all my projects at the time, and I didn't even know what a schematic was (I instead submitted a messy pencil sketch of a sort of flowchart).

    In the past year, I've put a lot of effort into moving on from stripboard, wood, drills, and saws. I've acquired a 3D printer, learned to use KiCAD, designed and ordered my first PCBs, and generally moved a lot further towards my goal of designing something that looks professional (or at least less amateur). I've also belatedly learned what a schematic is, and produced some!

    I'm really happy with DrumKid's progress so far, and luckily I've already fulfilled a lot of the criteria for the final round, but I'd still like to put in a big push to improve the project by October 1st, the deadline for the finals. I can't go into full production mode by then, but I can lay a lot of the groundwork. Here's my September to-do list:

    • Source enough components to make a small initial run of DrumKid units for testing
    • Find a local company with a laser cutter
    • Explore possibility of moving to an enclosed case design, rather than the current open-sided, standoff-based design (this is based on early user feedback). I'm hoping to use recycled wood for this to reduce environmental impact
    • Add a couple of minor features to the code - there are a still two free slots for controllable parameters, I'd like DrumKid to automatically load the last saved patch when powered on, and I'm also anticipating a few tweaks based on user feedback
    • Research packaging
    • Do a full cost analysis to determine how much I should sell the finished unit for - I've already got a pretty solid idea of this but I'd like to go over my numbers in more detail
    • Make a final decision on aesthetics - I can easily vary the PCB colour, the LED colour, the laser-cut section colour and the laser-cut section material (plastic or wood)
    • Design and order a fifth revision of the PCB
    • Make an improved video for the final round

View all 26 project logs

  • 1
    Source components

    The simplest way to get a version of DrumKid working (apart from buying one when it's released!) is to build the breadboard circuit using an Arduino. The components are mainly pretty standard: you'll need a breadboard, jumper wires, an Arduino Uno, tactile buttons, LEDs, 10k potentiometers (linear), an LM386 amplifier chip, and a selection of capacitors and resistors. You'll also need some sort of breadboard-compatible headphone socket - I used a 3.5mm socket with screw terminals which is designed for prototyping like this.

    3.5mm stereo socket (wired as mono) with screw terminals to connect to the breadboard

    I've squeezed everything onto a single breadboard with small buttons and tightly spaced potentiometers, but you might want to consider sprawling over two breadboards, which would allow you to use bigger buttons, making for a more ergonomic playing experience. Using a second breadboard might also give you space to use a breadboard-friendly Arduino variant, keeping the whole project a bit neater, although I haven't tested this.

  • 2
    Build breadboard circuit

    Build the breadboard circuit shown below. Refer to the schematic for capacitor values. There are six push buttons which use the Arduino's internal pull-up resistors, five LEDs with current-limiting resistors, and four potentiometers connected to the Arduino's analog inputs. All these parts of the circuit are fairly standard, and found in lots of basic Arduino examples.

    The more complex part of the circuit is found on the right of the breadboard - this takes the audio output from pin 9 of the Arduino and filters it, before amplifying it. The raw audio output is a PWM output which has quite a lot of unwanted noise (the carrier signal), so I've added a 2nd-order RC filter to clean it up. In doing so, I've removed quite a lot of the higher frequencies, which I'm happy with because of the lo-fi sound I'm aiming for, but if you want to keep more of the high frequencies (at the expense of a noisier signal), you can try different resistor and capacitor values. The LM386 part of the circuit then amplifies the signal. There are many ways to wire an LM386, so feel free to use a different circuit for this if you'd prefer.

    If you just want to play around with DrumKid and aren't too worried about audio quality, you can just connect your headphone socket straight to pin 9 and ground, and omit the the LM386 circuit, filter circuit, and volume control.

  • 3
    Upload Arduino code

    Download the DrumKid repository from https://github.com/mattybrad/drumkid and use the Arduino IDE (software) to open the Arduino sketch found at drumkid/arduino/drumkid/drumkid.ino

    The code relies on several external libraries, so you will either need to install them using the Arduino library manager or from a zip file. Any libraries not available through the library manager will be noted in the code.

    Make sure that the DEBUGGING constant is set to "false", and BREADBOARD is set to "true", then upload the sketch to the Arduino. If all goes well, you should see all five LEDs flash rapidly, after which you can play your breadboard drum machine.

View all 5 instructions

Enjoy this project?

Share

Discussions

sunny wrote 18 hours ago point

We are looking forward to your PCB update. If you plan to reduce the PCB size to 10 * 10cm, its price will be more friendly.

  Are you sure? yes | no

see24ya wrote 10/01/2019 at 17:06 point

Thanks for updating BOM! It's much clearer now. And thanks for the new photos of the assembled pcb! I will give it a try the next days. Good Luck for the competition!

  Are you sure? yes | no

Matt Bradshaw wrote 10/15/2019 at 11:33 point

Hey, sorry for slow reply, I don't seem to be getting notifications for comments! Let me know if there's anything you're still stuck on. In answer to your other comment (which may or may not have been addressed by the new BOM!), the crystal has to be 16MHz and the pots are meant to be 10k (other values will probably work for the control pots but the volume pot should probably be 10k). CP is a polarised capacitor and C is an unpolarised capacitor - they don't have values because I originally wasn't sure what value of decoupling capacitor to use, I was using the PCB to do some live prototyping! But if you get everything on the current BOM then everything should be fine. I'm actually due to release version 5 of the PCB in the next couple of weeks - it will (probably) have MIDI/sync and a slightly better layout, just in case you wanted to wait :) Oh, and if you've ordered/made the V4 PCB already and are having trouble, please note that there is a little hack required, shown on the schematic (pin 4 of the LM386 needs to be soldered to ground).

  Are you sure? yes | no

see24ya wrote 10 hours ago point

Hi, I made two PCBs but both of them will not function as expected. When turning on I expect every single led to light up several times for a short time. But only the two leds on the left side do so, the other leds light up permanently. All knobs and switches seem to be without function. No sound. Maybe it will be easier to understand with a photo but I don't know how to post them here... I power it up with a nine volt block. Maybe you can give me hint?

  Are you sure? yes | no

see24ya wrote 09/29/2019 at 13:52 point

Hey, nice project! I've built the breadboard version with success finally. Now I'm trying to get along with the pcb version 4. First try wasn't successful. There was no sound and weird behaviour of the led's (only the first two seemed to function, the rest were only glowing weakly). I'm wondering if you could be more precise in your bom? For example: the crystal has to be 16 MHz one? What do you mean with postion 12 (the pots have to be 10 k ones?)? What do you mean with CP or C in positon 16 or 19?  I hope that you can help me out....Thanks for your efforts!

  Are you sure? yes | no

Dan Maloney wrote 09/18/2019 at 15:19 point

Glad to see you're making progress on this. And great documentation, BTW!

  Are you sure? yes | no

Matt Bradshaw wrote 09/18/2019 at 15:30 point

Thanks, Dan! Yeah, I'm really happy with how the first batch turned out. Can't wait to see how musicians use them.

  Are you sure? yes | no

Ken Yap wrote 08/01/2019 at 08:35 point

Nice going, looks like the break did you good. 👍

  Are you sure? yes | no

Matt Bradshaw wrote 08/01/2019 at 08:42 point

Thanks :) Yeah, it's going much better now!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates