jcaas.midi
Class Note

java.lang.Object
  extended by jcaas.midi.Note

public class Note
extends java.lang.Object

Note represents a note that may be played by MIDIPlayer Extends StaffProperty.

Version:
last updated: 4/17/05
Author:
Conrad Hutcheson

Constructor Summary
Note(int tone)
          Default constructor, makes a note with a duration of 1ms/1 beat and a given pitch.
Note(int tone, int length, double beats)
          Constructor, makes a note with a given pitch and duration in milliseconds.
 
Method Summary
 double getBeats()
           
 int getDuration()
          Returns the duration of this note.
 int getPitch()
          Returns the tone of this note.
 void setBeats(double beats)
           
 void setDuration(int time)
          Sets a time duration for this note in milliseconds.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Note

public Note(int tone)
Default constructor, makes a note with a duration of 1ms/1 beat and a given pitch.

Parameters:
tone - - the int pitch this note represents.

Note

public Note(int tone,
            int length,
            double beats)
Constructor, makes a note with a given pitch and duration in milliseconds.

Parameters:
tone - - the int pitch this note represents.
length - - the int duration of this song in milliseconds.
Method Detail

getPitch

public int getPitch()
Returns the tone of this note.

Returns:
the int pitch this note represents.

getDuration

public int getDuration()
Returns the duration of this note.

Returns:
the int duration of this note in milliseconds.

setDuration

public void setDuration(int time)
Sets a time duration for this note in milliseconds.

Parameters:
time - - the duration of the note in milliseconds

getBeats

public double getBeats()
Returns:
the number of beats this tone lasts for This method returns the number of beats this note is played for, rather than the number of milliseconds.

setBeats

public void setBeats(double beats)