Simple piano keyboard?

I’ve been looking for a simple circuit I can use to bodge together a tiny 1 octave keyboard with tact or lever switches. This is mostly soccer I’m supremely lazy and don’t like having to drag out my little Oxygen 25 when I want to test something. I’ve got really limited desk space and when the are electronics bits spread all over there’s absolutely zero room for that thing. If I can find a suitable donor I’d like to be able to build it into a little kids toy keyboard. Anybody got any advice on designing something like this, or links to schematics? Thanks in advance!

CV or MIDI? Or both?

I think MIDI might be a bridge too far for something like this. Adhering to V/oct standards might even be silly given I only really need it to span one octave. So, whatever is simplest, I think.

MIDI would require an MCU, yeah? I expect a CV keyboard is the way to go.

here is a diy pcb synthcube sells and the explanation of how it works is in the diy section of the MFOS site I would link straight to it but the links have been broken for awhile .

1 Like

The links aren’t broken, it’s just the antiquated frames and PHP navigation Wilson used hide the actual page URL, but you can get it from the share icon up top.

Or you can be like me and get fed up with it all, and put a simple MFOS index on your website.

So the single buss keyboard controller is here:

There’s also

all of which I suspect are a good deal more complicated than what the OP envisioned stuffing into a toy keyboard. It’s really easy to build a voltage divider that will give you the voltages for an octave’s worth of keys (0, 1/12, 2/12, 3/12, …, 11/12, 12/12). The hard parts are setting up keys or buttons to send one or another voltage when pressed in such a way that strange things don’t happen if two keys are pressed at the same time, and you probably don’t want the voltage to revert back to 0 when you stop pressing a key (you can use a sample and hold), and you normally want a gate as well as a control voltage. That’s where it gets messy. In fact it’s probably easier to build a Nano based controller than an analog one. Needs a DAC, though, or filtered PWM.

2 Likes

Rich, sir, you are an absolute gem.

1 Like

I think that one of those simpler single bus keyboards is going to work. I might have to draw this schematic over in Kicad and generate something I can reliably etch at home or get fabbed. Thanks a mil, sir!

surely the solution to this is to just use a mini 1 octave kids toy keyboard to begin with?
I literally took 5 of these to our local opshop on the weekend after a cleanout of my ‘potnetial ciurcuit bending gear’ box.

Crack it open and just solder to the switch point connections off the pcb, and add a 100k multiturn trimpot to each one to set the cv.

1 Like

That gets you a CV, but what happens if two keys are pressed at once? What happens to the CV when a key is released? (You don’t want it to change.) How do you get a keyboard gate?

I’m honestly not looking for more than thirteen buttons that make different sounds. If I need a fully functioning keyboard I can use my MIDI one. This is me looking for a small footprint solution that I can put on my desk when I’ve got all my other electronics stuff spread all over it. Simple is probably better at this point, or else it’s unlikely to get done.

If literally all you want is a way to have 13 buttons that send different voltages you could just do something like this:

If you want things to be in tune then match R2 through R13 to within 0.1R. Adjust RV1 to get exactly 1.000 V at the test point.

This will give funny voltages if more than one button is pressed, and will revert to 0 V when all buttons are released (which means SW13 doesn’t really do anything but whatever). There’s no gate to control an envelope generator. This isn’t designed to be used with a toy keyboard though maybe you can do it, if you have one whose keys close switches between different unconnected points and a common bus (but I think you’re more likely to find them connected to a MCU via a matrix and then I think you’re pretty much out of luck).

2 Likes

Thanks for this! I think this will do for what I need for now, and I can always upgrade to something fancier later. Looking at the circuit, all the resistances are dependent on each other and not the op-amp, so I should be able to swap something else in without having to change any of the other components to adjust to a different supply voltage, within reason (except for dividing whatever it is down to ~1V at the top of the resistor ladder. Am I completely wrong? Just asking since I think all the op-amps I have are TL07x, though 12V seems like a bit much to throw at this. I’ll see if I have something that’ll run at a smaller Vdd–I’m sure I’ve gotten something in a kit at some point and just put it on a shelf.

As to the toy keyboard–it was a nice-to-have, but not a dealbreaker. I’ve struck out finding any at my local thrift stores anyway, so maybe it’s a later addition.

Thanks again!

I assumed a 5 V supply for something battery or USB powered, it could be adapted to higher voltage.

With a TL07x you’d need a dual supply since it won’t go rail to rail.

The trimmer resistance needs to be of a suitable size to get 1 V at the test point. With 100R resistors and 1M pulldown a 2k or 5k trimmer works. Scale that to 20k or 50k if using 1k resistors.

You want the total resistance from the test point to ground to be small compared to the pulldown resistor. If, for instance, you used 10k resistors with the switches, 200k for the trimmer, and 1M for the pulldown, then voltages in the middle of the scale would be off by about 10 mV, which might be more out of tune than you’d like. 1k resistors with a 20k trimmer and 1M pulldown would be fine I guess, or 100R resistors with a 2k trimmer and 100k pulldown. Now that I think about it the 100R resistors and 2k trimmer might be more of a load than the voltage reference would like, so probably 1k resistors and 20k trimmer would be better.

R1 limits current for the voltage reference and isn’t critical but should be up around 1k, especially if the power voltage is more like 12 V.

Of course if this is just for crude test purposes and you don’t really care about being in tune or stable you could simplify this some more, leave out the voltage reference and trimmer and just divide the power rail down to 1 V.

2 Likes

I put together this a while back which might be useful, well if you want something thats eurorack

Brilliantly documented. Your writing style is concise and relatable. I will have to give this a go if I can find one of the rare peculiar chips required. Thanks!

1 Like

hah! Thanks :slight_smile:

The chips are a ebay / aliexpress situation rather than a mouser / tayda situation.
heres a link to where I got them: 5PCS IC MM74C922N MM74C922 FSC ENCODER 16-KEY DIP-18 | eBay

If you were in NZ I could post you a pcb and a chip, but looking at your username I’m guessing you are across the ditch

1 Like

I am definitely across at least one ditch from you. Spoiler: I’m not actually Australian, or a marsupial.

Do you really need a keyboard? would a diy sequencer not do the job?

I think I’m looking for something a little less, I dunno, involved than a sequencer? I don’t suppose I need either of these things. I have both a MIDI keyboard and a sequencer, but they both take a considerable amount of setting up, you know? I want something wee that I can just whip out when I need a series of buttons that will make noises from whatever I’m working on.

Small 1 octave “keyboard” made from a bunch of momentary toggles FTW. I like the square snap-in tops.

I tried turning a thrift store bontempi kids keyboard into a j-wire bus bar deal using the mfos cv keyboard pcb years back. It wasn’t reliable due to the short throw of the keys, coupled by the copper tape “bus bar” idea I used. If you manage success on that angle, share your work!