diff options
| author | Tim Redfern <tim@getdrop.com> | 2018-02-03 19:02:57 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2018-02-03 19:02:57 +0000 |
| commit | deed61c5f4d9de82101bb55a5a017ed9775df5d3 (patch) | |
| tree | 147566f63094e1a214eb725cdeeb44f9c446df80 /gui/src/ofApp.cpp | |
| parent | 8549014760e1ac10faafa9d9335ff8e63c01bb06 (diff) | |
midi control
Diffstat (limited to 'gui/src/ofApp.cpp')
| -rw-r--r-- | gui/src/ofApp.cpp | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/gui/src/ofApp.cpp b/gui/src/ofApp.cpp index 57c5b51..1457b74 100644 --- a/gui/src/ofApp.cpp +++ b/gui/src/ofApp.cpp @@ -50,6 +50,11 @@ void ofApp::setup(){ framecounter=0; + //============================ MIDI + + midiIn.listPorts(); + midiIn.openPort(0); + midiIn.addListener(this); //======================================= //positioning interface @@ -843,23 +848,26 @@ void ofApp::dragEvent(ofDragInfo dragInfo){ } - //printf("%s at %i %i \n",dragInfo.files.begin(),dragInfo.position.x,dragInfo.position.y); - //std::string filenames; - //cout << dragInfo.files.begin()->c_str()<<","<<dragInfo.position.x<<","<<dragInfo.position.y<<std::endl; - - //for (auto f = dragInfo.files.begin(); f != dragInfo.files.end(); f++){ - // cout << f->c_str()<<","<<dragInfo.position.x<<","<<dragInfo.position.y<<std::endl; - //if (f!=dragInfo.files.begin()){ - // filenames=filenames+", "; - //} - //} - // filenames=filenames+*f; - - // if (dragInfo.position.y<200){ - // sets[0].addfiles(dragInfo.files); //,dragInfo.position); - // } - // else sets[1].addfiles(dragInfo.files); //,dragInfo.position); +void ofApp::newMidiMessage(ofxMidiMessage& msg) { + //column 0 for general controls - - //} + int offset; + + //=============================================== + offset=0; + + if (msg.channel==1&&msg.control==1+offset){ + //pot + } + if (msg.channel==1&&msg.control==65+offset){ + //top button + } + if (msg.channel==1&&msg.control==73+offset){ + //bottom button + } + if (msg.channel==1&&msg.control==81+offset){ + //fader + laser_intensity=msg.value*2; + } +} |
