def parseFile(self, fp, number=None): from music21.romanText import rtObjects from music21.romanText import translate as romanTextTranslate rtf = rtObjects.RTFile() # not sure why -- @UndefinedVariable rtf.open(fp) # returns a handler instance of parse tokens rtHandler = rtf.read() rtf.close() romanTextTranslate.romanTextToStreamScore(rtHandler, self.stream)
def parseData(self, strData, number=None): from music21.romanText import rtObjects from music21.romanText import translate as romanTextTranslate rtf = rtObjects.RTFile() # not sure why -- @UndefinedVariable rtHandler = rtf.readstr(strData) if rtHandler.definesMovements(): # this re-defines Score as an Opus self.stream = romanTextTranslate.romanTextToStreamOpus(rtHandler) else: romanTextTranslate.romanTextToStreamScore(rtHandler, self.stream)
def parseFile(self, fp, number=None): ''' ''' from music21 import romanText as romanTextModule from music21.romanText import translate as romanTextTranslate rtf = romanTextModule.RTFile() rtf.open(fp) # returns a handler instance of parse tokens rtHandler = rtf.read() rtf.close() romanTextTranslate.romanTextToStreamScore(rtHandler, self.stream)
def parseData(self, strData, number=None): ''' ''' from music21 import romanText as romanTextModule from music21.romanText import translate as romanTextTranslate rtf = romanTextModule.RTFile() rtHandler = rtf.readstr(strData) if rtHandler.definesMovements(): # this re-defines Score as an Opus self.stream = romanTextTranslate.romanTextToStreamOpus(rtHandler) else: romanTextTranslate.romanTextToStreamScore(rtHandler, self.stream)