Synth DIY : Software for Generating ADSR Envelopes

I’ve spent a fair amount of time detailing the hardware that Rockit uses for it’s Voltage-Controlled Amplifier. It’s a transconductance amplifier-based design and you can read about it here. I haven’t, however, discussed the software behind implementing the envelope generator. It ends up being more useful than just controlling amplitude. The same envelope generator code works for the filter envelope too. I didn’t end up using exactly the same code, but it could be made entirely modular, taking some basic inputs like timing and parameter data and returning an appropriate value for an envelope. Let’s just focus on how to code an ADSR envelope for now. If you’d like to get the source code for Rockit, please download it from Rockit’s Sourceforge Page.

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

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