Giter VIP home page Giter VIP logo

usbh_midi's Introduction

USBH_MIDI v1.0.0

USB-MIDI 1.0 class driver for Arduino USB Host Shield 2.0 Library

USBH_MIDI is USB-MIDI class driver for Arduino USB Host Shield 2.0 Library.
USBH_MIDI is included in USB Host Shield 2.0 Library. You don't need install separatery.

If you want use with Arduino MIDI Library, try the Transport

for single device

File->Examples->USBH_MIDI->USB_MIDI_converter

for single device with SysEx support

File->Examples->USBH_MIDI->USB_MIDI_converter_wSysEx

for multiple device (with USB hub)

File->Examples->USBH_MIDI->USB_MIDI_converter_multi

for bidirectional conversion

File->Examples->USBH_MIDI->bidirectional_converter

Examine the descriptor of your USB-MIDI device.

File->Examples->USBH_MIDI->USB_MIDI_desc If your device does not work, please report this information.

API

  • uint8_t RecvData(uint8_t *outBuf)

    Receive MIDI message (3 bytes)
    return value is MIDI message length(0-3)

  • uint8_t RecvData(uint16_t *bytes_rcvd, uint8_t *dataptr)

    Receive raw USB-MIDI Event Packets (each 4 bytes, upto 64 bytes)
    dataptr must allocate 64bytes buffer.
    return value is 0:Success, non-zero:Error(MAX3421E HRSLT) and bytes_rcvd is received USB packet length.
    note: USB packet length is not necessarily the length of the MIDI message.

  • uint8_t RecvRawData(uint8_t *outBuf)

    Receive MIDI Event Packet (4 bytes)
    return value is MIDI message length(0-3)

  • uint8_t SendData(uint8_t *dataptr, uint8_t nCable=0)

    Send MIDI message. You can set CableNumber(default=0).
    return value is 0:Success, non-zero:Error(MAX3421E HRSLT)

  • uint8_t SendRawData(uint16_t bytes_send, uint8_t *dataptr)

    Send raw data. You can send any data to MIDI. (no compliant USB-MIDI event packet)
    return value is 0:Success, non-zero:Error(MAX3421E HRSLT)

  • uint8_t SendSysEx(uint8_t *dataptr, uint8_t datasize, uint8_t nCable=0)

    Send SysEx MIDI message. You can set CableNumber(default=0).
    return value is 0:Success, non-zero:Error(MAX3421E HRSLT)
    note:

    • You must set first byte:0xf0 and last byte:0xf7
    • Max message length is up to 256 bytes. If you want extend it change the MIDI_MAX_SYSEX_SIZE.
  • void attachOnInit(void (*funcOnInit)(void))

    Register a user function to call when the controller is successfully initialized.
    See 'eVY1_sample' example.

  • void attachOnRelease(void (*funcOnRelease)(void))

    Register a user function to call when the device is removed.

  • uint16_t idVendor())

    Get the vendor ID.

  • uint16_t idProduct())

    Get the product ID.

  • uint8_t GetAddress()

    Get the USB device address.

ChangeLog

2022.4.22 (1.0.0)

  • Add OnRelease() callback.
  • The timing for enabling PollEnable has been changed to before the onInit() callback.
  • Update vender specific code for Novation.

2022.1.6 (0.6.1)

  • Fix for RecvData(uint8_t) does not work when CableNumber(CN) is non-zero.

2021.5.9 (0.6.0)

  • Change configuration descriptor parser. Supports large descriptors.
  • Fixed an issue when the endpoint size exceeded 64 bytes
  • Add OnInit() callback
  • Add a predefined macro "USBH_MIDI_VERSION".
  • Changed the method of deriving the message length
  • Refine the examples

2021.1.11 (0.5.1)

  • Fix for bool operator.

2020.11.23 (0.5.0)

  • Change to Windows style enumeration process.

2020.11.21 (0.4.1)

  • Add new example USB_MIDI_desc
  • Update vender specific code for Novation

2018.03.24 (0.4.0)

  • Add boolean operator
  • Add idVendor()/idProduct() function. vid/pid variables have been change to private.
  • Update the examples using new feature.
  • Vendor/Device specific setup (workaround for novation LaunchPad series)

2017.02.22 (0.3.2)

  • Improve reconnect stability.
  • Fix for MIDI out only device support.
  • Update SysEx code
  • Remove MidiSysEx class
  • Add new example USB_MIDI_converter_wSysEx
  • Fix typo: the example name was corrected from 'bidrectional_converter' to 'bidirectional_converter'.

2016.04.26 (0.3.1)

  • Change the type of the variables from byte to uint8_t.

2016.04.24 (0.3.0)

  • Limited support for System Exclusive message on bidirectional_converter example.
  • Add MidiSysEx Class for System Exclusive packet data management.

2016.04.09 (0.2.2)

  • Improve SysExSend() performance.
  • Add SendRawData()
  • Update debug messages

2016.03.21 (0.2.1)

  • Join the USB Host Shield 2.0 Library.
  • Adjust indentation

2015.09.06 (0.2.0)

  • Compatible with USB Host Shield 2.0 Library 1.0.0 or lator.
  • Compatible with Arduino IDE 1.6.0 or lator.
  • Fix for less than 64 bytes USB packet devices
  • SysEx message was broken since felis/USB_Host_Shield_2.0@45df706

2014.07.06 (0.1.0)

  • Merge IOP_ArduinoMIDI branch into master
  • Change class name to USBH_MIDI
  • Rename the function RcvData to RecvData (Old name is still available)
  • Fix examples for Arduino MIDI Library 4.2 compatibility
  • Add SendSysEx()
  • Add new example (eVY1_sample)

2014.03.23

  • Fix examples for Arduino MIDI Library 4.0 compatibility and Leonardo

2013.12.20

  • Fix multiple MIDI message problem.
  • Add new example (USBH_MIDI_dump)

2013.11.05

  • Removed all unnecessary includes. (latest UHS2 compatibility)
  • Rename all example extensions to .ino

2013.08.28

  • Fix MIDI Channel issue.

2013.08.18

  • RcvData() Return type is changed to uint8_t.
  • Fix examples.

2012.06.22

  • Support MIDI out and loosen device check

2012.04.21

  • First release

License

Copyright © 2012-2021 Yuuichi Akagawa

Licensed under the GNU General Public License v2.0

usbh_midi's People

Contributors

eugene-sadovsky avatar per1234 avatar theotterwizard avatar yuuichiakagawa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

usbh_midi's Issues

Digitech RP-355, why No MIDI Device?

Hi!
Sorry for bad English.
Why library does not see my guitar processor RP-355(composite usb device)?

  1. I connect  my RP-355 to the PC (usbview.exe) and show(fragment):
    

=============================
Interface Descriptor:
bInterfaceNumber: 0x07 =7
bAlternateSetting: 0x00
bNumEndpoints: 0x02
bInterfaceClass: 0x01 (Audio) ++ buf_ptr[5] ==USB_CLASS_AUDIO
bInterfaceSubClass: 0x03 (MIDI Streaming) ++buf_ptr[5] ==USB_CLASS_AUDIO
bInterfaceProtocol: 0x00
iInterface: 0x04
0x0409: "DigiTech RP355 MIDI"
0x0409: "DigiTech RP355 MIDI"

  1. Next, I start sketch "Usb_Desc", and show:

===
Start
01

String Descriptors:
Manufacturer: DigiTech
Product: DigiTech RP355

Device descriptor:
Descriptor Length: 12
Descriptor type: 01
USB version: 0110
Device class: 00
Device Subclass: 00
Device Protocol: 00
Max.packet size: 08
Vendor ID: 1210
Product ID: 001D
Revision ID: 0001
Mfg.string index: 01
Prod.string index: 02
Serial number index: 00
Number of conf.: 01
Total length truncated to 256 bytes
Configuration descriptor:
Total length: 0160
Num.intf: 05
Conf.value: 01
Conf.string: 02
Attr.: 80
Max.pwr: 00

Interface descriptor:
Intf.number: 00
Alt.: 00
Endpoints: 00
Intf. Class: 01
Intf. Subclass: 01
Intf. Protocol: 00
Intf.string: 03
Unknown descriptor:
Length: 0A
Type: 24
Contents: 01000134000201020C24
Unknown descriptor:
Length: 0C
Type: 24
Contents: 020101010002030000030924
Unknown descriptor:
Length: 09
Type: 24
Contents: 030203060001030C24
Unknown descriptor:
Length: 0C
Type: 24
Contents: 020303060002030000030924
Unknown descriptor:
Length: 09
Type: 24
Contents: 030401010003030904

Interface descriptor:
Intf.number: 01
Alt.: 00
Endpoints: 00
Intf. Class: 01
Intf. Subclass: 02
Intf. Protocol: 00
Intf.string: 03

Interface descriptor:
Intf.number: 01
Alt.: 01
Endpoints: 01
Intf. Class: 01
Intf. Subclass: 02
Intf. Protocol: 00
Intf.string: 03
Unknown descriptor:
Length: 07
Type: 24
Contents: 01010101000B24
Unknown descriptor:
Length: 0B
Type: 24
Contents: 02010202100144AC000905

Endpoint descriptor:
Endpoint address: 01
Attr.: 0D
Max.pkt size: 00C0
Polling interval: 01
Unknown descriptor:
Length: 07
Type: 25
Contents: 01010100000904

Interface descriptor:
Intf.number: 01
Alt.: 02
Endpoints: 01
Intf. Class: 01
Intf. Subclass: 02
Intf. Protocol: 00
Intf.string: 03
Unknown descriptor:
Length: 07
Type: 24
Contents: 01010101000B24
Unknown descriptor:
Length: 0B
Type: 24
Contents: 02010203180144AC000905

Endpoint descriptor:
Endpoint address: 01
Attr.: 0D
Max.pkt size: 0120
Polling interval: 01
Unknown descriptor:
Length: 07
Type: 25
Contents: 01010100000904

Interface descriptor:
Intf.number: 02
Alt.: 00
Endpoints: 00
Intf. Class: 01
Intf. Subclass: 02
Intf. Protocol: 00
Intf.string: 03

Interface descriptor:
Intf.number: 02
Alt.: 01
Endpoints: 01
Intf. Class: 01
Intf. Subclass: 02
Intf. Protocol: 00
Intf.string: 03
Unknown descriptor:
Length: 07
Type: 24
Contents: 01040101000B24
Unknown descriptor:
Length: 0B
Type: 24
Contents: 02010202100144AC000905

Endpoint descriptor:
Endpoint address: 82
Attr.: 0D
Max.pkt size: 00C0
Polling interval: 01
Unknown descriptor:
Length: 07
Type: 25
Contents: 01010100000904

Interface descriptor:
Intf.number: 02
Alt.: 02
Endpoints: 01
Intf. Class: 01
Intf. Subclass: 02
Intf. Protocol: 00
Intf.string: 03
Unknown descriptor:
Length: 07
Type: 24
Contents: 01040101000B24
Unknown descriptor:
Length: 0B
Type: 24
Contents: 02010203180144AC000905

Endpoint descriptor:
Endpoint address: 82
Attr.: 0D
Max.pkt size: 0120
Polling interval: 01
Unknown descriptor:
Length: 07
Type: 25
Contents: 0100010AE300E7

Addr:1(0.0.1)

  1. With enabled Debug:
    =====================================
    Usb.Init=ok
    MIDI Init
    Addr:01
    VID:1210 PID:001D #Conf:01

Conf:01 Int:00 Alt:00 EPs:00 IntCl:01 IntSubCl:01
No MIDI Device

Conf:01 Int:01 Alt:00 EPs:00 IntCl:01 IntSubCl:02
No MIDI Device

Conf:01 Int:01 Alt:01 EPs:01 IntCl:01 IntSubCl:02
No MIDI Device
-EPAddr:01 bmAttr:0D MaxPktSz:C0

Conf:01 Int:01 Alt:02 EPs:01 IntCl:01 IntSubCl:02
No MIDI Device
-EPAddr:01 bmAttr:0D MaxPktSz:20

Conf:01 Int:02 Alt:00 EPs:00 IntCl:01 IntSubCl:02
No MIDI Device

Conf:01 Int:02 Alt:01 EPs:01 IntCl:01 IntSubCl:02
No MIDI Device
-EPAddr:82 bmAttr:0D MaxPktSz:C0

Conf:01 Int:02 Alt:02 EPs:01 IntCl:01 IntSubCl:02
No MIDI Device
-EPAddr:82 bmAttr:0D MaxPktSz:20

NumEP:01

Tell me please, what to do?

Support for Arduinio midi libary.

Hello,

Thanks for great job. I'm waiting wor my usb host shield to come, and your code is what i'm looking for. But i have few qestions.

First of all i would like to use in my code MIDI.h from arduino as i'm already familiar with and got some code done for it. As far as i understand the easiest way is to accually wire tx with rx on ardiuno and it would work with your code. But what about the midi out generated by arduino than. It will not go back to usb-midi device as there is no midi-input support in your code. And guidlines on how to implement it?

I need arduino to send midi back to controler as i want tu use icon istage which i use as a base for my light control sequencer project.

And this brings us to my other question, how to ad support for other devices?

Kind regards,

Maciej Kubat

Why module "LED&KEY"(TM1638) not working?

Hi!
Sorry for my bad english!
I want to use the “LED&KEY“ module on the TM1638 chip(https://www.ebay.com/c/9013057606) to switch presets for my “Digitech RP-355“ via USBMIDI. For testing, I use example ”tm1638_one_module_example.ino” from library TM1638 (https://github.com/rjbatista/tm1638-library).
To sketch I add the next lines:

#include <usbh_midi.h>
#include <usbhub.h>
USB Usb;
USBH_MIDI Midi(&Usb);

But when starting, the LED indicators do not light up and the buttons do not respond to pressing.
I found, that if in setup() I comment line with “Usb.Init ()“
// if (Usb.Init() == -1) while (1);
then the “LED & KEY” module and the sketch begin to work.

Thank you in advance for your help!

sketch code:

`/*
Library examples for TM1638.

Copyright (C) 2011 Ricardo Batista

This program is free software: you can redistribute it and/or modify
it under the terms of the version 3 GNU General Public License as
published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
*/

#include <usbh_midi.h>
#include <usbhub.h>

#include <TM1638.h>

// define a module on data pin 8, clock pin 9 and strobe pin 7
TM1638 module(8, 9, 7);

USB Usb;
USBH_MIDI Midi(&Usb);

void setup() {
//if (Usb.Init() == -1) while (1); <--- problem line
// display a hexadecimal number and set the left 4 dots
module.setDisplayToHexNumber(0x1234ABCD, 0xF0);
}

void loop() {
byte keys = module.getButtons();

// light the first 4 red LEDs and the last 4 green LEDs as the buttons are pressed
module.setLEDs(((keys & 0xF0) << 8) | (keys & 0xF));
}`

Buffer overwrite in SendSysEx()

Hi,
I'm using SendSysEx() and noticed that buf gets overwritten during the call to pUsb->outTransfer(). The root cause is SPI.transfer() in the SPI_HAS_TRANSACTION case. Anyway, the solution seems to be to to set

buf[0] = (nCable << 4) | 0x4;

inside the loop because it gets overwritten during each iteration.

Cheers,
Mathis

Question

Can I send Sysex messages from Arduino via USB?

Connecting Arduino Micro 32u4 USB/MIDI keyboard to USB Host Shield

Hello!
I'm trying to connect Arduino Micro 32u4 USB/MIDI keyboard to USB Host Shield. Micro is programmed using MIDIUSB library. I want to recieve MIDI messages from the keyboard and handle them with Arduino UNO the Shield is mounted on. But i can't get it to work. It seems like the Shield doesn't recieve anything and Micro's LED doesn't even blink as it always does during MIDI messages sending. What should I start with to solve the problem?

Using MIDI Converter with nanoKEY Studio on Arduino Pro Mini / mini USB Host Shield

当方、ハードウェアソフトウェア共に初心者です。

こちらの「USBH_MIDI」をArduino IDEに導入した際にサンプルコードに含まれる「USBH_MIDI_converter」を、手持ちだった「Arduino Pro Mini 328 3.3V 8MHz + ミニUSBホストシールド (+ MIDIアウト回路)」上で動かすことで、「KORG nanoKEY Studio」をUSBキーボードとして使えないかと考えています。標準の「Arduino + USBホストシールド」でないことと、およびここに書かれている対応機種の後継機種であることが、この意図に対してどのように影響するのかわからず、質問をします。

[質問]
nanoKEY無印は対応機種に含まれているものの、nanoKEY Studioが現状では含まれていないことは理解しています。そのそもそもの意味としては、ハードウェアの何らかのIDの制限などの理由で、対応機種に含まれていないものは全く動かないという話なのでしょうか、それともソフトウェアを多少触ることによって動くようになる感じでしょうか、またはおおかたは動くはずなのでしょうか。

[試したこと]
1)「USBH_MIDI_converter」に、LED点灯を使った簡易デバッグをすることで、Usb.Init()は通過することはわかった(これにより、USBH_MIDI_converterはミニUSBホストシールドでも使える、と理解)
2)しかし同様に簡易デバッグによると、Midi.RecvData(outBuf)は出ていない様子。
3)nanoKEY StudioからMIDIとして信号を受け取れていないのかと思い「USBH_MIDI_dump」を書き込んだが、ボーレートを115200とした「シリアルモニタ」窓を開いても何も表示されなかった(使い方が合っているか自信無し)。

何か示唆するにしてもこのような情報が足りない、このようなことを試すべきだ、そもそも用途が違う、動くはずだから故障ではないか、などご指摘ご教示いただけるとありがたいです。

USBH_MIDI for STM32F4 ?

Great respects for your job ! I wish I had the same MIDI USB host implementation for my STM32F4 Discovery board....
But I'm overwhelmed by USB programming complexity at the moment !
Have you planned to adapt it ?
Best regards
Xavier

PS : I'd like to connect a Korg NanoKontrol on my STM32F4 synth :
http://youtu.be/NJDcqiR5RQg

Device list

I'm currently testing both receive and send via usb using a roland td-11, alesis micron, and microkorg xl. Receive works great but I cannot get send to work for any of them. Any thoughts on where to start debugging?

Question: what's the proper way to handle incoming sysex

Hi, first of all thank you for awesome library!

I have a project that sends and receives sysex, while sending with your library is flawless, sometimes when i receive messages (specially when it's 2 or more) they don't have the 0xF0, the rest of the bytes are there but no 0xF0, i'm using this with a guitar processor which when i monitor it on my mac it's sending everything properly so i know it's something i'm not doing right.

I wrote some code based on your examples but again for some reason sometimes i don't get the 0xF0 and in those ocassions sometimes there are bytes missing or a byte added here and there.

Do you have any other examples to receive a sysex array properly?

Thanks!

Cannot get Launchpad S to run

I have tried a number of things.

Here is the Debug output:

MIDI Init
Addr:01
VID:1235 PID:0020 #Conf:01

Conf:01 Int:00 Alt:00 EPs:00 IntCl:01 IntSubCl:01
No MIDI Device

Conf:01 Int:01 Alt:00 EPs:02 IntCl:01 IntSubCl:03
MIDI Device
-EPAddr:81 bmAttr:03 MaxPktSz:40
-EPAddr:02 bmAttr:03 MaxPktSz:40

NumEP:01

But the Launchpad S does not work. I looked at Usb.getUsbTaskState() and the result is 160 (DEC) which is USB_STATE_ERROR (0xA0 in HEX).

Can't send MIDI data to the controller

II've stumbled with a fact, that I can't send MIDI data to the controller.
I'm trying to turn on pad backlight in accordance with the controller manual:

To light the bottom left drum-pad the following message would be sent
Example LED on message: MIDI Channel 16, C1, Colour/Velocity (1-127)
9Fh, 24h, Colour/Velocity (01h - 7Fh)
(159, 36, Colour/Velocity (1- 127))

So I'm just checking all possible velocities for a single pad, but the controller doesn't respond:

void loop()
{
  uint8_t msg[3] = {159, 36, 0};
  Usb.Task();
  uint32_t t1 = (uint32_t)micros();
  if ( Usb.getUsbTaskState() == USB_STATE_RUNNING )
  {    
    for (int i=0; i<128; i++)
    {        
       Serial.println(i);
       msg[2] = i;
       Midi.SendData(msg, 3);
       delay(100);
    }
  }
}

Identical code on python, when the controller is connected to PC, changes backlight successfully.

Please, tell me what I'm doing wrong.

Launchpad mini

Hello, i have troubles trying to get a Novation Launchpad Mini running. It's supposed to be midi compliant, but is not working if i declare it as a midi usb device.
if i run the hardware test without declaring it as a midi device (using just the usb hub 2.0 library) it runs with no issues (gets to the running status), but if i use the usbh_midi and declare Midi(Usb) it gets stuck in waiting for first SOF status. Any clues on how to solve it?
The test runs ok with a waldorf rocket synth. Actually, been sequencing it with the arduino via usb host with no issues with your code, great work btw.
Thanks in advance.

Yamaha Portable Grand not working

Hi.
I own a Yamaha Portable Grand piano that lacks real midi connection and thus been thinking about using an Arduino and an USB Host Shield to convert USB-Midi <-> Midi.
In the device compatibility list of the USBH_MIDI library my device is listed as supported (VID:0x0499 PID:0x1039) but I've tested it and it didn't work. I know it's not the shield fault as I own a different keyboard that worked immedeately.
Any lights on how to make it work?

Thanks in advance

Test of USB_DESCRIPTOR_INTERFACE may be too strict

Dear Akagawa-san,

Firstly thank you so much for putting this excellent library together. It solves a problem I'd been trying to solve myself with little success. I believe many others would be interested in this, people are struggling to use the LPK25 examples with the older version of the library (and an older Arduino interface). I wanted to use the 2.0 version of the host shield library and your library does exactly what I want. Have you drawn this to the attention of Oleg at circuits@home? It seems like something he might want to consider including since he's already got several other devices in the standard library.

The one issue I did find was that with my Casio Keyboard the check on the USB_DESCRIPTOR_INTERFACE failed. The Casio keyboards return 0xFF for both device class and interface subclass. I suspect many MIDI keyboards will do the same, or have their own class definitions. A better strategy might be just to check the PID and VID against known values. I modified the constructor of the MIDI class to take a target PID and VID (ones I know to be correct for my keyboard) and check those against the ones returned from the device descriptor. That seems to work, most device drivers function that way.

By the way there's a small omission in the description of the MIDI messages in the comments - I think the lower four bits of the status byte reflect the channel. Many keyboards probably just use channel 0 so you do get 0x80 for Note On. But my Casio is configurable and if I set it to channel 1 I get 0x81 for Note On.

Many thanks,

Quentin McDonald

Novation 49SL MK2 Key Stuck

Hey,

thanks for your work on this!
I came across one issue related to this particular Keyboard.
If I pressed a chord (e.g. 3 keys at once) repeatedly and very fast, the pointer somehow got stuck and all consecutive pressed Keys had an old MIDI On message read last from the buffer (think of that message as being "attached" to the other ones).
The raw USB MIDI Packets were also significantly longer than from my AKAI MPK Mini.
I was able to quickly fix this issue by resetting the pointer to 0 within the return function for the buffer:

RecvData_return_from_buffer:
  readPtr++;
  outBuf[0] = recvBuf[readPtr];
  readPtr++;
  outBuf[1] = recvBuf[readPtr];
  readPtr++;
  outBuf[2] = recvBuf[readPtr];
  readPtr++;
  readPtr = 0;
  return lookupMsgSize(outBuf[0]);

I'm not sure whether this has an impact on the other code which is why I did not commit a fix yet.

Update: Nevermind, it seems to not be there for a reason. If I change this the Novation runs fine, but I'm running into stuck keys with the MPK (when pressed fast). However I'm also to replicate missing MIDI (Note off) messages if more than around 8 keys are pressed at once on the MPK.

Problem with Program Change messages.

First of all thanks a lot for your work. Generally it works good. I couldn't only send Program Change MIDI messages. When I monitor MIDI in my MacBook all looks ok but when I connect via Arduino PC is transmtted but immediately after it turns to 0 = Program 1 and again and again ...When I change one more time next Program number is transmitted but still it is followed by "0". Only when I send message with note on, PC massages with "0" are stopped and I can change manually Program on my hardware synth. Any idea what is wrong?

ARDUINO DUE and its embedded USB HOST: wondering to use USBH_MIDI with it

Hi Yuuichi,
I am contacting you as the best source for this issue: you probably know that Arduino DUE has an USB HOST port on board, cost less than Arduino UNO + USB-H shield, is more powerful and rich of I/O and has 4 USARTS that can open the possibility to do a MIDI merge with USB MIDI and 3 legacy MIDI.
http://arduino.cc/en/Main/arduinoBoardDue
http://arduino.cc/en/Reference/USBHost

so I was wondering to use that USB for the MIDI communication to a legacy 5 pin MIDI.
I have one, I tried to compile the program but probably that USBH has different chipset.

Can you help somehow ?

Thank you for you help!

Best Regards,
Roberto Baldassar

midi filter

hi, i am trying to remap the keys of an axis-49 controller. the connection via usb-shield works flawlessly, perfect! the controller runs in selfless mode, which means it outputs a note on (and off) from 1 to 98 for every key respectively. i want to remap those note numbers to different ones. so nr. 1 will be 18, 2 20, 3, 22 and so on. i created an array remap[ ] that stores all the values. looking at the simple example (usb midi converter) i thought i could do something like: outBuf[1] = remap[outBuf[1]]; to remap all the keys, but it does not work. is there a way to do this with this library? cheers

Question about MIDI over USB to computer

Today if we compare your project with commercial one like discontinued iConnectivity iConnectMIDI just only one thing is missing: parallel bidirectional connection with computer over cable used to programing Arduino. Is possible to ad this functionality to your project?

USB MIDI Host IN > MIDI 5 Out and over USB to computer (as MIDI IN_)
USB MIDI Host Out and over USB from computer (as MIDI Out) > USB MIDI Host In and 5 DIN Out
USB MIDI Host Out and 5 DIN In > Computer over USB ie. MIDI IN

BTW: Fishman TriplePlay is supported (IN/OUT); Tutorial based on your library http://www.vguitarforums.com/smf/index.php?topic=9681.msg69488#msg69488

CC to Sysex translator

hello again.

How can I translate incoming data/ CC / from nanopad in to Sysex and sent via midi out.
Or If I know Sysex code and I need send them out.

Thank you
Mirek

Problem Send SysEx message

Hi, Yuuichi!

Question:
If send program change(2 byte message) to my device over usb it stability change preset,
but if i send SysEx message(15 byte), my device does not receive a command stably.
in monitor I show "rc=4" as result Midi.SendData(dataptr, 0);

=============================================================
// Test , 15 byte SysEx message Effect "Compressor(On/Off)"

uint8_t COMP_OFF[] = {0xf0, 0x00, 0x00, 0x10, 0x00, 0x5e, 0x09, 0x41, 0x20, 0x00, 0x41, 0x04, 0x00, 0x63, 0xf7};
uint8_t COMP_ON[] = {0xf0, 0x00, 0x00, 0x10, 0x00, 0x5e, 0x09, 0x41, 0x20, 0x00, 0x41, 0x04, 0x01, 0x62, 0xf7};
bool enabled=false;

void loop() {
checkMyButtons();
Usb.Task();
if ( Midi ) { // USB
if (pressedButton] != 1)
if (enabled) Send_SysEx(COMP_OFF, sizeof(COMP_OFF));
else Send_SysEx(COMP_ON, sizeof(COMP_ON));
enabled=(!enabled);
}
}
}

void Send_SysEx(uint8_t *dataptr, uint16_t datasize) {
Usb.Task();
//uint8_t rc = Midi.SendSysEx(dataptr, datasize, 0);
uint8_t rc = Midi.SendData(dataptr, 0);
#if defined(UseDebug)
Serial.print(F("Send_SysEx():"));
Serial.print(rc, HEX);
prnarr(":", dataptr, datasize, HEX);
#endif //defined(UseDebug)
}

what can be done?

my config:
Arduino Leonardo + USB Host Shield + my guitar processor "Digitech RP-355" midi over USB.

I am looking examples where arduino sends and receive a SySex messages to a midi device via USB as dialog. Can you show some example of sketch?

thanks.

Novation Launchkey Mini Issue

Hello,

Usb.getUsbTaskState() returns 0xa0 (USB_STATE_ERROR), when Novation Launchkey Mini controller is connected.

USB_desc returns the following:

01

Device descriptor:
Descriptor Length: 12
Descriptor type: 01
USB version: 0110
Device class: 00
Device Subclass: 00
Device Protocol: 00
Max.packet size: 40
Vendor ID: 1235
Product ID: 0035
Revision ID: 0000
Mfg.string index: 01
Prod.string index: 02
Serial number index: 00
Number of conf.: 01

Configuration descriptor:
Total length: 0063
Num.intf: 02
Conf.value: 01
Conf.string: 00
Attr.: 80
Max.pwr: 32

Interface descriptor:
Intf.number: 00
Alt.: 00
Endpoints: 00
Intf. Class: 01
Intf. Subclass: 01
Intf. Protocol: 00
Intf.string: 03
Unknown descriptor:
Length: 09
Type: 24
Contents: 010001090001010904

Interface descriptor:
Intf.number: 01
Alt.: 00
Endpoints: 02
Intf. Class: 01
Intf. Subclass: 03
Intf. Protocol: 00
Intf.string: 03
Unknown descriptor:
Length: 07
Type: 24
Contents: 0100013F000624
Unknown descriptor:
Length: 06
Type: 24
Contents: 020101040624
Unknown descriptor:
Length: 06
Type: 24
Contents: 020104050924
Unknown descriptor:
Length: 09
Type: 24
Contents: 030102010101040924
Unknown descriptor:
Length: 09
Type: 24
Contents: 030103010202050705

Endpoint descriptor:
Endpoint address: 81
Attr.: 03
Max.pkt size: 0040
Polling interval: 01
Unknown descriptor:
Length: 06
Type: 25
Contents: 010202030705

Endpoint descriptor:
Endpoint address: 02
Attr.: 03
Max.pkt size: 0040
Polling interval: 01
Unknown descriptor:
Length: 06
Type: 25
Contents: 01020104000B

Addr:1(0.0.1)

Maybe it's worth mentioning, that when I connect the controller, it shows a starting pads backlight sequence and after that pads backlight respond on touch. So I assume, that problem is not in shield library or the controller itself.

I checked all novation issues and tried the following:

  • Connecting arduino to 12V (nothing changes)
  • Inserting a powered USB 2.0 HUB in between arduino and midi controller (staring backling sequence loops over and over, but still no midi data)

Thanks in advance,
Hope for your help!

Note-off messages are being dropped.

Based on Issue #9, this appears to be an old problem that was fixed, but I am having this problem using my M-Audio Oxygen 49 keyboard. Single notes are fine, but playing multiple notes simultaneously in a repetitive manner sometimes causes a note to be stuck on.

I'm using an Arduino Uno R3 with a USB Host Shield 2.0 along with the current Arduino IDE, MIDI library 4.3.1, USB Host Shield library 2.0, and your current USBH_MIDI release. I'm using your USB_MIDI_converter example sketch. Based on reading Issue #9 should I be using the USB_MIDI_converter_multi sketch instead?

Compatibility with Zero / M0 / Due native USB Host?

Hi, the new version works great with the MAX3241 based USB Host Shield! Arduino.cc have adapted Oleg's v2.0 library as part of the new USBHost library to run on the ARM / SAM based boards. How difficult do you think it would be to port your library to run on the native USB host interface of these boards?

sending midi clock to connected client (waldorf blofeld)

hi, i try to send midi clock messages (248) to a waldorf blofeld. the messages should be retrieved on port 2 on the blofeld, what function should i use? i tried this simple test code and something is received by the blofeld, but the tempo does not sync to the Arduino messages:

#include <usbh_midi.h>
#include <usbhub.h>
#include <SPI.h>

USB Usb;
USBHub Hub(&Usb);
USBH_MIDI Midi(&Usb);
uint8_t start = 0;
void setup()
{
Serial.begin(115200);

if (Usb.Init() == -1) {
while (1); //halt
}//if (Usb.Init() == -1...
delay( 200 );
}

void loop()
{
uint8_t msg2 = 250;
uint8_t msg = 248;
//LaunchKey channel 16
if (!start) {
Usb.Task();
Midi.SendData(msg2,1);
start = 1;
}
Usb.Task();

   Midi.SendData(msg,1);
   delay(10);

}

Please help me!

I have Leonardo and nanopad2.
I´m not able to run midi out.
What I´m doing wrong?
Must I write some think in code or only load library ?
Thank you very much.

Launchkey 61 not working

Hello!
My Novation Launchkey 61 is not working with the usb_midi_converter example, do you know why?
But my Launchpad S is working well. Maybe it has something do to with the launchkey having the "inControl" feature?
Here is what I get with the usb_desc sketch :
With my Launchpad S :

Start

01
--

Device descriptor: 
Descriptor Length:  12
Descriptor type:    01
USB version:        0110
Device class:       00
Device Subclass:    00
Device Protocol:    00
Max.packet size:    40
Vendor  ID:     1235
Product ID:     0020
Revision ID:        0000
Mfg.string index:   01
Prod.string index:  02
Serial number index:    00
Number of conf.:    01

Configuration descriptor:
Total length:       0052
Num.intf:       02
Conf.value:     01
Conf.string:        00
Attr.:          80
Max.pwr:        FA

Interface descriptor:
Intf.number:        00
Alt.:           00
Endpoints:      00
Intf. Class:        01
Intf. Subclass:     01
Intf. Protocol:     00
Intf.string:        03
Unknown descriptor:
Length:     09
Type:       24
Contents:   010001090001010904

Interface descriptor:
Intf.number:        01
Alt.:           00
Endpoints:      02
Intf. Class:        01
Intf. Subclass:     03
Intf. Protocol:     00
Intf.string:        03
Unknown descriptor:
Length:     07
Type:       24
Contents:   0100012E000624
Unknown descriptor:
Length:     06
Type:       24
Contents:   020101000924
Unknown descriptor:
Length:     09
Type:       24
Contents:   030102010101000705

Endpoint descriptor:
Endpoint address:   81
Attr.:          03
Max.pkt size:       0040
Polling interval:   01
Unknown descriptor:
Length:     05
Type:       25
Contents:   0101020705

Endpoint descriptor:
Endpoint address:   02
Attr.:          03
Max.pkt size:       0040
Polling interval:   01
Unknown descriptor:
Length:     05
Type:       25
Contents:   010101F773


Addr:1(0.0.1)

And with my Launchkey 61 :

Start


01
--

Device descriptor: 
Descriptor Length:  12
Descriptor type:    01
USB version:        0110
Device class:       00
Device Subclass:    00
Device Protocol:    00
Max.packet size:    08
Vendor  ID:     1235
Product ID:     0032
Revision ID:        0115
Mfg.string index:   01
Prod.string index:  02
Serial number index:    00
Number of conf.:    01

Configuration descriptor:
Total length:       0085
Num.intf:       02
Conf.value:     01
Conf.string:        00
Attr.:          80
Max.pwr:        32

Interface descriptor:
Intf.number:        00
Alt.:           00
Endpoints:      00
Intf. Class:        01
Intf. Subclass:     01
Intf. Protocol:     00
Intf.string:        00
Unknown descriptor:
Length:     09
Type:       24
Contents:   010001090001010904

Interface descriptor:
Intf.number:        01
Alt.:           00
Endpoints:      02
Intf. Class:        01
Intf. Subclass:     03
Intf. Protocol:     00
Intf.string:        00
Unknown descriptor:
Length:     07
Type:       24
Contents:   01000161000624
Unknown descriptor:
Length:     06
Type:       24
Contents:   0201010E0624
Unknown descriptor:
Length:     06
Type:       24
Contents:   020202000624
Unknown descriptor:
Length:     06
Type:       24
Contents:   0201030F0624
Unknown descriptor:
Length:     06
Type:       24
Contents:   020204000924
Unknown descriptor:
Length:     09
Type:       24
Contents:   0301090102010E0924
Unknown descriptor:
Length:     09
Type:       24
Contents:   03020A010101000924
Unknown descriptor:
Length:     09
Type:       24
Contents:   03010B0104010F0924
Unknown descriptor:
Length:     09
Type:       24
Contents:   03020C010301000905

Endpoint descriptor:
Endpoint address:   81
Attr.:          02
Max.pkt size:       0040
Polling interval:   00
Unknown descriptor:
Length:     06
Type:       25
Contents:   0102090B0905

Endpoint descriptor:
Endpoint address:   02
Attr.:          02
Max.pkt size:       0040
Polling interval:   00
Unknown descriptor:
Length:     06
Type:       25
Contents:   010201032980


Addr:1(0.0.1)

Thank you in advance for your help!

Problem with bidirectional and MIDI 4.2 library

bidrectional_converter.ino: In function 'void setup()':
bidrectional_converter:52: error: 'MIDI' was not declared in this scope
bidrectional_converter.ino: In function 'void loop()':
bidrectional_converter:74: error: 'MIDI' was not declared in this scope
bidrectional_converter.ino: In function 'void MIDI_poll()':
bidrectional_converter:98: error: 'MIDI_DEFAULT_SERIAL_PORT' was not declared in this scope

I use newest all libraries.

Devices that work

Hi Yuuichi Akagawa. Thank you very much for your great work!
I have successfully configured M-audio KeystationMini 32 - http://m-audio.com/products/en_us/KeystationMini32.html and Behringer BCF2000 - http://www.behringer.com/EN/Products/BCF2000.aspx. The latest - in both MIDI and Mackie mode, input and output MIDI messages.
A quick question, can you verify that your library works with the latest release of the USB_Host_Shield_20 library? Or if not - which is the one it works with?

Yamaha THR10, Midi with VendorClass (255) , Buffer overflow with ArduinoCore-samd library

Hi ,
finally i got my "Yamaha THR10" (guitar amp, that can be configured via MIDI-SysEx) working with this library and my "Arduino Due", but there were several problems to solve before:

  • USB-Enumeration works only, if Debug-outputs are enabled in USBHost.h
  #define TRACE_USBHOST(x)	x
//#define TRACE_USBHOST(x)

otherwise device is not detected. Don't ask me why... (perhaps a timing problem, that is solved when a "printf" delays process at the right time?)

  • Adding an "else if" in descriptor parsing
        if( buf_ptr[5] == USB_CLASS_AUDIO && buf_ptr[6] == USB_SUBCLASS_MIDISTREAMING )
	{  //p[5]; bInterfaceClass = 1(Audio), p[6]; bInterfaceSubClass = 3(MIDI Streaming)
          isMidiFound = true; //MIDI device found.
          isMidi      = true;
        }
//**Yamaha THR10**
	else if( buf_ptr[5] == USB_CLASS_VENDOR_SPECIFIC && buf_ptr[6] == USB_SUBCLASS_MIDISTREAMING ) //**Yamaha THR10**
		{  
                   //p[5]; bInterfaceClass = 255(VENDOR), p[6]; bInterfaceSubClass = 3(MIDI Streaming)
		   isMidiFound = true; //MIDI device found.
		   isMidi      = true;
		}
		else
		{
#ifdef DEBUG
          Serial.print("No MIDI Device\n");
#endif
//          buf_ptr += total_length + 1;
//          bConfNum = 0;
            isMidi = false;
        }
        break;
  • Solving buffer problems:
  1. always use (uint16_t) cast instead of (uint8_t) cast for epInfo[index].maxPktSize
    e.g.
  // Extract Max Packet Size from device descriptor
  epInfo[0].maxPktSize = (uint16_t)((USB_DEVICE_DESCRIPTOR*)buf)->bMaxPacketSize0; 
  1. quick and dirty change for buffersize, that works for THR10 (just a work around, no proper solution, i guess!!!):
if( isMidi )
{
            if ((epDesc->bEndpointAddress & 0x80) == 0x80) 
   	   {
              // Input
              index = epDataInIndex;
              epInfo[index].epAddr	= (epDesc->bEndpointAddress & 0x0F);
              //epInfo[index].maxPktSize	= (uint16_t)epDesc->wMaxPacketSize;
	      epInfo[index].maxPktSize	= (uint16_t)2048;  //necessary for YAMAHA THR10
              pipe = UHD_Pipe_Alloc(bAddress, epInfo[index].epAddr, UOTGHS_HSTPIPCFG_PTYPE_BLK, UOTGHS_HSTPIPCFG_PTOKEN_IN, epInfo[index].maxPktSize, 0, UOTGHS_HSTPIPCFG_PBK_1_BANK);
            }
            else 
	    {
              // Output
              index = epDataOutIndex;
              epInfo[index].epAddr	= (epDesc->bEndpointAddress & 0x0F);
              //epInfo[index].maxPktSize	= (uint8_t)epDesc->wMaxPacketSize;
			  epInfo[index].maxPktSize	= (uint16_t)2048;  //necessary for YAMAHA THR10
              pipe = UHD_Pipe_Alloc(bAddress, epInfo[index].epAddr, UOTGHS_HSTPIPCFG_PTYPE_BLK, UOTGHS_HSTPIPCFG_PTOKEN_OUT, epInfo[index].maxPktSize, 0, UOTGHS_HSTPIPCFG_PBK_1_BANK);
            }

After that modifikations, i can send System-Exlusive Messages to THR10, like

uint8_t msg1[]= {0xF0,0x43,0x7D,0x30,0x41,0x30,0x01,0x01,0xF7};  //Lamp off
uint8_t msg2[]= {0xF0,0x43,0x7D,0x30,0x41,0x30,0x01,0x00,0xF7};  //Lamp on`

that switches the light of the Guitar-Amp.

But more important, I can send sound-Patches, that are created as a file before with the THR10-Editor on PC.

This way I can build a foot-switch / pedal to change sound patches on the fly like

THR10 foot switch

But this guy did it with an ordinary Arduino Uno and the USB-Host Shield.
With the Due I can use the native USB-Host-Port, have got more memory and speed.
I want to inject Samples to the THR10 with this footswitch as well, as it can also act as IN-/OUT Audio Interface.

New Devices working and One Problem

Hi, thanks for your work with the USBH_MIDI Library. I didn´t know how to add a message to you so I decided to add an issue here.

I recently built a device using the USB Host Shield and using your code, I managed to make work an AKAI APC 20, AKAI APC 40 and Korg MS-20 MIDI controller. I´m testing now a Quneo from Keith McMillen with some unexpected results.

If more than one MIDI value is recieved simultaneously, like the Quneo controller does... Some MIDI values are ignored or simply missed, as no more than one MIDI message is being read. How could the code be changed to allow multiple MIDI messages being recieved simultaneously?

Thanks a lot in advance and looking forward to hearing from you soon!
Regards,
Julian
info @ inspektor gadjet . com

disable led

hi, in which file is the code that illuminates the led on every outgoing midi message? i would like to disable it...

Problem with Digital Piano

I have MIDI project using this library, I am using Yamaha Clavinova and Roland FP30 for testing, and it is working.
But it is not working With Yamaha P121. I got value 160 for Usb.getUsbTaskState() (normally with other 2 piano I got 144)

I try to use USB_desc example project, and found lines that suspicious, it said:
Total length truncated to 256 bytes

I open usbh_mid.h file and set DESC_BUFF_SIZE from 256 to 512

And yes, it working, I can connect, and send midi notes on/off successfully to Yamaha P121. But I can't receive midi data from the piano. So I try to change value of MIDI_EVENT_PACKET_SIZE from 64 to 128. and it working, Now I can receive midi data from P121. This setting also working on Yamaha Clavinova and Roland FP30.

Is it safe to change that value? or will it make the code broken on other midi events?

=============================

Midi Through?

Hey there, thank you very much for this great library. It works really well for converting USB to standard MIDI and I have used it already quite a lot. I was just wondering if it is possible to do something like a MIDI through? I have tried it already by sending the message in the outBuf back to the piano within the MIDI_poll() function. That seems to be fine, but after I play a few past notes on my keyboard it starts playing up and I triggers notes that I am actually not playing for some reason. Do you have any suggestions?

Many thanks for your help

Sam

change SPI channel

hi
i'm using a ESP32.
i'd like to install two USB HOST same device --> https://i.ebayimg.com/images/g/UUQAAOSwFyhaF6Pj/s-l1600.jpg

I saw that as default, usbh_midi refers to VSPI (18,19,23,5)
what i must do to use HSPI (14,12,13,15) also, or better more add another SS to use two usb host on same line (VSPI or HSPI) ?

here the code that works fine on VSPI with only one usb host shield


#include <usbh_midi.h>
USB Usb;
USBH_MIDI  Midi(&Usb);

//****
void setup() 
{
  Serial.begin(115200);
  if (Usb.Init() == -1) 
  {
    Serial.println("USB did not start.");
    while(1);
  }  
  else
  {
    Serial.println("Started USB :-)");
  }

/*
 ---> here i'd need to start another usb host  (ex.  usb_2) 
*/
}

i think i must refer to USB_MIDI_converter_multi.ino but i did not understand how to connect the pin SS of second usb host,

many thanks for help

Midi Send capability?

Hello Akagawa-san,

Thank you so much for putting together this library—it is a great addition to the USB Host Library!

I wonder why you did not implement Midi Send capability? Is this a restriction in the library itself, or is it something you just did not need?

I currently have the shield on the way to me, and I would like to use your code to implement MIDI communication on it, but I will also need to implement Send capability. I have not looked too far into the code, yet, since I don't have the shield to test or make changes on, yet. However, once I do receive it I'd like to add in Midi Send if it is possible.

What are your thoughts? Did you run into issues trying to implement Send, or was it just not necessary for your needs?

Thank you,
Adam

Why don't we get running status?

Is the library have any limits?
I want to get running status, Timing Clock, from rhythm machine or sequencer.
The rhythm machine have a usb-b port and it sends realtime message and notation, velocity and so on to usb-pc host. I want to listen Timing Clock and relay to my effector's tempo pedal.
If you have any knowledge to solve my aim, please post some information.
Thanks.

Arturia beatstep pro

hello, been trying to use an arduino with usb host cor converting the usb midi out of an Arturia beatstep pro to midi din, using the USB midi converter with no luck. eems like no midi streaming is geting to the beard. here's the USB desc

Start

01

Device descriptor:
Descriptor Length: 12
Descriptor type: 01
USB version: 0200
Device class: 00
Device Subclass: 00
Device Protocol: 00
Max.packet size: 40
Vendor ID: 1C75
Product ID: 0287
Revision ID: 0100
Mfg.string index: 01
Prod.string index: 02
Serial number index: 00
Number of conf.: 01

Configuration descriptor:
Total length: 0085
Num.intf: 02
Conf.value: 01
Conf.string: 00
Attr.: A0
Max.pwr: FA

Interface descriptor:
Intf.number: 00
Alt.: 00
Endpoints: 00
Intf. Class: 01
Intf. Subclass: 01
Intf. Protocol: 00
Intf.string: 00
Unknown descriptor:
Length: 09
Type: 24
Contents: 010001090001010904

Interface descriptor:
Intf.number: 01
Alt.: 00
Endpoints: 02
Intf. Class: 01
Intf. Subclass: 03
Intf. Protocol: 00
Intf.string: 00
Unknown descriptor:
Length: 07
Type: 24
Contents: 0100015F000624
Unknown descriptor:
Length: 06
Type: 24
Contents: 020101040624
Unknown descriptor:
Length: 06
Type: 24
Contents: 020202000624
Unknown descriptor:
Length: 06
Type: 24
Contents: 020105060624
Unknown descriptor:
Length: 06
Type: 24
Contents: 020206000924
Unknown descriptor:
Length: 09
Type: 24
Contents: 030103010201030924
Unknown descriptor:
Length: 09
Type: 24
Contents: 030204010101000924
Unknown descriptor:
Length: 09
Type: 24
Contents: 030107010601050924
Unknown descriptor:
Length: 09
Type: 24
Contents: 030208010501000905

Endpoint descriptor:
Endpoint address: 02
Attr.: 02
Max.pkt size: 0040
Polling interval: 00
Unknown descriptor:
Length: 06
Type: 25
Contents: 010201050905

Endpoint descriptor:
Endpoint address: 81
Attr.: 02
Max.pkt size: 0040
Polling interval: 00
Unknown descriptor:
Length: 06
Type: 25
Contents: 01020307140D

Addr:1(0.0.1)

Runnig the USB midi dump i get this:

VID:1C75, PID:0287

Off note messages are lost

HI Yuuichi, great effort first of all, thank you!

Have used your code USB_MIDI_converter with no modifications. + USB Host shield v2 + Korg NanoKey2

Overall all seems to work pretty well until I play polyphonic and try to press/release keys fast. Some of the notes get stuck. It seems NOTE OFF events are lost and looks like one of the buffers potentially get overloaded or erased ahead of time. Do you know what could be the issue? I could try to modify code and re-test locally if you have any idea.

Thanks,
JenShen

USBH_MIDI_Converter does not work on an Arduino Uno if unplugged from PC

Hello,

I am trying to use the USBH_MIDI_Converter example with this setup: an Arduino Uno with a USB Host Shield from SparkFun. The Arduino is powered through the barrel jack, but I also use the Arduino's USB port to upload the sketch.

The USBH_MIDI_Converter example works perfectly when the USB port is connected to my laptop, but as soon as I unplug the USB cable the Arduino becomes erratic and starts sending random things through the MIDI output. The problem is fixed as soon as I plug back in the USB cable to the computer.

Any idea of what could be causing this?

Thanks in advance for your help, I am really stuck on this one.

Behringer BControl BCF2000

Great work, you have put in a lot of hard work thanks.

I have tested with the BCF2000 and it seems to behave fine when tested with Hairless MIDI. In BControl mode at least.

I'm trying to get a Vox (made by Korg) Tonelab ST to work with the Hostshield (robotale.com.cn model which looks like a sparkfun), but that doesn't seem to want to be recognised so the intended sysex data is not being sent to it.

I would guess it is based on a similar system to the other Korg audio+midi devices. Any advice in adding support for that would be great. Do I need to find the midi endpoints?

Thanks for any help :-)

Multi works on CH 1 only

After correction in Multi Example I can only use CH 1. In earlier version I can use any MIDI channels simultaneously. I used wireless MIDI receiver for Fishman Triple Play which works on 6 (or more channels).
BTW: no problem with Program Change any more and double triggering notes when Pitch Bend isn't set to chromatic mode.

PS: Could you implement 5 DIN MIDI IN to USB MDI Host? It would give a two way communication.

USB shield and Arduino UNO - MIDI controller via USB

Sir, Can you please help.. I am at my wits end and dont know who else I can ask... Please let me know if I this is not the right forum to ask this question...
Question:
I am integrating a USB shield and an Arduino UNO. End goal = Control a MIDI device via USB. This is what I have done. I ran the "board_qc" sketch and if I connect an USB thumbdrive the tests all pass. But when I connect a MIDI device and run the following sketch ..
It fails at this step - " if( Usb.getUsbTaskState() == USB_STATE_RUNNING )"... any thoughts on how I can find what is wrong and get this working.

Vendor ID

Hi, The example code has detected my midi device Vendor ID / Product ID.
Do I need to edit this into the code somewhere? its not clear where if I do ?
other people asking the same thing, http://forum.arduino.cc/index.php?topic=277315.0
or are the detected values are used?
Also in dump example shoudl the midi values be dumped to the screen as keys are pressed / knobs turned etc ?I just get a load of numbers repeated scrolling and no change as keys are pressed..

I am using USB HOST LIB version 2

Akai LPK25 working but not Samson Graphite M32 and M-Audio Keystation mini32

Akai LPK25 is working fine but when I connect Samson Graphite M32 or M-Audio Keystation mini32, single notes play ok but when I start playing chords, a random note gets stuck and sustained, and is struck again with every other note played from then on. This is happening with both the Samson and the M-Audio.

I have successfully combined USB_MIDI_converter (from USBH_MIDI examples) and https://github.com/accordion-mega/AccordionMega by Dmitry Yegorenkov. I'm using AccordionMega for the bass buttons and an Akai LPK25 on the treble side. I'm trying the Samson Graphite M32 and the M-Audio Keystation mini32 since I would like to have a couple of extra keys.

accordionready

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.