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

This is a first cut at a simple MIDI output port.

instance methods
  input
  bufferTimeStampFrom:
flushInput
readInto:

  open/close
  close
ensureOpen
openOnPortNumber:
portNumber

  output
  midiCmd:channel:byte:
midiCmd:channel:byte:byte:
midiOutput:

  primitives
  primMIDIClosePort:
primMIDIOpenPort:readSemaIndex:interfaceClockRate:
primMIDIReadPort:into:
primMIDIWritePort:from:at:

class methods
  class initialization
  initialize

  instance creation
  openDefault
openOnPortNumber:

  primitives
  primPortCount
primPortDirectionalityOf:
primPortNameOf:

  utilities
  closeAllPorts
inputPortNumFromUser
midiIsSupported
outputPortNumFromUser
portDescription:

instance methods
  input top  
 

bufferTimeStampFrom:

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


 

flushInput

Read any lingering MIDI data from this port's input buffer.


 

readInto:

Read any data from this port into the given buffer.


  open/close top  
 

close

Close this MIDI port.


 

ensureOpen

Make sure this MIDI port is open. It is good to call this before starting to use a port in case an intervening image save/restore has caused the underlying hardware port to get closed.


 

openOnPortNumber:

Open this MIDI port on the given port number.


 

portNumber

Answer my port number.


  output top  
 

midiCmd:channel:byte:

Immediately output the given MIDI command with the given channel and argument byte to this MIDI port. Assume that the port is open.


 

midiCmd:channel:byte:byte:

Immediately output the given MIDI command with the given channel and argument bytes to this MIDI port. Assume that the port is open.


 

midiOutput:

Output the given bytes to this MIDI port immediately. Assume that the port is open.


  primitives top  
 

primMIDIClosePort:

Close the given MIDI port. Don't fail if port is already closed.


 

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.


 

primMIDIReadPort:into:

Read any available MIDI data into the given buffer (up to the size of the buffer) and answer the number of bytes read.


 

primMIDIWritePort:from:at:

Queue the given data to be sent through the given MIDI port at the given time. If midiClockValue is zero, send the data immediately.


class methods
  class initialization top  
 

initialize

SimpleMIDIPort initialize


  instance creation top  
 

openDefault

Answer a new instance of me opened on the default MIDI port.


 

openOnPortNumber:

Answer a new instance of me for the given MIDI port number.


  primitives top  
 

primPortCount

Answer the number of MIDI ports supported by this platform, or zero if this primitive is not implemented.


 

primPortDirectionalityOf:

Answer the platform-specific name for the given MIDI port.


 

primPortNameOf:

Answer the platform-specific name for the given MIDI port.


  utilities top  
 

closeAllPorts

Close all MIDI ports.


 

inputPortNumFromUser

Prompt the user for a MIDI input port. Answer a port number, or nil if the user does not select a port or if MIDI is not supported on this platform.


 

midiIsSupported

Answer true if this platform supports MIDI.


 

outputPortNumFromUser

Prompt the user for a MIDI output port. Answer a port number, or nil if the user does not select a port or if MIDI is not supported on this platform.


 

portDescription:

Answer a string indicating the directionality of the given MIDI port.