Topic: Python script for Yamaha P-525 variable Note-Off velocity (Linux)
Hi folks, about 3 months ago, I was given a new Yamaha P-525 digital piano as a gift and have been using it happily with Pianoteq. Like many others, I noticed that the P-525 outputs a fixed note-off velocity of 64. I wondered if it might be possible to improve this with a Python script.
For several years now, I have been using Arch Linux, and more recently, I have been making use of AI capabilities for a variety of tasks. So, over a few months, I worked and iterated on a Python script (with significant AI assistance) to estimate note-off velocity based on the MIDI output from the P-525. My goal was to improve the realism of my Pianoteq setup a little more compared to an acoustic piano.
The code is posted along with some testing-related scripts and a random MIDI file of me practicing at: https://github.com/HeftyNumber/p525_pianoteq_bridge. The MIDI file is raw output from the P-525, which I used early on when iterating on the code without having my piano directly connected.
I have been using the p525_pianoteq_bridge.py script for about a month now. It has been very stable and seems to work well, at least in my setup. As written, this code works on Linux, and I have only tested it on my Arch Linux computer running KDE as a desktop environment. It could likely be adapted for other operating systems such as Windows or macOS, though I have not investigated this.
I use a program called RaySession to run the Python script, launch Pianoteq, and make the necessary MIDI and audio connections. I also worked with AI to thoroughly document the code, explain how I run it, and create an architecture guide detailing how everything works.
I don't know if anyone else will find this useful, but if so, please feel free to use it!