Control your zynthian with a QWERTY (or other) keyboard

I was reading down the thread with exactly that thought in mind.

1+ for the Numeric Keypad - And then a bunch of descriptive stickers :wink:

1 Like

How are the key bindings implemented? If there is a text file (if so, @riban where is it located?) it should be quite easy to adapt an numeric keypad.
I count 16 keys which are currently assigned. Numeric Keypads have roughly the same number of keys.

regards.

1 Like

Sorry. Currently itā€™s hard-coded in the code ā€¦ please, create a feature request for this :wink:

1 Like

Thank you for the information and link. I created a feature request. (Iā€™m afraid I cannot really contribute to implementing that feature :face_with_raised_eyebrow:)

You made the first step ā€¦ so you already contributed :wink:

Iā€™ve been particularly impressed by the three switch footswitch Iā€™ve recently bought that defualys to KEys a, b & c . . .probably worth including in the thinking.

I like the idea of providing use mappable key binding and wanted to do it but needed to get base implementation done first. I could take a look at implementing this @jofemodo if you want to assign it to me. I may find some time whilst in Australia during next weekā€¦ if the mother-in-law doesnā€™t give me too many house maintenance tasks :frowning::grinning:

Just a silly thought: could an IR sensor be added to the RPi and a wireless remote used as a keyboard either on a spare pin or via the I2C route? Does ZynthOS include the LIRC (Linux Infrared Remote Control) library? Could it be added? Or would it be to resource intensive and cause latency?

Hereā€™s a link on how this is already done for a media centre: https://learn.adafruit.com/using-an-ir-remote-with-a-raspberry-pi-media-center/overview

2 Likes

Youā€™ve just reminded me I think I have an arduino kit which I think has a small remote in it and probably an ir detectorā€¦

That, of course, is the other solution: using and Arduino or other micro-controller, build a USB based IR receiver to receive the IR signal from the remote and send it to the Zynthian over USB. Itā€™s not quite as elegant as having an IR receiver built into the Zynth, though.

Hi @wolfpaw98!

It should be tested, so please, go forward with it. If you have success, we will integrate the IR stack in the official SD, of course :wink:

Regards,

I was just going to nick the bits out of the kit tbh.

I donā€™t think IR receiver should add too much load so worth a try. I have a few IR receiver chips in a drawer. I have one connected to a RPi2 vompclient (video streamer) which worked well. I am not a fan of IR - it is prone to interference. I never used it on my SoundCanvas but each to their own.

1 Like

I agree @riban!
It shouldnā€™t be a problem for the RBPi to manage the IR without causing problems or increase latency :wink:

Zynthian D-Beam!

2 Likes

Well Iā€™ve managed add an ir receiver to the RBPi and figure out how to turn ir-gpio on in both Buster and Stretch. Iā€™ve got the Zynthian (via ssh) to recognize and receive ir scancodes and interpret them as buttons pressed (in the case below, the OK button was pressed) like this:

9393.880015: lirc protocol(nec): scancode = 0x40
9393.880033: event type EV_MSC(0x04): scancode = 0x40
9393.880033: event type EV_KEY(0x01) key_down: KEY_OK(0x0160)
9393.880033: event type EV_SYN(0x00).
9393.930014: lirc protocol(nec): scancode = 0x40 repeat
9393.930025: event type EV_MSC(0x04): scancode = 0x40
9393.930025: event type EV_SYN(0x00).
9394.060062: event type EV_KEY(0x01) key_up: KEY_OK(0x0160)
9394.060062: event type EV_SYN(0x00).

What I found out is that ir-gpio has replaced lirc and is included as part of the linux kernel. Itā€™s reasonably straightforward to set up. Once set up, ir scancodes can be read by ir-keytable, but I have no idea how to bind these scancodes to keystrokes recognized by the Zynthian app. Iā€™m not a coder. Iā€™m surprised I got this far! Any suggestions? Is this worth pursuing?

1 Like

I think we could use something like:

for translating the remote events to standard keyboard events.

Regards ā€¦

or could we learn the codes like we do for midi controllers?

1 Like

Then we would need a ā€œjack clientā€ that receive the remote events and generate MIDI events ā€¦
Really funny to program ā€¦ you could take this as inspiration:

Regards,

is the new keyboard binding feature capable of mapping midi message to those actions as well?