Previous topic

music21.layout

Next topic

music21.lily.translate

Table Of Contents

Table Of Contents

music21.lily.lilyObjects

LyAlternativeMusic

Inherits from: LyObject

class music21.lily.lilyObjects.LyAlternativeMusic(musicList=None)

LyAlternativeMusic attributes

Attributes without Documentation: musicList

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyAlternativeMusic properties

Properties inherited from LyObject: newlineIndent

LyAlternativeMusic methods

LyAssignment

Inherits from: LyObject

class music21.lily.lilyObjects.LyAssignment(assignmentId=None, identifierInit=None, propertyPath=None, embeddedScm=None)

one of three forms of assignment:

assignment_id ‘=’ identifier_init assignment_id property_path ‘=’ identifier_init embedded_scm

if self.embeddedScm is not None, uses type 3 if self.propertyPath is not None, uses type 2 else uses type 1 or raises an exception.

>>> lyii = LyIdentifierInit(string = "hi")
>>> lya = LyAssignment(assignmentId = "title", identifierInit = lyii)
>>> print lya
title = "hi"

Note that you could also pass assignmentId a LyAssignmentId object, but that’s overkill for a lot of things.

LyAssignment attributes

Attributes without Documentation: identifierInit, assignmentId, propertyPath, embeddedScm

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyAssignment properties

Properties inherited from LyObject: newlineIndent

LyAssignment methods

LyAssignmentId

Inherits from: LyObject

class music21.lily.lilyObjects.LyAssignmentId(content=None, isLyricString=False)

LyAssignmentId attributes

Attributes without Documentation: content, isLyricString

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyAssignmentId properties

Properties inherited from LyObject: newlineIndent

LyAssignmentId methods

LyBookBlock

Inherits from: LyObject

class music21.lily.lilyObjects.LyBookBlock(bookBody=None)

LyBookBlock attributes

Attributes without Documentation: bookBody

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyBookBlock properties

Properties inherited from LyObject: newlineIndent

LyBookBlock methods

LyBookBody

Inherits from: LyObject

class music21.lily.lilyObjects.LyBookBody(contents=None, bookIdentifier=None)

Contains None, bookIdentifier (string?) or one or more of the following:

paperBlock bookPartBlock scoreBlock compositeMusic fullMarkup fullMarkupList lilypondHeader error

LyBookBody attributes

Attributes without Documentation: bookIdentifier, contents

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyBookBody properties

Properties inherited from LyObject: newlineIndent

LyBookBody methods

LyBookpartBlock

Inherits from: LyObject

class music21.lily.lilyObjects.LyBookpartBlock(bookpartBody=None)

LyBookpartBlock attributes

Attributes without Documentation: bookpartBody

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyBookpartBlock properties

Properties inherited from LyObject: newlineIndent

LyBookpartBlock methods

LyBookpartBody

Inherits from: LyObject

class music21.lily.lilyObjects.LyBookpartBody(contents=None, bookIdentifier=None)

Contains None, bookIdentifier (string?) or one or more of the following:

paperBlock scoreBlock compositeMusic fullMarkup fullMarkupList lilypondHeader error

LyBookpartBody attributes

Attributes without Documentation: bookIdentifier, contents

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyBookpartBody properties

Properties inherited from LyObject: newlineIndent

LyBookpartBody methods

LyChordBody

Inherits from: LyObject

class music21.lily.lilyObjects.LyChordBody(chordBodyElements=None)

LyChordBody attributes

Attributes without Documentation: chordBodyElements

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyChordBody properties

Properties inherited from LyObject: newlineIndent

LyChordBody methods

LyChordBodyElement

Inherits from: LyObject

class music21.lily.lilyObjects.LyChordBodyElement(parts=None)

Contains a note or a drum pitch or a music function:

chord_body_element: pitch
                      exclamations (a string of zero or more ! marks)
                      questions (a string of zero or more ? marks)
                      octave_check
                      post_events
                 | DRUM_PITCH post_events
                 | music_function_chord_body

TODO: only the first form is currently supported in creation

LyChordBodyElement attributes

Attributes without Documentation: parts

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyChordBodyElement properties

Properties inherited from LyObject: newlineIndent

LyChordBodyElement methods

LyCommandElement

Inherits from: LyObject

class music21.lily.lilyObjects.LyCommandElement(commandType=None, argument=None)

LyCommandElement attributes

Attributes without Documentation: commandType, argument

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyCommandElement properties

Properties inherited from LyObject: newlineIndent

LyCommandElement methods

LyCommandEvent

Inherits from: LyObject

class music21.lily.lilyObjects.LyCommandEvent(commandType=None, argument1=None, argument2=None)

LyCommandEvent attributes

Attributes without Documentation: commandType, argument2, argument1

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyCommandEvent properties

Properties inherited from LyObject: newlineIndent

LyCommandEvent methods

LyCompositeMusic

Inherits from: LyObject

class music21.lily.lilyObjects.LyCompositeMusic(prefixCompositeMusic=None, groupedMusicList=None)

one of LyPrefixCompositeMusic or LyGroupedMusicList stored in self.content

LyCompositeMusic attributes

Attributes without Documentation: prefixCompositeMusic, groupedMusicList

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyCompositeMusic properties

Properties inherited from LyObject: newlineIndent

LyCompositeMusic methods

LyContextChange

Inherits from: LyObject

class music21.lily.lilyObjects.LyContextChange(before=None, after=None)

LyContextChange attributes

Attributes without Documentation: alter, before

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyContextChange properties

Properties inherited from LyObject: newlineIndent

LyContextChange methods

LyContextDefMod

Inherits from: LyObject

class music21.lily.lilyObjects.LyContextDefMod(contextDef=None)

one of consists, remove, accepts, defaultchild, denies, alias, type, description, name

LyContextDefMod attributes

Attributes without Documentation: contextDef

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyContextDefMod properties

Properties inherited from LyObject: newlineIndent

LyContextDefMod methods

LyContextDefSpecBlock

Inherits from: LyObject

class music21.lily.lilyObjects.LyContextDefSpecBlock(contextDefSpecBody=None)

LyContextDefSpecBlock attributes

Attributes without Documentation: contextDefSpecBody

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyContextDefSpecBlock properties

Properties inherited from LyObject: newlineIndent

LyContextDefSpecBlock methods

LyContextDefSpecBody

Inherits from: LyObject

class music21.lily.lilyObjects.LyContextDefSpecBody(contextDefIdentifier=None, contextDefSpecBody=None, embeddedScm=None, contextMod=None, contextModification=None)

None or one of four forms:

CONTEXT_DEF_IDENTIFIER context_def_spec_body “grobdescriptions” embedded_scm context_def_spec_body context_mod context_def_spec_body context_modification

LyContextDefSpecBody attributes

Attributes without Documentation: contextDefIdentifier, contextMod, contextDefSpecBody, contextModification, embeddedScm

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyContextDefSpecBody properties

Properties inherited from LyObject: newlineIndent

LyContextDefSpecBody methods

LyContextMod

Inherits from: LyObject

class music21.lily.lilyObjects.LyContextMod(contextDefOrProperty=None, scalar=None)

LyContextMod attributes

Attributes without Documentation: scalar, contextDefOrProperty

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyContextMod properties

Properties inherited from LyObject: newlineIndent

LyContextMod methods

LyContextModList

Inherits from: LyObject

class music21.lily.lilyObjects.LyContextModList(contents=None, contextModIdentifier=None)

contains zero or more LyContextMod objects and an optional contextModIdentifier

LyContextModList attributes

Attributes without Documentation: contextModIdentifier, contents

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyContextModList properties

Properties inherited from LyObject: newlineIndent

LyContextModList methods

LyContextModification

Inherits from: LyObject

class music21.lily.lilyObjects.LyContextModification(contextModList=None, contextModIdentifier=None, displayWith=True)

represents both context_modification and optional_context_mod

but not context_mod!!!!!

LyContextModification attributes

Attributes without Documentation: contextModList, contextModIdentifier, displayWith

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyContextModification properties

Properties inherited from LyObject: newlineIndent

LyContextModification methods

LyDirectionLessEvent

Inherits from: LyObject

class music21.lily.lilyObjects.LyDirectionLessEvent(event=None)

represents [‘[‘,’]’,’~’,’(‘,’)’,’!’,’(‘,’)’,’>’,’<’] or an EVENT_IDENTIFIER or a tremolo_type

LyDirectionLessEvent attributes

Attributes without Documentation: event

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyDirectionLessEvent properties

Properties inherited from LyObject: newlineIndent

LyDirectionLessEvent methods

LyDirectionReqdEvent

Inherits from: LyObject

class music21.lily.lilyObjects.LyDirectionReqdEvent(event=None)

LyDirectionReqdEvent attributes

Attributes without Documentation: event

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyDirectionReqdEvent properties

Properties inherited from LyObject: newlineIndent

LyDirectionReqdEvent methods

LyEmbeddedScm

Inherits from: LyObject

class music21.lily.lilyObjects.LyEmbeddedScm(content=None)

represents Scheme embedded in Lilypond code.

Can be either a SCM_TOKEN (Scheme Token) or SCM_IDENTIFIER String stored in self.content

Note that if any LyEmbeddedScm is found in an output then the output SHOULD be marked as unsafe. But a lot of standard lilypond functions are actually embedded scheme. For instance, clef, which as http://lilypond.org/doc/v2.12/input/lsr/lilypond-snippets/Pitches#Tweaking-clef-properties shows is a macro to run a lot of set commands.

LyEmbeddedScm attributes

Attributes without Documentation: content

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyEmbeddedScm properties

Properties inherited from LyObject: newlineIndent

LyEmbeddedScm methods

LyEventChord

Inherits from: LyObject

class music21.lily.lilyObjects.LyEventChord(simpleChordElements=None, postEvents=None, chordRepetition=None, multiMeasureRest=None, duration=None, commandElement=None, noteChordElement=None)

takes all the parts as a list of up to three elements

event_chord: simple_chord_elements post_events
CHORD_REPETITION optional_notemode_duration post_events
MULTI_MEASURE_REST optional_notemode_duration post_events
command_element
note_chord_element

simple_chord_elements can be a LySimpleElement object. Or it can be a LyNewChord or LyFigureSpec + Duration once that is done. But there is no LySimpleChordElements object yet.

LyEventChord attributes

Attributes without Documentation: commandElement, noteChordElement, chordRepetition, postEvents, simpleChordElements, duration, multiMeasureRest

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyEventChord properties

Properties inherited from LyObject: newlineIndent

LyEventChord methods

LyFullMarkup

Inherits from: LyObject

class music21.lily.lilyObjects.LyFullMarkup

LyFullMarkupList

Inherits from: LyObject

class music21.lily.lilyObjects.LyFullMarkupList

LyGenTextDef

Inherits from: LyObject

class music21.lily.lilyObjects.LyGenTextDef(value=None)

holds either full_markup, string, or DIGIT

LyGenTextDef attributes

Attributes without Documentation: value

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyGenTextDef properties

Properties inherited from LyObject: newlineIndent

LyGenTextDef methods

LyGroupedMusicList

Inherits from: LyObject

class music21.lily.lilyObjects.LyGroupedMusicList(simultaneousMusic=None, sequentialMusic=None)

one of LySimultaneousMusic or LySequentialMusic

LyGroupedMusicList attributes

Attributes without Documentation: sequentialMusic, simultaneousMusic

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyGroupedMusicList properties

Properties inherited from LyObject: newlineIndent

LyGroupedMusicList methods

LyIdentifierInit

Inherits from: LyObject

class music21.lily.lilyObjects.LyIdentifierInit(scoreBlock=None, bookBlock=None, bookPartBlock=None, outputDef=None, contextDefSpecBlock=None, music=None, postEvent=None, numberExpression=None, string=None, embeddedScm=None, fullMarkup=None, fullMarkupList=None, digit=None, contextModification=None)
>>> lyii = LyIdentifierInit(string = "hello")
>>> print lyii
"hello"

LyIdentifierInit attributes

Attributes without Documentation: digit, outputDef, scoreBlock, fullMarkup, fullMarkupList, numberExpression, bookBlock, bookPartBlock, music, contextModification, postEvent, embeddedScm, string, contextDefSpecBlock

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyIdentifierInit properties

Properties inherited from LyObject: newlineIndent

LyIdentifierInit methods

LyLilypondHeader

Inherits from: LyObject

class music21.lily.lilyObjects.LyLilypondHeader(lilypondHeaderBody=None)

LyLilypondHeader attributes

Attributes without Documentation: lilypondHeaderBody

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyLilypondHeader properties

Properties inherited from LyObject: newlineIndent

LyLilypondHeader methods

LyLilypondHeaderBody

Inherits from: LyObject

class music21.lily.lilyObjects.LyLilypondHeaderBody(assignments=None)

LyLilypondHeaderBody attributes

Attributes without Documentation: assignments

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyLilypondHeaderBody properties

Properties inherited from LyObject: newlineIndent

LyLilypondHeaderBody methods

LyLilypondTop

Inherits from: LyObject

class music21.lily.lilyObjects.LyLilypondTop(contents=None)

corresponds to the highest level lilypond object in Appendix C:

`lilypond: /* empty */
       | lilypond toplevel_expression
       | lilypond assignment
       | lilypond error
       | lilypond "\invalid"`

error and invalid are not defined by music21

LyLilypondTop attributes

Attributes without Documentation: canContain, contents

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyLilypondTop properties

Properties inherited from LyObject: newlineIndent

LyLilypondTop methods

LyLyricElement

Inherits from: LyObject

class music21.lily.lilyObjects.LyLyricElement(lyMarkupOrString=None)

LyLyricElement attributes

Attributes without Documentation: lyMarkupOrString

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyLyricElement properties

Properties inherited from LyObject: newlineIndent

LyLyricElement methods

LyLyricMarkup

Inherits from: LyObject

class music21.lily.lilyObjects.LyLyricMarkup

LyMarkup

Inherits from: LyObject

class music21.lily.lilyObjects.LyMarkup(simpleMarkup=None, optionalMarkupHeadList=None)

LyMarkup attributes

Attributes without Documentation: optionalMarkupHeadList, simpleMarkup

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyMarkup properties

Properties inherited from LyObject: newlineIndent

LyMarkup methods

LyMarkupBracedList

Inherits from: LyObject

class music21.lily.lilyObjects.LyMarkupBracedList(listBody=None)

LyMarkupBracedList attributes

Attributes without Documentation: listBody

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyMarkupBracedList properties

Properties inherited from LyObject: newlineIndent

LyMarkupBracedList methods

LyMarkupBracedListBody

Inherits from: LyObject

class music21.lily.lilyObjects.LyMarkupBracedListBody(markupOrMarkupList=None)

LyMarkupBracedListBody attributes

Attributes without Documentation: markupOrMarkupList

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyMarkupBracedListBody properties

Properties inherited from LyObject: newlineIndent

LyMarkupBracedListBody methods

LyMarkupComposedList

Inherits from: LyObject

class music21.lily.lilyObjects.LyMarkupComposedList(markupHeadList=None, markupBracedList=None)

LyMarkupComposedList attributes

Attributes without Documentation: markupHeadList, markupBracedList

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyMarkupComposedList properties

Properties inherited from LyObject: newlineIndent

LyMarkupComposedList methods

LyMarkupList

Inherits from: LyObject

class music21.lily.lilyObjects.LyMarkupList(markupIdentifierOrList=None)

LyMarkupList attributes

Attributes without Documentation: markupIdentifierOrList

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyMarkupList properties

Properties inherited from LyObject: newlineIndent

LyMarkupList methods

LyMarkupTop

Inherits from: LyObject

class music21.lily.lilyObjects.LyMarkupTop(argument1=None, argument2=None)

LyMarkupTop attributes

Attributes without Documentation: argument2, argument1

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyMarkupTop properties

Properties inherited from LyObject: newlineIndent

LyMarkupTop methods

LyMock

Inherits from: LyObject

class music21.lily.lilyObjects.LyMock

A test object for trying various music21 to Lily conversions

LyModeChangingHead

Inherits from: LyObject

class music21.lily.lilyObjects.LyModeChangingHead(hasContext=False, mode=None)

represents both mode_changing_head and mode_changing_head_with_context

.hasContext = False .mode = [‘note’, ‘drum’, ‘figure’, ‘chord’, ‘lyric’]

>>> l = LyModeChangingHead(hasContext = True, mode = 'drum')
>>> print l.stringOutput()
\drummode
>>> l2 = LyModeChangingHead(hasContext = False, mode = 'chord')
>>> print l2.stringOutput()
\chords

LyModeChangingHead attributes

Attributes without Documentation: allowableModes, hasContext, mode

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyModeChangingHead properties

Properties inherited from LyObject: newlineIndent

LyModeChangingHead methods

LyMultipliedDuration

Inherits from: LyObject

class music21.lily.lilyObjects.LyMultipliedDuration(stenoDur=None, multiply=None)

represents either a simple LyStenoDuration or a list of things that the steno duration should be multiplied by.

if stenoDur is None then output is None – thus also represents optional_notemode_duration

LyMultipliedDuration attributes

Attributes without Documentation: stenoDur, multiply

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyMultipliedDuration properties

Properties inherited from LyObject: newlineIndent

LyMultipliedDuration methods

LyMusic

Inherits from: LyObject

class music21.lily.lilyObjects.LyMusic(simpleMusic=None, compositeMusic=None)

LyMusic attributes

Attributes without Documentation: simpleMusic, compositeMusic

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyMusic properties

Properties inherited from LyObject: newlineIndent

LyMusic methods

LyMusicList

Inherits from: LyObject

class music21.lily.lilyObjects.LyMusicList(contents=None)

can take any number of LyMusic, LyEmbeddedScm, or LyError objects

LyMusicList attributes

Attributes without Documentation: contents

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyMusicList properties

Properties inherited from LyObject: newlineIndent

LyMusicList methods

LyMusicPropertyDef

Inherits from: LyObject

class music21.lily.lilyObjects.LyMusicPropertyDef(isOnce=False, propertyDef=None)

LyMusicPropertyDef attributes

Attributes without Documentation: propertyDef, isOnce

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyMusicPropertyDef properties

Properties inherited from LyObject: newlineIndent

LyMusicPropertyDef methods

LyNewLyrics

Inherits from: LyObject

class music21.lily.lilyObjects.LyNewLyrics(groupedMusicLists=None)

contains a list of LyGroupedMusicList objects or identifiers

LyNewLyrics attributes

Attributes without Documentation: groupedMusicLists

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyNewLyrics properties

Properties inherited from LyObject: newlineIndent

LyNewLyrics methods

LyNoteChordElement

Inherits from: LyObject

class music21.lily.lilyObjects.LyNoteChordElement(chordBody=None, optionalNoteModeDuration=None, postEvents=None)

LyNoteChordElement attributes

Attributes without Documentation: postEvents, chordBody, optionalNoteModeDuration

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyNoteChordElement properties

Properties inherited from LyObject: newlineIndent

LyNoteChordElement methods

LyNumberExpression

Inherits from: LyObject

class music21.lily.lilyObjects.LyNumberExpression(numberAndSepList=None)

any list of numbers or LyNumberTerms separated by ‘+’ or ‘-‘ objects.

LyNumberExpression attributes

Attributes without Documentation: numberAndSepList

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyNumberExpression properties

Properties inherited from LyObject: newlineIndent

LyNumberExpression methods

LyNumberTerm

Inherits from: LyObject

class music21.lily.lilyObjects.LyNumberTerm(numberAndSepList=None)

any list of numbers separated by ‘*’ or ‘/’ strings.

LyNumberTerm attributes

Attributes without Documentation: numberAndSepList

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyNumberTerm properties

Properties inherited from LyObject: newlineIndent

LyNumberTerm methods

LyObject

class music21.lily.lilyObjects.LyObject

LyObject attributes

Attributes without Documentation: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyObject properties

newlineIndent

No documentation.

LyObject methods

ancestorList()

returns a list of all unwrapped parent objects for the current object

comment(stringIn)

returns a comment that is %{ stringIn.strip() %}

Don’t put %} etc. in comments. That’s just rude...

encloseCurly(arg)

No documentation.

getAncestorByClass(classObj, getAncestorNumber=1)

No documentation.

getFirstNonNoneAttribute(attributeList)

No documentation.

getParent()

No documentation.

newlineSeparateStringOutputIfNotNone(contents)

No documentation.

quoteString(stringIn)

returns a string that is quoted with internal quotation marks backslash’d out and an extra space at the end.

>>> m = LyObject()
>>> print m.quoteString(r'Hello "there"!')
"Hello \"there\"!"
setAttributes(m21Object)

Returns a dictionary and sets self.lilyAttributes to that dictionary, for a m21Object of class classLookup using the mapping of self.m21toLy[classLookup]

>>> from music21 import *
>>> class Mock(base.Music21Object): pass
>>> m = Mock()
>>> m.mockAttribute = 32
>>> m.mockAttribute2 = None

>>> lm = LyMock()

LyMock (our test class) defines mappings for two classes: to LyMock.lilyAttributes:

>>> print lm.supportedClasses
[u'Mock', u'Mocker']

Thus we can get attributes from the Mock class (see setAttributesFromClassObject):

>>> lilyAttributes = lm.setAttributes(m)
>>> for x in sorted(lilyAttributes.keys()):
...    print "%s: %s" % (x, lilyAttributes[x])
mock-attribute: 32
mock-attribute-2: None

>>> lilyAttributes is lm.lilyAttributes
True
setAttributesFromClassObject(classLookup, m21Object)

Returns a dictionary and sets self.lilyAttributes to that dictionary, for a m21Object of class classLookup using the mapping of self.m21toLy[classLookup]

>>> from music21 import *
>>> class Mock(base.Music21Object): pass
>>> m = Mock()
>>> lm = LyMock()

LyMock (our test class) defines certain mappings from the m21 Mock class to LyMock.lilyAttributes:

>>> for x in sorted(lm.m21toLy['Mock'].keys()):
...    print "%s: %s" % (x, lm.m21toLy['Mock'][x])
mockAttribute: mock-attribute
mockAttribute2: mock-attribute-2

Some of these attributes have defaults:

>>> for x in sorted(lm.defaultAttributes.keys()):
...    print "%s: %s" % (x, lm.defaultAttributes[x])
mockAttribute2: 7
>>> m.mockAttribute = "hello"
>>> lilyAttributes = lm.setAttributesFromClassObject('Mock', m)
>>> for x in sorted(lilyAttributes.keys()):
...    print "%s: %s" % (x, lilyAttributes[x])
mock-attribute: hello
mock-attribute-2: 7

>>> lilyAttributes is lm.lilyAttributes
True
setParent(parentObject)

No documentation.

stringOutput()

No documentation.

LyOctaveCheck

Inherits from: LyObject

class music21.lily.lilyObjects.LyOctaveCheck(equalOrQuotesOrNone=None)

LyOctaveCheck attributes

Attributes without Documentation: equalOrQuotesOrNone

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyOctaveCheck properties

Properties inherited from LyObject: newlineIndent

LyOctaveCheck methods

LyOptionalId

Inherits from: LyObject

class music21.lily.lilyObjects.LyOptionalId(content=None)

an optional id setting

LyOptionalId attributes

Attributes without Documentation: content

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyOptionalId properties

Properties inherited from LyObject: newlineIndent

LyOptionalId methods

LyOptionalRest

Inherits from: LyObject

class music21.lily.lilyObjects.LyOptionalRest(rest=False)

LyOptionalRest attributes

Attributes without Documentation: rest

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyOptionalRest properties

Properties inherited from LyObject: newlineIndent

LyOptionalRest methods

LyOutputDef

Inherits from: LyObject

class music21.lily.lilyObjects.LyOutputDef(outputDefBody=None)

ugly grammar since it doesnt close curly bracket...

LyOutputDef attributes

Attributes without Documentation: outputDefBody

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyOutputDef properties

Properties inherited from LyObject: newlineIndent

LyOutputDef methods

LyOutputDefBody

Inherits from: LyObject

class music21.lily.lilyObjects.LyOutputDefBody(outputDefHead=None, outputDefIdentifier=None, outputDefBody=None, assignment=None, contextDefSpecBlock=None, error=None)
output_def_body: output_def_head_with_mode_switch ‘{‘
output_def_head_with_mode_switch ‘{‘ OUTPUT_DEF_IDENTIFIER
output_def_body assignment
output_def_body context_def_spec_block
output_def_body error

LyOutputDefBody attributes

Attributes without Documentation: assignment, outputDefBody, outputDefIdentifier, outputDefHead, error, contextDefSpecBlock

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyOutputDefBody properties

Properties inherited from LyObject: newlineIndent

LyOutputDefBody methods

LyOutputDefHead

Inherits from: LyObject

class music21.lily.lilyObjects.LyOutputDefHead(defType=None)

defType can be paper, midi, or layout.

>>> lyODH = LyOutputDefHead()
>>> lyODH.defType = 'midi'
>>> print lyODH.stringOutput()
\midi

According to Appendix C, is the same as LyOutputDefHeadWithModeSwitch

LyOutputDefHead attributes

Attributes without Documentation: defType

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyOutputDefHead properties

Properties inherited from LyObject: newlineIndent

LyOutputDefHead methods

LyPaperBlock

Inherits from: LyObject

class music21.lily.lilyObjects.LyPaperBlock(outputDef=None)

LyPaperBlock attributes

Attributes without Documentation: outputDef

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyPaperBlock properties

Properties inherited from LyObject: newlineIndent

LyPaperBlock methods

LyPitch

Inherits from: LyObject

class music21.lily.lilyObjects.LyPitch(noteNamePitch=None, quotes=None)

represents a pitch name and zero or more sup or sub quotes also used for steno_pitch and steno_tonic_pitch

LyPitch attributes

Attributes without Documentation: noteNamePitch, quotes

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyPitch properties

Properties inherited from LyObject: newlineIndent

LyPitch methods

LyPostEvent

Inherits from: LyObject

class music21.lily.lilyObjects.LyPostEvent(arg1=None, arg2=None)

LyPostEvent attributes

Attributes without Documentation: arg1, arg2

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyPostEvent properties

Properties inherited from LyObject: newlineIndent

LyPostEvent methods

LyPostEvents

Inherits from: LyObject

class music21.lily.lilyObjects.LyPostEvents(eventList=None)

LyPostEvents attributes

Attributes without Documentation: eventList

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyPostEvents properties

Properties inherited from LyObject: newlineIndent

LyPostEvents methods

LyPrefixCompositeMusic

Inherits from: LyObject

class music21.lily.lilyObjects.LyPrefixCompositeMusic(type=None, genericPrefixMusicScm=None, simpleString=None, optionalId=None, optionalContextMod=None, music=None, fraction=None, repeatedMusic=None, pitchAlsoInChords1=None, pitchAlsoInChords2=None, modeChangingHead=None, groupedMusicList=None, modeChangingHeadWithContext=None, relativeMusic=None, reRhythmedMusic=None)

type must be specified. Should be one of:

scheme, context, new, times, repeated, transpose, modeChanging, modeChangingWith, relative, rhythmed

prefix_composite_music: generic_prefix_music_scm
“context” simple_string optional_id optional_context_mod music
“new” simple_string optional_id optional_context_mod music
“times” fraction music
repeated_music
“transpose” pitch_also_in_chords pitch_also_in_chords music
mode_changing_head grouped_music_list
mode_changing_head_with_context optional_context_mod grouped_music_list
relative_music
re_rhythmed_music

LyPrefixCompositeMusic attributes

Attributes without Documentation: pitchAlsoInChords2, pitchAlsoInChords1, modeChangingHead, modeChangingHeadWithContext, simpleString, groupedMusicList, optionalId, reRhythmedMusic, music, fraction, relativeMusic, repeatedMusic, type, optionalContextMod, genericPrefixMusicScm

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyPrefixCompositeMusic properties

Properties inherited from LyObject: newlineIndent

LyPrefixCompositeMusic methods

LyPropertyOperation

Inherits from: LyObject

class music21.lily.lilyObjects.LyPropertyOperation(mode=None, value1=None, value2=None, value3=None)

Represents:

property_operation: STRING ‘=’ scalar
“\unset” simple_string
“override” simple_string property_path ‘=’ scalar
“revert” simple_string embedded_scm

manditory mode in [‘set’, ‘unset’, ‘override’, ‘revert’]

also represents simple_music_property_def which has the same forms

LyPropertyOperation attributes

Attributes without Documentation: mode, value3, value2, value1

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyPropertyOperation properties

Properties inherited from LyObject: newlineIndent

LyPropertyOperation methods

LyPropertyPath

Inherits from: LyObject

class music21.lily.lilyObjects.LyPropertyPath(embeddedScheme=None)

represents both property_path and property_path_revved

has one or more of LyEmbeddedScm objects

LyPropertyPath attributes

Attributes without Documentation: embeddedScheme

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyPropertyPath properties

Properties inherited from LyObject: newlineIndent

LyPropertyPath methods

LyReRhythmedMusic

Inherits from: LyObject

class music21.lily.lilyObjects.LyReRhythmedMusic(groupedMusic=None, newLyrics=None)

LyReRhythmedMusic attributes

Attributes without Documentation: newLyrics, groupedMusic

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyReRhythmedMusic properties

Properties inherited from LyObject: newlineIndent

LyReRhythmedMusic methods

LyRelativeMusic

Inherits from: LyObject

class music21.lily.lilyObjects.LyRelativeMusic(content=None)

relative music

LyRelativeMusic attributes

Attributes without Documentation: content

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyRelativeMusic properties

Properties inherited from LyObject: newlineIndent

LyRelativeMusic methods

LyRepeatedMusic

Inherits from: LyObject

class music21.lily.lilyObjects.LyRepeatedMusic(simpleString=None, unsignedNumber=None, music=None, alternativeMusic=None)

LyRepeatedMusic attributes

Attributes without Documentation: unsignedNumber, alternativeMusic, simpleString, music

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyRepeatedMusic properties

Properties inherited from LyObject: newlineIndent

LyRepeatedMusic methods

LySchemeFunction

Inherits from: LyObject

class music21.lily.lilyObjects.LySchemeFunction(content=None)

Unsupported for now, represents all of:

function_scm_argument: embedded_scm
  116                      | simple_string

  117 function_arglist_music_last: EXPECT_MUSIC function_arglist music

  118 function_arglist_nonmusic_last: EXPECT_MARKUP
                                        function_arglist
                                        full_markup
  119                               | EXPECT_MARKUP
                                        function_arglist
                                        simple_string
  120                               | EXPECT_SCM
                                        function_arglist
                                        function_scm_argument

  121 function_arglist_nonmusic: EXPECT_NO_MORE_ARGS
  122                          | EXPECT_MARKUP
                                   function_arglist_nonmusic
                                   full_markup
  123                          | EXPECT_MARKUP
                                   function_arglist_nonmusic
                                   simple_string
  124                          | EXPECT_SCM
                                   function_arglist_nonmusic
                                   function_scm_argument

  125 function_arglist: EXPECT_NO_MORE_ARGS
  126                 | function_arglist_music_last
  127                 | function_arglist_nonmusic_last

  128 generic_prefix_music_scm: MUSIC_FUNCTION function_arglist

We have ususally been using LyEmbeddedScm for this

LySchemeFunction attributes

Attributes without Documentation: content

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LySchemeFunction properties

Properties inherited from LyObject: newlineIndent

LySchemeFunction methods

LyScoreBlock

Inherits from: LyObject

class music21.lily.lilyObjects.LyScoreBlock(scoreBody=None)

represents the container for a score ( score { ... } )

with all the real stuff being in self.scoreBody

>>> lysb = LyScoreBlock(scoreBody = "hello")
>>> print lysb
\score { hello }

LyScoreBlock attributes

Attributes without Documentation: scoreBody

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyScoreBlock properties

Properties inherited from LyObject: newlineIndent

LyScoreBlock methods

LyScoreBody

Inherits from: LyObject

class music21.lily.lilyObjects.LyScoreBody(music=None, scoreIdentifier=None, scoreBody=None, lilypondHeader=None, outputDef=None, error=None)

represents the contents of a score { ...contents... } block

can take one of the following attributes: music, scoreIdentifier, scoreBody, lilypondHeader, outputDef, error

LyScoreBody attributes

Attributes without Documentation: scoreIdentifier, outputDef, lilypondHeader, scoreBody, music, error

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyScoreBody properties

Properties inherited from LyObject: newlineIndent

LyScoreBody methods

LyScriptAbbreviation

Inherits from: LyObject

class music21.lily.lilyObjects.LyScriptAbbreviation(value=None)

Holds a script abbreviation (for articulations etc.), one of:

^ + - | > . _

LyScriptAbbreviation attributes

Attributes without Documentation: value

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyScriptAbbreviation properties

Properties inherited from LyObject: newlineIndent

LyScriptAbbreviation methods

LyScriptDir

Inherits from: LyObject

class music21.lily.lilyObjects.LyScriptDir(value=None)

Holds a script direction abbreviation (above below etc), one of:

_ ^ -

LyScriptDir attributes

Attributes without Documentation: value

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyScriptDir properties

Properties inherited from LyObject: newlineIndent

LyScriptDir methods

LySequentialMusic

Inherits from: LyObject

class music21.lily.lilyObjects.LySequentialMusic(musicList=None, displayTag=False)

represents sequential music.

Can be explicitly tagged with “sequential” if displayTag is True

LySequentialMusic attributes

Attributes without Documentation: musicList, displayTag

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LySequentialMusic properties

Properties inherited from LyObject: newlineIndent

LySequentialMusic methods

LySimpleElement

Inherits from: LyObject

class music21.lily.lilyObjects.LySimpleElement(parts=None)

A single note, lyric element, drum pitch or hidden rest:

simple_element: pitch
                exclamations (a string of zero or more ! marks)
                questions (a string of zero or more ? marks)
                octave_check
                optional_notemode_duration
                optional_rest
            | DRUM_PITCH optional_notemode_duration
            | RESTNAME optional_notemode_duration
            | lyric_element optional_notemode_duration

LySimpleElement attributes

Attributes without Documentation: parts

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LySimpleElement properties

Properties inherited from LyObject: newlineIndent

LySimpleElement methods

LySimpleMarkup

Inherits from: LyObject

class music21.lily.lilyObjects.LySimpleMarkup(simpleType='string', argument1=None, argument2=None)

simpleType can be ‘string’ (or markup identifier or lyric markup identifier, etc.) or ‘score-body’ or ‘markup-function’

takes 1 required arg, 2nd for markup_function

LySimpleMarkup attributes

Attributes without Documentation: simpleType, argument2, argument1

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LySimpleMarkup properties

Properties inherited from LyObject: newlineIndent

LySimpleMarkup methods

LySimpleMusic

Inherits from: LyObject

class music21.lily.lilyObjects.LySimpleMusic(eventChord=None, musicIdentifier=None, musicPropertyDef=None, contextChange=None)

LySimpleMusic attributes

Attributes without Documentation: contextChange, eventChord, musicIdentifier, musicPropertyDef

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LySimpleMusic properties

Properties inherited from LyObject: newlineIndent

LySimpleMusic methods

LySimultaneousMusic

Inherits from: LyObject

class music21.lily.lilyObjects.LySimultaneousMusic(musicList=None, displayTag=False)

represents simultaneous music.

Can be explicitly tagged with “simultaneous” if displayTag is True otherwise encloses in double angle brackets

LySimultaneousMusic attributes

Attributes without Documentation: musicList, displayTag

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LySimultaneousMusic properties

Properties inherited from LyObject: newlineIndent

LySimultaneousMusic methods

LyStenoDuration

Inherits from: LyObject

class music21.lily.lilyObjects.LyStenoDuration(durationNumber=None, numDots=0)

the main thing that we think of as non-tuplet duration.

a duration number followed by one or more dots

>>> from music21 import *
>>> lsd = LyStenoDuration('2', 2)
>>> print lsd
2..

LyStenoDuration attributes

Attributes without Documentation: numDots, durationNumber

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyStenoDuration properties

Properties inherited from LyObject: newlineIndent

LyStenoDuration methods

LyTempoEvent

Inherits from: LyObject

class music21.lily.lilyObjects.LyTempoEvent(tempoRange=None, stenoDuration=None, scalar=None)
tempo_event: “tempo” steno_duration ‘=’ tempo_range
“tempo” scalar steno_duration ‘=’ tempo_range
“tempo” scalar

LyTempoEvent attributes

Attributes without Documentation: scalar, stenoDuration, tempoRange

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyTempoEvent properties

Properties inherited from LyObject: newlineIndent

LyTempoEvent methods

LyTempoRange

Inherits from: LyObject

class music21.lily.lilyObjects.LyTempoRange(lowestOrOnlyTempo=None, highestTempoOrNone=None)

defines either a single tempo or a range

LyTempoRange attributes

Attributes without Documentation: highestTempoOrNone, lowestOrOnlyTempo

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyTempoRange properties

Properties inherited from LyObject: newlineIndent

LyTempoRange methods

LyTopLevelExpression

Inherits from: LyObject

class music21.lily.lilyObjects.LyTopLevelExpression(lilypondHeader=None, bookBlock=None, bookPartBlock=None, scoreBlock=None, compositeMusic=None, fullMarkup=None, fullMarkupList=None, outputDef=None)

can contain one of:

lilypondHeader bookBlock bookPartBlock scoreBlock compositeMusic fullMarkup fullMarkupList outputDef

LyTopLevelExpression attributes

Attributes without Documentation: compositeMusic, outputDef, scoreBlock, lilypondHeader, fullMarkupList, bookBlock, bookPartBlock, fullMarkup

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyTopLevelExpression properties

Properties inherited from LyObject: newlineIndent

LyTopLevelExpression methods

LyTremoloType

Inherits from: LyObject

class music21.lily.lilyObjects.LyTremoloType(tremTypeOrNone=None)

LyTremoloType attributes

Attributes without Documentation: tremTypeOrNone

Attributes inherited from LyObject: backslash, defaultAttributes, m21toLy, supportedClasses, thisIndent, lilyAttributes

LyTremoloType properties

Properties inherited from LyObject: newlineIndent

LyTremoloType methods