DIY Digitally-Controlled Analog Filter Design

In the Beginning

For the Rockit Synth, I designed a digitally-controlled analog filter.  I went down this path after a good amount of thinking, learning, and design attempts.  First, I looked into cribbing a filter design from some reputable synthesizer.  I found a few problems with this approach.  Primarily, voltage-controllable analog filters tend to be part-count heavy.  Look at most designs and you’ll find dozens of components, many of them requiring trimming to work properly, and many of them requiring many dollars to purchase.  The designs also tend to require high rail voltages, like +/- 15V.  And some require all of the above. Take a look at an old Moog filter.  It’s got boatloads of parts, high rail voltages, and in the end is only a low pass filter.  Sure, it sounds sweet, but my goal was to make an affordable kit synth.  Maybe one day, I’ll splurge and build a no holds barred filter, but it turned out to be interesting to live with some limitations and make my own filter.  Click through for a detailed discussion of the filter in the Rockit Synth.

Continue reading

All Kickstarter Has Shipped!

I finished shipping all the Kickstarter orders. Altogether, I’ve shipped about 175 Rockits in some form. I’m happy to say that no problem that I encountered along the way was unresolvable. Everyone that has one built has it working. That was a lot of work and it’s kind of weird to be on the other side of such a monumental effort. I’ve been working 60+ hour weeks between my real job and Rockit for as long as I can remember. The real lesson I learned from doing this has been persistence, sheer dogged persistence. There were several times I sat at my workbench (kitchen table) and thought that if I didn’t figure out what was wrong pretty soon, I was going to cancel the Kickstarter project. But I just kept coming back and trying again. I did two board revisions between the beginning of the project and when it was funded and then spent an entire more month tweaking the software. I added the drone/loop feature after the Kickstarter project started! All in all, Rockit took two years of my evenings and weekends to design, and several more years of learning before I had the courage to start it. All in all, there were six Rockit prototypes from breadboard to the present board. I have a hard time estimating the amount of time that I put into it, but it must be a couple thousand hours.

Rockit is now available for sale in the HackMe Store. The case is coming along and should be finished and available in December.

So, what’s next? I’m going to be working on the software a bit to come out with a 1.1 release with some fixes, some changes, and some new features. I’ve received some requests and I’m going to do my best to incorporate those requests. Some people would like some envelope changes, some LFO changes, and I think I could figure out some surprises too. There are different oscillator modes that leave open some clock cycles that could be put to use. That’s all I’ll say on that for now.

I’m also starting work on the next project. It’s not super-secret. I just want to have gotten a little further before I show it and why not have a little surprise. I’m thinking it’ll be ready to show in a few weeks. Now that Kickstarter is over, I’ve got some time on my hands.

Kickstarter Project at 75%

Cheers to you Kickstarter. The project reach 75% funding in only two and a half weeks.

I’ve been through every emotion imaginable. It’s really exciting to reach this point in the project. The response is a validation of the work I’ve done for the past year and a half pretty. I’ve overcome problems which I couldn’t easily resolve after days and weeks of scouring the internet and reading dense textbooks.  I had to learn a lot about digital signal processing, firware optimization, filter design, and about how to use all the parts I ended up using. The good part for you is that I’ve learned about all this stuff, packaged it into the synth, and written about and will continue to write about it on this blog. Click through for more and a celebratory 75% Rockit bassline.

Continue reading

DIY Voltage-Controlled Amplifier

The purpose of the voltage controlled amplifier is to make an amplitude envelope like this.

When I started the Rockit 8 Bit Synth design, I thought that I could implement a voltage-controlled amplifier, VCA, in 8 Bit land, saving precious hardware and everything would be easy. Well, as with many of the other things that I learned in the process of developing this project, reality would not be so kind. In this post, I’ll explain why that doesn’t work and then fill you in on how you can implement a functional Voltage-Controlled Amplifier using some fairly simple hardware.
Continue reading

8 Bit Synth: Status Update

I was hoping to be writing that I had finished the design and had started the final layout, but I’ve got one more thing to get sorted.  I’ve found that digital scaling in the 8 bit world has serious audio problems and I’m implementing some more analog circuitry to resolve it.  As usual, I’m hacking my way through a well beaten path but I’ve never done it before so it takes some thought and experimentation.  My usual limitation is to try to find the cheapest, lowest part count, and most consistent solution.  I’ll post about the final solution, hopefully soon.

Otherwise, I’ve made huge progress.  I’ve ditched the R2R DAC because it has linearity problems. I’ve wrapped up the filter after a bunch of experimentation and a couple misleading wrong turns. The final filter is going to sound pretty cool.  I’m adding a bunch more waveshapes for synthesis and for the LFO which works very well.  MIDI in and out are fully functional and implemented.  I also got patch storage and recall working.  So, it’s almost all there.  One more thing to figure out and then it’ll be the final layout.  In the end, I’ll be posting this project initially on Kickstarter as a way to generate the money to get started.  I’ve got another investor, but I’m hoping to be able to do it alone.  Anyways, send me an email or post a comment if you want to know more.

Bandlimited Wavetable Synthesis

Sin Wavetable
I’ve discussed the phenomenon of aliasing in digital synthesis in several previous posts.  I described the phenomena, it’s source and what it sounds like.  There are many, many solutions to the problem of aliasing in digital synthesis.  A lot of them rely on performing sequences of calculations, multiplications and additions to implement various filtering methods or methods of synthesis which theoretically do not create aliasing, like additive synthesis. In my Rockit 8 Bit Synth, I don’t have the luxury of loads of extra cycles to throw at calculations, so I need something that can reduce the aliasing without requiring boatloads of clock cycles.  I settled on bandlimited wavetable synthesis.  With it, I have reduced the aliasing to a point that I can tolerate and probably further optimize.  Let’s discuss how it works.  Also, click through for source code for generating a wavetable and a sample wavetable from my synthesizer.

Continue reading

Embedded Software: #ifndef #define my_way

So, I’m deep in embedded software, or as people in the know call it, firmware.  A lot of what I’m dealing with is rookie nonsense.  Now, I’m probably more of a journeyman coder at this point, but good high quality code doesn’t just spring from good intention and effort.  There are a great many rules and tricks of the trade that can only really be learned from someone else.  I, being self-taught, have learned much of what I now know by blindly stumbling through the wilderness until through sheer effort, I find the way out of the woods of impenetrable error messages.  I’m going to be sharing over the course of many posts, some of the rules and best practices that I discover along my journey. Hopefully, they’ll shorten the duration of your meanderings.  Follow the jump for a discussion of the use of the preprocessor directive, #ifndef.

Continue reading

Volatile and the GNU C Compiler

Twice now, I’ve been burned.  I’m using the GNU C Compiler with the AVR ATMEGA164PA for my current project, the 8 Bit Synth.  I need to use external interrupts to determine when a switch has been pressed.  When it has, the i/o expander drops its interrupt pin from high to low.  So, I set up the external interrupt routine to be falling edge-triggered.  I had to figure out how to get the i/o expander to trigger its pin when a button was pressed.  I knew that the i/o expander’s output interrupt pin was changing when I pressed a button.  I also knew that the microcontroller’s interrupt service routine was being triggered because I made a pin toggle when the routine ran.  I set a flag high in the service routine.  I configured an if statement in the main routine checking for the flag.  If the flag is set, I need to read the i/o expander’s interrupt latch register to determine which switch was pressed.  The microcontroller never sends the read command.  Not ever, ever.  I couldn’t figure out why.  Do you know?  Follow the jump for the answer to this riddle…

Continue reading

MCP23S08: 8-Bit I/O Expander: Part One: Extra Ports for LEDs

So you’ve got 100 LEDs, 72 Buttons, and a microcontroller with 18 I/O pins?  You could try multiplexing the LED.  Use 8 pins for the cathodes of LEDs and drive groups of 8 LEDs with transistors to turn them on groups at a time.  That’s the cheapest thing you could do, but the more LEDs the more complicated it gets and the more pins you still need.  You could do 96 LEDs with 20 pins, 8 for cathodes and 12 for multiplexing transistors.  You’d have to sink all that current and switch everything fast enough to maintain persistence of vision (about 30Hz).  There must be a better way.

And there certainly is.  There are shift registers, which are a great way to go especially if you’re doing simple input and output.  They have to be polled regularly, but you can send them information serially which they put out in parallel, using only a few microcontroller pins.  What I’ve landed upon recently are I/O Expanders from Microchip, particularly the MCP23S08.  Follow the jump to learn about them and how to use them.

Continue reading