Difference between computer-generated midi values and keyboard-generated midi values

Status
Not open for further replies.

rockandroll

New member
I've got a project that works exactly perfectly with my Teensy 3.2, so long as i'm using something like bome's midi keyboard to spit midi values at it.
However, when I attach it to a keyboard, no reaction whatsoever. I've got power into the Teensy, since I don't get any out of the keyboard.
I can attach this keyboard to my PC and use MidiOX to check the incoming midi values and I'm definitely getting identical output at least as far as channel, pitch and velocity go, so it's not like I'm just not getting anything out of the keyboard.
This can't be too complicated, I'm sure I just missed something essential.

Is there a difference between keyboard USB-OUT midi values and computer generated ones?
If you've worked with keyboards before, I would appreciate your assistance.

I've attached the simplest form of code I could reproduce this problem with, in case I'm just not listening to what it's saying.
Code:
/*

*/

void setup() {
  usbMIDI.setHandleNoteOff(myNoteOff)
  usbMIDI.setHandleNoteOn(myNoteOn)
}

void loop() {
    usbMIDI.read();
    pinMode(13,OUTPUT);
}

void myNoteOn(byte channel, byte note, byte velocity)
{
  digitalWrite(13,HIGH);
}
void myNoteOff(byte channel, byte note, byte velocity)
{
  digitalWrite(13,LOW);
}
 
...Is there a difference between keyboard USB-OUT midi values and computer generated ones?
If you've worked with keyboards before, I would appreciate your assistance....
Decidedly 'yes' in that both your Teensy and the keyboard are likely set up as USB devices rather than hosts and with there needs to be one of each.

Some Teensy can play USB host and in particular MIDI hosts but you connect off the board as host and not from the micro-B USB connector.

I hope I haven't got the wrong end of the stick on your problem but it's not clear to me what you mean by "when I attach it to a keyboard".
 
You're entirely correct- I hadn't considered that both of them would be usb clients.
The closest thing I can find to using a 3.2 as a usb host is https://forum.pjrc.com/threads/28173-Teensy-3-x-NATIVE-USB-HOST-PREVIEW-AVAILABLE?highlight=usb+host

also, As per https://static1.squarespace.com/static/53233e4be4b044fa7626c453/t/59244ac02994cae0de9fcb7d/1495550657799/card7a_rev1.pdf, if I add a 150uf capacitor to the bottom, how does that affect the teensy? the pin sheet states "add 150us capacitor for USB Host Mode" but I've fiddled with this enough not to believe that it's as simple as soldering in a capacitor and calling it a day.
 
I'm not expert but I think 3.2 never quite got to a working host solution and I think 3.6 or 4 are the only viable options for hosting (without a shield).

Hosting is not properly documented on the pjrc.com site.

Can anyone point to best current information for hosting on either model?
 
Last edited:
Status
Not open for further replies.
Back
Top