def createOtherRepetitions(self, attributes): r''' Repetitions like "Coda", "Segno" and some others. >>> nwt = noteworthy.translate.NoteworthyTranslator() >>> nwt.currentMeasure = stream.Measure() >>> nwt.createOtherRepetitions({"Style" : "ToCoda", "Pos": "8", ... "Wide":"Y","Placement":"BestFitForward"}) >>> "Coda" in nwt.currentMeasure[0].classes True ''' # DaCapoAlFine - Coda - Segno - ToCoda style = attributes['Style'] if style == "DCalFine": g = repeat.DaCapoAlFine() elif style == "Coda": g = repeat.Coda() elif style == "ToCoda": g = repeat.Coda() elif style == "Segno": g = repeat.Segno() elif style == "DSalCoda": g = repeat.DalSegnoAlCoda() elif style == "Fine": g = repeat.Fine() else: raise NoteworthyTranslateException('Cannot get style from %s' % str(attributes)) self.currentMeasure.append(g)
def createOtherRepetitions(self, attributes): r''' Repetitions like 'Coda', 'Segno' and some others. >>> nwt = noteworthy.translate.NoteworthyTranslator() >>> nwt.currentMeasure = stream.Measure() >>> nwt.createOtherRepetitions({'Style' : 'ToCoda', 'Pos': '8', ... 'Wide':'Y', 'Placement': 'BestFitForward'}) >>> 'Coda' in nwt.currentMeasure[0].classes True ''' # DaCapoAlFine - Coda - Segno - ToCoda style = attributes['Style'] if style == 'DCalFine': g = repeat.DaCapoAlFine() elif style == 'Coda': g = repeat.Coda() elif style == 'ToCoda': g = repeat.Coda() elif style == 'Segno': g = repeat.Segno() elif style == 'DSalCoda': g = repeat.DalSegnoAlCoda() elif style == 'Fine': g = repeat.Fine() else: raise NoteworthyTranslateException('Cannot get style from %s' % str(attributes)) self.currentMeasure.append(g)