I built a basic drum sequencer


A (nother) stand alone drum sequencer!
*8 Channels!
*No Included Samples!
*Doesn’t crash too much!
*Not VST compatible!

It’s ugly! it’s unintuitive! but I built it with JUCE and with help from others, and someone who is even noobier than me might want to have a look through the source code. It took about 2 months to Frankenstein it together, and has helped me to get my head around a tiny little bit of JUCE and a tiny little bit of c++; I hadn’t touched c++ before, and could empathise with haydxn’s preamble to the tutorial.

Get it and put holes in it and tell me why my programming was bad!

Oh, and Jules, thanks for making such an awesome set of tools!

… oh yeah, the link…http://blog.assemblism.com/basic-drum-machine/


wow, you’re certainly making those TextButtons do some work!


:smiley: NIce one,

after some tweaking I got it working under MacOsx.
There was a compile error in MainComponent.h and I took the freedom to make the samples attack time abit shorter:
With your 100ms default settings the drums where not sounding really ‘knackig’. 8)
Here are the modified sources with a XCode project file:

Congrats, really good work looking at your experience!


If all you’ve got is a TextButtonHammer, everything starts to look like a TextButtonNail…

Frank, I don’t want you to spill all your secrets, but I can’t seem to tell where you modified MainComponent.h… for future reference, what should I look out for?
Thank you for compiling an OSX version, as I posted this on my blog I was thinking there is a large percentage of my friends who are in the mac camp… maybe they’d stop talking to me?
I think only two or three would get their heads around compiling stuff, despite how “everything’s sooo much easier”.

Extra Knackig noted, thank you! It looked like a familiar word I might have seen in the notes of an *.xm or *.it mod…


Ha! Indeed. You do what you can with what you have. Check out some of the graphics class … there is a lot you can do by drawing some creative lines and rectangles and slapping it on a custom component.


Sure, nothing complicated. Some brackets at the end of the file where wrong, surely unintentional.
You can find the changes in the version.txt inside the modified sources.

  • fixed compile bug ( wrong brackets in MainComponent.h)
  • changed attack time for samples to 3 ms in Sampler.h

For your fun: 8)
Every drum machine needs a chase light to show the current step:
Derive your channel component also from public Timer and implement the callback method kindalike the following code:

void MasterControl::timerCallback() { for (int i = 0; i<16; i++) { seqButtons[i]->setToggleState(false, false); } int step = samplers[0]->currentStep; seqButtons[step]->setToggleState(true, false); }


I actually made something very similar a while back for my first juce app and went the TextButton route too. A nice quick and dirty way of getting something on the screen without learning about all the graphics classes. Nice.


Next step: Adding functionality to play a (drum) loop in time with everything else.

I can set up an AudioTransportSource inside a ResamplingAudioSource, so I can adjust the playback speed, but I can’t seem to figure out how to trigger it in time with the Synthesiser.

I can load the sample into a Synthesiser, and synth.setCurrentPlaybackSampleRate(correct speed), but it’s cutting the playback midway, which isn’t very good.

If I’m going about it the wrong way, could someone tell me? Or do I need to start hacking? I thought I could maybe do something like add a getter/setter to the SamplerSound or the SamplerVoice.

Any wisdom would be appreciated, for the time being I might get stuck into the SamplerSound class.


Do you have this drum machine posted anywhere else cause that link isn't working.  I would really like to see it!


Exactly 6 years later than the original post.. was this done on purpose? :D