Unveiled at the beginner’s class at Handmade Music Austin #4, the SimSam (Simple Sampler) is a single-chip “sample-rate cruncher” that’s glitchy as all-get-out but only costs about $8-$12 in parts. It’s an effect with an input and output jack; and it’s a noise-maker since a jumper shorts the output back into the input when nothing is plugged into the input jack. We built 28 SimSams in a couple hours at the workshop.
Update: SimSam 2.0
SimSam 2.0 is an improved version that runs the same code as v1.0 (thus has the same functionality), but adds a Reset button. This button is on the left. The other two buttons are the same as SimSam v1.0. Also, on the PCB v2.0 there is a spot for a fourth button underneath the middle button. This is not used and only for testing/hacking your own firmware. Really, it will do nothing (except possibly damage the chip) if you install a button here, so don’t think about it. The code uses it as an output, low when the code is initializing and high when it’s running.
What the heck is this thing?
The heart of it is a programmable AVR chip, the ATTINY85. This 8-pin chip has 512 bytes of SRAM memory, which is used to simultaneously record and play a constantly changing “sample.” Think of the SRAM as a very very short tape loop (a few milliseconds long). The signal comes in the Audio Input jack and gets stored into SRAM (via a virtual “record head”) at a variable rate called the “sample rate”. Sample rate can be thought of as the speed of the motor on a tape-deck that’s recording. While that’s happening, the SRAM is also being played back (via a virtual “playback head”) and sent out the Audio Output jack. Two buttons affect the sample rate to get different effects. The button on the right cycles through one of 8 different rates, which effectively changes the pitch of the output– but don’t think of it like a pitch shifter, it’s way glitchier than that. If you hold this button down, recording to SRAM is disabled, and the playback just plays whatever happens to be stored in SRAM. Since the SRAM is so tiny, this “sample” sounds like a tone with a weird waveshape. Finally, when you hold down the button in the middle (or the left button for v1.0), it cycles through all the sample rates at a fast pace to create a warble effect. In v2.0, there is a button on the left that resets the whole circuit (because it crashes like crazy, read below…)
That’s it, that’s all it does.
Ok, whatever, show me the tech
- Schematic for PCBv2.0 (PDF)
- Schematic for PCBv2.0 (gschem file)
- PCB layout for PCBv2.0 (PDF)
- PCB layout for PCBv2.0 (gEDA pcb file)
What’s wrong with you?
Ok, there are some things wrong with the SimSam. For one, it has to have the watchdog timer enabled, and that thing goes off every few seconds. For those of you who aren’t cringing, the watchdog timer is a little counter that runs in the background and automatically resets the SimSam whenever it freezes up… so the translation is that the SimSam is trying its darndest to freeze up constantly, but the watchdog keeps bailing it out.
Since it’s resetting all the time, your current sample rate would also get reset, so to keep the sound somewhat consistent (heh heh) it stores the sample rate into EEPROM every time you press the sample button. EEPROM is a non-volatile memory which means it doesn’t get erased when the chip is reset. Then when the chip starts back up again, it reads the settings from EEPROM and all you hear is a tiny click amidst a gazillion other clicks pops robots whines zooms and crashes. Of course, EEPROM can only be written reliably 100,000 times, and any decent game player can top that in a day. So forget reliability. Tomorrow it won’t work the same as it did today. If you don’t like it, fix my code and send me something better. Now leave me alone so I can make more circuits…