Converter for all Score objects.
BaseScoreConverter methods
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:
converts a .tex file to pdf using lulatex Returns the filename with .pdf substituted for .tex
>>> bsc = chant.BaseScoreConverter()
>>> filePath = bsc.writeFile('hello')
>>> filePath
u'/var/folders/k9/85ztxmy53xg1qxvr0brw1zyr0000gn/T/music21/tmpekHFCr.gabc'
DefaultTeXWrapper methods
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 %...
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
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
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'
Methods inherited from Note:
Methods inherited from GeneralNote:
Methods inherited from Music21Object:
GregorianNote instance variables
Boolean read-only value describing if this Note is a Note (True).
Boolean read-only value describing if this Note is a Rest (False).
Boolean read-only value describing if this Note is Unpitched (False).
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:
>>> 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
>>> s = chant.GregorianStream()
>>> c = clef.AltoClef()
>>> s.clefToGABC(c)
u'(c3)'
Methods inherited from Stream:
Methods inherited from Music21Object:
GregorianStream instance variables
Boolean describing whether the Stream is automatically sorted by offset whenever necessary.
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
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
When this flat Stream is derived from another non-flat stream, a reference to the source Stream is stored here.
Boolean describing whether this Stream contains embedded sub-Streams or Stream subclasses (not flat).
Boolean describing whether the Stream is sorted or not.
Instance variables inherited from Stream:
Instance variables inherited from Music21Object: