Class: Visitor

Visitor()

Creates AlphaTexStructure out of given AlphaTex using the AlphaTex.g4 grammar and generated files

Constructor

new Visitor()

Source:

Methods

createAndSetStr(attribute, value) → {AlphaTexStructure}

Creates a new AlphaTexStructure, sets the given attribute to the given value, and returns the new structure
Parameters:
Name Type Description
attribute string Attribute to be set
value string Value to set the attribute to
Source:
Returns:
AlphaTexStructure with the given attribute and value in its attributesStr
Type
AlphaTexStructure

getString(words) → {string}

Appends the array of strings together
Parameters:
Name Type Description
words Array.<string> Array of strings to be appended together
Source:
Returns:
The completed string appended together
Type
string

visitAlbumContext(ctx) → {AlphaTexStructure}

Collects album
Parameters:
Name Type Description
ctx object AlbumContext
Source:
Returns:
AlphaTexStructure with attribute album set to the album
Type
AlphaTexStructure

visitAlphaTexContext(ctx) → {AlphaTexStructure}

Visits the outermost layer of AlphaTex Copies resulting structures from visiting children
Parameters:
Name Type Description
ctx object Overall sheet music context
Source:
Returns:
Overall AlphaTexStructure
Type
AlphaTexStructure

visitArtistContext(ctx) → {AlphaTexStructure}

Collects artist
Parameters:
Name Type Description
ctx object ArtistContext
Source:
Returns:
AlphaTexStructure with attribute artist set to the artist
Type
AlphaTexStructure

visitBeatEffectsContext(ctx) → {AlphaTexStructure}

Collects effects including tuplet, dotted, crescendo, and decrescendo
Parameters:
Name Type Description
ctx object BeatEffectsContext
Source:
Returns:
AlphaTexStructure whose attributes are the beat effects
Type
AlphaTexStructure

visitCapoContext(ctx) → {AlphaTexStructure}

Collects capo
Parameters:
Name Type Description
ctx object CapoContext
Source:
Returns:
AlphaTexStructure with attribute capo set to the capo
Type
AlphaTexStructure

visitChildren(ctx) → {AlphaTexStructure}

Disbatches the given context to the correct function
Parameters:
Name Type Description
ctx object Given context
Source:
Returns:
The created AlphaTexStructure from the visit.
Type
AlphaTexStructure

visitChordContext(ctx) → {AlphaTexStructure}

Collects all the notes information for this chord
Parameters:
Name Type Description
ctx object ChordContext
Source:
Returns:
AlphaTexStructure with one track, one staff, one measure, one chord which has been filled.
Type
AlphaTexStructure

visitClefContext(ctx) → {AlphaTexStructure}

Collects clef
Parameters:
Name Type Description
ctx object ClefContext
Source:
Returns:
AlphaTexStructure with attribute clef set to the clef
Type
AlphaTexStructure

visitCopyrightContext(ctx) → {AlphaTexStructure}

Collects copyright
Parameters:
Name Type Description
ctx object CopyrightContext
Source:
Returns:
AlphaTexStructure with attribute copyright set to the copyright
Type
AlphaTexStructure

visitFullNoteContext(ctx) → {AlphaTexStructure}

Collects pitch and octave of note
Parameters:
Name Type Description
ctx object FullNoteContext
Source:
Returns:
AlphaTexStructure whose attributes are the pitch and octave
Type
AlphaTexStructure

visitInstrumentContext(ctx) → {AlphaTexStructure}

Collects instrument
Parameters:
Name Type Description
ctx object InstrumentContext
Source:
Returns:
AlphaTexStructure with attribute instrument set to the instrument
Type
AlphaTexStructure

visitKeySignatureContext(ctx) → {AlphaTexStructure}

Collects key signature
Parameters:
Name Type Description
ctx object KeySignatureContext
Source:
Returns:
AlphaTexStructure with attribute keySignature set to the key signature
Type
AlphaTexStructure

visitLyricsContext(ctx) → {AlphaTexStructure}

Collects lyrics
Parameters:
Name Type Description
ctx objrct LyricsContext
Source:
Returns:
AlphaTexStructure with attribute lyrics set to the lyrics
Type
AlphaTexStructure

visitMeasureContext(ctx) → {AlphaTexStructure}

Collects all data for this measure's context and stores it in the first track, first staff of the resulting object Copies fixed duration in measure over all notes without duration in measure
Parameters:
Name Type Description
ctx object MeasureContext
Source:
Returns:
AlphaTexStructure with one track, one staff, and one measure which was filled.
Type
AlphaTexStructure

visitMeasureDataContext(ctx) → {AlphaTexStructure}

Collects all data for each individual measuredata filling fixedDuration attribute if present
Parameters:
Name Type Description
ctx object MeasureDataContext
Source:
Returns:
AlphaTexStructure with one track, one staff, one measure which has been filled.
Type
AlphaTexStructure

visitMetadataContext(ctx) → {AlphaTexStructure}

Visits all of the children and copies their attributes into temporary structure before returning
Parameters:
Name Type Description
ctx object MetaDataContext
Source:
Returns:
AlphaTexStructure with metadata
Type
AlphaTexStructure

visitMusicContext(ctx) → {AlphaTexStructure}

Collects music
Parameters:
Name Type Description
ctx object MusicContext
Source:
Returns:
AlphaTexStructure with attribute music set to the music
Type
AlphaTexStructure

visitNoteContext(ctx) → {AlphaTexStructure}

Collects all note information
Parameters:
Name Type Description
ctx object NoteContext
Source:
Returns:
AlphaTexStructure with one track, one staff, one measure, one chord, one note which has been filled
Type
AlphaTexStructure

visitNoteOptionsContext(ctx) → {AlphaTexStructure}

Collects noteoptions including tied, dotted, crescendo, and decrescendo
Parameters:
Name Type Description
ctx object NoteOptionsContext
Source:
Returns:
AlphaTexStructure whose attributes are the noteoptions
Type
AlphaTexStructure

visitNoteTypeContext(ctx) → {AlphaTexStructure}

Collects notetype attributes
Parameters:
Name Type Description
ctx object NoteTypeContext
Source:
Returns:
AlphaTexStructure whose attributes are the notetype's attributes
Type
AlphaTexStructure

visitPitchContext(ctx) → {AlphaTexStructure}

Collects pitch information
Parameters:
Name Type Description
ctx object PitchContext
Source:
Returns:
AlphaTexStructure whose attributes are the pitch components
Type
AlphaTexStructure

visitStaffContext(ctx) → {AlphaTexStructure}

Copies the metadata for the staff and gets all of the chords for the measure, copies the fixed duration if present into all notes without duration.
Parameters:
Name Type Description
ctx object StaffContext
Source:
Returns:
AlphaTexStructure with one track whose one staff was filled
Type
AlphaTexStructure

visitStaffMetadataContext(ctx) → {AlphaTexStructure}

Visits and copies all staff metadata
Parameters:
Name Type Description
ctx object StaffMetadataContext
Source:
Returns:
AlphaTexStructure whose attributes are the staffs attributes
Type
AlphaTexStructure

visitSubtitleContext(ctx) → {AlphaTexStructure}

Collects subtitle
Parameters:
Name Type Description
ctx object SubtitleContext
Source:
Returns:
AlphaTexStructure with attribute subtitle set to the subtitle
Type
AlphaTexStructure

visitTempoContext(ctx) → {AlphaTexStructure}

Collects tempo
Parameters:
Name Type Description
ctx object TempoContext
Source:
Returns:
AlphaTexStructure with attribute tempo set to the tempo
Type
AlphaTexStructure

visitTimeSignatureContext(ctx) → {AlphaTexStructure}

Collects time signature
Parameters:
Name Type Description
ctx object TimeSignatureContext
Source:
Returns:
AlphaTexStructure with attribute tsTop set to the top of the time signature and tsBottom set to the bottom
Type
AlphaTexStructure

visitTitleContext(ctx) → {AlphaTexStructure}

Collects title
Parameters:
Name Type Description
ctx object TitleContext
Source:
Returns:
AlphaTexStructure with attribute title set to the title
Type
AlphaTexStructure

visitTrackContext(ctx) → {AlphaTexStructure}

Parses the track names and copies the trackMetaData after visit
Parameters:
Name Type Description
ctx object TrackContext
Source:
Returns:
AlphaTexStructure with one track which is the parsed track of this context
Type
AlphaTexStructure

visitTrackMetadataContext(ctx) → {AlphaTexStructure}

Visits and stores the staffs and tunings for this context
Parameters:
Name Type Description
ctx object TrackMetaDataContext
Source:
Returns:
AlphaTexStructure with one track whose TrackMetaData has been filled
Type
AlphaTexStructure

visitTuningContext(ctx) → {AlphaTexStructure}

Collects tuning
Parameters:
Name Type Description
ctx object TuningContext
Source:
Returns:
AlphaTexStructure with attribute tuning set to the tuning
Type
AlphaTexStructure

visitWordsContext(ctx) → {AlphaTexStructure}

Collects words
Parameters:
Name Type Description
ctx object WordsContext
Source:
Returns:
AlphaTexStructure with attribute words set to the words
Type
AlphaTexStructure