I’m using ofxMidi and ofxATK addonds, trying to connect my Native Instruments Traktor X1 midi controller. But I get an error message (screenshot attached) I can not even see something printed in the console when I test it with the Traktor X1
Any ideas why?
ofApp.h
#include "ofMain.h"
#include "ofxATK.hpp"
#include "ofxMidi.h"
class ofApp : public ofBaseApp, public ofxMidiListener{
public:
void setup();
void update();
void draw();
void exit();
void audioOut(float* buffer, int bufferSize, int nChannels);
void newMidiMessage(ofxMidiMessage& message);
ofxMidiIn midiIn;
};
ofApp.cpp
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
midiIn.listInPorts();
midiIn.openPort(0);
midiIn.addListener(this);
ofSoundStreamSetup(2,0, ATKSettings::sampleRate, ATKSettings::bufferSize, 4);
}
//--------------------------------------------------------------
void ofApp::update(){
}
//--------------------------------------------------------------
void ofApp::draw(){
}
//--------------------------------------------------------------
void ofApp::audioOut(float* buffer, int bufferSize, int nChannels){
for (int i = 0; i < bufferSize; i++) {
float currentSample = 0;
buffer[i*nChannels+0] = currentSample;
buffer[i*nChannels+1] = currentSample;
}
}
//--------------------------------------------------------------
void ofApp::newMidiMessage(ofxMidiMessage &message){
// cout << ofGetElapsedTimef() << endl;
cout << mtof(message.pitch) << endl;
}
//--------------------------------------------------------------
void ofApp::exit(){
ofSoundStreamClose();
}