Package de.saar.coli.arranger
Class Score
- java.lang.Object
-
- de.saar.coli.arranger.Score
-
public class Score extends Object
A musical score, or piece of sheet music. Scores consist of notes in the four parts of barbershop music, in the order defined by the constants inVoicePart, i.e.VoicePart.TENOR= 0. Scores can also contain lyrics and chords.
-
-
Method Summary
Modifier and Type Method Description voidaddChord(int startTime, Chord chord)Adds a chord at the end of this score.voidaddNote(int part, Note note)Adds the given note to the end of the given voice part.voidaddWord(String word)Adds a word to the end of the lyrics.ScorecloneWithoutNotes()Returns a copy of this score with all the notes removed.intcountNotes(int part)Counts the number of notes in the given part.voidforeachNoteAndChord(int part, BiConsumer<Note,Chord> fn)Iterates over all the notes in the given part.ChordgetChordAtTime(int time)Returns the chord that is played at the given time.StringgetComposer()Returns the composer of this score.StringgetKey()Returns the key of this score.List<String>getLyrics()Returns the lyrics of the song, as a list of words.List<Note>getPart(int part)Returns the notes in the given voice part.intgetQuartersPerMeasure()Returns the time signature of this score, in quarters per measure.StringgetTempo()Returns the tempo of the song, as per the "Q:" field in the ABC notation.StringgetTitle()Returns the title of this score.voidsetComposer(String composer)Changes the composer of this score.voidsetKey(String key)Changes the key of this score.voidsetQuartersPerMeasure(int quartersPerMeasure)Changes the time signature of thi score, in quarters per measure.voidsetTempo(String tempo)voidsetTitle(String title)Changes the title of this score.StringtoString()
-
-
-
Method Detail
-
addNote
public void addNote(int part, Note note)Adds the given note to the end of the given voice part.- Parameters:
part-note-
-
getPart
public List<Note> getPart(int part)
Returns the notes in the given voice part.- Parameters:
part-- Returns:
-
getKey
public String getKey()
Returns the key of this score.- Returns:
-
getTitle
public String getTitle()
Returns the title of this score.- Returns:
-
getComposer
public String getComposer()
Returns the composer of this score.- Returns:
-
getQuartersPerMeasure
public int getQuartersPerMeasure()
Returns the time signature of this score, in quarters per measure.- Returns:
-
setKey
public void setKey(String key)
Changes the key of this score.- Parameters:
key-
-
setTitle
public void setTitle(String title)
Changes the title of this score.- Parameters:
title-
-
setComposer
public void setComposer(String composer)
Changes the composer of this score.- Parameters:
composer-
-
setQuartersPerMeasure
public void setQuartersPerMeasure(int quartersPerMeasure)
Changes the time signature of thi score, in quarters per measure.- Parameters:
quartersPerMeasure-
-
getTempo
public String getTempo()
Returns the tempo of the song, as per the "Q:" field in the ABC notation.- Returns:
-
setTempo
public void setTempo(String tempo)
-
addChord
public void addChord(int startTime, Chord chord)Adds a chord at the end of this score. The "startTime" is the time in 1/8 notes since the beginning of the score at which this chord is to be played. This makes it possible to hold the same chord over several notes in the music.- Parameters:
startTime-chord-
-
addWord
public void addWord(String word)
Adds a word to the end of the lyrics.- Parameters:
word-
-
getLyrics
public List<String> getLyrics()
Returns the lyrics of the song, as a list of words.- Returns:
-
getChordAtTime
public Chord getChordAtTime(int time)
Returns the chord that is played at the given time. Time is counted in 1/8 notes since the beginning of the score.- Parameters:
time-- Returns:
-
cloneWithoutNotes
public Score cloneWithoutNotes()
Returns a copy of this score with all the notes removed.- Returns:
-
foreachNoteAndChord
public void foreachNoteAndChord(int part, BiConsumer<Note,Chord> fn)Iterates over all the notes in the given part. With each note, the corresponding chord is passed to the given consumer "fn".- Parameters:
part-fn-
-
countNotes
public int countNotes(int part)
Counts the number of notes in the given part.- Parameters:
part-- Returns:
-
-