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
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
Instance variables inherited from Stream:
Instance variables inherited from Music21Object: