abc.notation
Class Tune

java.lang.Object
  extended byabc.notation.Tune

public class Tune
extends java.lang.Object

This class encapsulates all information retrieved from a tune transcribed using abc notation : header and music.


Nested Class Summary
 class Tune.Score
           
 
Constructor Summary
Tune()
          Creates a new empty tune.
 
Method Summary
 void addHistory(java.lang.String history)
          Adds historical information about the tune.
 void addTitle(java.lang.String title)
          Adds a title to this tune.
 void addTranscriptionNotes(java.lang.String transciptionNotes)
          Adds notes about transcription of this tune.
 Part createPart(char partLabel)
          Creates a new part in this tune and returns it.
 java.lang.String getArea()
          Returns the area where this tune comes from.
 java.lang.String getBook()
          Returns the list of publications where this tune can be found.
 java.lang.String getComposer()
          Returns the composer of this tune.
 java.lang.String getDiscography()
          Returns recordings where this tune appears.
 int getElemskip()
           
 java.lang.String getGroup()
           
 java.lang.String getHistory()
          Returns historical information about the tune.
 java.lang.String getInformation()
          Returns additional information about the tune.
 KeySignature getKey()
          Returns the key signature of this tune.
 MultiPartsDefinition getMultiPartsDefinition()
          Returns the multi parts definition of this tune.
 java.lang.String getNotes()
          Returns notes concerning the transcription of this tune.
 java.lang.String getOrigin()
          Returns the origin of this tune.
 Part getPart(char partLabel)
          Returns the part of the tune identified by the given label.
 int getReferenceNumber()
          Returns the reference number of this tune.
 java.lang.String getRhythm()
          Returns the rhythm of this tune.
 Tune.Score getScore()
          Returns the score of this tune.
 java.lang.String getSource()
          Returns the source of this tune.
 java.lang.String[] getTitles()
          Returns the titles of this tune.
 java.lang.String getTranscriptionNotes()
          Returns transcription notes of this tune.
 void removeTitle(java.lang.String title)
          Removes one the titles of this tune.
 void setArea(java.lang.String area)
          Sets the geographic area where this tune comes from.
 void setBook(java.lang.String book)
          Sets the list of publications where this tune can be found.
 void setComposer(java.lang.String composer)
          Sets the composer of this tune.
 void setDiscography(java.lang.String discography)
          Sets recordings where this tune appears.
 void setElemskip(int value)
           
 void setGroup(java.lang.String value)
           
 void setInformation(java.lang.String information)
          Sets additional information about the tune.
 void setMultiPartsDefinition(MultiPartsDefinition multiPartsDef)
          Sets the multi parts definition of this tune.
 void setNotes(java.lang.String notes)
          Sets notes concerning the transcription of this tune.
 void setOrigin(java.lang.String origin)
          Sets the origin of this tune.
 void setReferenceNumber(int id)
          Sets the reference number of this tune.
 void setRhythm(java.lang.String rhythm)
          Sets the rhythm of this tune.
 void setSource(java.lang.String source)
          Sets the source of this tune.
 java.lang.String toString()
          Returns a string representation of this tune.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tune

public Tune()
Creates a new empty tune.

Method Detail

setArea

public void setArea(java.lang.String area)
Sets the geographic area where this tune comes from. Corresponds to the "A:" abc field. Ex: A:Donegal, A:Bampton

Parameters:
area - The area where this tune comes from.

getArea

public java.lang.String getArea()
Returns the area where this tune comes from.

Returns:
The area where this tune comes from. null if the area hasn't been specified.

setBook

public void setBook(java.lang.String book)
Sets the list of publications where this tune can be found. Corresponds to the "B:" abc field. Ex: B:O'Neills

Parameters:
book - The book where this tune comes from.

getBook

public java.lang.String getBook()
Returns the list of publications where this tune can be found.

Returns:
Returns the list of publications where this tune can be found, null if the book hasn't been specified.

setComposer

public void setComposer(java.lang.String composer)
Sets the composer of this tune. Corresponds to the "C:" abc field. Ex: C:Paddy Fahey

Parameters:
composer - The composer who wrotes this tune. For tunes known as traditional, you can use "traditional" as parameter so that that people don't think the composer has just been ignored.

getComposer

public java.lang.String getComposer()
Returns the composer of this tune.

Returns:
The composer of this tune, null if the composer hasn't been specified.

setDiscography

public void setDiscography(java.lang.String discography)
Sets recordings where this tune appears. Corresponds to the "D:" abc field. Ex: D:Gwenojenn

Parameters:
discography - Recordings where this tune appears.

getDiscography

public java.lang.String getDiscography()
Returns recordings where this tune appears.

Returns:
recordings where this tune appears, null if the discography hasn't been specified.

setElemskip

public void setElemskip(int value)

getElemskip

public int getElemskip()

setGroup

public void setGroup(java.lang.String value)

getGroup

public java.lang.String getGroup()

addHistory

public void addHistory(java.lang.String history)
Adds historical information about the tune. Corresponds to the "H:" abc field. Ex: H:Composed in 1930

Parameters:
history - Historical information about the tune to be added.

getHistory

public java.lang.String getHistory()
Returns historical information about the tune.

Returns:
Historical information about the tune, null if no historical information about the tune is provided.

getKey

public KeySignature getKey()
Returns the key signature of this tune.

Returns:
The key signature of this tune.

setInformation

public void setInformation(java.lang.String information)
Sets additional information about the tune.

Parameters:
information - Additional information about the tune.

getInformation

public java.lang.String getInformation()
Returns additional information about the tune.

Returns:
Additional information about the tune, null if no additional information about the tune is provided.

setNotes

public void setNotes(java.lang.String notes)
Sets notes concerning the transcription of this tune. Corresponds to the "N:" abc field. Ex: N:see also O'Neills - 234

Parameters:
notes - Notes concerning the transcription of this tune.

getNotes

public java.lang.String getNotes()
Returns notes concerning the transcription of this tune.

Returns:
Notes concerning the transcription of this tune, null if no transcription notes about the tune is provided.

setOrigin

public void setOrigin(java.lang.String origin)
Sets the origin of this tune. Corresponds to the "O:" abc field. Ex: O:Irish, O:English

Parameters:
origin - Origin of this tune : place or a person that the music came from. N.B: For a person, setSource is probably better.
See Also:
setSource(java.lang.String)

getOrigin

public java.lang.String getOrigin()
Returns the origin of this tune.

Returns:
The origin of this tune. null if no origin about the tune is provided.

getPart

public Part getPart(char partLabel)
Returns the part of the tune identified by the given label.

Parameters:
partLabel - A part label.
Returns:
The part of the tune identified by the given label, null if no part with the specified label exists in this tune.

createPart

public Part createPart(char partLabel)
Creates a new part in this tune and returns it.

Parameters:
partLabel - The label defining this new tune part.
Returns:
The new part properly labeled.

setMultiPartsDefinition

public void setMultiPartsDefinition(MultiPartsDefinition multiPartsDef)
Sets the multi parts definition of this tune.

Parameters:
multiPartsDef - The multi parts definition of this tune : defines how parts should be played.

getMultiPartsDefinition

public MultiPartsDefinition getMultiPartsDefinition()
Returns the multi parts definition of this tune.

Returns:
The multi parts definition of this tune. null is returned if this tuned isn't composed of several parts.

setRhythm

public void setRhythm(java.lang.String rhythm)
Sets the rhythm of this tune. Corresponds to the "R:" abc field. Ex: R:hornpipe

Parameters:
rhythm - Type of rhythm of this tune.
See Also:
getRhythm()

getRhythm

public java.lang.String getRhythm()
Returns the rhythm of this tune.

Returns:
The rhythm of this tune, null if no rhythm about the tune is provided.
See Also:
setRhythm(java.lang.String)

setSource

public void setSource(java.lang.String source)
Sets the source of this tune. Corresponds to the "S:" abc field. Ex: S:collected in Brittany

Parameters:
source - The source of this tune (place where it has been collected for ex).

getSource

public java.lang.String getSource()
Returns the source of this tune.

Returns:
The source of this tune. null if no source is provided.

addTitle

public void addTitle(java.lang.String title)
Adds a title to this tune. Corresponds to the "T:" abc field. Ex: T:Dansaone

Parameters:
title - A title for this tune.

removeTitle

public void removeTitle(java.lang.String title)
Removes one the titles of this tune.

Parameters:
title - The title to be removed of this tune.

getTitles

public java.lang.String[] getTitles()
Returns the titles of this tune.

Returns:
An array containing the titles of this tune. If this tune has no title, null is returned.

setReferenceNumber

public void setReferenceNumber(int id)
Sets the reference number of this tune.

Parameters:
id - The reference number of this tune.

getReferenceNumber

public int getReferenceNumber()
Returns the reference number of this tune.

Returns:
The reference number of this tune.

addTranscriptionNotes

public void addTranscriptionNotes(java.lang.String transciptionNotes)
Adds notes about transcription of this tune. Corresponds to the "Z:" abc field. Ex: Z:collected in Brittany

Parameters:
transciptionNotes - notes about about who did the ABC transcription : email addresses and URLs are appropriate here, and other contact information such as phone numbers or postal addresses may be included.

getTranscriptionNotes

public java.lang.String getTranscriptionNotes()
Returns transcription notes of this tune.

Returns:
Transcription notes of this tune.

getScore

public Tune.Score getScore()
Returns the score of this tune.

Returns:
The score of this tune. If this tune isn't composed of several parts this method returns the "normal" score. If this tune is composed of several parts the returned is generated so that the tune looks like a "single-part" one. If you want to retrieve the score related to each part separatly just do getPart(char partLabel).getScore().
See Also:
getPart(char)

toString

public java.lang.String toString()
Returns a string representation of this tune.

Returns:
A string representation of this tune.