music21.braille.noteGrouping

NoteGroupingTranscriber

class music21.braille.noteGrouping.NoteGroupingTranscriber(brailleElementGrouping=None)

Object that can transcribe note groupings…

NoteGroupingTranscriber read/write properties

NoteGroupingTranscriber.showClefSigns

Generally, in Braille, clef signs are not used. However, they can be shown for pedagogical purposes or to make a facsimile transcription of the sighted text.

If not set but self.brailleElementGrouping.showClefSigns is set, uses that instead.

>>> ngt = braille.noteGrouping.NoteGroupingTranscriber()
>>> ngt.showClefSigns
False
>>> beg = braille.segment.BrailleElementGrouping()
>>> ngt.brailleElementGrouping = beg
>>> ngt.showClefSigns
False
>>> beg.showClefSigns = True
>>> ngt.showClefSigns
True
>>> ngt.showClefSigns = False
>>> ngt.showClefSigns
False
NoteGroupingTranscriber.upperFirstInFingering

When there are multiple fingering patterns listed at the same time, should the highest be listed first (default True) or last?

If not set but self.brailleElementGrouping.upperFirstInNoteFingering is set, uses that instead. (note the slight difference in names… NoteFingering)

>>> ngt = braille.noteGrouping.NoteGroupingTranscriber()
>>> ngt.upperFirstInFingering
True
>>> beg = braille.segment.BrailleElementGrouping()
>>> ngt.brailleElementGrouping = beg
>>> ngt.upperFirstInFingering
True
>>> beg.upperFirstInNoteFingering = False
>>> ngt.upperFirstInFingering
False
>>> ngt.upperFirstInFingering = True
>>> ngt.upperFirstInFingering
True

NoteGroupingTranscriber methods

NoteGroupingTranscriber.optionallyAddDotToPrevious(el=None)

if el is None or not a Dynamic or TextExpression, add a dot-3 Dot before the current transcription under certain circumstances:

  1. self.previousElement exists

  2. the last character in the current transcription (self.trans) fits the criteria for basic.yieldDots()

  3. one of these three. PreviousElement was…:
    1. a Dynamic.

    2. a Clef and clef signs are being transcribed

    3. a TextExpression not ending in “.”

Returns True if a dot as added, or False otherwise.

NoteGroupingTranscriber.reset()
NoteGroupingTranscriber.transcribeGroup(brailleElementGrouping=None)

transcribe a group of notes, possibly excluding certain attributes.

Returns a (unicode) string of brailleElementGrouping transcribed.

NoteGroupingTranscriber.transcribeOneElement(el)

Transcribe a single element and add it to self.trans, setting self.previousElement along the way.

>>> ngt = braille.noteGrouping.NoteGroupingTranscriber()
>>> n = note.Note('C4')
>>> ngt.transcribeOneElement(n)
>>> ''.join(ngt.trans)
'⠐⠹'
>>> ngt.previousElement
<music21.note.Note C>
NoteGroupingTranscriber.translateBarline(currentBarline)
NoteGroupingTranscriber.translateChord(currentChord)
NoteGroupingTranscriber.translateClef(currentClef)

translate Clefs to braille IF self.showClefSigns is True

NoteGroupingTranscriber.translateDynamic(currentDynamic)
NoteGroupingTranscriber.translateNote(currentNote)
NoteGroupingTranscriber.translateRest(currentRest)
NoteGroupingTranscriber.translateTextExpression(currentExpression)

Functions

music21.braille.noteGrouping.transcribeNoteGrouping(brailleElementGrouping, showLeadingOctave=True)

transcribe a group of notes, possibly excluding certain attributes.

To be DEPRECATED – called only be BrailleGrandSegment now.