--- /dev/null
+mailto(daboys@bga.com)
+manpage(LilyPond)
+ (1)
+ (1998)
+ (The LilyPond package)
+ (Ly2dvi32)
+
+metalC(Automatically generated by yodl(1) from ly2dvi32.yo.)
+
+manpagename(Ly2dvi32)(Python utility to convert mudela to DVI)
+
+manpagedescription()
+ly2dvi is a Python script which creates input file for LaTeX,
+based on information from the output files from LilyPond.
+The script handles multiple files. If a mudela file name is
+specified LilyPond is run to make an output (TeX) file.
+
+One or more LaTeX files are created, based on information found
+in the output (TeX) files, and latex is finally run to create
+one or more DVI files.
+
+The majority of this utility came from a bourne script written by Jan
+Arne Fagertun name file(ly2dvi).
+
+manpagesynopsis()
+
+ ly2dvi32 [options] inputfile[.ly] [....]
+
+manpageoptions()
+
+description(
+dit(-D,--debug)
+ Set debug mode. There are two levels - in level one some debug
+ info is written, in level two the command bf(set -x) is run, which
+ echoes every command in the ly2dvi script.
+dit(-F,--headers=)
+ Name of additional LaTeX headers file. This is included in the
+ tex file at the end of the headers, last line before code(\begin{document})
+dit(-H,--Heigth=)
+ Set paper heigth (points). Used together with width and LaTeX name of
+ papersize in case of papersize unknown to ly2dvi.
+dit(-F,--headers=)
+ Name of additional LaTeX headers file. This is included in the
+ tex file at the end of the headers, last line before code(\begin{document})
+dit(-K,--keeplilypond)
+ Keep LilyPond output after the run.
+dit(-L,--landscape)
+ Set landscape orientation - portrait is the default.
+ (bf(-L) produces code(\usepackage[landscape]{article}))
+dit(-N,--nonumber)
+ Switch off page numbering.
+dit(-O,--orientation=)
+ Set orientation landscape - obsolete, use bf(-L) instead.
+dit(-P,--postscript)
+ In addition to the DVI file, also Generate a postsript file.
+dit(-W,--Width=)
+ Set paper width (points). Used together with heigth and LaTeX name of
+ papersize in case of papersize unknown to ly2dvi.
+dit(-d,--dependencies)
+ Tell lilypond to make dependencies file.
+dit(-h,--help)
+ Print help.
+dit(-k,--keeply2dvi)
+ Keep the LaTeX file after the run.
+dit(-l,--language=)
+ Specify LaTeX language.
+ (bf(-l norsk) produces code(\usepackage[norsk]{babel})).
+dit(-o,--output=)
+ Set output directory.
+dit(-p,--papersize=)
+ Specify papersize.
+ (bf(-p a4) produces code(\usepackage[a4paper]{article}))
+dit(-s,--separate)
+ Normally all output files are included into one LaTeX file.
+ With this switch all files are run separately, to produce one
+ DVI file for each.
+)
+
+manpagesection(Features)
+
+ly2dvi responds to several parameters specified in the mudela
+file. They are overridden by corresponding command line options.
+
+description(
+dit(language="";)
+ Specify LaTeX language
+dit(latexheaders="";)
+ Specify additional LaTeX headers file
+dit(orientation="";)
+ Set orientation.
+dit(paperlinewidth="";)
+ Specify the width (pt, mm or cm) of the printed lines.
+dit(papersize="";)
+ Specify name of papersize.
+)
+
+manpagesection(Environment)
+
+description(
+dit(LILYPONDPREFIX)
+ Sets the root directory of the LilyPond installation
+dit(LILYINCLUDE)
+ Additional directories for input files.
+dit(TMP)
+ Temporary directory name. Default is /tmp
+)
+
+manpagesection(Files)
+
+file(titledefs.tex) is inspected for definitions used to extract
+additional text definitions from the mudela file. In the current
+version the following are defined:
+
+description(
+dit(title)
+ The title of the music. Centered on top of the first page.
+dit(subtitle)
+ Subtitle, centered below the title.
+dit(poet)
+ Name of the poet, leftflushed below the below subtitle.
+dit(composer)
+ Name of the composer, rightflushed below the subtitle.
+dit(metre)
+ Meter string, leftflushed below the below poet.
+dit(opus)
+ Name of the opus, rightflushed below the below composer.
+dit(arranger)
+ Name of the arranger, rightflushed below the opus.
+dit(instrument)
+ Name of the instrument, centered below the arranger
+dit(piece)
+ Name of the piece, leftflushed below the instrument
+)
+
+file($LILYPONDPREFIX/share/.lilyrc $HOME/.lilyrc ./.lilyrc) are files
+to set up default running conditions. On Windows OS initialization
+files are named file(_lilyrc). The file syntax is as follows:
+
+verb(VARIABLE-NAME=VALUE)
+
+Where bf(VARIABLE-NAME) is the name of the variable documented below
+and bf(VALUE) is either a string, a 1, or a 0. All files are parsed,
+in the shown sequence. In the current version the following are
+allowed:
+
+description(
+dit(DEBUG=value)
+This turns off (default) or on the debug capabilities. Possible
+values are 0 (off) and 1 (on).
+dit(DEPENDENCIES=value)
+This turns off (default) or on the ability to generate a Makefile
+dependency list. Possible values are 0 (off) and 1 (on).
+dit(KEEPLILYPOND=value)
+This turns off (default) or on the ability to keep the log file
+associated with the LilyPond job. Possible values are 0 (off) and 1
+(on).
+dit(KEEPLY2DVI=value)
+This turns off (default) or on the ability to keep the temporary files
+that are generated by the ly2dvi job. Possible values are 0 (off) and
+1 (on)
+dit(LANGUAGE=value)
+Specify LaTeX language. Possible value is a valid LaTeX language.
+dit(LATEXHF=value)
+Specify additional LaTeX headers file. Possible value is a file
+specification.
+dit(LILYINCLUDE=value)
+Additional directories for input files. Possible value is a delimited
+directory path list.
+dit(LILYPONDPREFIX=value)
+This defines the LilyPond root directory. Possible value is a valid
+directory specification to the LilyPond distribution location.
+dit(NONUMBER=value)
+This turns off (default) or on the page numbering capability.
+Possible values are 0 (page numbering enabled) and 1 (page numbering
+disabled).
+dit(ORIENTATION=value)
+This sets the image orientation. Possible values are
+portrait (default) and landscape.
+dit(OUTPUTDIR=value)
+This defines the directory where the resultant files will be
+generated. Possible value is a valid directory specification.
+Default is the current working directory.
+dit(PAPERSIZE=value)
+This defines the papersize the image will be sized to fit. Possible
+values are a0, a1, a2, a3, a4 (default), a5, a6, a7, a8, a9, a10, b0,
+b1, b2, b3, b4, b5, archA, archB, archC, archD, archE, flsa, flse,
+halfletter, ledger, legal, letter, or note.
+dit(PHEIGHT=value)
+Specify paperheight (points - an inch is 72.27, a cm is 28.453 points).
+dit(POSTSCRIPT=value)
+This turns off (default) or on the capability of additionally
+generating a postscript file. Possible values are 0 (off) and 1 (on).
+dit(PWIDTH=value)
+Specify paperwidth (points - an inch is 72.27, a cm is 28.453 points).
+dit(SEPARATE=value)
+This turns off (default) or on the capability of generating multiple
+dvi and postscript files from multiple source files. The default is
+to generate a concatenation of the source files. Possible values are
+0 (single file) and 1 (separate files).
+dit(TMP=value)
+This defines the emporary directory. Actually this is not used at the
+present. Possible value is a valid directory specification that is
+writable to the user.
+)
+
+manpagesection(Initialization Sequence)
+The initialization process reads inputs for several sources. Below is
+a list of priorities for lowest to hightest proirity.
+
+itemize(
+it() Program's defaults
+it() Values found in LilyPond output file
+it() Environment variables
+it() $LILYPONDPREFIX/share/lilypond/.lilyrc
+it() $HOME/.lilyrc
+it() ./.lilyrc
+it() command line options
+)
+
+Note that this differs slightly from the original bourne shell
+version.
+
+
+manpagesection(See Also)
+
+lilypond(1), tex(1), latex(1)
+
+manpagesection(Bugs)
+
+If you have found a bug, you should send a bugreport.
+
+itemize(
+it()Send a copy of the input which causes the error.
+it()Send a description of the platform you use.
+it()Send a description of the LilyPond and ly2dvi version you use.
+it()Send a description of the bug itself.
+it()Send it to email(bug-gnu-music@gnu.org) (you don't have to subscribe
+ to this mailinglist).
+)
+
+manpagesection(Remarks)
+
+Many papersizes are now supported. Information on other sizes
+(LaTeX names, horizontal and vertical sizes) should be mailed to
+the author or to the mailing list.
+
+Supported papersizes are:
+
+a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, archA, archB, archC, archD,
+archE, b0, b1, b2, b3, b4, b5, flsa, flse, halfletter, ledger, legal,
+letter, note
+
+manpageauthor()
+Python Version author:
+nemail(Jeffrey B. Reed)(daboys@bga.com),
+lurl(http://www.realtime.net/~daboys/lilypond/)
+
+Original bourne shell version author:
+nemail(Jan Arne Fagertun)(Jan.A.Fagertun@energy.sintef.no),
+lurl(http://www.termo.unit.no/mtf/people/janaf/)
+
+
+
subsect(NEWS) label(news)
This is what the version @TOPLEVEL_VERSION@ brings:
+
verb(
top_of_NEWS
)
description(
dit(batch file)
In a batch file you can add the following entries: nl()
- bf(set LILYPOND=em(LilyPond-dir)) nl()
- bf(set path=%path%%LILYPOND%\bin;em(MiKTeX-dir)\miktex\bin) nl()
- bf(set TEXINPUTS=%LILYPOND%\texmf\tex\lilypond;;) nl()
- bf(set MFINPUTS=%LILYPOND%\texmf\mf\public\lilypond;;) nl()
+ bf(set LILYPONDPREFIX=em(LilyPond-dir)) nl()
+ bf(set path=%path%;%LILYPONDPREFIX%\bin;em(MiKTeX-dir)\miktex\bin) nl()
+ bf(set TEXINPUTS=%LILYPONDPREFIX%\texmf\tex\lilypond;;) nl()
+ bf(set MFINPUTS=%LILYPONDPREFIX%\texmf\mf\public\lilypond;;) nl()
COMMENT( dit(Windows Environment)
In the Windows environment you can select
properties menu of the My Computer icon. Click on
area of MiKTeX: nl()
bf(copy cmbx14.mf em(MiKTeX-dir)\fonts\source\public\cm\base)
)
+ dit(NOTE)
+ MiKTeX-1.11 localtexmf configurations should use
+ bf(em(localtexmf-dir)) in place of bf(em(MiKTeX-dir)).
) nl()
it()See the link(Running)(running) instructions below
)
subsect(Running LilyPond) label(running)
itemize(
- it()Take a look at url(angles.ly)(angles.ly)
+ it()Take a look at url(angels.ly)(angels.ly)
it()Save angles.ly to your local disk
it()From a Command Prompt run: nl()
bf(ly2dvi.py angles.ly) nl()
-(arbitrary number of bars' rest):bâton de pause:::::
:comma enharmonique:::::
-:comma pythagoricien:::komma van Pythagoras::
-:comma syntonique:::komma van Didymos, syntonische komma::
:doigté de pédale:::::
:doigté:::::
-:fioriture:::cadens:cadenza:
:indication de pédale:::::
-:mode ecclésiastique:::::
:pointillés:::::
A:la:::::
-B:si:::::
-C:do:::C::
-C:ut:::::
-D:ré:::::
-E:mi:::::
-F:fa:::::
-G:sol:::::
accent:accent:Akzent::accent:accento:
-accident; accidental alteration:altération accidentelle:Vorzeichen::toevallig teken:accidento:
+accidental:altération accidentelle:Vorzeichen::toevallig teken:accidento:
adjacent keys:tons voisins:::::
alto:alto:::alt::
-ancient form (diatonic minor scale):forme du mode mineur ancien:::::
+ancient form??? (diatonic minor scale):forme du mode mineur ancien:::::
appoggiatura:appogiature, ports de voix, notes d'agr\'ement:langer Vorschl\"age:::appogiature:
+arbitrary number of bars' rest):bâton de pause:::::
arpeggio:arpège, arpègement:Brechungen::gebroken akoord:arpeggio:
artificial measure:mesure artificielle:::::
artificial rest:respiration:::::
ascending interval:intervalle ascendant:::::
augmented (interval):augmenté (intervalle):::overmatig interval::
+B:si:::::
backfall, forefall:accent, chute, port de voix:Vorschlag::korte voorslag:appogiature:
+bar line:barre (de mesure):Taktstrich::maatstreep:stanghetta:
bar; measure:mesure:::maat, maatstreep::
baritone:bariton:::bariton::
-barline:barre (de mesure):Taktstrich::maatstreep:stanghetta:
bass clef:clé de fa:F Schl\"ussel::F sleutel, bas sleutel:chiave di basso:
bass:basse:::bas::
beam:barre:Balken::waardestreep/balk:barra:
beat:temps:::tel::
-binary beat:temps binaire:::tweedelige maatsoort::
brace:accolade:Klammer:::accolada:Symbol at the start of a system that connects staffs.
brass::::koper (blazers)::
+C clef:clé d'ut:::C sleutel, alt sleutel:chiave di tenore:
+C:do:::C::
+C:ut:::::
cadence:cadence:::cadens::
+cadenza:fioriture:::cadens:cadenza:
+cent::::::1/1200 of an octave (1/100 of an equally tempered semitone)
chain of trills:chaîne de trilles:::triller::
character:caractère:::::
chevron:chevron:::::
-chord of the dominant ninth:accord de neuvième dominante:::dominant noon akkoord::
-chord of the dominant seventh:accord de septième dominante:::septiem akkoord::
chord:accord:::akkoord::
chromatic scale:gamme chromatique:::chromatische toonladder::
chromatic semitone:demi-ton chromatique:::chromatische halve toon::
chromatic transposition:transposition chromatique:::::
chromatic type:genre chromatique:::::
-clef:clef:Schl\"ussel::Sleutel:la chiave (pl. le chiavi):
-clef:clé:::sleutel::
-closing angular bracket:::::decrescendo:
-comma:comma:::::
+church mode, ecclesiastical mode:mode ecclésiastique:::::
+clef:clé:Schl\"ussel::Sleutel:la chiave (pl. le chiavi):
+comma:comma:::::Difference in pitch of a note when the note is derived from a different tuning system.
compound interval:intervalle composé:::::
compound measure:mesure composée:::::
conjunct movement:mouvement conjoint:::::
consonant interval; consonance:consonance:::consonant::
contralto:contralto:::::
contro-time:contre-temps:::::
+crescendo:crescendo::::crescendo:written with an extended opening angular bracket, indicates increasing volume
cue-notes::Stichnoten::stichnoten::
+D:ré:::::
dash over/below:pizzicato:::::
+decrescendo:::::decrescendo:written with an extended closing angular bracket, indicates decreasing volume
degree [of the scale]:degré [de la gamme]:::trap [van de toonladder]::
descending interval:intervalle descendant:::dalend interval::
diatonic major scale:gamme diatonique majeure:::diatonische majeur toonladder::
diminished (interval):diminué (intervalle):::verminderd (interval)::
disjunct movement:mouvement disjoint:::::
dissonant interval; dissonance:dissonance:::dissonant interval; dissonant::
-dominant:dominante:::dominant::A tone that creates tension; usually the fifth degree of the scale.
+dominant ninth chord:accord de neuvième dominante:::dominant noon akkoord::
+dominant seventh chord:accord de septième dominante:::dominant septiem akkoord::
+dominant:dominante:::dominant::A tone that creates tension;the fifth degree of the scale.
+dorian mode::::::Mode obtained by raising the sixth in minor mode. A Dorian scale can be played from D to D with no sharps or flats.
dot (augmentation dot) :point:Punkt::punt:punto:
dot and curved line combined:point et liaison combinés:::::
dot over/below::::staccato:staccato:
double trill:trille double:::::
double triplet:double triolet:::dubbele triool::
double whole note:::breve:brevis:breve:
+duple meter:temps binaire:::tweedelige maatsoort::
duplet:duolet:::duool::
duration:durée:::duur, lengte::
+E:mi:::::
eighth note:croche::quaver:achtste noot::
eighth rest:demi-soupir::quaver rest:achtste rust::
engraving::notenstechen::steken::
-enharmonic intervals:intervalles enharmoniques:::::
-enharmonic notes:notes enharmoniques:::enharmonische noot::
-enharmonic scales:gammes enharmoniques:::::
-enharmonic transposition:transposition enharmonique:::::
-enharmonic type:genre enharmonique:::::
-enharmony:enharmonie:::::
+enharmonic:enharmonique:::enharmonisch::Two notes, intervals, or scales are enharmonic if they have different names but sound the same. Examples: C sharp and D flat, diminished fourth and major third
+equal temperament:tempérament égal:::getempereerde stemming::Tuning system in which each semitone is precisely 100 cents.
essential alteration:altération essentielle:::::
expression mark:signe d'expressoin:Vortragszeichen::voordrachtsteken:segno d'espressione:
extension of interval:extension d'intervalle:::::
+F:fa:::::
fermata:pauses:Fermate::fermate:fermata:Prolonged sound or silence of indefinite duration
fifth:quinte:::kwint::
flag, hook, tail, pennant:crochet:F\"anchen::vlaggetje:coda uncinata:
flat:bémol:Be::mol:bemolle:
four-bar rest:bâton de pause:::::
fourth:quarte:::kwart::
+G:sol:::::
glissando:glissement:Glissando::glissando:glissando:
graces:petites notes:kurz Vorschl\"age, Manieren (?)::versieringen:appogiature:
grand staff::::piano systeem::A combination of two staffs with a brace. Usually used for piano music.
harmonic form (diatonic minor scale):forme harmonique:::::
harmonic interval:intervalle harmonique:::::
incomplete measure:mesure incomplète:::::
-interval:intervalle:::interval::
+interval:intervalle:::interval::Difference in pitch between two notes
inversion of interval:renversement d'intervalle:::inversie::
irregular contro-time:contre-temps irrégulier:::::
irregular group:groupe irrégulier:::::
irregular measure:mesure irrégulière:::::
irregular syncopation:syncope irrégulière:::onregelmatige syncope::
+just intonation::::::Tuning system in which the notes are obtained by adding and subtracting natural fifths and thirds.
key signature:armure, armature [de la clé], signes des accidentals:Vorzeichen::toonsoort (voortekens):segni di chiave:
kind of note:figure de note:::::
kind of rest:figure de silence:::::
lower number:chiffre inférieur:::::
major (interval):majeur (intervalle):::groot (interval)::
major mode:mode majeur:::::
-meantone tuning:tempérament mésotonique:::::
-mediant:médiante:::mediant::The sixth degree of a scale
+meantone temperament:tempérament mésotonique:::::Tuning based on a fifth that is 16 cents smaller than the natural fifth.
+mediant:médiante:::mediant::The third degree of a scale
melodic cadence:cadence mélodique:::cadens::
melodic form (diatonic minor scale):forme mélodique:::::
meter, time:m\`etre:Takt, Metrum::maatsoort::A recurring pattern of stress
metronome:métronome:::metronoom::
metronomic indication:indication métronomique:::::
mezzo-soprano:mezzo-soprano:::::
-middle C clef:clé d'ut:::C sleutel, alt sleutel:chiave di tenore:
middle C:do central:::centrale C::
minor (interval):mineur (intervalle):::::
minor mode:mode mineur:::::
mordent:mordant, pinc\'e:Pralltriller, Mordent::mordent:mordente:
motive:incise:::motief::
musical ladder:échelle musicale:::::
+mixolydian mode::::::Mode obtained by lowering the seventh in major. A mixolydian scale can be obtained by playing G to G with no sharps or flats.
natural sign:bécarre:Aufl\"osungszeichen::herstellingsteken:bequadro:
ninth::::noon::
note head::Notenkopf::noot balletje::
note:note:Note::noot:nota:
-octave line:clé d'octave:::::
octave line:échelle d'octave:::::
+octave line:clé d'octave:::::
octave sign:octave:Oktave:::ottava:
octave:octave:::octaaf::
-opening angular bracket:::::crescendo:
ornament, embellishment; accessory:agr\'ement, ornement:Verzierungen:::fiorette, fioriture, abbellimenti:
part::::partij::
pause:pause:Luftpause::::
phrasing:phrasé:::::
pitch pipe; tuning fork:diapason:::stemfluitje; stemvork::
pitch:hauteur:::toonhoogte::
+Pythagorean comma:comma pythagoricien:::komma van Pythagoras::A sequence of fifths starting on C eventually circles back to C (B sharp), but this B sharp is 24 cents higher than C. This gap is the Pythagorean comma.
quadruplet:quartolet:::kwartool::
quarter note:noire::crotchet:kwartnoot::
quarter rest:soupir::crotchet rest:kwart rust::
stem:queue:Stiel, Hals::stok:asta, gamba:
strings::::strijkers::
strong beat:temps fort:::thesis::
-subdominant:sous-dominante:::::
-subtonic:sous-tonique:::::
-superdominant:sus-dominante:::::
-supertonic:sus-tonique:::::
+subdominant:sous-dominante:::::The fourth degree of the scale
+submediant::::::The sixth scale degree
+subtonic:sous-tonique:::::The seventh degree of the scale
+superdominant:sus-dominante:::::The sixth scale degree
+supertonic:sus-tonique:::::The second scale degree
syncopation; upbeat:syncope:::syncope::
+syntonic comma:comma syntonique:::komma van Didymos, syntonische komma::Difference between the natural third and the third obtained by Pythagorean tuning, euqal to 22 cents.
system:syst\`eme:System::systeem:sitema:
-tempered tuning:tempérament égal:::getempereerde stemming::
tempo indication:signes de temps:Zeitmasse, Tempobezeichnung::tempo aanduiding:segno di tempo:
tempo; movement:mouvement:::::
tenor:ténor:::::
tenth::::deciem:decime:
-ternary beat:temps ternaire:::driedelige maatsoort::
tetrachord:tétracorde:::::
third:tierce:::terts::
thirty-second note:triple croche::demisemiquaver:32e noot::
treble clef:clé de sol:G Schl\"ussel::G sleutel, viool sleutel:chiave di violino:
tremolo:tr\'emolo:Tremolo::tremolo:tremolo:
trill; shake:trille, tremblement, battement (cadence):Triller::triller:trillo:
+triple meter:temps ternaire:::driedelige maatsoort::
triplet:triolet:::::
tritone:triton:::::
turn; gruppetto:bris\'e, groupe, doubl\'e, grupetto:Doppelschlag::dubbelslag:grupetto:
list is alphabetically ordered.
itemize(
+it()nemail(Tom Cato Amundsen)(tomcato@xoommail.com),
+ cembalo-partita in mudela.
it()nemail(Mats Bengtsson)(matsb@s3.kth.se),
lurl(http://www.s3.kth.se/~matsb)
clef stuff, key stuff, swedish notenames, testing, general
%{
- abbreviations of english names for notes
-
- %}
+ English note names spelled out in full, and abbreviated
+ with s for sharp and f for flat.
+%}
\notenames {
+ cflatflat = \musicalpitch { -1 0 -2 }
+ cflat = \musicalpitch { -1 0 -1 }
+ c = \musicalpitch { -1 0 0 }
+ csharp = \musicalpitch { -1 0 1 }
+ csharpsharp = \musicalpitch { -1 0 2 }
+ dflatflat = \musicalpitch { -1 1 -2 }
+ dflat = \musicalpitch { -1 1 -1 }
+ d = \musicalpitch { -1 1 0 }
+ dsharp = \musicalpitch { -1 1 1 }
+ dsharpsharp = \musicalpitch { -1 1 2 }
+ eflatflat = \musicalpitch { -1 2 -2 }
+ eflat = \musicalpitch { -1 2 -1 }
+ e = \musicalpitch { -1 2 0 }
+ esharp = \musicalpitch { -1 2 1 }
+ esharpsharp = \musicalpitch { -1 2 2 }
+ fflatflat = \musicalpitch { -1 3 -2 }
+ fflat = \musicalpitch { -1 3 -1 }
+ f = \musicalpitch { -1 3 0 }
+ fsharp = \musicalpitch { -1 3 1 }
+ fsharpsharp = \musicalpitch { -1 3 2 }
+ gflatflat = \musicalpitch { -1 4 -2 }
+ gflat = \musicalpitch { -1 4 -1 }
+ g = \musicalpitch { -1 4 0 }
+ gsharp = \musicalpitch { -1 4 1 }
+ gsharpsharp = \musicalpitch { -1 4 2 }
+ aflatflat = \musicalpitch { -1 5 -2 }
+ aflat = \musicalpitch { -1 5 -1 }
+ a = \musicalpitch { -1 5 0 }
+ asharp = \musicalpitch { -1 5 1 }
+ asharpsharp = \musicalpitch { -1 5 2 }
+ bflatflat = \musicalpitch { -1 6 -2 }
+ bflat = \musicalpitch { -1 6 -1 }
+ b = \musicalpitch { -1 6 0 }
+ bsharp = \musicalpitch { -1 6 1 }
+ bsharpsharp = \musicalpitch { -1 6 2 }
+
cff = \musicalpitch { -1 0 -2 }
cf = \musicalpitch { -1 0 -1 }
c = \musicalpitch { -1 0 0 }
eff = \musicalpitch { -1 2 -2 }
ef = \musicalpitch { -1 2 -1 }
e = \musicalpitch { -1 2 0 }
- es = \musicalpitch { -1 2 1 }
+ es = \musicalpitch { -1 2 1 } % es = E-flat in Dutch
ess = \musicalpitch { -1 2 2 }
fff = \musicalpitch { -1 3 -2 }
ff = \musicalpitch { -1 3 -1 }
aff = \musicalpitch { -1 5 -2 }
af = \musicalpitch { -1 5 -1 }
a = \musicalpitch { -1 5 0 }
- as = \musicalpitch { -1 5 1 }
+ as = \musicalpitch { -1 5 1 } % as = A-flat in Dutch
ass = \musicalpitch { -1 5 2 }
bff = \musicalpitch { -1 6 -2 }
bf = \musicalpitch { -1 6 -1 }
%
+ Cflatflat = \musicalpitch { -2 0 -2 }
+ Cflat = \musicalpitch { -2 0 -1 }
+ C = \musicalpitch { -2 0 0 }
+ Csharp = \musicalpitch { -2 0 1 }
+ Csharpsharp = \musicalpitch { -2 0 2 }
+ Dflatflat = \musicalpitch { -2 1 -2 }
+ Dflat = \musicalpitch { -2 1 -1 }
+ D = \musicalpitch { -2 1 0 }
+ Dsharp = \musicalpitch { -2 1 1 }
+ Dsharpsharp = \musicalpitch { -2 1 2 }
+ Eflatflat = \musicalpitch { -2 2 -2 }
+ Eflat = \musicalpitch { -2 2 -1 }
+ E = \musicalpitch { -2 2 0 }
+ Esharp = \musicalpitch { -2 2 1 }
+ Esharpsharp = \musicalpitch { -2 2 2 }
+ Fflatflat = \musicalpitch { -2 3 -2 }
+ Fflat = \musicalpitch { -2 3 -1 }
+ F = \musicalpitch { -2 3 0 }
+ Fsharp = \musicalpitch { -2 3 1 }
+ Fsharpsharp = \musicalpitch { -2 3 2 }
+ Gflatflat = \musicalpitch { -2 4 -2 }
+ Gflat = \musicalpitch { -2 4 -1 }
+ G = \musicalpitch { -2 4 0 }
+ Gsharp = \musicalpitch { -2 4 1 }
+ Gsharpsharp = \musicalpitch { -2 4 2 }
+ Aflatflat = \musicalpitch { -2 5 -2 }
+ Aflat = \musicalpitch { -2 5 -1 }
+ A = \musicalpitch { -2 5 0 }
+ Asharp = \musicalpitch { -2 5 1 }
+ Asharpsharp = \musicalpitch { -2 5 2 }
+ Bflatflat = \musicalpitch { -2 6 -2 }
+ Bflat = \musicalpitch { -2 6 -1 }
+ B = \musicalpitch { -2 6 0 }
+ Bsharp = \musicalpitch { -2 6 1 }
+ Bsharpsharp = \musicalpitch { -2 6 2 }
+
Cff = \musicalpitch { -2 0 -2 }
Cf = \musicalpitch { -2 0 -1 }
C = \musicalpitch { -2 0 0 }
for (int i=0; i < errors.size(); i++)
errors[i]->error_mark_b_ = true;
- const Line_of_score *line_l=0;
+ Line_of_score *line_l=0;
if (breaking.size() >1)
{
line_l = (Line_of_score*)clone()->access_Spanner ();
}
else
- line_l = this;
+ line_l = (Line_of_score*) this;
((Array<Paper_column*> &)line_l->cols) = curline;
line_l->set_bounds(LEFT,curline[0]);
--- /dev/null
+\header {
+ filename = "";
+ title = "Partita II";
+ description = "6 Partite per il clavicembalo, Partita II (c-minor)";
+ opus = "BWV 826";
+ source = "Editio Musica Budapest (Urtext)";
+ composer = "Johann Sebastian Bach (1685-1750)";
+ enteredby = "Tom Cato Amundsen";
+ copyright = "Public Domain";
+}
+
+\version "1.0.1";
+\include "a4.ly";
+global = \melodic {
+ \time 4/4;
+ \key es;
+ \skip 1*7;
+ \bar "||";
+ \skip 1*22;
+ \time 3/4;
+ \skip 2.*62;
+ \bar "|.";
+}
+
+hoyreOpp = \melodic \relative c'' {
+ \stemup
+ es4 r16 [es d. es32] f4 r16 [f16 f. g32] |
+ [as8. as16] [as16 g32 f g16. d32] es4 r16 [g g. as32] |
+%3
+ bes4 r16 [bes,16 bes. c32] [des8. des16]
+ \type Staff <
+ { \stemup e4 }
+ { \stemup \property Voice.hshift = 1 [des16 c32 bes c16. g32] }
+ >
+%4
+ f4 \stemboth r16 [f g. as32] \stemup d,4 r16 [d g. es32] |
+ c4 ~ [c32 es des c des16. f32] [b,16. c32 b16. c32] d4 ~ |
+ d2 ~ [d16. g,32 a16. b32] [c16. <b32 g> <c16. a> <d32 b]> |
+ <[es8. c> <es16 c]>
+ \type Staff <
+ { \stemup fis4 }
+ { \stemup \property Voice.hshift = 1 [es16 d32 c d16. a32] }
+ > g2
+}
+
+hoyreNed = \melodic \relative c'' {
+ \clef violin;
+ \stemdown
+ <c4 g> r16 [c b. c32] d4 r16 [d d. es32] |
+ [f8. f16] f8 r <c4 g> r16 [es16 es. f32] |
+ <c4 g' > r16 [g16 g16. as32] [bes8. bes16] bes8 r |
+ <c4 as> r16 s16*3 r16 [f, f. g32] g4 |
+%5
+ r16 [es es. f32] f4 [g16. a32 g16. a32] b4 ~ |
+ [b8. d,16] [f8. as16] [g16. f32 es16. d32] [es16. d32 es16. f32] |
+ g4 <c8 a> r <d2 b>
+}
+
+venstreOpp = \melodic \relative c' {
+ \clef bass;
+ \stemup
+ <c4 g es> r <b as f d> r |
+ r <b f d> <c g es> r |
+ <c g e> r r <c g> |
+ <c as f> r r16 <[as d,><as. d,><g32 d]> <g4 d> |
+%5
+ r16 <[g c,><g. c,><f32 c]>
+%{ \type Voice <
+ {f4() f}
+ {c4 d}
+ >
+%}
+ <f4-"ikke bue c-d" ~ c><f d> r16 [f f. g32] |
+ [as8. as16]~ [as g32 f g16 d] <es4 c> r |
+ r <a es c> <g2 d>
+}
+
+venstreNed = \melodic{ \relative c{
+ \stemdown
+ c4 r c r | r c c r | c r r c | c r r16 [c c. bes32] bes4 |
+ r16 [bes bes. as32] as4 g r16 [d' d. es32] |
+ \type Staff <
+ { \stemdown \property Voice.hshift = 1 [f8. f16] [b,8. b16] g4 r | }
+ { \stemdown r4 g}
+ >
+ r g g2
+}}
+
+andanteEn = \melodic \relative c''{
+ [g16 c32 d es8~] [es16 d32 c es d c b] [c16 g as f] [g c g f] |
+ [es16 c'32 d es d c16] [g' c, as' c,] [b c d b] g16 r16 r8 |
+%10
+ \stemup [g'32 f es d c16 bes~] [bes des8 c16]
+ [as'32 g f e f8~] [f32 g as g f es d es] |
+ [f es d c bes16 as~] [as c8 bes16]
+ [g'32 f es d es8~] [es32 f g f es d c b]
+%12
+ \stemboth
+ [c bes as g f16 es'~] [es d32 c es d c b]
+ [c d es f g16 c,~] [c b32 c d c b c] |
+ [as'32 g f e f16 des~] [des c32 des es des c des]
+ [g f es d es16 c~] [c b32 c d c b c]
+%14
+ [f c b a b16 d] [f32 bes, as g as16 c]
+ [f32 as, g f g8~] [g32 f' g as g16 f] |
+ [g16 b,8 c16~] [c16 bes32 as g f es d] [es g f es f es d es] [d8 c] |
+%16
+ r8 g'~ [g32 as g f g16 as] [bes16 d es8~] [es32 bes es f g16 es] |
+ [des16 c f8~] [f32 c f g as16 f] [es c d8~] [d32 f g as bes as g as] |
+%18
+ [bes32 as g16~] [g32 f e16~] [e32 d c16~] [c32 g' as bes]
+ [as g f16~] [f32 es des16~] [des32 c bes16] [bes32 f' g as] |
+%19
+ [g f e f bes f e f] [as f e f g f e f] f4~ [f32 es d es f d es f] |
+ [bes,32 d f g as8~] [as32 g f as g f es d]
+ [es bes es f g8~] [g32 f es g f es d c] |
+%21
+ [c'32( a g )fis es16 d~] [d32 g a bes cis,16 d] ~
+ [d32 fis g a c, es d c] [fis d e fis g a bes c] |
+%22
+ [bes32 a g fis ~ fis16 g~] [g d8 es16~]
+ [es16 b8 c16~] [c32 bes as g as16 c]
+%23
+ [fis,32 es' d c bes'16. a32] [g8( )fis16.-\prall g32] g4~
+ [g32 f g as g f es d ] |
+ [f32 es d c g'8~] [g32 es f g f es d c] [es d c bes g'8~]
+ [g32 d es f es d c bes] |
+%25
+ [d c bes a g'8~] [g32 c, d es d c bes a] [c bes a g g'8~]
+ [g32 bes, c d c bes a g] |
+ as4~ [as32 as g as bes as g as] es'4~ [es32 c b c d c b c] |
+ [fis16 es8 d16] [g16 d8 c16] [a'16 c,8 bes16~] [bes32 d c bes g' bes, a g]
+%28
+ [bes'8-\fermata~ bes32 a g f] [g bes a g fis e d c] [bes d c es d g fis e]
+ [d c bes a bes d bes g] |
+ r16 [e'32 fis fis16.-\prall \[2/3 e64 fis g\]1/1 ]
+ \type Staff <
+ { \stemup
+ [bes,32 a g fis g32 bes16.~] [bes16 c32 bes a bes c a] [fis8. g16] }
+ { \stemdown s8 g8 ~ g4 d}
+ >
+}
+andanteTo = \melodic \relative c{
+%8
+ \clef "bass";
+ [c8 c'] [f, g] [es c] [es g] |
+ [c as] [es f] [g g,]
+ \stemdown \translator Staff = treble r16 [f''16 es d] |
+%10
+ [es8 g] [e c] [f as] [f c] | [d f] [d bes] [es g] [es c] |
+ \stemboth \translator Staff = bass
+ [as c] [f as,] [g c] [es g,] | [f as] [g f] [es g] [f es] |
+%14
+ [d f] [as c,] [b d] [g d] |
+ [es as,] [f g] c,4~ [c16 d32 es f g a b] |
+ [c8 c'] [bes as] [g bes] [g es] |
+ [as c] [as f] [bes as] [g f] |
+ [e g] [c e,] [f as] [f des] |
+ [bes g] [c c,] [f16 g32 as bes c d e] [f8 es] |
+ [d f] [d bes] [g' bes] [es, g] |
+ [a, fis'] [g g,] [d' a'] [c d,] |
+%22
+ [g a] [bes b] [c d] [es c] |
+ [a g] [d' d,] [g a] [b g] |
+ [c es] [c a] [bes d] [bes g] |
+ [a c] [a fis] [g bes] [g es] |
+%26
+ [c16 d32 es f g as bes] [c16 c, c'8~] [c32 c, d es f g as bes][c16 c, c'8~]|
+ [c c,] [bes bes'] [fis d] [g es] |
+ \type Staff <
+ { \stemup <g4 e> r <d'2 bes g> |
+ cis4~ [cis8. cis16] [d8 c16 bes]
+ \type Staff <
+ { \stemup [a bes c8] }
+ { \stemdown a4 } >
+ | }
+ { \slurdown \stemdown cis,4 r d2( | )d1 \slurboth }
+ >
+}
+
+allegroEn = \melodic \relative c''{
+%30
+ [g8 g16 a] [b8 c d es] |
+ [f16 es d es] [f8 g as d,] |
+ [f b, d g,] [g'16 f es d] |
+ es8 c'4 [bes16 as] [g f es d] |
+ c4~ [c16 d e f] [g as bes g] |
+ [e8 des'~] [des16 g, as bes] [as g f e] |
+ [f g as8~] [as16 g f es] [d c d f] |
+%37
+ [es f g8~] [g16 f es d] [c b c es] |
+ [d as' d, c] [d es f g] [ f es d c] |
+ [b g' f es] [d f d c] [b d b a] |
+ [g a b c] [d c b c] [d es f d] |
+ [b c d es] [f as g f] [es d c b] |
+ [c d es c] [a8 c] [f, es'] |
+%43
+ [bes16 c d bes] [g8 bes] [es, d'] |
+ [a16 bes c a] [fis8 a] [d, c'] |
+ [g16 a b g] [es g d g] [cis, bes' a g] |
+ [fis e d e] [fis8 g a bes] |
+ [c16 bes a bes] [c8 d] [es a,] |
+ [c fis,] [a d,] [d'16 c bes a]
+%49
+ [bes a g a] [bes8 c d es] |
+ [f16 es d c] [bes f' c bes] [as f' bes, as] |
+ [g16 f es f] [g8 a b c] |
+ [d16 c b a] [g d' as g] [f d' g, f] |
+ [es c' g f] [es f g as] [g c g f] |
+ [es c' g f] [es f g as] [g c g f]
+%55
+ [e bes' g f] [e f g as] [g bes g f] |
+ [e bes' g f] [e g bes des] [c bes as g]|
+ [as f' c bes] \stemup [as bes c des] [ c f c bes] |
+ [as f' c bes] \stemboth [as bes c des] [c f c bes] |
+ [a es' c bes] \stemup [a bes c des] [c es c bes] |
+ [a es' c bes] \stemboth [a c es ges] [f es des c] |
+%61
+ [des8 bes c des es des] |
+ [c as bes c des c] [bes as bes g as bes] |
+ [e,16 d c d] [e8 f g as] |
+ [bes16 as g as] [bes8 c] [des g,] |
+ [bes e,] [g c,] [c'16 bes as g]
+%67
+ [as g f8~] [f16 as g f] [es d c bes] |
+ [g' f es8~] [es16 g f es] [d c b c] |
+ [f es d8~] [d16 f es d] [c b a g] |
+ [es' f g8~] [g f16 es] [d a' b c] |
+ [d c b c] [d g f es] [d c b a] |
+ g4~ [g16 a b c] [d es f d]
+%73
+ [b8 as'~] [as16 d, es f] [es d c b] |
+ c4~ [c16 g' des c] [bes es bes as] |
+ [g as bes c] [des8 bes] g'4~ |
+ [g8 c,16 bes] [as f' bes, as] [g des' g, f] |
+ [e f g as] [bes8 g] [e'.-\prallprall d32 e] |
+%78
+ [f8 f,16 g] [as8 bes c d] |
+ [es16 d c d] [es8 f g as] |
+ [b,16 g' d c] \stemup [b c d es] [d g d c] |
+ [b g' d c] [b c d es] [d g d c] |
+ [b f' d c] [b c d es] [d f d c] |
+ [b f' d c] [b d f as] [g f es d] |
+%84
+ [es f g es] [c g' f es] [d c bes as] |
+ \stemboth [g as bes8~] [bes16 c bes as] [g f e d] |
+ [c g' c, bes] [c d e f] [es g c, bes] |
+ [c g' f e] [f c f g] [as bes c d] | [es d c d] [es8 f16 g] [as8 des,] |
+ [f b,] [d g,] [g'16 f es d] |
+ \type Staff <
+ { \stemup [es8. c16] c4 ~ [b8.-\prall c16] | c2-\fermata }
+ { \stemdown r8 r16 <a16 es> <g2 d> | <g es> }
+ >
+}
+allegroTo = \melodic \relative c'{
+ \clef bass;
+%30
+ \type Staff <
+ { \stemup <b8 g> r r4 r }
+ { \stemdown g,8 r8 r4 r }
+ >
+ r2. | r2. |
+ \clef treble; r8 [c16 d] [es8 f] [g as] |
+ [bes16 as g as][bes8 c] [des g,]
+ [bes e,][g c,][c'16 bes as g] | [as8 f g as][bes as] |
+ [g es f g as g] | [f es f d es f] | [g g,16 a] [b8 c] [d es] |
+ [f16 es d es][f8 g][as d,] |
+ [f b,][d g,][g'16 f es d] | \clef bass;
+ [es d c8~][c16 es d c][bes a g f] |
+%43
+ [d' c bes8~][bes16 d c bes][a g fis g] |
+ [c bes a8~][a16 c bes a][g fis e d] | [bes'8 d][g, bes][e, cis'] |
+ [d8 d,~][d c16 bes][a g fis e] | d4~ [d16 e fis g][a bes c a]
+%48
+ [fis8 es'~][es16 a, bes c][bes a g fis] |
+ g4 r16 [g' as bes][as g f es] | [d8 f][d bes][c d] |
+ [es es,] r16 [es' f g][f es d c] | [b8 d][b g][a b] |
+ [c c,] r16 [d''16 es f][es8 d] | [c c,] r16 [as' bes c][bes8 as] |
+ [g c,] r16 [d' e f][e8 d] | [c c,] r16 [d e f][e8 c]
+%57
+ [f f,] \stemdown \translator Staff = treble r16 [g'' as bes][as8 g] |
+ [f \stemboth \translator Staff = bass f,] r16 [des'16 es f][es8 des] |
+ [c f,] \stemdown \translator Staff = treble r16 [g' a bes][a8 g] |
+ [f \stemdown \translator Staff = bass f,] \stemboth r16 [g a bes][a8 f] |
+ [bes16 c des8~][des16 c bes as][g f g bes] |
+%62
+ [as bes c8~][c16 bes as g][f e f as] |
+ [g des' g, f][g as bes c][bes as g f] |
+ [c'8 bes16 as][g c bes as][g f e d] |
+ c4~ [c16 d e f][g as bes g] |
+ [e8 des'~][des16 g, as bes][as g f e] |
+%67
+ [f g as f][d8 f][bes, as'] |
+ [es16 f g es][c8 es][as, g'] |
+ [d16 es f d][b8 d][g, f'] |
+ [c16 d es c][as c g c][fis, es' d c] |
+ [b a g a][b8 c d es] |
+ [f16 es d es][f8 g as d,] |
+%73
+ [f b,][d g,][g'16 f es d] |
+ [es d c d][es8 f g as] |
+ [bes16 as g f][es bes' f es][des bes' es, des] |
+ [c bes as bes][c8 d e f] |
+ [g16 f e d][c g' des c][bes g' c, bes] |
+ [as f' as, g][f c' des g,][a es' f b,]
+%79
+ [c f es d][c g' as d,][es b' c f,] |
+ [g8 g,] \stemdown \translator Staff = treble r16 [a'' b c][b8 a] |
+ [g \translator Staff = bass g,] \translator Staff = treble
+ r16 [es' f g][f8 es] |
+ [d \stemboth \translator Staff = bass g,] r16 [a b c][b8 a] |
+ [g8 g,] \stemdown \translator Staff = treble r8 [g''16 f][es d c b] |
+ [c8 \stemboth \translator Staff = bass c,16 d][es8 f g as] |
+ [bes16 as g as][bes8 c des g,] |
+%86
+ [bes e,][g c,][c'16 bes as g] | as4~ [as16 bes as g][f g as f] |
+ [g f es d][c bes as g][f f' e f] | [as f e f][b, f' es d][es g c, es] |
+ [fis,8. fis'16] g4 g, | c,2-\fermata
+}
+a4 = \paper{
+% linewidth= 80.\mm;
+ Staff = \translator {
+ \type "Engraver_group_engraver";
+ defaultclef = violin;
+ \consists "Bar_engraver";
+ \consists "Clef_engraver";
+ \consists "Key_engraver";
+% \consists "Meter_engraver";
+ \consists "Local_key_engraver";
+ \consists "Staff_sym_engraver";
+ \consists "Collision_engraver";
+ \consists "Rest_collision_engraver";
+ \consists "Bar_column_engraver";
+ \consists "Bar_number_engraver";
+ \consists "Separating_line_group_engraver";
+% \consists "Line_group_engraver";
+ \accepts "Voice";
+ \accepts "Staff";
+ \accepts "GrandStaff";
+ }
+}
+\score {
+ \type GrandStaff <
+ \type Staff = treble <
+ \global
+ { \hoyreOpp \andanteEn \allegroEn }
+ \hoyreNed
+ >
+ \type Staff = bass <
+ \global
+ { \venstreOpp \andanteTo \allegroTo }
+ \venstreNed
+ >
+ >
+
+ \paper {
+% \a4
+% gourlay_maxmeasures =5.;
+% castingalgorithm = \Wordwrap;
+
+ }
+}
+
+% EOF
#!@PYTHON@
+"""
+=======================================================================
+LilyPond to dvi converter
+
+Features include Title information, paper size specification, and image
+orientation.
+
+Usage: ly2dvi.py [OPTION]... [FILE]...
+Input: LilyPond source or LilyPond generated TeX files
+Output: DVI file
+=======================================================================
+"""
+
name = 'ly2dvi'
-version = '0.0.2'
+version = '0.0.4'
import sys
import os
import time
import glob
+
class Input:
+ """
+ This class handles all ly2dvi.py input file methods
+
+ Public methods:
+
+ __init__() Constructor
+ open(file) Open a .ly file or .tex file using lilyinclude path
+ close() Close current file
+ type() Determine file type .ly (input) or .tex (output)
+ setVars() Set title definitions found in .tex (output) file
+ """
+
+ #
+ # Constructors
+ #
def __init__(this):
this.__fd = None
+ #
+ # open
+ #
def open(this,file):
+ """
+ open file and set private class variable __fd. The search
+ sequence is: current directory followed by the directories
+ found in include property list. Each directory is searched
+ for file, file.ly, and file.fly.
+
+ input: file filename
+ output: void
+ error: ExitNotFound Exception
+ """
+
for i in [''] + Props.get('include')[0:]:
ifile = os.path.join(i,file)
for j in ['','.ly','.fly']:
pass
sys.exit('ExitNotFound', file)
+
+ #
+ # close
+ #
def close(this):
+ """
+ close file object __fd
+
+ input: void
+ output: void
+ error: None
+ """
this.__fd.close()
+
+ #
+ # type
+ #
def type(this):
+ """
+ Determine input file type. LilyPond source is 'input' type
+ and LilyPond generated TeX file is 'output' type
+
+ input: void
+ output: 'input' | 'output'
+ error: None
+ """
+
firstline = this.__fd.readline()
this.__fd.seek(0)
if re.match('% Creator: GNU LilyPond [0-9]+[.0-9]+',firstline ):
return 'output'
else:
return 'source'
-#
-# Scan file for variable settings
-#
+
+
+ #
+ # setVars
+ #
def setVars(this):
- """Scan source file for variable settings"""
+ """
+ Search for properties in the current input file and set the
+ appropriate values. The supported properties names are in
+ local variable varTable along with the property list
+ titledefs.
+
+ input: void
+ output: None
+ error: None
+ """
+
varTable = [
# regexp set method
# ------ ----------
]
titles={}
- line='prime the pump' # ugh
- while line:
- line=this.__fd.readline()
+ for line in this.__fd.readlines():
m=re.match('\\\\def\\\\mudela([\w]+){(.*)}',line)
if m:
for var in varTable:
Props.setTitles(titles,'file')
this.__fd.seek(0)
-class TeXOutput:
+\f
+class TeXOutput:
+ """
+ This class handles all ly2dvi.py output file methods
+
+ private methods:
+ __mudelaDefs(opt) Send title info to output file
+
+ Public methods:
+ __init__() Constructor
+ write(str) Write a string to output file
+ start(file) Start the latex file
+ next() Process next output file
+ end() Finish latex file and run latex
+ """
+
+ #
+ # constructor
+ #
def __init__(this):
this.__fd = None
this.__base = ''
this.__outfile = ''
+ #
+ # __medelaDefs
+ #
+ def __mudelaDefs(this,opt):
+ """
+ Write titles to output
+
+ input: opt Supports header and subheader output
+ output: None
+ error: None
+ """
+
+ titles = Props.get('titles')
+ for key in titles.keys():
+ this.write('%s\\mudela%s{%s}%%\n' % (opt,key,titles[key]))
+
+ #
+ # write
+ #
def write(this,str):
+ """
+ Write str to current output file
+
+ input: str String to write
+ output: None
+ error: None
+ """
+
this.__fd.write(str)
+ #
+ # start
+ #
def start(this,file):
- """Start the latex file"""
+ """
+ Start LaTeX file. Calculates the horizontal and vertical
+ margin using pagewidth, pageheight, linewidth, and textheight.
+ Creates temporary output filename and opens it for write.
+ Sends the LaTeX header information to output. Lastly sends
+ the title information to output.
+
+ input: file output file name
+ output: None
+ error: None
+ """
+
now=time.asctime(time.localtime(time.time()))
linewidth = Props.get('linewidth')
textheight = Props.get('textheight')
\\makelilytitle
""")
+ #
+ # next
+ #
def next(this):
+ """
+ Write LaTeX subheader information to support more than one
+ score in a document. Lastly send current title information to
+ output.
+
+ input: None
+ output: None
+ error: None
+ """
+
this.write("""\
\\def\\theopus{}%
\\def\\thepiece{}%
\\makelilypiecetitle
""")
- def __mudelaDefs(this,opt):
- titles = Props.get('titles')
- for key in titles.keys():
- this.write('%s\\mudela%s{%s}%%\n' % (opt,key,titles[key]))
+ #
+ # end
+ #
def end(this):
+ """
+ Close output file and run latex on it.
+
+ input: None
+ output: None
+ error: ExitBadLatex Exception
+ """
+
outfile=this.__base + '.dvi'
if Props.get('output') != '':
outfile = os.path.join(Props.get('output'), outfile )
if os.path.isfile(outfile):
os.remove(outfile)
os.rename(this.__base + '.' + str(os.getpid()) + '.dvi', outfile)
+ sys.stderr.write( '\n' + program_id() + ': dvi file name is %s\n\n'
+ % (outfile))
+
+ if Props.get('postscript'):
+ psoutfile=this.__base + '.ps'
+ if Props.get('output') != '':
+ psoutfile = os.path.join(Props.get('output'), psoutfile )
+ stat = os.system('dvips -o %s %s 2>&1' % (psoutfile,outfile))
+ if stat:
+ sys.exit('ExitBadPostscript')
+
-class Properties:
-
- def __set(this,var,value,requester):
- if this.__overrideTable[requester] < this.__data[var][1]:
- return 0
- else:
- this.__data[var] = [value, this.__overrideTable[requester]]
-
- def get(this,var):
- if var == 'include' or var == 'lilyOutputFiles':
- return this.__data[var][0][0:] # return a copy not a ref
- else:
- return this.__data[var][0]
+\f
- def get_texfile_path (this, var):
- path =''
- cmd =('kpsewhich tex %s 2>&1' % var)
- pipe = os.popen (cmd, 'r')
- path = pipe.readline ()[:-1] # chop off \n
- if pipe.close():
- path = os.path.join(this.get('root'), 'texmf', 'tex', 'lilypond', var)
+class Properties:
+ """
+ This class handles all ly2dvi.py property manipulation
- fd = open(path, 'r')
- return fd
+ Public methods:
+
+ __init__() Constructor
+ set<property> methods
+ """
def __init__(this):
+
+ #
+ # Following is the order of priority for property assignment. The
+ # list is organized from lowest to highest priority. Each
+ # assignment is overridden by the next requester in the list.
+ #
+ # Requester Description
+ # --------- -----------
+ # init Initial default values
+ # file The values found in the lilypond generated TeX files
+ # environment Envrionment variables LILYINCLUDE, LILYPONDPREFIX
+ # rcfile $LILYPONDPREFIX/share/lilypond/.lilyrc
+ # rcfile $HOME/.lilyrc
+ # rcfile ./.lilyrc
+ # commandline command line arguments
+ #
this.__overrideTable = {
'init' : 0,
- 'environment' : 1,
- 'rcfile' : 2,
- 'file' : 3,
+ 'file' : 1,
+ 'environment' : 2,
+ 'rcfile' : 3,
'commandline' : 4,
'program' : 5
}
- this.__roverrideTable = {} # reverse lookup
+ this.__roverrideTable = {} # reverse lookup used for debug
for i in this.__overrideTable.items():
this.__roverrideTable[i[1]]=i[0]
'titledefs' : [[], this.__overrideTable['init']],
'titles' : [{}, this.__overrideTable['init']],
'lilyOutputFiles' : [[], this.__overrideTable['init']],
+ 'postscript' : [0, this.__overrideTable['init']],
}
+ #
+ # Try to set root and HOME first before calling rcfile
+ #
+ if os.environ.has_key('LILYPONDPREFIX'):
+ this.setRoot(os.environ['LILYPONDPREFIX'], 'environment')
+ else:
+ p=os.path.split(sys.argv[0])
+ p=os.path.split(p[0])
+ this.setRoot(p[0],'init')
+
+ if not os.environ.has_key('HOME'):
+ if os.environ.has_key('HOMEDRIVE') and \
+ os.environ.has_key('HOMEPATH'):
+ os.environ['HOME'] = os.environ['HOMEDRIVE'] + \
+ os.environ['HOMEPATH']
+ else:
+ os.environ['HOME'] = os.curdir
+
+ this.rcfile() # Read initialization file(s)
+
if os.environ.has_key('LILYINCLUDE'):
tmp=this.get('include')
for s in string.split(os.environ['LILYINCLUDE'],os.pathsep):
tmp.append(s)
this.__set('include', tmp, 'environment')
- if os.environ.has_key('LILYPOND'):
- this.__set('root',os.environ['LILYPOND'], 'environment')
- else:
- p=os.path.split(sys.argv[0])
- p=os.path.split(p[0])
- this.__set('root',p[0],'init')
t=''
if os.environ.has_key ('TEXINPUTS'):
os.environ['TEXINPUTS'] = os.path.join(this.get('root'), 'texmf',
'tex', 'lilypond' ) + t
+ t=''
+ if os.environ.has_key ('MFINPUTS'):
+ t = os.pathsep + os.environ['MFINPUTS']
+ os.environ['MFINPUTS'] = os.path.join(this.get('root'), 'texmf',
+ 'mf', 'public', 'lilypond' ) + t
+
if os.environ.has_key('TMP'):
this.__set('tmp',os.environ['TMP'],'environment')
- if not os.environ.has_key('HOME'):
- if os.environ.has_key('HOMEDRIVE') and \
- os.environ.has_key('HOMEPATH'):
- os.environ['HOME'] = os.environ['HOMEDRIVE'] + \
- os.environ['HOMEPATH']
- else:
- os.environ['HOME'] = os.curdir
-
- fd =this.get_texfile_path ('titledefs.tex')
+ fd=this.get_texfile_path ('titledefs.tex')
mudefs=[]
- line='prime the pump' # ugh
- while line:
- line=fd.readline()
+
+ for line in fd.readlines():
m=re.match('\\\\newcommand\*{\\\\mudela([\w]+)}',line)
if m:
mudefs.append(m.group(1))
fd.close
this.__set('titledefs', mudefs, 'init')
-#
-# Read rc file
-#
+ #
+ # __set
+ #
+ def __set(this,var,value,requester):
+ """
+ All of the set methods call this to set a property. If the value
+ was last set by a requestor of lesser priority the new value is
+ assigned, else the old value has priority and is unchanged.
+ """
+
+ if this.__overrideTable[requester] < this.__data[var][1]:
+ return 0
+ else:
+ this.__data[var] = [value, this.__overrideTable[requester]]
+
+ #
+ # get
+ #
+ def get(this,var):
+ """
+ All of the get methods call this to get a property value. List
+ variable types are return by value to facilitate an append operation.
+ """
+
+ if var == 'include' or var == 'lilyOutputFiles':
+ return this.__data[var][0][0:] # return a copy not a ref
+ else:
+ return this.__data[var][0]
+
+ #
+ # get_texfile_path
+ #
+ def get_texfile_path (this, var):
+ """
+ locate and open titledefs.tex file
+ """
+
+ path =''
+ cmd =('kpsewhich tex %s 2>&1' % var)
+ pipe = os.popen (cmd, 'r')
+ path = pipe.readline ()[:-1] # chop off \n
+ if pipe.close():
+ path = os.path.join(this.get('root'), 'texmf', 'tex',
+ 'lilypond', var)
+ fd = open(path, 'r')
+ return fd
+
+
+ #
+ # Read rc file
+ #
def rcfile(this):
- """Read RCfile"""
+ """
+ Read initialization file(s)
+ """
varTable = [
# name set method
# ---- ----------
- ( 'LILYPOND', this.setInclude ),
+ ( 'DEBUG', this.setDebug ),
+ ( 'DEPENDENCIES', this.setDependencies ),
+ ( 'KEEPLILYPOND', this.setKeeplilypond ),
+ ( 'KEEPLY2DVI', this.setKeeply2dvi ),
( 'LANGUAGE', this.setLanguage ),
( 'LATEXHF', this.setHeader ),
+ ( 'LILYINCLUDE', this.setInclude ),
+ ( 'LILYPONDPREFIX', this.setRoot ),
+ ( 'NONUMBER', this.setNonumber ),
( 'ORIENTATION', this.setOrientation ),
( 'OUTPUTDIR', this.setOutput ),
( 'PAPERSIZE', this.setPaperZize ),
( 'PHEIGHT', this.setTextHeight ),
- ( 'TMP', this.setTmp ),
+ ( 'POSTSCRIPT', this.setPostscript ),
( 'PWIDTH', this.setLineWidth ),
+ ( 'SEPARATE', this.setSeparate ),
+ ( 'TMP', this.setTmp ),
]
+ if ( os.name == 'posix' ):
+ dotFilename='.lilyrc'
+ else: # Windows apps like edit choke on .lilyrc
+ dotFilename='_lilyrc'
+
for d in [os.path.join(this.get('root'),'share','lilypond'), \
os.environ['HOME'], os.curdir ]:
- file=os.path.join(d,'.lilyrc')
+ file=os.path.join(d,dotFilename)
try:
fd = open( file, 'r' )
except:
continue
- line='prime the pump' # ugh
- while line:
- line=fd.readline()
+ for line in fd.readlines():
if re.match('#.*',line):
continue
m=re.search('([\w]+)=(.*)',line)
break
fd.close
-#
-# Set paper size
-#
+ #
+ # setPaperZize
+ #
def setPaperZize(this,size,requester):
+ """
+ Set paper size properties
+ """
+
paperTable = [
# regex width height name
# ----- ----- ------ ----
if not found:
sys.exit('ExitBadPaper',size)
-#
-# set Text Height
-#
+ #
+ # setTextHeight
+ #
def setTextHeight(this,size,requester):
+ """
+ Set textheight property
+ """
+
m=re.match('([0-9][.0-9]*)(cm|mm|pt|$)',size)
if m:
if m.group(2) == 'cm':
sys.exit('ExitBadHeight', m.group(2))
else:
sys.exit('ExitBadHeight', size)
-#
-# set Text Width
-#
+
+ #
+ # setLineWidth
+ #
def setLineWidth(this,size,requester):
+ """
+ Set linewidth propery
+ """
+
m=re.match('([0-9][.0-9]*)(cm|mm|pt|$)',size)
if m:
if m.group(2) == 'cm':
sys.exit('ExitBadWidth', m.group(2))
else:
sys.exit('ExitBadWidth', size)
-#
-# Set Orientation
-#
+
+ #
+ # setOrientation
+ #
def setOrientation(this,orient,requester):
+ """
+ Set orientation property
+ """
+
if orient == 'landscape' or orient == 'portrait':
this.__set('orientation', orient, requester )
else:
sys.exit('ExitBadOrient', orient)
-#
-# Set Language
-#
+
+ #
+ # setLanguage
+ #
def setLanguage(this,lang,requester):
+ """
+ Set language property
+ """
+
this.__set('language', '\\usepackage[%s]{babel}' % (lang), requester )
-#
-# Append Include
-#
+
+ #
+ # setInclude
+ #
def setInclude(this,inc, requester):
+ """
+ Append an include path
+ """
+
tmp = this.get('include')
tmp.append(inc)
this.__set('include', tmp, requester )
-#
-# Set debug flag
-#
- def setDebug(this,requester):
- this.__set('debug',1,requester)
-#
-# Clear debug flag
-#
- def clearDebug(this, requester):
- this.__set('debug',0,requester)
-#
-# Set Keeplilypond flag
-#
- def setKeeplilypond(this, requester):
- this.__set('keeplilypond',1,requester)
-
-#
-# Clear Keeplilypond flag
-#
- def clearKeeplilypond(this, requester):
- this.__set('keeplilypond',0,requester)
+ #
+ # setDebug
+ #
+ def setDebug(this,value,requester):
+ """
+ Set or Clear debug flag
+ """
-#
-# Set Keeply2dvi flag
-#
- def setKeeply2dvi(this, requester):
- this.__set('keeply2dvi',1,requester)
-#
-# Clear Keeply2dvi flag
-#
- def clearKeeply2dvi(this, requester):
- this.__set('keeply2dvi',0,requester)
-#
-# Set No page number flag
-#
- def setNonumber(this, requester):
- this.__set('pagenumber','\\pagestyle{empty}',requester)
-
-#
-# Clear No page number flag
-#
- def clearNonumber(this, requester):
- this.__set('pagenumber','%',requester)
-#
-# Set separate flag
-#
- def setSeparate(this, requester):
- this.__set('separate',1,requester)
-
-#
-# Clear separate flag
-#
- def clearSeparate(this, requester):
- this.__set('separate',0,requester)
+ if int(value) == 1:
+ this.__set('debug',1,requester)
+ else:
+ this.__set('debug',0,requester)
+
+ #
+ # setKeeplilypond
+ #
+ def setKeeplilypond(this, value, requester):
+ """
+ Set or Clear keeplilypond flag
+ """
+
+ if int(value) == 1:
+ this.__set('keeplilypond',1,requester)
+ else:
+ this.__set('keeplilypond',0,requester)
+
+ #
+ # setKeeply2dvi
+ #
+ def setKeeply2dvi(this, value, requester):
+ """
+ Set or Clear keeply2dvi flag
+ """
+
+ if int(value) == 1:
+ this.__set('keeply2dvi',1,requester)
+ else:
+ this.__set('keeply2dvi',0,requester)
+
+ #
+ # setNonumber
+ #
+ def setNonumber(this, value, requester):
+ """
+ Set nonumber flag
+ """
+
+ if int(value) == 1:
+ this.__set('pagenumber',1,requester)
+ else:
+ this.__set('pagenumber',0,requester)
+
+ #
+ # setSeparate
+ #
+ def setSeparate(this, value, requester):
+ """
+ Set or Clear separate flag
+ """
+
+ if int(value) == 1:
+ this.__set('separate',1,requester)
+ else:
+ this.__set('separate',0,requester)
-#
-# Set output directory name
-#
+ #
+ # Set output directory name
+ #
def setOutput(this,out,requester):
this.__set('output',out,requester)
-#
-# Set latex header name
-#
+ #
+ # Set latex header name
+ #
def setHeader(this,head, requester):
this.__set('header',head,requester)
-#
-# Set Dependencies flag to generate makefile dependencies
-#
+
+ #
+ # Set or Clear Dependencies flag to generate makefile dependencies
+ #
def setDependencies(this, requester):
- this.__set('dependencies',1,requester)
+ """
+ Set or Clear dependencies flag
+ """
-#
-# Clear Dependencies flag
-#
- def clearDependencies(this, requester):
- this.__set('dependencies',0,requester)
-#
-# Set tmp directory
-#
+ if int(value) == 1:
+ this.__set('dependencies',1,requester)
+ else:
+ this.__set('dependencies',0,requester)
+
+ #
+ # Set tmp directory
+ #
def setTmp(this,dir, requester):
this.__set('tmp',dir,requester)
-#
-# Set mudela source file name
-#
+
+ #
+ # Set mudela source file name
+ #
def setFilename(this,file, requester):
this.__set('filename',file,requester)
-#
-# Set title commands
-#
+
+ #
+ # Set title commands
+ #
def setTitles(this,titles, requester):
this.__set('titles',titles,requester)
- def addLilyOutputFiles(this,file,requester):
+ #
+ # Set title commands
+ #
+ def addLilyOutputFiles(this,filelist,requester):
+ """
+ Add a to the lily output list
+ """
+
tmp = this.get('lilyOutputFiles')
- tmp.append(file)
+ tmp = tmp + filelist
this.__set('lilyOutputFiles',tmp,requester)
+ #
+ # Set/Clear postscript flag
+ #
+ def setPostscript(this,value,requester):
+ """
+ Set postscript flag
+ """
+
+ if int(value) == 1:
+ this.__set('postscript',1,requester)
+ else:
+ this.__set('postscript',0,requester)
+
+ #
+ # Set root
+ #
+ def setRoot(this,path, requester):
+ """
+ Set lilypond root directory
+ """
+
+ os.environ['LILYPONDPREFIX'] = path
+ this.__set('root',path,requester)
+
+ #
+ # printProps
+ #
def printProps(this):
+ """
+ Print properties
+ """
+
for key in this.__data.keys():
print "%s <%s>:<%s>" % (key,this.get(key),
this.__roverrideTable[this.__data[key][1]])
+\f
+
+#
+# Misc functions
+#
+
def getLilyopts():
inc = ''
if len(Props.get('include')) > 0:
fd.close()
def getTeXFile(contents):
- m = re.search('^TeX output to (.+)\.tex', contents,re.M)
- if m:
- return ( m.group(1)+'.tex' )
- else:
+ texfiles=[]
+ for line in string.split(contents,'\n'):
+ m = re.search('^TeX output to (.+)\.\.\.', line)
+ if m:
+ texfiles.append(m.group(1))
+
+ if texfiles == []:
sys.exit('ExitNoTeXName')
+ else:
+ return texfiles
def program_id ():
return name + ' ' + version;
' -L,--landscape set landscape orientation\n'
' -N,--nonumber switch off page numbering\n'
' -O,--orientation= set orientation (obsolete - use -L instead)\n'
+ ' -P,--postscript generate postscript file\n'
' -W,--Width= set paper width (points) (see manual page)\n'
' -d,--dependencies tell lilypond make a dependencies file\n'
' -h,--help this help text\n'
'files may be (a mix of) input to or output from lilypond(1)\n'
)
+\f
+
+#
+# main
+#
def main():
"""Generate dvi files from lilypond source/output"""
outfile = TeXOutput()
texInputFiles=[]
- Props.rcfile()
(options, files) = getopt.getopt (sys.argv[1:],
- 'DF:H:I:KLNW:dhkl:o:p:s',
+ 'DF:H:I:KLNPW:dhkl:o:p:s',
['debug', 'headers=', 'Height=',
'include=', 'keeplilypond', 'landscape',
'nonumber', 'Width=', 'dependencies',
'help', 'keeply2dvi', 'language=',
- 'output=', 'papersize=', 'separate'])
+ 'output=', 'papersize=', 'separate',
+ 'postscript'])
for opt in options:
o = opt[0]
a = opt[1]
if o == '--debug' or o == '-D':
- Props.setDebug('commandline')
+ Props.setDebug(1,'commandline')
elif o == '--headers' or o == '-F':
Props.setHeader(a,'commandline')
elif o == '--include' or o == '-I':
elif o == '--Height' or o == '-H':
Props.setTextHeight(a,'commandline')
elif o == '--keeplilypond' or o == '-K':
- Props.setKeeplilypond('commandline')
+ Props.setKeeplilypond(1,'commandline')
elif o == '--landscape' or o == '-L':
Props.setOrientation('landscape','commandline')
elif o == '--nonumber' or o == '-N':
elif o == '--Width' or o == '-W':
Props.setLineWidth(a,'commandline')
elif o == '--dependencies' or o == '-d':
- Props.setDependencies('commandline')
+ Props.setDependencies(1,'commandline')
elif o == '--help' or o == '-h':
help()
return 0
elif o == '--keeply2dvi' or o == '-k':
- Props.setKeeply2dvi('commandline')
+ Props.setKeeply2dvi(1,'commandline')
elif o == '--language' or o == '-l':
Props.setLanguage(a,'commandline')
elif o == '--output' or o == '-o':
elif o == '--papersize' or o == '-p':
Props.setPaperZize(a,'commandline')
elif o == '--separate' or o == '-s':
- Props.setSeparate('commandline')
+ Props.setSeparate(1,'commandline')
+ elif o == '--postscript' or o == '-P':
+ Props.setPostscript(1,'commandline')
if len(files):
for file in files:
if type == 'source':
cmd = 'lilypond %s %s 2>&1' % (getLilyopts(), file)
fd = os.popen( cmd , 'r' )
- log = fd.read()
+ log = ''
+ line=fd.readline()
+ while line:
+ log = log + line
+ sys.stderr.write( line )
+ line=fd.readline()
stat = fd.close()
- print log
if stat:
sys.exit('ExitBadLily', cmd )
- texFile=getTeXFile(log)
+ texFiles=getTeXFile(log)
writeLilylog(log)
- Props.addLilyOutputFiles(texFile,'program')
- texInputFiles.append(texFile)
+ Props.addLilyOutputFiles(texFiles,'program')
+ texInputFiles = texInputFiles + texFiles
else:
texInputFiles.append(file)
infile.open(file)
infile.setVars() # first pass set variables
infile.close()
-# Props.printProps()
+ if Props.get('debug'):
+ Props.printProps()
if firstfile:
outfile.start(file)
else:
'ExitNoTeXName' : ['hmm, I could not find an output file name', 9 ],
'ExitBadLily' : ['Lilypond failed', 10 ],
'ExitBadLatex' : ['Latex failed', 11 ],
+ 'ExitBadPostscript' : ['Postscript failed', 12 ],
'ExitUnknown' : ['Unknown Exit Code', 20 ],
}
os.remove(file)
-
-
-
-
-
identify()
Props = Properties()
sys.stderr.write( '%s: %s: %s\n' % (name, msg[0], errno.args[1]))
else:
sys.stderr.write( '%s %s\n' % (name, msg[0]))
+ if Props.get('debug'):
+ Props.printProps()
cleanup()
sys.exit(msg[1])
else:
cleanup()
-
-
-
-
-
-
-
exit 1
fi
+if ! make -C Documentation/man doc ; then
+ echo "make -C documentation/man doc failed"
+ exit 1
+fi
+
#
# Post install clean up
#
exit 1
fi
-cd $distdir/bin
-cp $CYGWIN_LIB .
-mv ly2dvi32 ly2dvi.py
+#
+# copy cygwin lib into bin
+#
+cp $CYGWIN_LIB $distdir/bin
+
+#
+# Rename ly2dvi32 to ly2dvi.py
+#
+mv $distdir/bin/ly2dvi32 $distdir/bin/ly2dvi.py
+
+#
+# copy man documentation to doc directory
+#
+mkdir $distdir/doc
+cp Documentation/man/out/*.txt $distdir/doc
+mv $distdir/doc/ly2dvi32.txt $distdir/doc/ly2dvi_py.txt
cd $distdir/..
$ZIP_CMD $ZIP_FILE $name
echo "Wrote $ZIP_FILE"
+rm -rf $name
exit 0