Skip to content

Cybrid - a DIY MIDI controller with grand piano action

AlexanderBunt

CyberGene

For now, I try to remake your video (linked it below), but I cant't get the code right. Maybe you can help me with this? Like maybe you have that code anywhere, so you can send it me…?


CyberGene

AlexanderBunt I've forgotten almost anything about those early prototypes but from the video I could see the name of the program is "CNY70_Velocity_test_02" and so I found it on my computer.

cny70-velocity-test-02ino.zip
1kB

It uses the Teensy development board which is also Arduino-language compatible.


HZPiano

Hello,

@AlexanderBunt Lovely project!!

If your are going to use an actual 'fist-pounding' manual like in your picture, then perhaps:

  • You can have one microswitch that is depressed when the 'key' is up;
  • One more microswitch that is depressed when the 'key' is down.
  • Then, it could be measured how long it takes between 'leaving' the upper switch until 'reaching' the lower switch -- giving you the strike velocity.
  • This assumes that it is acceptable/realistic that for slower/quiet 'hits' to the 'bells' the carillonneur has to fulfill the whole up-down travel. If not, more advanced (such as optic/magnetic field) sensoring is needed.
  • With the number of inputs (keys/pedals (if any)) you mention, an Arduino Mega could handle all of this. (Edit: Well, maybe not, because you'd have to double -- times two switches. Then two megas that each handle half of the manual might do it.)

This is all just spontaneously from the top of my head, I am not yet among the microcontroller experts!

Cheers and happy pounding,

HZ


AlexanderBunt

CyberGene Thank you very much! Yes, I understand the point haha, but for me this is very helpful… ;-)


AlexanderBunt

HZPiano Hmm that is interesting. What you say is not realy what I need (because sometimes the carillonneur makes just very little movement with the key (only like 1cm up and then again press the key down to hit the bell). So de measurement of the movement has to be very small, thats why I think sensors like the CNY70 would be very suitable.

Thanks for the help and I will keep you posted!


HZPiano

AlexanderBunt only like 1cm up and then again press the key down to hit the bell

Hello,

Hmmm. Thinking about an actual carillon, I started to suspect that while writing.

Essentially, that is why in digital pianos 3 sensors instead of two, or even optical/continuous sensors are in vogue. And you'll need what is called analogue inputs on any microcontrollers you'd select for your project.

There, @CyberGene 's and @RIP 's project sure will give you lots of great clues.

Cheers and happy idea development,

HZ


AlexanderBunt

CyberGene It's a pitty, but I can't get my sensor working. When I check my serial monitor, it only puts out '1 0', which (I think) is a result of a malfunctioning ciruit, or false components. See the the two pictures below for my circuit.

I see I made a mistake with the wiring for the sensor (blue and white wire not on the same line), but I fixed that and it didn't solve the problem…



AlexanderBunt

n-player Yeah maybe, but isn't this all without velocity?


AlexanderBunt

HZPiano that is why in digital pianos 3 sensors instead of two

Is that for calculating velocity, even when the key has not been fully released?


CyberGene

AlexanderBunt When I have more time I will try to check your circuitry, I found one image of an earlier prototype with Arduino instead of Teensy which might be helpful for the wiring:

Also, I remember with the Teensy there were some stuff you had to enable in the Teensyduino for it to work properly, maybe the serial communication needs a specific configuration?


CyberGene

BTW, do your potentiometers have three connectors on the other side (not visible in the picture)? Because I see they have three on the visible side and you use only the middle one. Mine have two connectors on the left and one (middle) on the right.


HZPiano

AlexanderBunt Exactly that.

(And, in a well implemented (virtual) piano, this makes restriking the 'string' possible without it being dampened first. Raising the key to the full-up position also means the damper is then fully back on the string).

Cheers,

HZ


n-player

AlexanderBunt There may be sensors and upstream controllers that have velocity for broader applications.


AlexanderBunt

CyberGene Yeah, three on one side and two on the other side… can that be a problem?

EDIT: Hm I thing there is the problem. I used Rotary Encoders… that's not the way how its is meant to be, I think…

I just bought a few 10kΩ cermet potmeters, which will arrive after the weekend, so I will try again then. Like I said before… I am just starting in this 'world'… ;-)


HZPiano

AlexanderBunt Rotary Encoders

Ah! There's your culprit.

Cheers and a happy learning curve,

HZ


AlexanderBunt

HZPiano Thank you! There will be many moments of learning during this project, I think. But that's a good thing!


AlexanderBunt

HZPiano And, in a well implemented (virtual) piano, this makes restriking the 'string' possible without it being dampened first.

Yeah I understand that part, but on a carillon, there are no dampeners. Do I still need three 'measure points', or just two?


HZPiano

AlexanderBunt Three sensors (with strategic placement in the key travel to allow the restrike without having to go all the way back to the top, and still have velocity information between the en-route and lower sensors) at least.

Or have optical/magnetic position sensors which, with nifty programming, can do a lot more nuanced things than "just" three sensors. But there, my insights are theoretical rather than practical, but some great people here know a lot more about that.

Cheers and best,

HZ


JayKominek

@AlexanderBunt Ah, doing a carillon is an interestingly different technical challenge.

Some of the key differences I see from doing a piano:

  1. Physically quite a bit larger per-note. Both the overall structure, and the individual keys. You have space to put things wherever you want, and to make keys that feel right you're going to end up with long, thick pieces of wood.
  2. You have fewer notes; presumably a max of 77, that being the largest real carillon?
  3. Your keys only do one interesting thing; they trigger the mechanism which strikes the bell. They don't then dampen it later. Right?
  4. Everything is made from scratch; you're not interested in pulling unused carillon consoles out and converting them?

But you still need to measure the instantaneous velocity as the key passes some triggering point?

I don't think using optical reflectance to measure distance is at all appropriate for you. That'll be a pain, and there's no reason you need to constrain yourself with physically small sensors.

My initial thoughts for you would be to use rotary encoders that can attach to existing shafts, like these https://www.cuidevices.com/catalog/motion/rotary-encoders and then measure the angular velocity at the shaft. You'll get clean values which directly correspond to physical motion you can understand. They're expensive, probably starting at $20/ea, likely more with limited availability of everything these days. But it might be possible to connect all the ones you'd need to a single sufficiently powerful microcontroller. That'd make your life quite a bit easier. But some design work, reviewing the interfaces available on those encoders, would be necessary.

Similarly, you could adapt some sort of fine-resolution rotary encoder like you already accidentally purchased to the task.

I'd shy away from potentiometers, if nothing else because you'd need to get a huge number of ADC channels and that is more of a pain in the ass than the casual observer realizes.

You could also apply optical reflectance sensors as they were originally intended to be used. Point one at the side of every key, and put a strip of alternating black and white lines on the key, such that as the key moves the sensor will swing between its minimum and maximum outputs. That'll get you a pulse train proportional to speed. You'd need a tiny bit of clean up on the signal and then it could go straight into a microcontroller. You could almost certainly get away with feeding 77 such signals into a single sufficiently powerful controller.


« Previous Page Next Page »