Previous topic

music21.note

Next topic

music21.noteworthy.translate

Table Of Contents

Table Of Contents

This Page

music21.noteworthy.binaryTranslate

Attempts at reading pure .nwc files in music21

First will solve uncompressed .nwc then compressed .nwc

Thanks to Juria90 and the nwc2xml project for solving so many of the documentation problems. No part of this code is taken from that project, but this project would have been impossible without his work.

Translates .nwc into .nwctxt and then uses Jordi Guillen’s .nwctxt translator to go from there to music21.

NWCConverter

class music21.noteworthy.binaryTranslate.NWCConverter(*args, **keywords)

NWCConverter methods

NWCConverter.advanceToNotNUL(nul='x00')
NWCConverter.byteToInt(updateParsePosition=True)
NWCConverter.byteToSignedInt(updateParsePosition=True)
NWCConverter.dumpToNWCText()
NWCConverter.fileVersion(updateParsePosition=True)
NWCConverter.isValidNWCFile(updateParsePosition=True)
NWCConverter.parse()
NWCConverter.parseFile(fp=None)
NWCConverter.parseHeader()
NWCConverter.parseString(stringIn=None)
NWCConverter.readBytes(bytesToRead=1, updateParsePosition=True)
NWCConverter.readLEShort(updateParsePosition=True)

read a little-endian short value to an integer

NWCConverter.readToNUL(updateParsePosition=True)
NWCConverter.skipBytes(numBytes=1)
NWCConverter.toStream()

NWCObject

class music21.noteworthy.binaryTranslate.NWCObject(staffParent=None, parserParent=None)

NWCObject methods

NWCObject.barline()
NWCObject.clef()
NWCObject.dynamic()
NWCObject.dynamicVariation()
NWCObject.ending()
NWCObject.flowDir()
NWCObject.instrument()
NWCObject.keySig()
NWCObject.mpc()

what is this?

NWCObject.note()
NWCObject.noteChordMember()
NWCObject.parse()

determine what type of object I am, and set things accordingly

NWCObject.pedal()
NWCObject.performance()
NWCObject.rest()
NWCObject.restChordMember()
NWCObject.setDurationForObject()

get duration string for note or rest

NWCObject.tempo()
NWCObject.tempoVariation()
NWCObject.text()
NWCObject.timeSig()

NWCStaff

class music21.noteworthy.binaryTranslate.NWCStaff(parent=None)

NWCStaff methods

NWCStaff.dump()
NWCStaff.parse()
NWCStaff.parseHeader()
NWCStaff.parseLyrics()
NWCStaff.parseObjects()