music21.corpus.work

This is a lightweight module that stores information about individual corpus works.

CorpusFile

class music21.corpus.work.CorpusFile(path, title, filename, format, ext)

CorpusFile read-only properties

CorpusFile.ext

Alias for field number 4

CorpusFile.filename

Alias for field number 2

CorpusFile.format

Alias for field number 3

CorpusFile.path

Alias for field number 0

CorpusFile.title

Alias for field number 1

CorpusWork

class music21.corpus.work.CorpusWork(title, files, virtual)

CorpusWork read-only properties

CorpusWork.files

Alias for field number 1

CorpusWork.title

Alias for field number 0

CorpusWork.virtual

Alias for field number 2

DirectoryInformation

class music21.corpus.work.DirectoryInformation(dirName='', dirTitle='', isComposer=True, corpusObject=None)

returns information about a directory in a Corpus. Called from corpus.corpora.Corpus

only tested with CoreCorpus so far.

DirectoryInformation methods

DirectoryInformation.findWorks()

populate other information about the directory such as files and filenames.

>>> di = corpus.work.DirectoryInformation('schoenberg',
...             corpusObject=corpus.corpora.CoreCorpus())
>>> di.findWorks()
OrderedDict([(...'opus19', CorpusWork(title='Opus 19',
                               files=[CorpusFile(path='schoenberg/opus19/movement2.mxl',
                                                 title='Movement 2',
                                                 filename='movement2.mxl',
                                                 format='musicxml',
                                                 ext='.mxl'),
                                      CorpusFile(path='schoenberg/opus19/movement6.mxl',
                                                 title='Movement 6',
                                                 filename='movement6.mxl',
                                                 format='musicxml',
                                                 ext='.mxl')],
                                virtual=False))])