tswift66 wrote:Hi yang,
yang wrote:for software, I just use a Debian server, installed pianoteq, and setup some service myself. main features are:
- when piano is turned on (usb device detected), check pianoteq's audio chain is fully healthy, if yes, send "local control off" signal to piano. I intentionally do NOT remember the local control to OFF on piano, just in case the box is not working, my kids won't be stuck with a muted piano. it should always make sound when turned on. (piano always turns on with local control ON)
- when piano is turned on, enable performance mode and disable sleep, etc
- when piano is off, enable normal power management.
also has a program I made for my self that run on the linux box, serves a web page i can access from my phone (for remote control/change presets, etc).
If you're interested i can share more details.
I think it is very interesting and would love more details if you're willing to share!
How do you send ,local off‘ to the piano? And how does the program look that you created?
Glad you're interested! Here are the details on how the Local Off handshake works, the software design, and what the UI looks like:
1. How to send "Local Off" (and the safety handshake)
Under the hood, it uses standard MIDI:
- MIDI CC 122 (Local Control): Sending [0xB0, 0x7A, 0x00] (channel 1, CC 122, value 0) turns off the piano's internal sound generator, and [0xB0, 0x7A, 0x7F] (value 127) turns it back on.
- Note: While CC 122 is standard on Yamaha CLPs and many modern digital pianos, implementation can vary by brand and model, so it's always worth double-checking your piano's MIDI implementation chart in the manual.
More importantly, the safety logic behind when it gets sent:
- The Linux daemon monitors the USB connection. When the piano is turned on, it performs a quick health check:
1) Verifies the Pianoteq process is running.
2) Verifies the PipeWire/ALSA low-latency audio stream is actively linked to the piano's USB audio interface.
- Only when the entire audio chain is 100% verified does it send CC 122 (value 0). If the audio connection ever drops, it automatically sends CC 122 (value 127) to restore the piano's native sound.
(it also changes the linux box's power saving mode, etc, triggered by the same event)
2. Software Architecture & Upstream Velocity Mapping
The box runs headless Debian with a lightweight daemon written in Rust:
- Centralized Velocity Mapping: I map the velocity curve right in the MIDI proxy layer before sending events to Pianoteq. In Pianoteq itself, the velocity curve is left completely flat/linear.
The big advantage: If I ever switch to or layer another VST (like Garritan CFX or a DAW), I don't have to duplicate or calibrate the curve across different plugins. All sound engines receive the exact same touch response from the upstream proxy.
- Headless Pianoteq Control: Pianoteq runs without a desktop GUI. The daemon communicates with it via Pianoteq's native JSON-RPC API to switch presets, adjust reverb, and manage parameters.
3. How the Program & Web UI Look
The daemon serves a responsive Web app over the local network (e.g. http://<box-ip>:8770). You just open the URL in Chrome or Safari on your phone or tablet (and you can tap "Add to Home Screen" so it opens full-screen like a native app).
The phone interface focuses on quick, practical controls while sitting at the piano:
- Preset Switcher: Large touch buttons for favorite presets (e.g. Steinway D, Bösendorfer, Warm/Bright configurations) so you can switch sounds in two taps.
- 60-Minute Rolling Recorder: You don't have to remember to press "Record" before playing. The daemon continuously keeps the latest 60 minutes of mapped MIDI in a memory buffer. If you just played something you like, pull out your phone, view the detected takes on a timeline, audition the clip, and export a standard .mid file directly.
- Metronome & Practice tools.
It essentially turns Pianoteq into an invisible "built-in sound engine" for the piano, with your phone acting as the wireless remote. It looks like this on my phone.
change preset and switch between built-in audio vs pianoteq

change volume, reverb, etc.

see the midi input details, and also possible to see recent played midi.(can save or export).
