Beats by Teensy

A standalone sampler/sequencer/drum machine based on the Teensy 3.1

Similar projects worth following
A standalone sampler/sequencer/drum machine based on the Teensy 3.1

Inspired by the Akai MPC, and the MIDI Fighter, I embarked upon the construction of a standalone hybrid.

It will feature a 96 pulse-per-quarter-note sequencer, with quantize and swing functions. It will also perform as a MIDI device both sending and receiving MIDI commands, allowing it to be sequenced by Cubase, Reaper, Ableton or any other MIDI compatible device.

The specific function set is likely to expand within the limits of the hardware, but for now, lets say it's just a sampler/looper/drum machine.

The project utilises a Teensy 3.1, which is an arduino-compatible embedded board. It's an arduino on steroids, utilising a 32bit Cortex M4 chip, with hardware DSP, and clock speeds of up to 144Mhz. Available RAM is 64k, Sketch RAM is 256k.

Added to that is the Teensy Audio board, not technically a shield, but a stacking bolt on to the Teensy 3.1. It features a 44Khz 16bit D/A chip with Headphones, Lineout, Line in, Mic in and an SDcard port to boot. It also features an optional 16Mbyte flash ROM chip which is key to the project's success.

Other bolt on hardware includes an i2c Adafruit LCD display @ 128x64 with RGB backlight, a PS/2 MiniPAC 32 way button interface, along with 16 backlit arcade buttons featuring Cherry D44X microswitches. The microswitch of champions.

On top of this, there are numerous transport and control push buttons, a cross fader for modulation and effects, 4 potentiometers and a rotary encoder for menu operation. I also hope to add a piezo sensor to detect the power a button is struck, but this might not work very well :)

Add to all of this the excellent Audio Library from, tieing it all together.

I'm pulling together an awful lot of ingenious and powerful software and hardware, provided by others, to make a whole that is larger than the sum of its parts. :)

  • 1 × Teensy 3.1 Arduino-Compatible powerhouse from
  • 1 × Teensy Audio Board Soundcard stacker board for Teensy 3.1
  • 1 × PS/2 MiniPAC PS/2 32 way button interface
  • 1 × Adafruit ST7565 Negative 128x64 LCD with RGB backlight
  • 1 × Adafruit PCA9685 12bit PWM driver for Servos, or in this case, 5v LEDs.

View all 20 components

  • Video of Early Functionality

    Jonathan Payne06/12/2017 at 09:01 0 comments

    While it hasn't moved for a couple of years (I've been working on some slightly less ambitious projects) I've posted a video showing what it's doing at the moment. Enjoy!

  • Sidetracked, but still moving

    Jonathan Payne02/10/2015 at 23:31 0 comments

    I've been sidetracked recently into beta testing the new unreleased Teensy-LC from PJRC, and building an Adafruit Untztrument with Teensy-LC at its core. More on that in another project another time.

    But I have contributed a 2way, 8 way and 16 way mixer back to the audio project which should clean up my design no end, as well as increasing sound quality. The beatmaker is already running the new code and works like a charm.

    BEen having interrupt struggles with the sequencer. I'm sure the solution will present itself to me in a moment of insanity, as is usual.

  • Synth Added

    Jonathan Payne02/03/2015 at 10:13 0 comments

    Last night I added a synth mode t othe project, and all the buttons play the blues scale. The four pots are tweaking LFO frequencies. Great fun!!! and only a 3% CPU load to run the Synth. Very. Very. Cool :)

    Still needs some work to sound like a pro synth but it's on it's way. Minimoog anyone?

  • Status Report #1

    Jonathan Payne02/02/2015 at 20:49 0 comments

    It's been about 6 months since I conceived the idea.

    I've got the device mostly built and wired into breadboard, excepting the LED driver for the arcade buttons, the fader, the piezo and the 3.3v leds.

    I've been working mainly on the code and I'm running beta code to load up samples onto the 16Mbyte SPI flash chip and play them back (20 sample polyphony) instead of playing from SDcard (5 sample polyphony).

    I have LCD backlight colours and fading implemented which will denote the current operating mode during use.

    I modified the standard Teensy PS/2 library to pass through key up and key down information.

    I have all the buttons triggering samples through an envelope which gives each sample many more uses; noteOn and noteOff are triggered by the pads being depressed and released. Great fun to play and operates at around 6ms Latency which is plenty good enough for me. Of course, as a sequencer, this will only affect live playing and recording, playback will be in time to the millisecond.

    An example of the layout of the audio system is below:

View all 4 project logs

Enjoy this project?



nicolas Jonasson wrote 03/28/2020 at 14:27 point

Considering releasing all project info to public cause of the stall?

  Are you sure? yes | no

houtson wrote 12/28/2017 at 22:45 point

Jonathan, great to see you picked this up again. super impressed with video - sounds really tight and responsive. impressed with the polyphony of 20 samples, is that just using the standard audio lib? cheers Paul

  Are you sure? yes | no

Oschern572 wrote 12/14/2016 at 01:50 point

awesome project! May i ask, how did you implement the swing and quantize function. I am trying to find some way to do so. Does it require any math? Thanks!

  Are you sure? yes | no

Jonathan Payne wrote 06/12/2017 at 09:15 point

 Hi there

   I found some information on a  forum - basically for Swing you add a tiny delay to the third beat of a 4/4 beat. 54% is basic hip hop swing. 50% is no swing.

Found it:

50-52%: 001.01.00, 001.01.24, 001.01.48, 001.01.72
53-54%: 001.01.00, 001.01.25, 001.01.48, 001.01.73
55-56%: 001.01.00, 001.01.26, 001.01.48, 001.01.74
57-58%: 001.01.00, 001.01.27, 001.01.48, 001.01.75
59-60%: 001.01.00, 001.01.28, 001.01.48, 001.01.76
61-62%: 001.01.00, 001.01.29, 001.01.48, 001.01.77
63-64%: 001.01.00, 001.01.30, 001.01.48, 001.01.78
65-66%: 001.01.00, 001.01.31, 001.01.48, 001.01.79
67-68%: 001.01.00, 001.01.32, 001.01.48, 001.01.80
69-70%: 001.01.00, 001.01.33, 001.01.48, 001.01.81
71-72%: 001.01.00, 001.01.34, 001.01.48, 001.01.82
73-74%: 001.01.00, 001.01.35, 001.01.48, 001.01.83
75%: 001.01.00, 001.01.36, 001.01.48, 001.01.84

  Are you sure? yes | no

The Big One wrote 12/04/2015 at 17:30 point

Question for you... I see that you had created some other mixer sizes (8 and 16).  I have done the same for my teensy drums project #Drum Master, and things were working fine.  However I was talking to Paul on another topic and mentioned that I was using 16 channel mixers, and he indicated that it is better to stack 5x Mixer4 objects rather than use a single Mixer16 one, due to memory usage.  Looking at the code I can't see why this would be the case (assuming a Mixer4 uses 4 units of memory, a Mixer16 would use 16 and a multi level set of Mixer4s to reproduce a Mixer16 would therefore take 20), but Paul knows his code much better than I do... however I was wondering if you had seen any issues with using Mixer16 vs. multiple Mixer4?

I am still deciding whether I am going to change over to Mixer4 or not (I would only need 5, vs. the 10 that you need, so it's not as critical as your case), but would be interested in hearing your results.


  Are you sure? yes | no

Jonathan Payne wrote 12/04/2015 at 19:07 point

yes, I spoke with Paul about this on GitHub.

They work perfectly. But Paul has his reasons. He rejected the 16 channel mixer but indicated he might entertain a 6 or an 8 channel in the library.

However all contributions were rejected. 

He has many reasons including promoting a correctly ordered design without any feedback inputs imparting latency delays.

My 16 channel mixers work perfectly but I would recommend you build on vanilla Audio library ;)

  Are you sure? yes | no

The Big One wrote 12/04/2015 at 19:31 point

Fair enough.  FWIW, I just tried hooking things up with vanilla Mixer4s, and it works fine that way as well.  I can't tell any difference in performance, sound, or otherwise between Mixer4 and Mixer16, so as you say, I figure I may as well just stick to vanilla.

Other than mixers, now that my SerialFlash playback objects have been accepted into Teensyduino, the only customized library code I have remaining is the one which supports SerialFlash using a non-standard CS pin.  I have submitted a patch, but am not sure if Paul will use it or not (it really only matters if you have a custom board mated to the teensy, and I would think that most projects don't bother with that...)


  Are you sure? yes | no

davedarko wrote 02/02/2015 at 12:50 point

Could you add some more details and informations please? Your forum build thread and this project could also benefit from a little demonstration video as well :)

  Are you sure? yes | no

Jonathan Payne wrote 02/02/2015 at 13:57 point

Certainly! Bear with me..... Plenty of details to add. Re:video - Current status is working pads triggering samples really nicely, with polyphony up to 20 samples @ 44Khz 16bit Mono - but no sequencer yet. Once I have got a simple sequencer running with record and playback I will have reached Stage 1 of an (approximately) 4 stage process, I will post a video demonstrating the functionality so far.Hopefully within a fortnight :)

  Are you sure? yes | no

davedarko wrote 02/02/2015 at 14:15 point

Good to hear, good luck and happy hacking :)

  Are you sure? yes | no

Jonathan Payne wrote 06/12/2017 at 09:08 point

It's been a while but i just added a video. I havent made any progress since you're previous comment however! :)

  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