Topic: Extending the control of Pianoteq on a Raspberry Pi

My Clavinova CLP115 only has two buttons that I can map to Pianoteq actions which is very limiting as I like to be able to use Pianoteq without recourse to a keyboard and mouse or the Ipad. I've therefore written a script which enables me to put the keyboard into a "typing" mode where I can map any of the keys to Pianoteq actions. The only limitation is remembering which keys do what!

When in normal "Piano" mode I have the low A (that I never use) sending a shutdown command to the Raspberry and the soft pedal assigned as a page turner which works in whichever application is open. Useful when playing and reading music in the PDF viewer.

Pressing my "Demo" button switches the keyboard into "Typing" mode with a range of keys assigned to send abc etc and anything else on a computer keyboard. Multiple key presses can be simulated and I use one to bring up the "Save MIDI file" window which is one action that I don't think is possible from the Pianoteq built-in mappings. I can then type the file name on the piano keyboard and save the file. Pressing the Demo button again returns to Piano mode.

If anyone adventurous is interested in experimenting with the script I'll be happy to share it. It would require some knowledge of sudo nano chmod etc. I make no guarantee that it will work - I can only say that it works on my setup of a CLP115 and a Raspberry Pi 400.

Re: Extending the control of Pianoteq on a Raspberry Pi

I've now created a document which includes the script mentioned above and some instructions on installing and configuring it. This is the link:
https://docs.google.com/document/d/1vy3...sp=sharing

I'd be very interested to know if anyone has success or failure with it and I'll be happy to answer any queries in this thread.

Incidentally a by-product of this script is that with a complete mapping it can turn a digital piano, or any MIDI keyboard or controller, into a perfectly usable computer keyboard.

Last edited by ean (19-02-2022 11:39)

Re: Extending the control of Pianoteq on a Raspberry Pi

ean wrote:

I've now created a document which includes the script mentioned above and some instructions on installing and configuring it. This is the link:
https://docs.google.com/document/d/1vy3...sp=sharing

I'd be very interested to know if anyone has success or failure with it and I'll be happy to answer any queries in this thread.

Incidentally a by-product of this script is that with a complete mapping it can turn a digital piano, or any MIDI keyboard or controller, into a perfectly usable computer keyboard.

very outrageous, audacious idea, and a great way to work around the limitations of your controller.  really like it!

Re: Extending the control of Pianoteq on a Raspberry Pi

very outrageous, audacious idea, and a great way to work around the limitations of your controller.  really like it!

Thank you! I've discovered tonight a particular feature that gives a piano keyboard a distinct advantage over a computer keyboard being used for mouse control, perhaps by people with disabilities. The distance, i.e. the speed the mouse travels, can be controlled by the velocity level. It's a great way of improving your touch, trying to move it the least possible distance!
Does anyone, like me, see a possibility that piano type keyboards could have a place in Assistive Technology? I can find no reference to their use in that way anywhere.

Re: Extending the control of Pianoteq on a Raspberry Pi

Below is some code to add touch-sensitive mouse control to the script. I have updated the script document to include it but if anyone has already installed the script these lines can just be pasted into the script into the Typing section.

It's a mouse in the scale of C in the second octave up :-)
Cmaj7 is mapped to the 90 degree compass points i.e. Up, Right, Down, Left.
Dm7 is mapped to the 45 degree points i.e. NE, SE, SW, NW.
Playing the full C scale sends the mouse in a circle.
Velocity level controls the distance travelled.
Clicks and the wheel are assigned to the black keys as shown.


#Mouse Control

        "Note on 36" ) xdotool mousemove_relative --polar 360 "$data2";; #C
        "Note on 38" ) xdotool mousemove_relative --polar 45 "$data2";;  #D
        "Note on 40" ) xdotool mousemove_relative --polar 90 "$data2";;  #E
        "Note on 41" ) xdotool mousemove_relative --polar 135 "$data2";; #F
        "Note on 43" ) xdotool mousemove_relative --polar 180 "$data2";; #G
        "Note on 45" ) xdotool mousemove_relative --polar 225 "$data2";; #A
        "Note on 47" ) xdotool mousemove_relative --polar 270 "$data2";; #B
        "Note on 48" ) xdotool mousemove_relative --polar 315 "$data2";; #C

        "Note on 37" ) xdotool click 4;; # Csharp Scroll Down
        "Note on 39" ) xdotool click 5;; # Dsharp Scroll Up
        "Note on 42" ) xdotool click 1;; # Fsharp Left
        "Note on 44" ) xdotool click 2;; # Gsharp Middle
        "Note on 46" ) xdotool click 3;; # Asharp Right

Last edited by ean (20-02-2022 13:39)

Re: Extending the control of Pianoteq on a Raspberry Pi

ean wrote:

I've now created a document which includes the script mentioned above and some instructions on installing and configuring it. This is the link:
https://docs.google.com/document/d/1vy3...sp=sharing

I'd be very interested to know if anyone has success or failure with it and I'll be happy to answer any queries in this thread.

Incidentally a by-product of this script is that with a complete mapping it can turn a digital piano, or any MIDI keyboard or controller, into a perfectly usable computer keyboard.

Google MIDI4Text and Plover Michela. You will be surprised. The "piano" keyboard has been used as a stenography approach for at least 150 years, probably more. I always wanted to learn it, but never found the time, and since I'm already a relatively fast typist I never pushed myself.

Re: Extending the control of Pianoteq on a Raspberry Pi

dv wrote:

Google MIDI4Text and Plover Michela. You will be surprised. The "piano" keyboard has been used as a stenography approach for at least 150 years, probably more. I always wanted to learn it, but never found the time, and since I'm already a relatively fast typist I never pushed myself.

Thanks for those links which I hadn't found in all my searching. There is also a program called Pianotext or something. But I've found nothing that suggests the use of midi controllers as assistive technology devices except for one harmonica type device, and none of the people that I've contacted in the field of assistive technology seemed to be aware of the possibilities and the simplicity of the concept.

It's not so much the typing aspect that is interesting, but the touch-sensitive mouse control that a piano keyboard gives and maybe even more importantly the ability to send system commands. I've now programmed an Artiphon Orba to control the mouse and send system commands. That is just one of a myriad of devices that can be enabled to perhaps provide an alternative means of computer control for people with disabilities.

I apologise if this thread is wandering.