The Yamaha Disklavier is a sophisticated piece of technology, but typically, you’re limited to Yamaha’s song library. Many Yamaha songs include both a piano part for the Disklavier and an accompanying music track, though the Disklavier piano part might differ dramatically from the original piano part in the song. In many cases, the piano tracks are recorded as accompaniments by artists, and are either added to songs that didn’t have piano originally, or that are designed to augment rather than to replace the piano in the original recording.
I recently had a customer ask if I could figure out a way for the Disklavier to play the piano portion of a particular song that was important to him.
To achieve this, I used four programs: first, Spleeter by Deezer to isolate the piano and separate it from the other components of the song, and then Audacity, a powerful open-source tool, to edit and combine the non-piano tracks. I chose to use the service Ivory to convert the piano audio to MIDI. Finally, I used Ardour to adjust the timing in the MIDI to perfectly sync it with the audio.
As an alternative to Ivory, Onset and Frames can be locally installed. This software is dated (2018), and there are many frustrations with attempting to run such an old Python program, so I opted not to use this solution. However, if you have a high-end system with a powerful GPU and the free time to get it running, it’s a free option. You’ll also need to train your own model, with was estimated to take several days on my GeForce RTX 4080.
Separating the Tracks
I used the 5stems model in Spleeter, which allows you to individually separate the piano. See the instruction below.
spleeter separate -o ./tmp -p spleeter:5stems "sample.wav"
Recombining the Tracks
After reviewing each track, I found only the bottom vocals track had usable audio; the others were filled with artifacts, so I simply removed them. However, in songs with more instrumentation, this would be an important step. Review the tracks, listen to them individually, and remove any artifacts you can, applying filters as necessary.
Next, I used the Ivory App to transcribe the piano audio track. Ivory is an AI-driven piano transcription tool that converts piano audio into sheet music or into MIDI files. Utilizing advanced deep neural networks, it offers high transcription accuracy. I converted my piano.wav file (produced by Spleeter) into an mp3, and then uploaded it to Ivory.
Syncing the Audio
After downloading the MIDI file, I found that the MIDI file did not properly sync with the audio. In order to solve this, I synthesized the audio (using FluidSynth with Yamaha C7 samples). I then imported this into Audacity, and played the isolated piano alongside the original audio. After a few attempts, I then moved the audio back and forth until I determined exactly how much time had to be added to properly sync the two pieces.
fluidsynth -a alsa -g 1.3 -m alsa_seq -i /usr/share/sounds/sf2/Yamaha_C7__SMB_.sf2 ~/DownloadedMIDI.mid -F ~/IsolatedPiano.mp3
After carefully adjusting the audio which I’d synthesized from the MIDI file in Audacity, I determined that the MIDI file needed a total of 1.150 seconds added to it. This is a decimal fraction, rather than seconds in 60ths of a second, which is how Ardour determines time.
Seconds in 60ths = Integer Part + (Decimal Fraction × 60)
Just take the decimal component of the number (.150, in this case), and multiply it by 60. In this case, we end up with 1:09 seconds. Now we have a number we can use in Ardour.
Once the MIDI file is downloaded, name the MIDI file from Ivory and the piano-free audio from Audacity identically, and transfer them onto a USB stick. The properly named files will look something like this:
01MySong.mid
01MySong.mp3
Provided the filenames are identical (excepting the extension), the two files will be recognized as the same song by the Disklavier.
Your Disklavier is now ready to play both files in sync! The keys will move to the isolated piano track, and the audio will play alongside it without any competing piano sounds.