net.charlesames.music.ensemble
Class NoteAttribute

java.lang.Object
  extended by net.charlesames.music.ensemble.NoteAttribute

public abstract class NoteAttribute
extends java.lang.Object

The NoteAttribute class maps attribute names to specific properties of ScoreNote instances.

Author:
Charles Ames

Field Summary
static NoteAttribute ACCENT
          Note accent.
static NoteAttribute DURATION
          Note duration.
static NoteAttribute ID
          Note ID.
static NoteAttribute INSTRUMENT
          Note-list Instrument ID.
static NoteAttribute ONSET
          Note onset time.
static NoteAttribute ONSET_PITCH
          Pitch, expressed in cycles per second, as of the note's starting time.
static NoteAttribute PROCESS
          Note process ID.
static NoteAttribute RELEASE_PITCH
          Pitch, expressed in cycles per second, as of the note's ending time.
static NoteAttribute SLUR_FROM_ID
          ID of slur-from note.
static NoteAttribute VOICE
          Note voice ID.
 
Method Summary
abstract  java.lang.String formatValue(double value)
          Format the indicated value as text.
 java.lang.String getName()
          Get the attribute name.
abstract  double getValue(ScoreNote note)
          Get the note property value corresponding to the attribute name from the indicated note.
static NoteAttribute valueOf(java.lang.String name)
          Find the NoteAttribute instance with the indicated name.
static java.util.SortedMap<java.lang.String,NoteAttribute> values()
          Get all the attributes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static NoteAttribute ID
Note ID.


SLUR_FROM_ID

public static NoteAttribute SLUR_FROM_ID
ID of slur-from note.


INSTRUMENT

public static NoteAttribute INSTRUMENT
Note-list Instrument ID.


ONSET

public static NoteAttribute ONSET
Note onset time.


DURATION

public static NoteAttribute DURATION
Note duration.


ACCENT

public static NoteAttribute ACCENT
Note accent.


ONSET_PITCH

public static NoteAttribute ONSET_PITCH
Pitch, expressed in cycles per second, as of the note's starting time.


RELEASE_PITCH

public static NoteAttribute RELEASE_PITCH
Pitch, expressed in cycles per second, as of the note's ending time.


PROCESS

public static NoteAttribute PROCESS
Note process ID.


VOICE

public static NoteAttribute VOICE
Note voice ID.

Method Detail

getName

public java.lang.String getName()
Get the attribute name.

Returns:
The attribute name.

formatValue

public abstract java.lang.String formatValue(double value)
Format the indicated value as text.

Parameters:
value - The indicated value.
Returns:
A text string representing the indicated value.

getValue

public abstract double getValue(ScoreNote note)
Get the note property value corresponding to the attribute name from the indicated note.

Parameters:
note - The indicated name.
Returns:
The corresponding value.

valueOf

public static NoteAttribute valueOf(java.lang.String name)
Find the NoteAttribute instance with the indicated name.

Parameters:
name - The indicated name.
Returns:
A NoteAttribute instance.

values

public static java.util.SortedMap<java.lang.String,NoteAttribute> values()
Get all the attributes.

Returns:
A collection of NoteAttribute instances, indexed by attribute name.