USB Composite read MIDI messages

Post here first, or if you can't find a relevant section!
Post Reply
leogomide07
Posts: 5
Joined: Thu Jan 30, 2020 12:07 pm

USB Composite read MIDI messages

Post 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

User avatar
Bakisha
Posts: 57
Joined: Fri Dec 20, 2019 6:50 pm
Answers: 3
Contact:

Re: USB Composite read MIDI messages

Post 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); )

leogomide07
Posts: 5
Joined: Thu Jan 30, 2020 12:07 pm

Re: USB Composite read MIDI messages

Post by leogomide07 »

Greetings, sorry for the delay

I have tested to change the ID number, does not work too

And yes, traktor can identify it as a midi in-out device

Hope some day we can have this lib to the official stm32 core :/

User avatar
Bakisha
Posts: 57
Joined: Fri Dec 20, 2019 6:50 pm
Answers: 3
Contact:

Re: USB Composite read MIDI messages

Post by Bakisha »

You could try

Code: Select all

digitalWrite(PC13, HIGH);
Also, update library from library manager, if you havent.
Maybe even check is core have any updates.

Post Reply

Return to “General discussion”