c11files.calgorythmic.midi
Class Beat

java.lang.Object
  extended by c11files.calgorythmic.midi.Beat

public class Beat
extends java.lang.Object

This object collects all the MIDI events that must be sent on a particular beat.

Version:
CS 108, August, 2008
Author:
Keith Vander Linden

Constructor Summary
Beat()
          This constructor creates a beat object with an empty MIDI event list.
 
Method Summary
 void addEvent(Event event)
          This routine adds an event to this beat
 void addEvents(java.util.List<Event> events)
          This routine adds a list of events to the current beat.
 java.util.List<Event> getEvents()
           
 void send(MidiPlayer midi, int channel)
          This routine sends all the MIDI events for the this beat to the given MIDI device.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Beat

public Beat()
This constructor creates a beat object with an empty MIDI event list.

Method Detail

addEvent

public void addEvent(Event event)
This routine adds an event to this beat

Parameters:
event - the event to be added

addEvents

public void addEvents(java.util.List<Event> events)
This routine adds a list of events to the current beat.

Parameters:
events - the list of event objects

getEvents

public java.util.List<Event> getEvents()
Returns:
the current list of MIDI events for this beat

send

public void send(MidiPlayer midi,
                 int channel)
This routine sends all the MIDI events for the this beat to the given MIDI device.

Parameters:
midi - the given MIDI device
channel - the MIDI channel on which to send them