This is the second in my series of tiny audio accessories: a pocket-sized two channel stereo mixer. It fits in an Altoids tin and lasts approximately forever on a pair of AA batteries.

There also two output jacks; I like to send one to speakers and the other to a recorder.

If you try to build this yourself, please let me know about it!

Warnings!

I am not a professional electrical engineer. Use these designs at your own risk. That said, I am pretty happy with this design and it more or less works exactly how I want it to.

The provided PCB is laid out for surface-mount components. I personally think soldering surface-mount components is no harder than through-hole, but the process is quite different and it was a little intimidating at first.

Schematic

PCB

Design notes

Power supply

I wanted to use AA batteries for a low profile, but the VCA requires a minimum 8V supply, so I used a boost converter. I selected the TI/National LMR62014 mainly because it’s cheap and readily available. The ratio of R16 to R17 sets the output voltage; I’m aiming for about 9.5V to provide a little headroom. The TLE2426 splits the boosted voltage to create a virtual ground, letting us simulate a bipolar power supply.

Mixer

The core of this mixer is the COOLAUDIO 2164 quad VCA, and this circuit is pretty much straight out of the datasheet.

Recall the design of a simple summing inverting amplifier:

The current through R1 is I1 = V1/R1, and the current through R2 is I2 = V2/R2. The op amp input wants to sink zero current, so the only remaining path for the current I1 + I2 is through R3. That makes Vout = -1 * (I1 + I2) * R3; if we choose R1 = R2 = R3, then Vout = V1 + V2.

The 2164 is a current amplifier, so that means we can just drop in the middle of the summing amplifier design to add a gain control. Referring back to our mixer schematic, R1 controls the original input current, the VCA scales it according to the control voltage, and the op amp pulls it back through R9 to convert the signal back to a voltage.

The control voltage is -33 mV/dB, with ground giving unity gain. R14 – VOL1 – R15 sets up a voltage divider where the wiper on the pot can tap into the middle. Ideally the gain range would be something like -60 dB of cut and up to 6 dB of gain, but I also wanted to stick to common resistor values. The actual range ends up being something like -70dB to +3 dB, which is just fine for my purposes. We can apply the same control voltage to two channels to get a proper stereo gain control. No messy dual-gang pots required!

You could add as many VCAs as you wanted to this circuit to make more channels.

Output stage

There are two output jacks and I just tied them together.

Of course, there are two unused op amps, so you could add an independent buffer for the second output. I ran into some trouble routing the board in that configuration, so I decided the lazy approach was probably good enough.

Parts list

You can get almost everything from Mouser. The VCA chip, however, is pretty difficult to find. The big distributors don’t carry it, so you have to hunt around specialist distributors.

Connectors

4x battery clip Mouser
4x 1/8″ audio jack Mouser
Switch Mouser
16-pin DIP socket Jameco (or, if you want to get everything from Mouser try this one; I think the footprint is the same, but this is not exact one I used)

Diodes

I am SUPER INTO the current trend of tiny musical instruments (OP-1, Volca series, Pocket Piano, etc). I’ve built a few accessories to complement my collection. Some people at the Operator-1 forum have expressed interest, so I thought I’d share the designs. I hope to provide enough information that you can make your own.

In this case, I wanted to use a pro microphone with the OP-1. So I designed a small, battery-powered mic preamp with an 1/8″ output.

Warnings!

I am not a professional electrical engineer. Use these designs at your own risk.

The design has no phantom power, and therefore will only work with dynamic microphones.

I had a bit of a brainfart when I designed the output stage, and the result is that it won’t work plugged into a balanced input. The preamp works great with the OP-1, but you might get funny results if you plug it into a pro mixer or such.

The provided PCB uses some surface-mount components, which require a different soldering technique from through-hole electronics. If you can do through-hole soldering, you can probably learn surface-mount, but it is different. I highly recommend using a hot air tool, but it is theoretically possible to do it with a plain old soldering iron as well.

Schematic

Click for full size:

PCB

I shared the project on OSH Park, where you can download the .brd file or order PCBs.

Design notes

I can’t really take any credit for this design as it’s more or less straight out of the INA217 datasheet.

Power supply

The TLE2426 is a nifty IC for converting a single voltage into a bipolar power supply. It finds the midpoint voltage of its two inputs, and then you can pretend that’s ground. Your 9V battery then looks like a +/- 4.5V bipolar supply.

D1 is for reverse protection. D2 is a power indicator. If you use the same LED I did, it’s SUPER bright, so feel free to replace R5 with a slightly bigger resistor. You can swap in your favorite color of LED instead, just adjust R5 to match. C5 is for smoothing the power supply. This circuit is not very power hungry, so you don’t need much; 47μ is probably plenty. I happen to have a giant bag of small 100μ caps so that’s what I use.

Preamp

This is a totally standard application of the INA217 preamp.

R6 is the gain potentiometer; it should have a reverse-log (also called reverse audio) taper for smooth control. Unfortunately, it’s backward: fully clockwise is minimum gain, fully counterclockwise is maximum gain. I could not find a suitable arrangement that gave me both a nice gain curve and conventional operation, so I chose the gain curve.

R2 sets the maximum gain at about 60 dB.

Output stage

There’s a 1/4″ and 1/8″ output, each of which has its own op-amp buffer. Even though the schematic says 4227, you should use a rail-to-rail op amp like the TI 2374 instead. (This is a case where I didn’t really know how to use Eagle yet.)

It was kinda dumb of me to give the tip and ring of the 1/4″ output independent buffers with the same signal. This is really confusing to a balanced input. I never bothered to fix this, because I mainly just connect the 1/8″ output to a stereo line input and that works great.

Parts list

You can get almost everything from Mouser. There are a couple random things that I got from other suppliers, mainly because they matched the parts that happened to be in my Eagle library. Feel free to substitute, just check the data sheets carefully.

This blog has had the same theme for about 8 years, and it looked pretty dated. Thus I made this new one. This theme is “responsive,” which means it looks good even if you have a really tiny screen, which, I’m told, is what the kids are into these days.

What do you think?

I haven’t quite polished all the bits so some things still look weird. I’ll fix them when I get to them!

Some credit

The color scheme is “OceanSandBeachParty” by Suzana_K. Thanks for putting a bunch of rad color palettes on the internet for free, Suzana_K! I owe you one.

How does one get it?

Find and open your Live app bundle. (Right-click and choose “Show Package Contents”)

Go to Contents -> App-Resources -> MIDI Remote Scripts.

Drop the “Alias8” directory there.

The script should also work on Windows, but I don’t know how to find your MIDI Remote Scripts directory.

NOTE: This script assumes the encoder above the master fader is in relative (infinite) mode. Out of the box, it’s configured in absolute mode, so you’ll need to change it. The easiest way to do so is with Livid’s web editor.

If you have an oddly-sized instrument, and you take it out of your house more than rarely, you should get a custom bag from Mooradian.

Way back in January or so my faithful microKorg died and I replaced it with a Waldorf Blofeld. I picked up a generic 49-key keyboard bag to go with it. This bag was crap. First, the bag was way too big for the Blofeld, making it floppy and awkward to carry. Second, the flimsy hardware on the strap broke within a couple weeks.

Long story short, a couple months ago I stumbled across Mooradian, who will make a variety of bags to order. I ordered a bag for the Blofeld. It came to under $200 delivered and arrived in about 4 weeks.

The Blofeld in its nest

The hardware and craftsmanship are top quality. Most importantly, the difference from the ill-fitting bag to the properly-fitting bag is shocking. My instrument feels ten pounds lighter, probably just because it doesn’t shift around when I carry it.

My friend asked me if I could make a music player with a spectrum analyzer for his web page. I’m like, I dunno? Can I?

I can make a spectrum analyzer in my sleep, and browsers can do some audio stuff these days, right? So, maybe?

I can make a spectrum analyzer in my sleep

Here’s how you make a spectrum analyzer. First, run your original signal through a few parallel bandpass filters. The range of human hearing spans about 10 octaves, from 20 Hz to 20k. If we want a 5-band display, we’ll place our bandpass filters at 2-octave intervals. This gives us centers at 40 Hz, 160 Hz, 640 Hz, 2.5k, and 10k.

Now we’ve got five (or whatever) new audio signals. We compute the power of each band and draw a bar for each one. There are some details around how you compute the actual size of the bars to make them look good, but that’s the main idea.

Easy! NEXT

Browsers can do some audio stuff these days, right?

Yes, but with difficulty. Dropping in an audio player is straightforward with the audio tag. Codecs are a bit muddled– Firefox won’t play MP3; Safari won’t play Vorbis. But in the grand scheme of browser quirks, this one is charmingly easy to deal with.

We specify both sources so that all browsers can play at least one. And presto:

This is cute, but to add a spectrum analyzer to our player, we need access to the raw PCM stream. The problem is thorny.

In Firefox

Firefox’s Audio Data API makes it easy. Your audio element will fire a MozAudioAvailable event for each little chunk of sound it plays. Create an event listener, and your callback can process the stream however you like. Like this (I use Cobra cause I like it):

In WebKit

Nope! WebKit is implementing the Web Audio API. This API sorta works like a modular. You create chains of AudioNode objects which act as sound sources or processors. There are a bunch of prefab AudioNodes, or you can write your own.

Chrome implements at least part of the Web Audio API. So do Safari nightlies, and I presume Safari 6 will as well.

My plan was to connect an audio element to a custom AudioNode, which would use the same spectrum analyzer code from the Firefox example. This plan was foiled when I discovered that the MediaElementAudioSourceNode, designed to provide integration with the audio and video tags, is silently unimplemented in Chrome. You can create one, but it will just feed you a steady stream of zeroes.

For now, it appears that the preferred solution is to re-implement the audio tag yourself using an XHR and an AudioBufferSource. Which is insane.