void ofApp::draw(){
// update beat info
if (beat.received()) {
- ofSetHexColor(0x00FF00);
- ofRect(90,150,50,50);
+ ofSetHexColor(0x00FF00);
+ ofRect(90,150,50,50);
}
// update onset info
if (onset.received()) {
- ofSetHexColor(0xFF0000);
- ofRect(250 + 90,150,50,50);
- gotOnset = 1;
+ ofSetHexColor(0xFF0000);
+ ofRect(250 + 90,150,50,50);
+ gotOnset = 1;
} else {
- gotOnset = 0;
+ gotOnset = 0;
}
onsetNovelty = onset.novelty;
onsetThresholdedNovelty = onset.thresholdedNovelty;
class ofApp : public ofBaseApp{
- public:
- void setup();
- void exit();
-
- void update();
- void draw();
-
- void keyPressed(int key);
- void keyReleased(int key);
- void mouseMoved(int x, int y );
- void mouseDragged(int x, int y, int button);
- void mousePressed(int x, int y, int button);
- void mouseReleased(int x, int y, int button);
- void windowResized(int w, int h);
- void dragEvent(ofDragInfo dragInfo);
- void gotMessage(ofMessage msg);
-
- void audioIn(float * input, int bufferSize, int nChannels);
- void audioOut();
-
- private:
- ofxAubioOnset onset;
- ofxAubioPitch pitch;
- ofxAubioBeat beat;
-
- ofxPanel pitchGui;
- ofxFloatSlider midiPitch;
- ofxFloatSlider pitchConfidence;
-
- ofxPanel beatGui;
- ofxFloatSlider bpm;
-
- ofxPanel onsetGui;
- ofxFloatSlider gotOnset;
- ofxFloatSlider onsetThreshold;
- ofxFloatSlider onsetNovelty;
- ofxFloatSlider onsetThresholdedNovelty;
+ public:
+ void setup();
+ void exit();
+
+ void update();
+ void draw();
+
+ void keyPressed(int key);
+ void keyReleased(int key);
+ void mouseMoved(int x, int y );
+ void mouseDragged(int x, int y, int button);
+ void mousePressed(int x, int y, int button);
+ void mouseReleased(int x, int y, int button);
+ void windowResized(int w, int h);
+ void dragEvent(ofDragInfo dragInfo);
+ void gotMessage(ofMessage msg);
+
+ void audioIn(float * input, int bufferSize, int nChannels);
+ void audioOut();
+
+ private:
+ ofxAubioOnset onset;
+ ofxAubioPitch pitch;
+ ofxAubioBeat beat;
+
+ ofxPanel pitchGui;
+ ofxFloatSlider midiPitch;
+ ofxFloatSlider pitchConfidence;
+
+ ofxPanel beatGui;
+ ofxFloatSlider bpm;
+
+ ofxPanel onsetGui;
+ ofxFloatSlider gotOnset;
+ ofxFloatSlider onsetThreshold;
+ ofxFloatSlider onsetNovelty;
+ ofxFloatSlider onsetThresholdedNovelty;
};