Bill Manaris : JMUSIC / Note

Note

The Note class is representative of notes in standard western music notation. It contains data relevant to music note information such as pitch and rhythm value. Notes get contained in Phrase objects. Like in traditional music notation (CPN) notes get played one after the other in the order in which they are added to the Phrase.

A note is created via Note(pitch, rhythmValue), where

Notes can be added to a phrase like this:

phrase = Phrase(0.0)    # create a phrase that starts at the beginning of the music
note = Note(C4, HN)     # create a middle C note with 1/2 duration
phrase.addNote(note)    # add this note to a phrase
 

Rests can be defined like this:

rest = Rest(HN)         # create an 1/2 rest
phrase.addNote(rest)    # add this rest to an existing phrase
 

For more information, see the jMusic Note Java class.

(Printable View of http://www.cs.cofc.edu/~manaris/?n=JMUSIC.Note)