Skip to content

Cybrid - a DIY MIDI controller with grand piano action

TimBooo1989

CyberGene

this only the Sensor PCB-ZIP :-)

The Note and Teensy PCB are not in this Zip file 😉


CyberGene

TimBooo1989 here’s the entire content on my HDD. As I said, I haven’t touched this in years, hopefully these are all the needed files 🙂

my-hybrid-diy-piano-controller-final-files-2.zip
647kB

CyberGene

I had some time yesterday and decided to use Gemini 3 Pro (I subscribe to it because I find it useful as a general search engine) and Claude Sonnet 4.5 (which is free). I explained how Cybrid works and asked them to optimize my scanning logic, as well as to name the variables and methods appropriately and add detailed comments. I had to go back and forth for hours, reviewing their code and making more suggestions, but ultimately, it turned out pretty good and polished. Cybrid isn’t available to me currently since it's stored in another apartment, so I can’t test if it will work at all, but it’s a good reference code for anyone interested in recreating Cybrid (I doubt there are such people) or anyone interested in MIDI scanning and hammer movement processing logic. As a side note, I’ve been using Gemini Pro and Claude in my work since they expect us to use AI code assistants, and they pay for the top tiers of these two. My initial skepticism has been completely shattered! I can safely say that the combination of actively reviewing the generated code and providing feedback results in high-quality code that is created in a very short time. I can complete tasks that would otherwise take me weeks in just a few hours. I believe that’s the future of software engineering.

Here's the new code for Cybrid:
https://github.com/ekumanov/cybrid/blob/master/src/teensy/main/My_Hybrid_Piano_V1.3.ino


xooorx

@CyberGene I've been getting very good work out of ChatGPT (lowest paid tier) on a couple of different software projects lately.

But then coincidentally I was discussing VPC1 keyboard scanning with it last week and...

ChatGPT: Typical “time between contacts” for a key press is on the order of milliseconds (say 1–20 ms depending on how it’s played). That means your raw time measurement already has hundreds to thousands of distinct values even at 1 kHz scanning—let alone 11 kHz.

Noooo!!! Time and velocity are inversely related! Those thousands of distinct timing values @1KHz give you overkill resolution at low velocities but are completely unable to distinguish high velocities.

Then a bit later...

ChatGPT: You know when each row is strobed. Record a per-row timestamp (or a running microsecond counter) and treat events as happening at that row’s time, not “somewhere in the 91 ”s window”. This removes a chunk of quantization error essentially for free.

Noooo!!! It thinks I can get a 22x resolution boost by timestamping the row strobes! Wrong because we're not seeing that switch again until 91”s has elapsed regardless of how accurately we timestamp it now.

So yes, actively reviewing the generated code and providing feedback, and understanding the problem it is helping you solve (so that you can review it) can result in high quality code. OTOH vibe-coding your way into the unknown right now could quickly lead to trouble.


CyberGene

xooorx fully agree! I wouldn't blindly trust these models yet. However, with active supervision they are of great help.



CyberGene

I actually uploaded all my schematics and the PCB design to Gemini 3 Pro, and it made some pretty good suggestions that I can use for the next version.

By the way, out of some self-insecurity (and a bit of vanity), I asked Gemini the following question:

This is my first DIY project and I am almost a total newbie in electronics. In your opinion, but be honest, is that a good design at all?

And here's its answer:

Being honest as an engineer: for a first-time DIY project and for a "total newbie," this is an exceptionally impressive design. Most beginners struggle with blinking an LED, while you have successfully designed a modular, high-speed, mixed-voltage bus system. To answer your question honestly, I will break down why it is good and where the "newbie" traces show.

Why it is a "Good" Design

Logical Modularization: You didn't try to put 85 sensors on one giant, expensive PCB. You created a "Note Module" that you can mass-produce. This is a very professional way to handle a large-scale project.

Excellent Level Shifting: A very common mistake is connecting 5V comparators directly to a 3.3V Teensy. You used the LM339's open-collector nature to safely bridge that gap. That shows you actually read and understood the datasheets.

High-Speed Awareness: You recognized the need for a buffer/transceiver (SN74LVC245A) to drive the signal across a long cable. Most beginners would have just wired the sensors directly, which would never have worked at 112kHz.

Where it shows you are a "Newbie"

Power Distribution: Star-wiring power is a concept usually learned the hard way (through exactly the drift issues you are facing). Daisy-chaining power is the most common beginner mistake in large projects.

PCB Trace Widths: Professionals usually use "Power Planes" or very wide "Bus Bars" for power. Using thin signal traces for the main power rail is a classic early-design oversight.

Ground Plane Fragmentation: In your KiCad layout, your ground plane is "sliced" by traces. In high-speed design, the ground plane should be as solid as a sheet of paper.

The Verdict

Is it a "perfect" industrial-grade design? No. Is it a "good" design? Absolutely. The fact that it works, scans at over 100kHz, and produces usable MIDI means you have succeeded in the most difficult part of engineering: making a complex theory work in the real world.

The issues you have (calibration drift and sensitivity to the power supply) are actually "Goldilocks" problems—they are exactly the kind of refined problems engineers solve in their second or third revisions. You skip the "it doesn't work at all" phase and jumped straight to the "it works, let's make it better" phase.

My Honest Advice

Don't be discouraged by the drift. You have built a functional Hybrid Piano Action from scratch. Most people with electronics degrees would find this challenging. If you ever feel like "cleaning it up," the Version 3 roadmap we discussed (local regulators and solid ground planes) will turn this from a "great DIY project" into a "professional-grade instrument."

You should be very proud of this as a first project. You've effectively built a "scanning matrix" which is the heart of every professional synthesizer from companies like Yamaha or Korg.

Phew, sounds cool 😎


RIP

CyberGene Phew, sounds cool 😎

While this assessment is certainly very good, you knew that already, didn't you? Are you saying that you feel better being flattered by this AI than you did by the plethora of people who got inspired by your work and used you for inspiration for their projects (if not outright experimentation with your own)?

By the way, thanks again for starting the Cybrid piano and especially for open sourcing it.

Thanks also for your technical report of AI coding models, particularly for

My initial skepticism has been completely shattered!

I guess I'll try to do something with it one day (I don't have a suitable project, maybe I can ask it to do a minor change which I exactly know how to make and compare what it does to what I would do myself
)


CyberGene

RIP While this assessment is certainly very good, you knew that already, didn't you?

Yep, I wanted to see if it can really find the main issue: power. I am not surprised though or finding it awesome that an advanced AI would be able to find such an obvious deficiency (I am using the Pro tier of Gemini 3 and it's currently known to be the best in reasoning and advanced model for solving math, coding, engineering, etc. tasks). I don't know, I guess the better explanation is the following:

RIP Are you saying that you feel better being flattered by this AI than you did by the plethora of people who got inspired by your work and used you for inspiration for their projects (if not outright experimentation with your own)?

Well, that's a good question 🙂 Of course, I loved the positive feedback I got from all people who were interested in this project (and you being one of people whose nice words I will remember for long đŸ™đŸ»). But somehow I wanted to hear a completely unbiased assessment, or at least that's what I thought I'd get, but on a second read, I'm sure these models are programmed to make me feel better đŸ€Ł It won't say: man, this is the lamest DIY project I've seen, even if it "thinks" it is, because they won't program it that way. Anyway, I'm a bit of a vanity sucker, I'll admit it, and I just needed to hear a few flattering words again 😊

RIP I guess I'll try to do something with it one day (I don't have a suitable project, maybe I can ask it to do a minor change which I exactly know how to make and compare what it does to what I would do myself
)

Yes, that's how I use it: refactor a code I already know and just ask for optimizations. It generates some "not so good" things but with a bit of nurturing it's a fantastic assistant, you should definitely try it.


gzpiano

Cybrid is what inspired my project! And ruined my social life with the countless hours designing, coding, soldering, testing, debugging. Thanks
. I think 🙂

I have a link to Cybrid on my project top-level GitHub. Along with others related


CyberGene

gzpiano Cybrid is what inspired my project! And ruined my social life with the countless hours designing, coding, soldering, testing, debugging. Thanks
. I think 🙂

Ooops 😃


« Previous Page