music21.alpha.chant¶
ALPHA MODULE
: Not directly supported by cuthbertLab.
Classes and Tools for converting Music21 Streams to Gregorio .gabc
Requires the amazing Gregoio library: http://gregorio-project.github.io , which itself requires LaTeX. (MacTeX, etc.; I suggest Basic TeX instead of the full MacTeX for this, since it’s only 100MB instead of 2.5GB)
BaseScoreConverter¶
-
class
music21.alpha.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 = alpha.chant.BaseScoreConverter() >>> fn = '~cuthbert/Library/Gregorio/examples/Populas.gabc' >>> newFp = bsc.launchGregorio(fn) >>> bsc.gregorioCommand '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 = alpha.chant.BaseScoreConverter() >>> filePath = bsc.writeFile('hello') >>> filePath '/var/folders/k9/T/music21/tmpekHFCr.gabc'
DefaultTeXWrapper¶
-
class
music21.alpha.chant.
DefaultTeXWrapper
¶
DefaultTeXWrapper
methods
-
DefaultTeXWrapper.
substituteInfo
(converter)¶ Puts the correct information into the TeXWrapper for the document
>>> wrapper = alpha.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.alpha.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 = alpha.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 = alpha.chant.GregorianNote("D3") >>> n.fill '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 = alpha.chant.GregorianNote("C4") >>> c = clef.AltoClef() >>> n.toBasicGABC(c) 'h'
>>> c2 = clef.SopranoClef() >>> n.toBasicGABC(c2) 'd'
-
GregorianNote.
toGABC
(useClef=None, nextNote=None)¶
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
:
GregorianStream¶
-
class
music21.alpha.chant.
GregorianStream
(givenElements=None, *args, **keywords)¶ >>> s = alpha.chant.GregorianStream() >>> s.append(clef.AltoClef()) >>> n = alpha.chant.GregorianNote("C4") >>> l = note.Lyric("Po") >>> l.syllabic = "start" >>> n.lyrics.append(l) >>> n.oriscus = True >>> s.append(n) >>> s.toGABCText() '(c3) Po(ho)\n'
GregorianStream
bases
GregorianStream
read-only properties
Read-only properties inherited from Stream
:
Read-only properties inherited from StreamCoreMixin
:
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
(clefIn)¶ >>> s = alpha.chant.GregorianStream() >>> c = clef.AltoClef() >>> s.clefToGABC(c) '(c3)'
-
GregorianStream.
toGABCText
()¶
Methods inherited from Stream
:
Methods inherited from StreamCoreMixin
:
Methods inherited from Music21Object
:
GregorianStream
instance variables
Instance variables inherited from Stream
:
Instance variables inherited from Music21Object
: