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)

CorpusWork

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

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 bases

DirectoryInformation read-only properties

Read-only properties inherited from ProtoM21Object:

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))])

Methods inherited from ProtoM21Object: