Will paypal $40 for code to make my USB QWERTY kbd output midi off/on (read)

Hello,... I have a USB host shield, and Arduino UNO (or Mega 2560 if preferred) and a Olimex Midi Shield. I only need to send note on/note off commands for 13 notes (C to C) using the following keys:

Q, 2, W, 3, E, R, 5, T, 6, Y, 7, U, I corresponding to:

C Db D Eb E F Gb G Ab A Bb B C (in a low octave range, but I assume I can make changes if need be).

One thing to be aware of... if you hold down a typing key, a standard USB keyboard is designed to fire the key multiple times before you lift your finger (sending a note off message). This will need to be eliminated so that the USB keyboard sends note on/note off.

For any that might recognize this subject,... I had received info on how to possibly make this happen on another forum,... and I eventually make a converter to make it work using 3 Arduinos (I know, ridiculous). It worked great,... but to test I was using a generic WalMart USB keyboard... and I actually eventually needed this to work with an HP SK2885 (long story)... but didn't have one to test with until today and it doesn't work with it. I think the reason is that I was using a PS2 library and I think the WalMart special had some kind of cross protocol compatibility (I have read about such things).

Anyhow,... I'm out of time and out of patience. I should have used a USB shield to begin with.... but I found a music project with a PS2 based project code that that I monkeyd around with and got it to accept the usb keyboard I had.

I will pay $40... it's just gotta work (that's the only criteria :)

Thank you for your consideration... Jim

There's free project guides for getting Arduinos to read PS2 keyboards and there are USB-PS2 adapters but will they work for this?

Someone who knows all the ins and outs you need might do this for $40. I am not that person, I lack knowing enough specifics.

This thread should be moved to the Gigs and Collaborations section.

Thank you for your input... and I wasn't aware there was such a section.

I think the problem with the adapter is the same thing I ran into with my last solution... if you've got a keyboard that has no PS2 software accommodation... the adapter will be ineffective (unless there is some high tech kind of adapter out there that's not just rerouting wires.

A PS2 keyboard might be a way to let you do this without a PC, be more portable.

If you send chars from PC through USB to Arduino then that can work but set the serial baud rate to at least 115200. Arduino Serial Monitor does not send key strokes until the line is sent but there are terminal emulators for different OS's that will send keys.

See if you can turn typematic autorepeat off at the PC end or maybe lose the ability to play 16th or maybe 8th notes due to the Arduino filtering autorepeat key signals.

Look into capacitive touch sensing. You could make a (sorry but) no-feel keyboard pretty cheap, most of the cost would be in wiring, boards and shift registers which still isn't so much. With 11 shift registers you can input 88 'keys'.

If you use piezo disks for keys, you can detect the force of the touch. That would take more circuitry and code.

Imagine a nice set of keys with Grand Piano movement links (and feel) up to the hammers that don't hit strings in an 800 lb harp (my impression) but instead hit acoustic pickups with commanded strength.

There is this project but it uses a SAMD21 board to get USB host mode.

https://github.com/gdsports/USBHIDKbd2MIDI

You sir... (gdsports) may win the prize :). I have ordered the stuff... here's hoping this works for my application! I'll report back after results become conclusive... thank you again.

Mr. gdsports … I only just now realized that you are the poster of this circuit on github (so I’m thinking you probably know the workings of it well). The TrinketM0 arrived, and think that I found the proper library online that I needed (KeyboardController.h) at the following address:

I copied the type, put it in Notepad ++ and saved as file in C++ language… and then gave it it’s own folder… and then added the library.

I am having errors with the code in terms of loading it into the TrinketM0 though… so maybe I did something wrong (?). Any ideas ?? (Thank You). Here are the errors:


In file included from C:\Users\User\Desktop\USBHKbdToUARTMIDI\USBHKbdToUARTMIDI.ino:55:0:

C:\Users\User\Documents\Arduino\libraries\KeyboardController/KeyboardController.h:34:30: error: expected ‘)’ before ‘&’ token

KeyboardController(USBHost &usb) : hostKeyboard(&usb), key(0), keyOem(0), modifiers(0) {

^

C:\Users\User\Documents\Arduino\libraries\KeyboardController/KeyboardController.h:47:11: error: ‘HID_PROTOCOL_KEYBOARD’ was not declared in this scope

HIDBoot<HID_PROTOCOL_KEYBOARD> hostKeyboard;

^

C:\Users\User\Documents\Arduino\libraries\KeyboardController/KeyboardController.h:47:32: error: template argument 1 is invalid

HIDBoot<HID_PROTOCOL_KEYBOARD> hostKeyboard;

^

USBHKbdToUARTMIDI:58: error: ‘USBHost’ does not name a type

USBHost usb;

^

USBHKbdToUARTMIDI:61: error: ‘usb’ was not declared in this scope

KeyboardController keyboard(usb);

^

C:\Users\User\Desktop\USBHKbdToUARTMIDI\USBHKbdToUARTMIDI.ino: In function ‘void setup()’:

USBHKbdToUARTMIDI:244: error: ‘usb’ was not declared in this scope

if (usb.Init() == -1)

^

C:\Users\User\Desktop\USBHKbdToUARTMIDI\USBHKbdToUARTMIDI.ino: In function ‘void loop()’:

USBHKbdToUARTMIDI:254: error: ‘usb’ was not declared in this scope

usb.Task();

^

exit status 1
‘USBHost’ does not name a type

Be sure to follow the Adafruit Trinket M0 tutorial to install the board support. Be sure the Board Type is set to Adafruit Trinket M0. The KeyboardController.h file and its related files are automatically installed. There is no need to download the file from github.

https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino/arduino-ide-setup

Since you are going to have to do most of work yourself, don't worry about the $40.

I have followed all instructions... installed the libraries etc, but I can't get this to work. It seems to load fine. I have tested the Midi Breakout Board with a different Arduino set up and it works fine. When I turn the circuit on, my USB Keyboard's LEDs blink on and off once like they do for normal operation (so the USB port sees it I assume, or at least is sending power there). There are no error messages with the Arduino IDE... seems to load fine. I made a fake Craigslist post to act as a picture host so that you can view:

https://akroncanton.craigslist.org/ele/d/adlafruit-trinkets-vf01/6561664736.html

A couple of questions that perhaps might be helpful... in trying to think outside the box I ran across a tutorial for the Adafruit Trinket (before the M0 version). It said not to bother with a COM port, but to select a Programmer. The one that this has been defaulting to is: AVRISP mkll . Because the previous board "Trinket" used USBtinyISP I tried that one also...

I was wondering,.. when this is working properly, should the LEDs on the Trinket M0 show activity, or do they just stay solid? I've never seen any activity that would suggest that we have life going on. I seem to recall early on in my process loading a Blink test sketch and that worked.

Thank you for your assistance so far,... please let me know if you have any thoughts. Thanks :)

Thanks to all that responded.... I ended up solving this a different way (with a couple of UNOs).

You can get a small MIDI keyboard controller for $46.

https://www.ebay.com.au/itm/Worlde-Easykey-25-Keyboard-Mini-25-Key-USB-MIDI-Controller-Musical-V1G2/292531077980

Way cheaper (money and time) than attempting to cobble together something using Arduinos.