ofxMidi input

Hello,

I’ve used ofxMidi to send notes out, but this time I need to get MIDI input.
I’ve compiled example-input, but I get “Received: Unknown” and no values seem to be coming in.
I’ve tried sending data from Max but no joy. In the console I see:

  
  
ofxMidiIn: 2 ports available  
ofxMidiIn: 0: from MaxMSP 1  
ofxMidiIn: 1: from MaxMSP 2  
OF: OF_VERBOSE: ofxMidiIn: opened port 0 from MaxMSP 1  
OF: OF_VERBOSE: ofxMidiIn: ignore types on from MaxMSP 1: sysex: 0 timing: 0 sense: 0  
  

but values never change.

Am I missing something ?

Ok,

I found one major thing I was missing: the ports ofxMidiIn lists as available: “from MaxMSP 1” and “from MaxMSP 2”. They should be “to MaxMSP 1” and “to MaxMSP 2”.

I’ve tried

  
  
midiIn.openPort("to MaxMSP 1");  
  

but I got:

  
  
OF: OF_LOG_ERROR: ofxMidiIn: port "to MaxMSP 1" is not available  
  

How can I get ofxMidiIn to listen “to MaxMSP 1” ?

Ok, I’m getting confused because input/outputs seem reversed:

  
  
RtMidiOut midiOut;	  
	for(int i = 0 ; i < midiOut.getPortCount(); i++){  
		cout << "RtMidiOut port index: " << i << " name: " << midiOut.getPortName(i) << endl;  
	}  
RtMidiIn midiIn;	  
	for(int i = 0 ; i < midiIn.getPortCount(); i++){  
		cout << "RtMidiIn port index: " << i << " name: " << midiIn.getPortName(i) << endl;  
	}  
  

which outputs:

  
  
RtMidiOut port index: 0 name: to MaxMSP 1  
RtMidiOut port index: 1 name: to MaxMSP 2  
RtMidiIn port index: 0 name: from MaxMSP 1  
RtMidiIn port index: 1 name: from MaxMSP 2  
  

I’ve done a basic test with GarageBand+MidiO to output some MIDI data.
The only output options are “to MaxMSP 1” and “to MaxMSP 2”.
In MaxMSP if I use the midiin object I can get the notes from Garage Band,
but not in oF since ofxMidiIn can only open “from MaxMSP 1” and “from MaxMSP 2”.

I’ve used the MIDITester Max extra and if I send notes to “from MaxMSP 2” (port at index 1)
I can see them received in InputExample.

I barely have any experience with MIDI, but this looks weird/reversed somehow.
Any clues ?