Squeak Class Documentation category index | class index  
 
MidiPrimTester
  category: System-Serial Port
  superclass: Object
  subclasses:

This class simply demonstrates and tests the MIDI primitives. MIDI applications should use Stephen Pope's MIDIPort class, which will replace this one.

The Macintosh, and perhaps some other platforms, can send and receive MIDI data over a serial port by using an external clock signal supplied by an external MIDI adapter to generate the correct MIDI baud rate. Typical clock speeds of such adapters are 1, 2, or 0.5 MHz. This clock speed can be specified when a MIDI port is opened. On other platforms, this clock speed parameter is ignored.

instance methods
  primitives
  primMIDIClosePort:
primMIDIGetClock
primMIDIGetPortCount
primMIDIGetPortDirectionality:
primMIDIGetPortName:
primMIDIOpenPort:readSemaIndex:interfaceClockRate:
primMIDIParameterGet:
primMIDIParameterSet:to:
primMIDIReadPort:into:
primMIDIWritePort:from:at:

  private
  bufferTimeStampFrom:
canTurnOnParameter:
openPort:andDo:

  tests
  getDriverParameters
getInputForSeconds:onPort:
getPortList
playDrumRoll:count:onPort:
playNoteOnPort:
playScale:onPort:

class methods
  class initialization
  initialize

instance methods
  primitives top  
 

primMIDIClosePort:


 

primMIDIGetClock


 

primMIDIGetPortCount


 

primMIDIGetPortDirectionality:


 

primMIDIGetPortName:


 

primMIDIOpenPort:readSemaIndex:interfaceClockRate:

Open the given MIDI port. If non-zero, readSemaIndex specifies the index in the external objects array of a semaphore to be signalled when incoming MIDI data is available. Not all platforms support signalling the read semaphore. InterfaceClockRate specifies the clock rate of the external MIDI interface adaptor on Macintosh computers; it is ignored on other platforms.


 

primMIDIParameterGet:


 

primMIDIParameterSet:to:


 

primMIDIReadPort:into:


 

primMIDIWritePort:from:at:


  private top  
 

bufferTimeStampFrom:

Return the timestamp from the given MIDI input buffer. Assume the given buffer is at least 4 bytes long.


 

canTurnOnParameter:

Return true if the given MIDI parameter can be turned on. Leave the parameter in its orginal state.


 

openPort:andDo:

Open the given MIDI port, evaluate the block, and close the port again. Answer the value of the block.


  tests top  
 

getDriverParameters

Return a string that describes this platform's MIDI parameters.


 

getInputForSeconds:onPort:

Collect MIDI input from the given port for the given number of seconds, and answer a string describing the data read.


 

getPortList

Return a string that describes this platform's MIDI ports.


 

playDrumRoll:count:onPort:

MidiPrimTester new playDrumRoll: 75 count: 64 onPort: 0


 

playNoteOnPort:

MidiPrimTester new playNoteOnPort: 0


 

playScale:onPort:

MidiPrimTester new playScale: 130 onPort: 0


class methods
  class initialization top  
 

initialize

Initialize the MIDI parameter constants.