Skip to content

Commit

Permalink
Separating MIDI channel messages from raw MIDI bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
nettoyeurny committed Jan 21, 2013
1 parent a9f7bf7 commit 5020b4d
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 53 deletions.
68 changes: 68 additions & 0 deletions java/org/puredata/core/PdMidiListener.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/**
*
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution.
*
*/

package org.puredata.core;

/**
*
* Interface for receiving MIDI channel messages from Pd.
*
* @author Peter Brinkmann ([email protected])
*/
public interface PdMidiListener {

/**
* receives a note on event from pd
*
* @param channel starting at 0
* @param pitch
* @param velocity
*/
void receiveNoteOn(int channel, int pitch, int velocity);

/**
* receives a control change event from pd
*
* @param channel starting at 0
* @param controller
* @param value
*/
void receiveControlChange(int channel, int controller, int value);

/**
* receives a program event from pd
*
* @param channel starting at 0
* @param value
*/
void receiveProgramChange(int channel, int value);

/**
* receives a pitch bend event from pd
*
* @param channel starting at 0
* @param value centered at 0; no 8192 offset
*/
void receivePitchBend(int channel, int value);

/**
* receives an aftertouch event from pd
*
* @param channel starting at 0
* @param value
*/
void receiveAftertouch(int channel, int value);

/**
* receives a polyphonic aftertouch event from pd
*
* @param channel starting at 0
* @param pitch
* @param value
*/
void receivePolyAftertouch(int channel, int pitch, int value);
}
56 changes: 3 additions & 53 deletions java/org/puredata/core/PdMidiReceiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,63 +9,13 @@

/**
*
* PdReceiver is an interface for receiving MIDI events from pd, to be used with setMidiReceiver in {@link PdBase}.
* Interface for receiving MIDI channel messages as well as raw MIDI bytes from Pd,
* to be used with setMidiReceiver in {@link PdBase}.
*
* @author Peter Brinkmann ([email protected])
*
*/
public interface PdMidiReceiver {

/**
* receives a note on event from pd
*
* @param channel starting at 0
* @param pitch
* @param velocity
*/
void receiveNoteOn(int channel, int pitch, int velocity);

/**
* receives a control change event from pd
*
* @param channel starting at 0
* @param controller
* @param value
*/
void receiveControlChange(int channel, int controller, int value);

/**
* receives a program event from pd
*
* @param channel starting at 0
* @param value
*/
void receiveProgramChange(int channel, int value);

/**
* receives a pitch bend event from pd
*
* @param channel starting at 0
* @param value centered at 0; no 8192 offset
*/
void receivePitchBend(int channel, int value);

/**
* receives an aftertouch event from pd
*
* @param channel starting at 0
* @param value
*/
void receiveAftertouch(int channel, int value);

/**
* receives a polyphonic aftertouch event from pd
*
* @param channel starting at 0
* @param pitch
* @param value
*/
void receivePolyAftertouch(int channel, int pitch, int value);
public interface PdMidiReceiver extends PdMidiListener {

/**
* receives one raw MIDI byte from pd
Expand Down

0 comments on commit 5020b4d

Please sign in to comment.