Previous topic

music21.capella.fromCapellaXML

Next topic

music21.chord

Table Of Contents

Table Of Contents

This Page

music21.chant

Functions

music21.chant.fromStream(inputStream)

BaseScoreConverter

class music21.chant.BaseScoreConverter

Converter for all Score objects.

BaseScoreConverter methods

BaseScoreConverter.launchGregorio(fp=None)

converts a .gabc file to LaTeX using the gregorio converter. Returns the filename with .tex substituted for .gabc

>>> bsc = chant.BaseScoreConverter()
>>> newFp = bsc.launchGregorio('~cuthbert/Library/Gregorio/examples/Populas.gabc')
>>> bsc.gregorioCommand
u'open -a"/usr/local/bin/gregorio"  ~cuthbert/Library/Gregorio/examples/Populas.gabc'

More often, you’ll want to write a textfile from writeFile:

BaseScoreConverter.launchLaTeX(fp=None)

converts a .tex file to pdf using lulatex Returns the filename with .pdf substituted for .tex

BaseScoreConverter.writeFile(text=None)
>>> bsc = chant.BaseScoreConverter()
>>> filePath = bsc.writeFile('hello')
>>> filePath 
u'/var/folders/k9/85ztxmy53xg1qxvr0brw1zyr0000gn/T/music21/tmpekHFCr.gabc'

DefaultTeXWrapper

class music21.chant.DefaultTeXWrapper

DefaultTeXWrapper methods

DefaultTeXWrapper.substituteInfo(converter)

Puts the correct information into the TeXWrapper for the document

>>> wrapper = chant.DefaultTeXWrapper()
>>> class Converter():
...    score = r'\note{C}' + "\n" + r'\endgregorioscore %' + "\n" + r'\endinput %'
...    incipit = 'Gaudeamus Omnes'
...    mode = 'VII'
...    paperType = None
>>> c = Converter()
>>> print wrapper.substituteInfo(c)
% !TEX TS-program = lualatex
% !TEX encoding = UTF-8
...
\geometry{letterpaper} % a4paper or letterpaper (US) or a5paper or other 
...
% The title:
\begin{center}\begin{huge}\textsc{Gaudeamus Omnes}\end{huge}\end{center}
...
% We set Mode above the initial.
\gresetfirstlineaboveinitial{\small \textsc{\textbf{VII}}}{\small \textsc{\textbf{VII}}}
...
% and finally we include the score.
\note{C}
\endgregorioscore %
\end{document}
\endinput %...

GregorianNote

class music21.chant.GregorianNote(*arguments, **keywords)

A GregorianNote is a subclass of Note that contains extra attributes which represent the interpretation or graphical representation of the note.

Most of the attributes default to False. Exceptions are noted below.

Example: a very special note.

>>> n = chant.GregorianNote("C4")
>>> n.liquescent = True 
>>> n.quilisma = True
>>> n.basicShape = 'virga'  # default: punctus
>>> n.breakNeume = True # don't connect to the next note in a neume.
>>> n.stropha = True
>>> n.inclinatum = True
>>> n.debilis = True  # small note
>>> n.episema = True
>>> n.punctumMora = True
>>> n.fill = 'cavum' # 

GregorianNote bases

GregorianNote read-only properties

Read-only properties inherited from Note:

Read-only properties inherited from Music21Object:

GregorianNote read/write properties

GregorianNote.fill

Sets the fill for the note, for teaching purposes, representing polyphony, etc. Acceptable values are:

  • solid (default)
  • cavum (void)
  • linea (lines around it; technically not a fill)
  • linea-cavum (both of the previous)
  • accentus
  • reversed-accentus
  • circulus
  • semi-circulus
  • reversed-semi-circulus

See the docs for Gregorio for graphical representations of these figures.

>>> n = chant.GregorianNote("D3")
>>> n.fill
u'solid'
>>> n.fill = 'cavum'
>>> n.fill
'cavum'

Read/write properties inherited from Note:

Read/write properties inherited from NotRest:

Read/write properties inherited from GeneralNote:

Read/write properties inherited from Music21Object:

GregorianNote methods

GregorianNote.toBasicGABC(useClef=None)

returns the character representing inNote in the given clef (default = AltoClef)

see http://home.gna.org/gregorio/gabc/ for more details. ‘d’ = lowest line

>>> n = chant.GregorianNote("C4")
>>> c = clef.AltoClef()
>>> n.toBasicGABC(c)
u'h'
>>> c2 = clef.SopranoClef()
>>> n.toBasicGABC(c2)
u'd'
GregorianNote.toGABC(useClef=None, nextNote=None)

Methods inherited from Note:

Methods inherited from GeneralNote:

Methods inherited from Music21Object:

GregorianNote instance variables

GregorianNote.beams

A Beams object that contains information about the beaming of this note.

GregorianNote.isNote

Boolean read-only value describing if this Note is a Note (True).

GregorianNote.isRest

Boolean read-only value describing if this Note is a Rest (False).

GregorianNote.isUnpitched

Boolean read-only value describing if this Note is Unpitched (False).

GregorianNote.pitch

A Pitch object containing all the information about the note’s pitch. Many .pitch properties and methods are also made Note properties also

Instance variables inherited from Note:

Instance variables inherited from NotRest:

Instance variables inherited from GeneralNote:

Instance variables inherited from Music21Object:

GregorianStream

class music21.chant.GregorianStream(givenElements=None, *args, **keywords)
>>> s = chant.GregorianStream()
>>> s.append(clef.AltoClef())
>>> n = chant.GregorianNote("C4")
>>> l = note.Lyric("Po")
>>> l.syllabic = "start"
>>> n.lyrics.append(l)
>>> n.oriscus = True
>>> s.append(n)
>>> s.toGABCText()
u'(c3) Po(ho)\n'

GregorianStream bases

GregorianStream read-only properties

Read-only properties inherited from Stream:

Read-only properties inherited from Music21Object:

GregorianStream read/write properties

Read/write properties inherited from Stream:

Read/write properties inherited from Music21Object:

GregorianStream methods

GregorianStream.clefToGABC(clef)
>>> s = chant.GregorianStream()
>>> c = clef.AltoClef()
>>> s.clefToGABC(c)
u'(c3)'  
GregorianStream.toGABCText()

Methods inherited from Stream:

Methods inherited from Music21Object:

GregorianStream instance variables

GregorianStream.autoSort

Boolean describing whether the Stream is automatically sorted by offset whenever necessary.

GregorianStream.definesExplicitPageBreaks

Boolean that says whether all page breaks in the piece are explicitly defined. Only used on musicxml output (maps to the musicxml <supports attribute=”new-page”> tag) and only if this is the outermost Stream being shown

GregorianStream.definesExplicitSystemBreaks

Boolean that says whether all system breaks in the piece are explicitly defined. Only used on musicxml output (maps to the musicxml <supports attribute=”new-system”> tag) and only if this is the outermost Stream being shown

GregorianStream.flattenedRepresentationOf

When this flat Stream is derived from another non-flat stream, a reference to the source Stream is stored here.

GregorianStream.isFlat

Boolean describing whether this Stream contains embedded sub-Streams or Stream subclasses (not flat).

GregorianStream.isSorted

Boolean describing whether the Stream is sorted or not.

Instance variables inherited from Stream:

Instance variables inherited from Music21Object: