The Note class is representative of notes in standard western music notation. It contains data relavent to music note information such as time, duration and pitch. Notes get contained in Phrase objects. Like in tradtional music notation (CPN) notes get played one after the other in the order in which they are added to the Phrase.
!IMPORTANT: notes with a pitch of the minimum integer are rests, those between 0 <> 127 are exactly the same as normal sounding notes numbered like the MIDI specification. Notes with a pitch specified as a double value, e.g., 440.0, are frequency values for the note pitch. In general, note pitch refers to the chromatic key number (as per MIDI) as an int and the note frequency refer to the value in hertz as a double value.
Notes can be added to a phrase like this...
Phrase phrase = new Phrase(0.0); Note note = new Note(C4, CROTCHET, MF); phrase.addNote(note);
The note also has the option to create notes with reasonable default values. This allows a user who is not interested in any performance details to work with notes solely using pitch value and rythmValue like this....
Note note = new Note(C4, CROTCHET);
The final option for building a note also includes the dynamic parameter for minimal performace information.
Note note = new Note(C4, CROTCHET, F);
Comments about the offset parameter: The intention of offset was to allow for 'feel' in score playback. For example, a snare drum might be played slightly ahead or behind the beat, or a sound with a slow attack might need to be triggered early in order to sound in time with other parts.
With this in mind, offset should have no influence on rhythmValue or duration calculations within the jMusic data structure, only when translated to another format (eg MIDI). In your example (offset 0.1, duration 0.8, and rv 1.0) the rendering (MIDI or other that does not support the offset concept) should consider the start time of the note 0.1 bpm later than 'normal' but the duration of the note will be 0.8 bpm from that offset start time. The next note should start 1.0 bpm after the 'normal' startTime (ignoring offset). This allows for offset to be used in cases where performance of music varies from beat to beat, eg., the downbeat is anticipated slightly. In extreme cases this could cause overlapping notes in MIDI translation which need to be 'handled' but we consider this a weakness of the MIDI data specification rather than a problem for jMusic : )
In short, think of offset as "A displacement from the normal start time of a note that allows performance interpretation without distorting the score for compositional or analysis purposes." ---------------
@author Andrew Sorensen
@version 1.0, Sun Feb 25 18:43:31 2001
@see Phrase