
Restoring and MIDI-Fying a Baby Grand Piano - jacquesm
https://jacquesmattheij.com/midi-fied-baby-grand-piano/
======
bsimpson
My parents bought a used Disklavier in the 90s that had mostly just been
furniture, since floppy disks went obsolete.

A few years ago, my dad found a Bluetooth adaptor for it, but the process of
streaming songs to it was a convoluted mess that involved downloading MIDIs,
putting them in Dropbox, opening them on an iPad in a different app, etc.

I was home for the holidays that week, so I threw together a Chrome extension
that streams songs with WebMIDI:

[https://github.com/appsforartists/midicast](https://github.com/appsforartists/midicast)

Super fun project. Far from perfect, but it's neat to programmatically control
a musical instrument.

Gave me a chance to try the Cycle architecture too, which works really well
for a Chrome extension. Chrome extensions are all about message passing
between various contexts. Cycle's reactive model abstracts all that away, so
you don't have to think about which piece is running where - you just describe
how data gets transformed as it flows through the system.

~~~
jacquesm
Neat project!

Disklavier control boxes also have MIDI in, and you can get fairly cheap
USB->Midi adapters. That way you can sidestep the bluetooth link if you want
to use a computer to drive it.

~~~
bsimpson
I think the Bluetooth is Yamaha-branded, but it's really just BT -> MIDI.
Probably pretty similar to your cable, but wireless.

WebMIDI doesn't care, so either adaptor should work with it.

------
jancsika
I imagine the demo to be playing a Nancarrow Player Piano Study like no. 36 or
37 (or Tango?).

No. 36 is a 4 part canon where each part moves in a different tempo, forming a
tempo ratio 17:18:19:20. Imagine taking a Bach fugue and applying a skewX or
perhaps a Gaussian blur to it. All the voices converge roughly in the middle
of the piece to create a striking texture unplayable by humans.

No. 37 is a twelve-voice canon with an esoteric relationship among the voices
(based on pitch-interval ratios of a particular scale from a book by Henry
Cowell.) It's basically a series of little episodes where he trains the
listener to focus on the texture-- because what else could you focus on in a
twelve-voice canon? Then at the end, he introduces this low, enigmatic
ricercare tune that builds into this enormous, sprawling texture of harmonic
and melodic surprises, like aliens slowly descending upon Eisenach 300 years
too late to find their lost ancestor.

Trimpin made MIDI recordings of the 50+ player piano etudes back in the 90s.

And if copyright weren't full of anachronistic concepts, one of them would be
the Lenna of MIDI piano demos in the 21st century.

Unfortunately, copyright is still full of anachronistic concepts.

So instead you get an early Debussy piece. And where you would have said,
"Holy shit, that is wild!" to a demo that properly shows off all the work the
author put into MIDI-fying a baby ground, you instead say, "Hm, neat."

~~~
dn3500
What's the problem with copyright? Assuming the rights owner can be found and
midi transcriptions made of the piano rolls, why would it be legally any more
complicated than publishing sheet music? Of course any public performace would
require royalties, as would shipping the midi files as demos when selling a
piano, but that's kind of the whole point of copyright law.

------
caiobegotti
That's some fantastic work, a job well done for sure! I couldn't help to
notice some texture on the new wood paint and I wondered why the author simply
did not restore the original beautiful wood and went instead for that hard
brownish painted tone. It's as if the sanding wasn't fine enough in grit too,
because lacquering with polishing is supposed to give you almost a mirror-like
result (that's all based on a single indoor picture of course, sorry).
Congrats again to the author!

~~~
jacquesm
The case was extremely damaged, and not made of real wood but of plywood with
veneer on top.

The veneer layer had already been sanded at least once and was super thin in
places and of course that is where the bulk of the water damage was. In the
end in a few places there was only a super thin layer of veneer left and in
one or two places none at all. Wood grain filler was used to make the first
layer more even, then three layers of red stain were added and finally two
layers of high gloss transparent.

I would have loved to use only two layers of stain but the wood left
underneath just wasn't good enough for that anymore. Anyway, so it isn't quite
as dire as you make out from the pics but it also could have come out a lot
better if there was more to start with. In person it looks quite good,
especially the combination of brass with the red stain.

~~~
caiobegotti
Thanks for the detailed follow-up!

~~~
jacquesm
You're welcome. In fact, the case was so bad, and the action so messed up that
I thought it might end up a total loss. I love recycling other people's junk
into things that are nice again, this is probably the best example of that so
far.

------
cs702
Fabulous work. The kind of project that I would have never heard about... if
it weren't for HN.

Supper happy to see this at the top of the front page.

Thank you for sharing.

On a less serious note, you could totally _freak out_ your future house guests
with stories about a ghost that occasionally plays the piano at night!

~~~
jacquesm
> On a less serious note, you could totally freak out your future house guests
> with stories about a ghost that occasionally plays the piano at night!

Hm... that's some inspiration I may not be able to ignore.

~~~
cs702
Love it. Thank you for reading and responding!

------
mkl
Does it have power limitations on the number of simultaneously active
solenoids? A friend ran into that problem. Can it play Circus Galop?
[https://www.neatorama.com/2012/02/03/unplayable-piece-
used-t...](https://www.neatorama.com/2012/02/03/unplayable-piece-used-to-test-
player-pianos/)

~~~
jacquesm
It will be more than happy to activate 20 solenoids at once, which is pretty
loud. In practical music you'd use the sustain pedal if you wanted more/longer
notes held.

I don't feel like stressing it to the point where it might break using 'black
MIDI' or some equivalent, the power supply is 35 years old and might give up
the ghost.

------
js2
This is amazing. I'm going to show this to my tuner who also does
restorations, but I know that he's going to shake his head that anyone would
do this much work on that piano.

What did you do with the G3? Do you now have two baby grands?

~~~
jacquesm
It is still there, sitting right next to the other. So yes, and a G3 is 180 so
not quite a baby, it is huge next to the other one. This is - obviously - a
matter of some discussion as was turning the living room into a woodshop for
the last month or so ;)

------
inetsee
This is an impressive amount of work, especially considering how much
modification had to be done to the solenoids.

For me, the best part was the link to the PianoBooster software
[http://pianobooster.sourceforge.net/](http://pianobooster.sourceforge.net/)
That software looks like a great way to help newbies overcome the early hump
in learning to play the piano.

~~~
jacquesm
Pianobooster is awesome, it is the most patient piano teacher you can imagine.
I've modified it a bit to give me more statistics and to more intelligently
split left / right hand parts. The original tends to assign notes based on a
pretty rigid rule and I changed it so it uses some geometrical clues about
what handspan you can expect to better assign the notes to the individual
hands.

~~~
bluGill
Can you open a pull request at
[https://github.com/captnfab/Piano](https://github.com/captnfab/Piano) Booster
someone has given the project new life in the past year (it was dead for about
5)

~~~
jacquesm
Ah cool. I tried to reach the original author but he did not respond. Thank
you for the pointer.

Pianobooster has an interesting internal architecture, it works completely in
'streaming' fashion which makes it quite hard to operate on the input files,
you can't really look ahead because the whole file is never entirely in
memory. It took me a while to get my head wrapped around that, it is so
completely different from how I would have approached that particular problem.
I can see some advantages to this way of doing things. Another interesting
point is that it has a lot of the business logic in two places, one where it
deals with the audio part of things and one where it deals with the visual
part. These then sync up again at the currently playing note(s).

Anyway, regardless, it is an awesome project and I'm super happy to see that
someone has taken up the mantle.

------
dharma1
Awesome project. The main difference I can see is that the solenoids on
Disklaviers are very quiet.

I've got a mid-80's U3 Disklavier I bought a couple of years ago, one with a
floppy disk controller. It was about £4k, bought it from a dealer who imports
them from Japan. I love it - the strings are longer than a standard upright,
but doesn't take as much space as a baby grand.

I only have one wish for it - that someone would make a new ( ideally open
source) controller unit that works with old Disklaviers!

The unit has midi I/O but has about 500ms of latency on playback - still very
nice as a party trick and for recording ideas - but somewhat limits the
usability with a sequencer.

Still, it's pretty mad I am using a Japanese robot piano from nearly 40 years
ago that still works exceptionally well.

~~~
jacquesm
Those solenoids are super quiet because of how they are designed, the top is
made of rubber with a felt insert, the weight also has a felt layer at the top
so when it strikes upwards it can so so forcefully but quietly, without the
'clack' associated with solenoids. Finally, the shaft is super thin (2mm) and
runs in a nylon guide for reduced friction, and there is a small spring in
between so that when it drops it gets slowed down a bit.

As for the 500 ms, there is a setting on the wagon that allows for realtime
during playback.

------
FatalLogic
How much control do you have with the solenoids, and the hammers? Is it just
control of the velocity of strike, or is it possible to have positional
control of the hammer?

If you could control the position, maybe you can create some interesting tonal
effects that a human pianist could not achieve, by holding the hammer close to
the string to partially damp it

(Similar to what guitarists can do)

~~~
jacquesm
Positional control of the _keys_ (not the hammers) is possible but the
solenoids get very hot. Strike velocity is not proportional, I will have to
add some filtering to ensure that loud passages don't break a hammershank.

As for the tonal effects, you can't really manipulate a piano hammer like that
through the action, and this mechanism still uses the normal action the way it
is intended, only it strikes from below the pivot rather than above, so at the
back of the key. The whole function of the piano action is to give a uniform
response to uniform input so the hammer can only describe a particular arc
with a speed relative to the force with which the key is struck. You can't
'freeze' the hammer at the top of that arc, it will just fall back down until
it gets caught by the back-checks.

What you can do and what would be impossible with just one pianist and just
your fingers is to strike key combinations that would be otherwise impossible.
For instance to make a chord that uses more than the normal number of fingers
or that would require extreme contortions or more than two hands.

~~~
FatalLogic
Then you could make some interesting effects by using each human key strike to
trigger extra keys, such as one or two octaves higher or lower, or something
more colorful like a note one fifth higher at reduced velocity, or time
delayed perhaps

edit - just noticed that it seems you hadn't yet been able to get the key
sensors working, only the output

~~~
rzzzt
The Windows 3.1-era Band-in-a-box had a feature (and probably still has, if
that software is still around) that allowed playing along a pre-programmed
chord progression in different styles, which always produced a harmony that
matched the current chord with a a single key press. You could play in the
style of eg. Erroll Garner, even if you only knew how the "bare" melody of the
song goes.

~~~
catblast
There's a relatively old FOSS "band-in-a-box" program:
[https://www.mellowood.ca/mma/](https://www.mellowood.ca/mma/)

~~~
jacquesm
Neat example of this (someone posted this as a response on Twitter):

[https://www.youtube.com/watch?v=bvMW71BJofc](https://www.youtube.com/watch?v=bvMW71BJofc)

------
tpurves
I misread this title as a MIDI capable 'flying' Baby Grand Piano. So was
mildly disappointed, but OTOH that could be a whole other level of drone-
art/aeronautical/electro-mechanical project for some enterprising hacker out
there?

~~~
ogre_codes
Thank you. I've seen this article on HN a couple times this morning and each
time I briefly think "A flying grand piano, that sounds awesome!".

------
dheera
This in interesting. I've been wanting to make a neural piano synthesizer for
an electronic keyboard that outperforms the sample-based stuff Yamaha and
Kawai use. But getting labelled training data is a problem. Would be
interesting to use a setup like this to amass loads of accurate training data
about what inputs produce what waveforms!

If the author is willing to mic up the piano properly with a good mic, and
publish a few hours of uncompressed samples of piano playing along with the
associated MIDI files -- it doesn't have to be good playing, but preferably
better than "random" playing, it would be super cool to play with that data.

~~~
jacquesm
For another project (mp3->midi) I used a large number of piano midi files
coupled with midi->wav conversion to give me a dataset like that. The original
midi serves as labels for the audio.

~~~
dheera
Yep all the author needs to do is download a few hundred MIDI files, play
them, and record the piano -- it would be an interesting dataset to play with.

Most of even the top of the line digital pianos seem to get the resonances and
cross-talk between the strings wrong in my opinion, and I think a neural net
should possibly be able to learn the internal physics of the piano from enough
samples.

~~~
jacquesm
Author here... Unfortunately there is a pretty busy road passing my house
which would preclude miking the piano and getting meaningful results. Also:
that's a _lot_ of combinations! But you are right, going this route should in
theory give you a way to generate audio that comes much closer to the real
interaction between the strings and the soundboard than the mixer step at the
end of your typical digital piano. They all sound way too clean.

~~~
keeganpoppen
would definitely be amazing for someone to do this. i do believe that there is
some more accurate sounding piano synthesis software (or whatever you want to
call it) out there that relies more directly on huge libraries of actual
recordings of playing steinways, etc. recording each key a bunch of different
ways and then ~interpolating between all those various recordings during
synthesis, which in my limited playing around with it seemed to work
relatively well (not that i had a steinway laying around, of course), but is
definitely not as inspiring or scalable an approach.

really, really cool hack btw. always inspiring to see people put
"unreasonable" amounts of time into labors of love like this. :)

~~~
jacquesm
The upside of the COVID lockdown I guess.

------
29athrowaway
It turns out, depending on where you live, a piano may actually cost you
nothing.

The free stuff section of craigslist has many pianos, for some weird reason.
Just go to "For sell" > "Free stuff" and search "Piano".

~~~
chadcmulligan
I mentioned it to some piano playing friends a while ago, I wondered the same,
and they said that if the "frame is cracked" then its just garbage - you can
never tune it properly, and repair is not viable unless it's a very expensive
piano. Here's a blurb on it
[http://www.cambridgepianotuner.co.uk/newsite/cracked-
frame/](http://www.cambridgepianotuner.co.uk/newsite/cracked-frame/)

~~~
jacquesm
Cracked frames are rare though they do happen usually because a piano was
mishandled during transport. Cracked soundboards quite common and just as bad,
cracked pinblock makes it impossible to tune the piano.

------
moralestapia
Very nice read, thanks.

It made me recall a nice memory as well. A while ago we (me and some friends)
were helping out in some hurricane struck area. We were basically cleaning and
throwing away stuff. In one house there was a Disklavier that was ruined and
almost completely covered with mud. We asked the owners if we could keep it
and they were like 'sure yeah just take it from here'. We spent a good month
just playing with it, taking out everything, then trying to put it back
together. Aside from the physical keys, nothing was salvageable but it was a
very fun experience.

~~~
jacquesm
Did you have a good look at the hammer/keyboard sensors? Those are works of
art.

~~~
moralestapia
I did but didn't know how good they were until pretty much now that I read
your comment :D. I remember I was overall impressed by the quality of
everything, even on things that nobody would ever see.

Your comment sent me into a rabbit hole where I didn't knew the Disklaviers
were capable of measuring and recording release velocity. That made me look up
which MIDI controllers do the same and turns out I have one that does (Axiom
Pro), and since I'm a music nerd now I'm using that on some software synths
(and want to learn the proper technique for playing with it, which will take
me months probably).

Thanks!

------
qrv3w
Totally amazing. The work you did seems tortuous but its looks like its paid
off! What a brilliant machine you have now, with so many possibilities, on top
of sounding really really good.

------
Thorentis
Woah, this is great! When I read the title I thought you'd just be putting
sensors under the keys to record your playing, or stripping out a really old
piano, putting speakers in the guts of it, and turning it into a digital piano
inside an acoustic shell (a cool project idea in itself really). But this is
something else entirely!

------
userbinator
_And if you get something wrong then you are going to have to fix your mistake
as many times as you have keys_

If I was doing a project like this, I'd definitely do one key first and test
it thoroughly before moving on with the rest.

~~~
jacquesm
Of course I did just that. And that worked flawlessly. Which totally suckered
me in. After that I built up the bar on that principle and found out that the
variability resulting from very small errors in cutting and drilling was
enough to cause some of the solenoids to bind. Re-doing that took a lot of
time but the end result is much better.

The essential dimensions are: hole: 6.05 mm (drill 6 mm, it drills a tiny bit
larger), pushrods about 5.72 mm. That gives minimum friction. But you can't
buy 5.72 mm rods so you end up buying 6 mm rod and then sanding that down for
every key to the right diameter. This is not the most precise process so
you'll end up with 5.72 +- a few 100th of a mm. And then there is the humidity
to deal with.

In the end I simply took a slightly larger bite out of the back of the action
so it would have some more room between the edge there and the row of
pushrods, that took care of any precision issues with where the holes were
drilled and I matched each hole to it's rod individually based on how much
play there was at the top, which is fairly easy to measure (deflection
left/right).

The failure modes are: action not far enough back, pushrod will push the key
up and then go right by it jamming the stick, pushrod can slip into the space
between the plunjer and the wall jamming the stick and front row pushrods
binding against the action. And because this only comes out when you have
assembled everything it takes some time to analyze and fix.

What did not help is that the action itself is highly irregular, both in force
required for a key to activate and in dimensions per key (especially
horizontally), this made each key a unique item and my test key ended up not
being representative enough.

------
squid_demon
This reminds me of Linus Åkesson's chipophone:

[https://www.linusakesson.net/chipophone/making.php](https://www.linusakesson.net/chipophone/making.php)

~~~
jacquesm
Very neat project! I did something similar to an old Heyligers organ from the
70's. It was an absolute monster, 2.45 m tall, 1.5 meter wide, double manual
and full pedal. I have it working with 'GrandOrgue', an open source organ
simulator and it sounds and plays fantastic. Organs are a bit easier than
pianos though because the outputs are binary rather than touch sensitive.

This:

[http://forum.pianoworld.com/ubbthreads.php/ubb/printthread/B...](http://forum.pianoworld.com/ubbthreads.php/ubb/printthread/Board/6/main/186453/type/thread.html)

Two year project is the same thing but then for a grand piano action -> MIDI.
It is super impressive but gives me the unspecified feeling that it should be
possible to do this in a simpler way.

------
nitrogen
Nice! I have an old Wurlitzer electric that I have been wanting to restore and
MIDIfy. This gives me hope that the requisite modifications to a Disklavier or
Pianodisk setup might actually be possible.

~~~
jacquesm
That should not be too hard, the thing to look for would be an Arduino based
MIDI project that you could adapt for your purposes.

------
yc-kraln
Grats on the cheap grand! I bought a similarly inexpensive piano in a
similarly decrepit condition before Covid, I've been meaning to MIDI-fy it as
well. Thanks for the inspiration!

~~~
jacquesm
Cool, let me know if I can help somehow. I've learned a lot that I would do
better on another run.

------
DenisM
This is some serious commitment to the cause. Hats off, sir.

------
jmportilla
Incredible work!

------
cdelsolar
this is just incredible.

