Metamodule and custom midi controllers

I’m trying to get the metamodule to work with a custom midi controller based on a teensy, but I can’t get it to see any midi input. What does the metamodule require for this to work, other than detecting the midi device properly?

I’ve simply created a sketch which outputs a cc every 1 second for testing purposes, I can see this working on my computer. When I plug it into the metamodule I can see from a serial debug that it’s finding the usb midi device, but the midi is never actually seen when I then try to map it to something.

Listening as a MIDI Host
USBH USER: USB Device Connected
USBH USER: USB Device Reset Completed
USBH USER: PID: 485h
USBH USER: VID: 16c0h
USBH USER: Address (#1) assigned.
USBH USER: Manufacturer : Teensyduino
USBH USER: Product : INFERNAL
USBH USER: Serial Number : 16644450
USBH USER: Enumeration done.
USBH USER: This device has only 1 configuration.
USBH USER: Default configuration set.
USBH USER: Looking for classcode 1 (MIDI)
USBH USER: Found interface with 1 classcode
USBH USER: Found interface with 3 classcode
USBH USER: Looking for classcode 8 (MSC)
USBH USER: Found interface with 1 classcode
USBH USER: Found interface with 3 classcode
USBH USER: Switching to Interface (#0)
USBH USER: Class    : 1h
USBH USER: SubClass : 3h
USBH USER: Protocol : 0h
USBH USER: MIDI class started.

This doesn’t really look any different than when I plug a working midi controller in.

You should be easily able to recreate this with any teensy midi example (with the board set to the simple single midi output option), but if it’s helpful my test sketch is simply

/* 
   You must select MIDI from the "Tools > USB Type" menu
*/

const int ledPin = 13;

// the MIDI channel number to send messages
const int channel = 1;

// the MIDI continuous controller for each analog input
const int controllerA0 = 10; // 10 = pan position
const int controllerA1 = 11; // 11 = volume/expression
const int controllerA2 = 91; // 91 = reverb level
const int controllerA3 = 93; // 93 = chorus level

void setup() {
  // initialize the digital pin as an output.
  pinMode(ledPin, OUTPUT);
}

elapsedMillis msecA = 0;
elapsedMillis msecB = 0;

int a = 0;
int b = 127;

void loop() {
  if (msecA >= 1000) {
    msecA = 0;
    usbMIDI.sendControlChange(controllerA0, a, channel,0);
    a = (a < 127) ? a+1 : 0;
    digitalWrite(ledPin, HIGH);   // set the LED on
  } 
  if (msecB >= 2000){
    msecB = 0;
    usbMIDI.sendControlChange(controllerA1, b, channel,0);
    b = (b > 0) ? b-1 : 127;
    digitalWrite(ledPin, LOW);   // set the LED on
  }

  // MIDI Controllers should discard incoming MIDI messages.
  // http://forum.pjrc.com/threads/24179-Teensy-3-Ableton-Analog-CC-causes-midi-crash
  while (usbMIDI.read()) {
    // ignore incoming messages
  }
}

What other info can I give to help with debugging this?

The MIDI connection log looks OK.

How exactly are you testing for MIDI input on the MetaModule?
These are my go-to places:

  • The Settings > System > Check Hardware page will show the latest CC sent, along with the latest note pressed
  • Param add mapping page
  • Jack “New MIDI Map” page
  • screen of the RackCore:MIDIToCVInterface

If you’re on v2.0.9 then try toggling the MIDI Feedback feature, it seems like that would tie into the Teensy’s usbMIDI.read() feature, maybe something is happening or not happening there? Also might try commenting this out on the Teensy and see if that changes things.

Another thing, if you’re compiling custom firmware, you could put a printf() at the top of parse() in core_m4/midi_controls.hh to see if it’s getting that far.

I’m working remotely and don’t have a Teensy here, otherwise I could test it.

Hey Dan, as always thanks for your time with debugging things. What was the hint for me here was 2.0.9. I was still on 2.0.5, which wasn’t working (I was checking on both the check hardware page and adding a param mapping). But since switching to 2.0.9 it’s working fine, with midi feedback both on and off.
For some reason though now my MM freezes when I back out of the check hardware page. I’m not exactly sure why, but it always seems to freeze the unit regardless of if I have a midi controller plugged in.
But I think with regards to the midi issue we can close it as it’s all good in the latest firmware.

OK cool! Yeah since 2.0.5 we’ve fixed and improved a few of MIDI issues
Not sure about the HW test freezing when you exit. Oh – well it could be something to do with that it tries to load the previous patch when you exit.