ChannelState


A ChannelState is an object which keeps track of the state of a single channel.

class ChannelState {
public:
  uchar notes[256];
  int program;
  int sustain;
  int pitchBend;
  int pressure;
  int volume;
  ChannelState();
  void update(const MidiMsg*);
  void change(const ChannelState*, ioref, int, void (*func)(const MidiMsg&));
};
ChannelState()
The constructor creates a new ChannelState where all of the members are set to their default values. (i. e. the state the synthesizer would be in when it is first turned on)
void update(const MidiMsg* m)
This member function changes the ChannelState to reflect what it would be after the MIDI message m was sent to the synthesizer, assuming m is a message for this channel.
void change(const ChannelState* s, ioref n, int c, void (*func)(const MidiMsg&))
This member function sends MIDI messages to channel c of node n, using func, to cause the synthesizer to have the state of this ChannelState object, assuming that its previous state was s.