org.herac.tuxguitar.io.abc.base
Class ABCSong

java.lang.Object
  extended byorg.herac.tuxguitar.io.abc.base.ABCSong

public class ABCSong
extends java.lang.Object


Field Summary
static int TICKS_PER_QUART
           
 
Constructor Summary
ABCSong()
           
 
Method Summary
 int addChord(java.lang.String name)
           
 void addHistory(java.lang.String string)
           
 void addLyrics(java.lang.String string)
           
 void addMacro(java.lang.String string)
           
 void addMusic(java.lang.String line)
           
 void addNote(java.lang.String string)
           
 void addRedefinable(java.lang.String string)
           
 void addRemarks(java.lang.String string)
           
 void addSymbols(java.lang.String string)
           
 void addTempoChange(ABCTempoChange tChange)
           
 void addTimeSignatureChange(ABCTimeSignatureChange tsChange)
           
 void addVoice(java.lang.String string)
           
 void addWords(java.lang.String string)
           
 int computePitch(ABCEvent event, char[] a)
           
 void directive(java.lang.String line)
           
 java.lang.String getBarkey()
           
 int getBassprog()
           
 int getBassvol()
           
 int getChordprog()
           
 ABCChord[] getChords()
           
 int getChordvol()
           
 ABCTimeSignature getDefaultNoteLength()
           
 java.lang.String getDrone()
           
 java.lang.String getDrum()
           
 java.util.ArrayList getEvents()
           
 java.lang.String getGchord()
           
 ABCInfo getInfo()
           
 int getKeySignature()
           
 int getMeasures()
           
 ABCRepeat[] getRepeats()
           
 int getStrings()
           
 int getTempo()
           
 int getTempo(int measure)
           
 ABCText[] getTexts()
           
 ABCTimeSignature getTimeSignature()
           
 ABCTimeSignature getTimeSignature(int measure)
           
 int getTrack()
           
 ABCTrack[] getTracks()
           
 int getVoice(java.lang.String string)
           
 void initBody()
           
 void initHead()
           
 boolean isDroneon()
           
 boolean isDrumon()
           
 boolean isGchordon()
           
 boolean isHornpipe()
           
 void midiCommand(java.lang.String line)
           
 void postprocessor()
           
 void resetScale()
           
 void setArea(java.lang.String string)
           
 void setArtist(java.lang.String string)
           
 void setBarkey(java.lang.String scale)
           
 void setBassprog(int bassprog)
           
 void setBassvol(int bassvol)
           
 void setBook(java.lang.String string)
           
 void setChord(int index, ABCChord chord)
           
 void setChordprog(int chordprog)
           
 void setChords(int length)
           
 void setChordvol(int chordvol)
           
 void setComments(java.lang.String string)
           
 void setComponist(java.lang.String string)
           
 void setDefaultNoteLength(ABCTimeSignature signature)
           
 void setDiscography(java.lang.String string)
           
 void setDrone(java.lang.String drone)
           
 void setDroneon(boolean droneon)
           
 void setDrum(java.lang.String drum)
           
 void setDrumon(boolean drumon)
           
 void setFilename(java.lang.String string)
           
 void setGchord(java.lang.String gchord)
           
 void setGchordon(boolean gchordon)
           
 void setGroup(java.lang.String string)
           
 ABCInfo setInfo(ABCInfo info)
           
 void setInformation(java.lang.String string)
           
 void setInstrumentOffset(int instrumentOffset)
           
 void setKey(java.lang.String string)
           
 void setOrigin(java.lang.String string)
           
 void setPart(java.lang.String string)
           
 void setParts(java.lang.String string)
           
 void setRepeat(int index, ABCRepeat repeat)
           
 void setRepeats(int length)
           
 void setRhythm(java.lang.String string)
          Abc also includes a rhythm field, R:, which is used for cataloguing and sorting collections of abc tunes: this is entirely free text (although there are obvious 'standard' entries eg R:reel, R:jig, R:schottische).
 void setSource(java.lang.String string)
           
 void setStrings(int strings)
           
 void setTempo(java.lang.String string)
           
 void setText(int index, ABCText text)
           
 void setTexts(int length)
           
 void setTimeSignature(ABCTimeSignature timeSignature)
           
 void setTitle(java.lang.String string)
           
 void setTrack(int index, ABCTrack track)
           
 void setTracks(int length)
           
 void setTranscriptor(java.lang.String string)
           
 void setVoice(java.lang.String string)
           
 void setX(int i)
           
 void sortEvents()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TICKS_PER_QUART

public static final int TICKS_PER_QUART
See Also:
Constant Field Values
Constructor Detail

ABCSong

public ABCSong()
Method Detail

getChords

public ABCChord[] getChords()

setChords

public void setChords(int length)

setChord

public void setChord(int index,
                     ABCChord chord)

getInfo

public ABCInfo getInfo()

setInfo

public ABCInfo setInfo(ABCInfo info)

getRepeats

public ABCRepeat[] getRepeats()

setRepeats

public void setRepeats(int length)

setRepeat

public void setRepeat(int index,
                      ABCRepeat repeat)

getTexts

public ABCText[] getTexts()

setTexts

public void setTexts(int length)

setText

public void setText(int index,
                    ABCText text)

getTracks

public ABCTrack[] getTracks()

setTracks

public void setTracks(int length)

setTrack

public void setTrack(int index,
                     ABCTrack track)

getTimeSignature

public ABCTimeSignature getTimeSignature()

setTimeSignature

public void setTimeSignature(ABCTimeSignature timeSignature)

getTempo

public int getTempo()

getStrings

public int getStrings()

setStrings

public void setStrings(int strings)

getMeasures

public int getMeasures()

addTempoChange

public void addTempoChange(ABCTempoChange tChange)

addTimeSignatureChange

public void addTimeSignatureChange(ABCTimeSignatureChange tsChange)

getTimeSignature

public ABCTimeSignature getTimeSignature(int measure)

getTempo

public int getTempo(int measure)

toString

public java.lang.String toString()

setTitle

public void setTitle(java.lang.String string)

setComments

public void setComments(java.lang.String string)

setArtist

public void setArtist(java.lang.String string)

setComponist

public void setComponist(java.lang.String string)

setArea

public void setArea(java.lang.String string)

setBook

public void setBook(java.lang.String string)

setDiscography

public void setDiscography(java.lang.String string)

setDefaultNoteLength

public void setDefaultNoteLength(ABCTimeSignature signature)

getDefaultNoteLength

public ABCTimeSignature getDefaultNoteLength()
Returns:
the defaultNoteLength

setFilename

public void setFilename(java.lang.String string)

setGroup

public void setGroup(java.lang.String string)

addHistory

public void addHistory(java.lang.String string)

setInformation

public void setInformation(java.lang.String string)

setKey

public void setKey(java.lang.String string)

resetScale

public void resetScale()

addNote

public void addNote(java.lang.String string)

setOrigin

public void setOrigin(java.lang.String string)

setParts

public void setParts(java.lang.String string)

setTempo

public void setTempo(java.lang.String string)

setRhythm

public void setRhythm(java.lang.String string)
Abc also includes a rhythm field, R:, which is used for cataloguing and sorting collections of abc tunes: this is entirely free text (although there are obvious 'standard' entries eg R:reel, R:jig, R:schottische).


setSource

public void setSource(java.lang.String string)

addWords

public void addWords(java.lang.String string)

setTranscriptor

public void setTranscriptor(java.lang.String string)

addRedefinable

public void addRedefinable(java.lang.String string)

addMacro

public void addMacro(java.lang.String string)

setX

public void setX(int i)

setPart

public void setPart(java.lang.String string)

addSymbols

public void addSymbols(java.lang.String string)
Parameters:
string -

Adding many symbols to a line of music can make a tune difficult to read.
In such cases, a symbol line (a line that contains only +...+ decorations and "..." chord symbols or annotations) can be used, analogous to a lyrics line.
A symbol line starts with s:, followed by a line of symbols.
Matching of notes and symbols follows the rules defined in section Lyrics.

 
	 Example: 
	   CDEF    | G'''AB'c
	s: "^slow" | +f+ ** +fff+
See Also:
addLyrics(String)

addLyrics

public void addLyrics(java.lang.String string)
Parameters:
string -

The w field (lowercase w) in the body, supplies a line of lyrics to be aligned syllable by syllable below the previous line of notes.
Syllables are not aligned on grace notes and tied notes are treated as two separate notes; slurred or beamed notes are also treated as separate notes in this context.
Note that lyrics are always aligned to the beginning of the preceding music line.
It is possible for a music line to be followed by several w fields.
This can be used together with the part notation to create verses.
The first w field is used the first time that part is played, then the second and so on.
The lyrics lines are treated as an ABC string.
Within the lyrics, the words should be separated by one or more spaces and to correctly align them the following symbols may be used:

SymbolMeaning
- (hyphen)break between syllables within a word
_ (underscore) last syllable is to be held for an extra note
* one note is skipped (i.e. * is equivalent to a blank syllable)
~ appears as a space; aligns multiple words under one note
\- appears as hyphen; aligns multiple syllables under one note
| advances to the next bar

Note that if - is preceded by a space or another hyphen, it is regarded as a separate syllable.
When an underscore is used next to a hyphen, the hyphen must always come first.
If there are not as many syllables as notes in a measure, typing a | automatically advances to the next bar; if there are enough syllables the '|' is just ignored.

Some examples:

 
	w: syll-a-ble    is aligned with three notes
	w: syll-a--ble   is aligned with four notes
	w: syll-a -ble   (equivalent to the previous line)
	w: time__        is aligned with three notes
	w: of~the~day    is treated as one syllable (i.e. aligned with one note)
	                 but appears as three separate words
	 gf|e2dc B2A2|B2G2 E2D2|.G2.G2 GABc|d4 B2
	w: Sa-ys my au-l' wan to your aul' wan\
	   Will~ye come to the Wa-x-ies dar-gle?

Please see section Continuation of input lines for the meaning of the backslash (\) character.

If a word starts with a digit, this is interpreted as numbering of a stanza and is pushed forward a bit.
In other words, use something like
w: 1.~Three blind mice
to put a number before Three.

See Also:
addSymbols(String)

addVoice

public void addVoice(java.lang.String string)

setVoice

public void setVoice(java.lang.String string)

addRemarks

public void addRemarks(java.lang.String string)

addMusic

public void addMusic(java.lang.String line)

getVoice

public int getVoice(java.lang.String string)

getBarkey

public java.lang.String getBarkey()

setBarkey

public void setBarkey(java.lang.String scale)

getEvents

public java.util.ArrayList getEvents()
Returns:
the events

addChord

public int addChord(java.lang.String name)

getBassprog

public int getBassprog()
Returns:
the bassprog

setBassprog

public void setBassprog(int bassprog)
Parameters:
bassprog - the bassprog to set

getBassvol

public int getBassvol()
Returns:
the bassvol

setBassvol

public void setBassvol(int bassvol)
Parameters:
bassvol - the bassvol to set

getChordprog

public int getChordprog()
Returns:
the chordprog

setChordprog

public void setChordprog(int chordprog)
Parameters:
chordprog - the chordprog to set

getChordvol

public int getChordvol()
Returns:
the chordvol

setChordvol

public void setChordvol(int chordvol)
Parameters:
chordvol - the chordvol to set

getDrone

public java.lang.String getDrone()
Returns:
the drone

setDrone

public void setDrone(java.lang.String drone)
Parameters:
drone - the drone to set

isDroneon

public boolean isDroneon()
Returns:
the droneon

setDroneon

public void setDroneon(boolean droneon)
Parameters:
droneon - the droneon to set

getDrum

public java.lang.String getDrum()
Returns:
the drum

setDrum

public void setDrum(java.lang.String drum)
Parameters:
drum - the drum to set

%%MIDI drum dzddd2dz 35 39 39 35 39 127 80 80 127 80 % Bass Drum 1 + Electric Snare


isDrumon

public boolean isDrumon()
Returns:
the drumon

setDrumon

public void setDrumon(boolean drumon)
Parameters:
drumon - the drumon to set

getGchord

public java.lang.String getGchord()
Returns:
the gchord

setGchord

public void setGchord(java.lang.String gchord)
Parameters:
gchord - the gchord to set

isGchordon

public boolean isGchordon()
Returns:
the gchordon

setGchordon

public void setGchordon(boolean gchordon)
Parameters:
gchordon - the gchordon to set

getTrack

public int getTrack()

getKeySignature

public int getKeySignature()
Returns:
the keySignature

midiCommand

public void midiCommand(java.lang.String line)

setInstrumentOffset

public void setInstrumentOffset(int instrumentOffset)
Parameters:
instrumentOffset - the instrumentOffset to set

postprocessor

public void postprocessor()

sortEvents

public void sortEvents()

initBody

public void initBody()

isHornpipe

public boolean isHornpipe()

initHead

public void initHead()

computePitch

public int computePitch(ABCEvent event,
                        char[] a)

directive

public void directive(java.lang.String line)
Parameters:
line -