Page 1 of 1

USB Composite read MIDI messages

Posted: Sun Sep 13, 2020 11:54 pm
by leogomide07
Greetings Everyone.

Im trying to get messages from Traktor in my bluepill, but when i send a message in the software, my function is never called

Im using the exemple that comes with the library, but with the onboard led:

Code: Select all

#include <USBComposite.h>

class myMidi : public USBMIDI {
 virtual void handleNoteOff(unsigned int channel, unsigned int note, unsigned int velocity) {
  digitalWrite(PC13, LOW);
 }
 virtual void handleNoteOn(unsigned int channel, unsigned int note, unsigned int velocity) {
   digitalWrite(PC13, LOW);
  }
  
};

myMidi midi;
USBCompositeSerial CompositeSerial;

void setup() {
    USBComposite.setProductId(0x0030);
    midi.registerComponent();
    CompositeSerial.registerComponent();
    USBComposite.begin();
    pinMode(PC13, OUTPUT);
    digitalWrite(PC13, HIGH);
}

void loop() {
  midi.poll();
}

I have tested if the software is really sending the message with LoopBe1 and another midi software, and i can get the output from it

Im doing something wrong in the code? There is another type of function that can work?

* i have tested the functions 'handleSysExData' and 'handleSysExEnd' too but same result

Re: USB Composite read MIDI messages

Posted: Tue Sep 15, 2020 10:54 am
by Bakisha
What OS are you using?
If windows, does it have "Maple" audio device in device manager?
In your Traktor program, did you selected "Maple" as midi-out device?

I had problem with drivers, and fix for me is to set different device ID (i used USBComposite.setProductId(0x0020); )