I copied your code but it keeps giving me this error message:
I'm still pretty stupid at programming languages so won't be able to help you with coding. All I know is the code that was written by Mr. Grumpy Mike. I changed some values (all the changes are in the thread). Then (after testing it with midi shield) I turned my arduino to (I believe) Hiduino. After that arduino was plugged via USB and was recognized by computer as midi device. You have to configure your DAW. In Peripherals choose midi controller (hiduino). Under type choose HUI. After that PT will send midi data to your device. Just in case: the values in code correspond only to HUI protocol. It won't work with BABY HUI or Mackie (it's confusing but will work with MACKIE HUI in Cubase).