Module nwcNotePos

A supporting object class for note position data.

An object of this type contains all of the information from a single note position on a staff. Only non-default properties are generally contained in the object.

Type nwcNotePos

nwcNotePos.Accidental

Contains a character reflecting the accidental

nwcNotePos.Color

Contains the numeric color for the notehead

nwcNotePos:GetAccidentalPitchOffset()

Retrieves the relative MIDI pitch offset associated with any accidental on the position.

nwcNotePos:GetNoteName(clef)

Extract the note name for the position, given the clef provided.

nwcNotePos.ID

Contains the name of the object type (nwcNotePos)

nwcNotePos.Notehead

Contains a character reflecting the notehead

nwcNotePos.Position

Contains the numeric position for a note (required)

nwcNotePos.Tied

Set to true when the note position includes an outward tie

nwcNotePos:WriteUsing(writeFunc)

Standard output function with a user specified write function.

nwcNotePos:__tostring()

Provides an automatic converting to string.

nwcNotePos.new(fieldtxt)

Constructs a new nwcNotePos object.

Type nwcNotePos

Field(s)

#string nwcNotePos.Accidental

Contains a character reflecting the accidental

#number nwcNotePos.Color

Contains the numeric color for the notehead

nwcNotePos:GetAccidentalPitchOffset()

Retrieves the relative MIDI pitch offset associated with any accidental on the position.

The offset table looks like this: {v=-2,b=-1,n=0,['#']=1,x=2}

Return value

#string: An integer offset to be applied to MIDI pitch

nwcNotePos:GetNoteName(clef)

Extract the note name for the position, given the clef provided.

Parameter

  • #string clef : the clef type.

Return value

#string: A note name letter.

#string nwcNotePos.ID

Contains the name of the object type (nwcNotePos)

#string nwcNotePos.Notehead

Contains a character reflecting the notehead

#number nwcNotePos.Position

Contains the numeric position for a note (required)

#boolean nwcNotePos.Tied

Set to true when the note position includes an outward tie

nwcNotePos:WriteUsing(writeFunc)

Standard output function with a user specified write function.

Parameter

  • writeFunc : The function that will be used to write the pieces that constitute the reconstructed text.

nwcNotePos:__tostring()

Provides an automatic converting to string.

Return value

#string: the raw string representation of the object.

nwcNotePos.new(fieldtxt)

Constructs a new nwcNotePos object.

Parameter

  • #string fieldtxt : The raw note position text.

Return value

#nwcNotePos: A new nwcNotePos object.

Copyright © 2020 NoteWorthy Software™, Inc.
All Rights Reserved.