rt300@9: /* rt300@9: * Copyright (c) 2011 Dan Wilcox rt300@9: * rt300@9: * BSD Simplified License. rt300@9: * For information on usage and redistribution, and for a DISCLAIMER OF ALL rt300@9: * WARRANTIES, see the file, "LICENSE.txt," in this distribution. rt300@9: * rt300@9: * See https://github.com/danomatika/ofxPd for documentation rt300@9: * rt300@9: */ rt300@9: #pragma once rt300@9: rt300@9: #include "ofMain.h" rt300@9: rt300@9: #include "ofxPd.h" rt300@9: rt300@9: // a namespace for the Pd types rt300@9: using namespace pd; rt300@9: rt300@9: class AppCore : public PdReceiver, public PdMidiReceiver { rt300@9: rt300@9: public: rt300@45: string patchName; rt300@9: // main rt300@9: void setup(const int numOutChannels, const int numInChannels, rt300@9: const int sampleRate, const int ticksPerBuffer); rt300@9: void update(); rt300@9: void draw(); rt300@9: void exit(); rt300@9: rt300@9: // do something rt300@9: void playTone(int pitch); rt300@9: rt300@9: // input callbacks rt300@9: void keyPressed(int key); rt300@9: rt300@9: // audio callbacks rt300@9: void audioReceived(float * input, int bufferSize, int nChannels); rt300@9: void audioRequested(float * output, int bufferSize, int nChannels); rt300@9: rt300@9: // pd message receiver callbacks rt300@9: void print(const std::string& message); rt300@9: rt300@9: void receiveBang(const std::string& dest); rt300@9: void receiveFloat(const std::string& dest, float value); rt300@9: void receiveSymbol(const std::string& dest, const std::string& symbol); rt300@9: void receiveList(const std::string& dest, const List& list); rt300@9: void receiveMessage(const std::string& dest, const std::string& msg, const List& list); rt300@9: rt300@9: // pd midi receiver callbacks rt300@9: void receiveNoteOn(const int channel, const int pitch, const int velocity); rt300@9: void receiveControlChange(const int channel, const int controller, const int value); rt300@9: void receiveProgramChange(const int channel, const int value); rt300@9: void receivePitchBend(const int channel, const int value); rt300@9: void receiveAftertouch(const int channel, const int value); rt300@9: void receivePolyAftertouch(const int channel, const int pitch, const int value); rt300@9: rt300@9: void receiveMidiByte(const int port, const int byte); rt300@9: rt300@9: // demonstrates how to manually poll for messages rt300@9: void processEvents(); rt300@9: rt300@9: ofxPd pd; rt300@9: vector scopeArray; rt300@9: rt300@9: int midiChan; rt300@9: };