// // Programmer: Craig Stuart Sapp // Creation Date: 4 June 2002 // Last Modified: 4 June 2002 // Filename: ...sig/doc/examples/improv/improv/midithru/midithru.cpp // Syntax: C++; improv // // Description: Have the computer act as a Patch Bay. Send MIDI input // data to any MIDI output port. MIDI input can be sent // to multiple output. // #include "improv.h" typedef Array ArrayInt; typedef Array MidiOutputArray; // function declarations: void displayPatchBay(Array& connections); void sendData(MidiMessage& message, MidiOutPort& output, MidiInput& input); ///////////////////////////////////////////////////////////////////////// int main(int argc, char* argv[]) { int incount = MidiInPort::getNumPorts(); int outcount = MidiOutPort::getNumPorts(); Array connections; connections.setSize(incount); int i, j; for (i=0; i midiins; for (i=0; i midiouts; midiouts.setSize(outcount); for (i=0; i 0) { message = midiins[i].extract(); if (message.p1() == A0) { done = 1; } cout << "[" << i << ":"; for (j=0; j= 0 && count <= 2) { if (count >= 0) output.rawsend(m.p0()); if (count >= 1) output.rawsend(m.p0(), m.p1()); if (count >= 2) output.rawsend(m.p0(), m.p1(), m.p2()); } } ////////////////////////////// // // displayPatchBay -- // void displayPatchBay(Array& connections) { int i, j; for (i=0; i9) { cout << " : "; } else { cout << " : "; } for (j=0; j