abc4j API Specification

abc.notation
Class MultiNote

java.lang.Object
  extended by abc.notation.NoteAbstract
      extended by abc.notation.MultiNote
All Implemented Interfaces:
MusicElement
Direct Known Subclasses:
PositionableMultiNote

public class MultiNote
extends NoteAbstract

A multi note is a group of notes that should be played together.


Field Summary
 
Fields inherited from class abc.notation.NoteAbstract
DOWN, NONE, UP
 
Constructor Summary
MultiNote(java.util.Vector notes)
          Creates a new MultiNote from given notes.
 
Method Summary
 boolean contains(Note aNote)
          Returns true if this chord contains the specified note.
static Note[] excludeTiesEndings(Note[] notes)
           
 Note getHighestNote()
          Returns the highest note among the notes composing this multi note.
static Note getHighestNote(Note[] notes)
          Returns the highest note from the given array of notes.
 Note getLongestNote()
          Returns the longest note of this multi note, based on its duration.
static Note getLongestNote(Note[] notes)
          Returns the note with the biggest duration from the given array of notes.
 Note getLowestNote()
          Returns the lowest note among the notes composing this multi note.
static Note getLowestNote(Note[] notes)
          Returns the lowest note from the given array of notes.
 java.util.Vector getNotesAsVector()
          Returns a new vector containing all Note objects contained in this multi note.
 Note[] getNotesBeginningTie()
          Returns the notes from this multinote that begin a tie.
static Note[] getNotesShorterThan(Note[] notes, int aStrictDuration)
          Returns all notes strictly shorter than the given strict duration.
 Note getShortestNote()
          Returns the shortest note of this multi note, based on its duration.
 short[] getStrictDurations()
          Returns the strict durations composing this multi notes.
 boolean hasAccidental()
          Returns true if this multi note some accidentals (for at least one of its note).
 boolean hasUniqueStrictDuration()
          Returns true if the strict durations of all notes composing this multi note have the same value.
 MultiNote[] normalize()
          Normalizes this multi note by decomposing it into multinotes with same strict duration.
 Note[] toArray()
          Returns notes composing this multinote as an array of notes, sorted from the lowest note to the highest one.
 
Methods inherited from class abc.notation.NoteAbstract
countDots, getBow, getChordName, getDotted, getGracingNotes, getGracingNotesLength, getSlurDefinition, getTuplet, hasGeneralGracing, hasGracingNotes, hasStaccato, isBeginingSlur, isEndingSlur, isPartOfSlur, isPartOfTuplet, setBow, setChordName, setDotted, setGeneralGracing, setGracingNotes, setPartOfSlur, setSlurDefinition, setStaccato, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultiNote

public MultiNote(java.util.Vector notes)
Creates a new MultiNote from given notes.

Parameters:
notes - A Vector containing the NoteAbstract of this MultiNote.
Method Detail

contains

public boolean contains(Note aNote)
Returns true if this chord contains the specified note.

Parameters:
aNote - A note instance.
Returns:
true if this chord contains the specified note. false otherwise.

getLongestNote

public Note getLongestNote()
Returns the longest note of this multi note, based on its duration.

Returns:
The longest note of this multi note. If several notes have the same longest length, the first one is returned.
See Also:
Note.getDuration()

getLongestNote

public static Note getLongestNote(Note[] notes)
Returns the note with the biggest duration from the given array of notes.

Parameters:
notes - An array of notes.
Returns:
The note with the biggest duration from the given array of notes.
See Also:
Note.getDuration()

getNotesShorterThan

public static Note[] getNotesShorterThan(Note[] notes,
                                         int aStrictDuration)
Returns all notes strictly shorter than the given strict duration.

Parameters:
notes - An arry of notes.
aStrictDuration - A strict duration (use constants defined class Note)
Returns:
All notes strictly shorter than the given strict duration. null is returned is no note if shorter than the given strict duration.
See Also:
Note.getStrictDuration()

getLowestNote

public static Note getLowestNote(Note[] notes)
Returns the lowest note from the given array of notes.

Parameters:
notes - An array of notes.
Returns:
The lowest note from the given array of notes.
See Also:
Note.isLowerThan(Note)

getHighestNote

public static Note getHighestNote(Note[] notes)
Returns the highest note from the given array of notes.

Parameters:
notes - An array of notes.
Returns:
The highes note from the given array of notes.
See Also:
Note.isHigherThan(Note)

getShortestNote

public Note getShortestNote()
Returns the shortest note of this multi note, based on its duration.

Returns:
The shortest note of this multi note. If several notes have the same shortest length, the first one is returned.
See Also:
Note.getDuration()

getHighestNote

public Note getHighestNote()
Returns the highest note among the notes composing this multi note.

Returns:
The highest note among the notes composing this multi note.
See Also:
getLowestNote(), Note.isHigherThan(Note)

getNotesBeginningTie

public Note[] getNotesBeginningTie()
Returns the notes from this multinote that begin a tie.

Returns:
Te notes from this multinote that begin a tie. null is returned if no note begins a tie.
See Also:
Note.isBeginningTie()

excludeTiesEndings

public static Note[] excludeTiesEndings(Note[] notes)

getLowestNote

public Note getLowestNote()
Returns the lowest note among the notes composing this multi note.

Returns:
The lowest note among the notes composing this multi note.
See Also:
Note.isLowerThan(Note), getHighestNote()

hasUniqueStrictDuration

public boolean hasUniqueStrictDuration()
Returns true if the strict durations of all notes composing this multi note have the same value.

Returns:
true if the strict durations of all notes composing this multi note have the same value, false otherwise.
See Also:
Note.getStrictDuration()

getStrictDurations

public short[] getStrictDurations()
Returns the strict durations composing this multi notes.

Returns:
The strict durations composing this multi notes. The array is sorted from shortest durations to longest ones.

normalize

public MultiNote[] normalize()
Normalizes this multi note by decomposing it into multinotes with same strict duration.

Returns:
An array of multinotes with unique strict duration. Such strict durations are sorted by ascent order.
See Also:
hasUniqueStrictDuration()

hasAccidental

public boolean hasAccidental()
Returns true if this multi note some accidentals (for at least one of its note).

Returns:
true if this multi note some accidentals (for at least one of its note), false otherwise.
See Also:
Note.hasAccidental()

getNotesAsVector

public java.util.Vector getNotesAsVector()
Returns a new vector containing all Note objects contained in this multi note.

Returns:
a new vector containing all Note objects contained in this multi note.

toArray

public Note[] toArray()
Returns notes composing this multinote as an array of notes, sorted from the lowest note to the highest one.

Returns:
Notes composing this multinote as an array of notes, sorted from the lowest note to the highest one.

abc4j API Specification

Submit a bug or feature