Squeak Class Documentation category index | class index  
 
MIDISynthChannel
  category: Sound-Scores
  superclass: Object
  subclasses:

I implement one polyphonic channel of a 16-channel MIDI synthesizer. Many MIDI commands effect all the notes played on a particular channel, so I record the state for a single channel, including a list of notes currently playing.

This initial implementation is extremely spartan, having just enough functionality to play notes. Things that are not implemented include:

1. program changes
2. sustain pedal
3. aftertouch (either kind)
4. most controllers
5. portamento
6. mono-mode

instance methods
  accessing
  instrument
instrument:
masterVolume
masterVolume:
muted
muted:
pan
pan:

  initialization
  initialize

  midi dispatching
  channelPressure:
control:value:
doChannelCmd:byte1:byte2:
key:pressure:
keyDown:vel:
keyUp:vel:
pitchBend:
programChange:

  other
  adjustPitch:
convertVelocity:
newVolume:

class methods
  no messages
 

instance methods
  accessing top  
 

instrument


 

instrument:


 

masterVolume


 

masterVolume:

Set the master volume the the given value (0.0 to 1.0).


 

muted


 

muted:


 

pan


 

pan:

Set the left-right pan to the given value (0.0 to 1.0).


  initialization top  
 

initialize


  midi dispatching top  
 

channelPressure:

Handle a channel pressure (channel aftertouch) change.


 

control:value:

Handle a continuous controller change.


 

doChannelCmd:byte1:byte2:

Dispatch a channel command with the given arguments.


 

key:pressure:

Handle a key pressure (polyphonic aftertouch) change. Rarely implemented.


 

keyDown:vel:

Handle a key down event with non-zero velocity.


 

keyUp:vel:

Handle a key up event.


 

pitchBend:

Handle a pitch-bend change.


 

programChange:

Handle a program (instrument) change.


  other top  
 

adjustPitch:

Handle a pitch-bend change.


 

convertVelocity:

Map a value in the range 0..127 to a volume in the range 0.0..1.0.


 

newVolume:

Set the channel volume to the level given by the given number in the range 0..127.


class methods
  no messages top