From 3bbf8ade8614c6e86a92163fc1b68712a26c5c9e Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Sat, 20 Jun 2020 14:49:57 +0200 Subject: [PATCH 01/20] =?UTF-8?q?add=20r=C3=83uberlied?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/songs/raeuberlied.ly | 132 ++++++++++++++++++++++++++++++++++++++ src/songs/raeuberlied.tex | 12 ++++ 2 files changed, 144 insertions(+) create mode 100644 src/songs/raeuberlied.ly create mode 100644 src/songs/raeuberlied.tex diff --git a/src/songs/raeuberlied.ly b/src/songs/raeuberlied.ly new file mode 100644 index 0000000..0a8c6e5 --- /dev/null +++ b/src/songs/raeuberlied.ly @@ -0,0 +1,132 @@ +\version "2.18.2" +\include "articulate.ly" + +\header { + title = "Räuberlied" + poet = "Frisch" + tagline = "" +} + +musicOne = \relative c'' { + \time 3/4 + \key c \major + \partial 8 c8 | + + \repeat volta 2 + { + g8. g16 g4 c | + a8. a16 a4. c8 | + b8. c16 d4 g, | + } + \alternative + { + { c8 e8 c4. c8 } + { c8 e8 c4. c8 } + } +} + +musicTwo = \relative c'' { + \repeat volta 2 + { + g8. b16 d4 d | + e8 c d4. c8 | + } +} + +musicThree = \relative c'' { + \repeat volta 2 + { + \time 3/4 + c8. b16 a4 (f'8) d | + \time 2/4 + e4 (d) | + } + \alternative + { + { c4. c8 } + { c4 r4 } + } + \bar "|." +} + +verseOne = \lyricmode { + Ein | + \repeat volta 2 + { + frei -- es Le -- ben | + füh -- ren wir, ein | + Le -- ben vol -- ller | + } + \alternative + { + { Won -- _ -- ne. Ein } + { Won -- _ -- ne. Der } + } +} + +verseTwo = \lyricmode { + \new Lyrics = "firstVerse"{ + << + { + Wald ist un -- ser | + Nacht -- quar -- tier; bei | + } + \new Lyrics = "secondVerse" + \with { alignBelowContext = "firstVerse" } + { + Sturm und Wind han -- | + tie -- ren wir; der | + } + >> + } +} + +verseThree = \lyricmode { + \repeat volta 2 + { + \time 3/4 + Mond ist uns -- re | + \time 2/4 + Son -- | + } + \alternative + { + { ne, der } + { ne. _ } + } +} + +\book { + \score { + << + \new Voice = "one" { + \musicOne + \musicTwo + \musicThree + } + \new Lyrics \lyricsto "one" { + \verseOne + \verseTwo + \verseThree + } + >> + \layout { + } + } +} + +\book { + \score { + \unfoldRepeats \articulate + << + \new Voice = "one" { + \musicOne + \musicTwo + \musicThree + } + >> + \midi { + \tempo 4 = 100 + } + } +} diff --git a/src/songs/raeuberlied.tex b/src/songs/raeuberlied.tex new file mode 100644 index 0000000..81915ea --- /dev/null +++ b/src/songs/raeuberlied.tex @@ -0,0 +1,12 @@ +\par +2. Heut kehren wir bei Pfaffen ein, bei masten Pächtern morgen; +da giebt’s Dukaten, Bier und Wein, was drüber ist, da lassen wir +fein den lieben Herrgott sorgen. +\par +3. Und haben wir im Traubensaft die Gurgel ausgebadet, so machen +wir uns Mut und Kraft und mit dem Schwarzen Brüderschaft, der +in der Hölle bratet. +\\~ +\begin{flushright} +Schiller, 1780 +\end{flushright} From 66c522310a955838f4ad41cba8a64dca324d433c Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Sat, 20 Jun 2020 14:59:42 +0200 Subject: [PATCH 02/20] add fourth verse for raeuberlied --- src/songs/raeuberlied.tex | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/songs/raeuberlied.tex b/src/songs/raeuberlied.tex index 81915ea..ff36a75 100644 --- a/src/songs/raeuberlied.tex +++ b/src/songs/raeuberlied.tex @@ -1,11 +1,15 @@ \par -2. Heut kehren wir bei Pfaffen ein, bei masten Pächtern morgen; -da giebt’s Dukaten, Bier und Wein, was drüber ist, da lassen wir -fein den lieben Herrgott sorgen. +2. |: Heut kehren wir bei Pfaffen ein, bei masten Pächtern morgen; :| +da gibt’s Dukaten, Bier und Wein, was drüber ist, da lassen wir fein +|: den lieben Herrgott sorgen. :| \par -3. Und haben wir im Traubensaft die Gurgel ausgebadet, so machen -wir uns Mut und Kraft und mit dem Schwarzen Brüderschaft, der -in der Hölle bratet. +3. |: Und haben wir im Traubensaft die Gurgel ausgebadet, so machen +wir uns Mut und Kraft und mit dem Schwarzen Brüderschaft, +|: der in der Hölle bratet. :| +\par +|: Und wenn dann unser Stündlein kommt, das unsre Taten lohnet, :| +so trinken wir uns toll und voll und bring'n dem Schwarzen unsern Zoll, +|: der in der Hölle thronet. :| \\~ \begin{flushright} Schiller, 1780 From 8e344b9d0524d1f98bbdd30dea16d1f36e10e8e3 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Sat, 20 Jun 2020 15:04:33 +0200 Subject: [PATCH 03/20] typo in lyrics to raeuberlied --- src/songs/raeuberlied.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/songs/raeuberlied.tex b/src/songs/raeuberlied.tex index ff36a75..34ab1c6 100644 --- a/src/songs/raeuberlied.tex +++ b/src/songs/raeuberlied.tex @@ -3,7 +3,7 @@ da gibt’s Dukaten, Bier und Wein, was drüber ist, da lassen wir fein |: den lieben Herrgott sorgen. :| \par -3. |: Und haben wir im Traubensaft die Gurgel ausgebadet, so machen +3. |: Und haben wir im Traubensaft die Gurgel ausgebadet, :| so machen wir uns Mut und Kraft und mit dem Schwarzen Brüderschaft, |: der in der Hölle bratet. :| \par From 8d3ea2b00feb2d1cdf3f2c6311ba766f4f5905a5 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 22 Jun 2020 08:56:27 +0200 Subject: [PATCH 04/20] =?UTF-8?q?typo=20in=20kurf=C3=BCrst=20friedrich?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/songs/kurfuerst_friedrich.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/songs/kurfuerst_friedrich.tex b/src/songs/kurfuerst_friedrich.tex index db438e9..50818be 100644 --- a/src/songs/kurfuerst_friedrich.tex +++ b/src/songs/kurfuerst_friedrich.tex @@ -25,7 +25,7 @@ machte er sein Testament, und es fanden seine Erben auch ein Buch in Pergament. Drinnen stand auf jeder Seit': -"Seid vernünftig, liebe Leuf! +"Seid vernünftig, liebe Leut! |: dieses geb' ich zu Attest: Heute wieder voll gewest!" \footnote{Diese Notiz des Kurfürsten Friedrich IV. von der Pfalz findet sich in dessen „Tage- und Ausgabebuch“ unterm 9. Juni 1598. Daselbst heißt es ferner: „30. Juli. Hab ich ein Rausch gehabet“} :| From b8720ec275656cdcefafc082073098b3359c8025 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 22 Jun 2020 09:29:58 +0200 Subject: [PATCH 05/20] add matrosenlied --- src/songs/matrosenlied.ly | 78 ++++++++++++++++++++++++++++++++++++++ src/songs/matrosenlied.tex | 20 ++++++++++ 2 files changed, 98 insertions(+) create mode 100644 src/songs/matrosenlied.ly create mode 100644 src/songs/matrosenlied.tex diff --git a/src/songs/matrosenlied.ly b/src/songs/matrosenlied.ly new file mode 100644 index 0000000..0e4eb9c --- /dev/null +++ b/src/songs/matrosenlied.ly @@ -0,0 +1,78 @@ +\version "2.18" +\include "articulate.ly" + +\header { + title = "Matrosenlied" + composer = "Fr. Silcher, 1830" + poet = "Mäßig" + tagline = "" +} + +musicOne = \relative b' { + \time 3/4 + \key g \major + + \partial 4 b8. a16 | + g4 d8 (b) c16 (d) e (fis) | + g8 (b,) d4 d16 (e) fis (g) | + a4. b16 (a) a8 e16 (fis) | + d4 r a'8. b16 | + c4 a g16 (fis) e (d) | + d8 (b') g4 a8. b16 | + c4 a g16 (fis) e (d) | + d8 (b') g4 g8\p g | + e8 e16 (c) g'4 fis8 (e) | + d2 g8.\f b16 | + a4 e fis8 d | + g2 g8.\ff b16 | + d4 d, b'8. a16 | + g2 r4 | + \bar "|." +} + +verseOne = \lyricmode { + Auf dem | + Meer bin ich ge -- | + bo -- ren, auf dem | + Mee -- re ward ich | + groß, zu dem | + Meer hab ich ge -- | + schwo -- ren, es zur | + ew -- gen Braut er -- | + ko -- ren; fin -- det | + drum des To -- des | + Los, auf dem | + Meer stirbt der Mat -- | + ros, auf dem | + Meer stirbt der Mat -- | + ros. +} + +\book { + \score { + << + \new Voice = "one" { + \musicOne + } + \new Lyrics \lyricsto "one" { + \verseOne + } + >> + \layout { + } + } +} + +\book { + \score { + \unfoldRepeats \articulate + << + \new Voice = "one" { + \musicOne + } + >> + \midi { + \tempo 4 = 130 + } + } +} diff --git a/src/songs/matrosenlied.tex b/src/songs/matrosenlied.tex new file mode 100644 index 0000000..79c30b9 --- /dev/null +++ b/src/songs/matrosenlied.tex @@ -0,0 +1,20 @@ +\par +2. Schwingt der Mai die Sonnenflügel, lacht ein heitrer Sommertag, +ziehen rebengrüne Hügel längs des Wassers Silberspiegel, sing +ich bei dem Ruderschlag |: seinen hellen Furchen nach. :| +\par +3. Stürmt, den Winter zu verkünden, durch die Nächte wild der +Nord, rauscht die Flut aus tiefen Gründen, wenn die Sternlein bleich +verschwinden, spring ich keck von Bord zu Bord, |: kühn zur Tat, wie treu im Wort. :| +\par +4. Kracht der Kiel dann auch zusammen, ich halt aus in letzter +Stund; unter Masten, Schutt und Flammen bet ich still zum Schicksal: +Amen! blick hinunter in den Schlund und |: fahr mit dem Schiff zu Grund. :| +\par +5. Unten schlaf ich doch nicht immer, denn der Himmel ist kein +Spott; einst erweckt im Morgenschimmer auch der Herr die lecken Trümmer, +und vom Stapel frank und flott |: läuft dahin ein neues Boot. :| +\par +6. Aus dem Meere ewger Rosen winkt des Lechtturms goldner +Strahl, und es landen die Matrosen als willkommne Festgenossen, +wo im heilgen Heldensaal |: thront der große Admiral. :| From 7e307a1b968684ae1f33de0971d67ac1070de855 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 22 Jun 2020 09:56:56 +0200 Subject: [PATCH 06/20] add bierlied --- src/songs/bierlied.ly | 86 ++++++++++++++++++++++++++++++++++++++++++ src/songs/bierlied.tex | 27 +++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 src/songs/bierlied.ly create mode 100644 src/songs/bierlied.tex diff --git a/src/songs/bierlied.ly b/src/songs/bierlied.ly new file mode 100644 index 0000000..9c2180b --- /dev/null +++ b/src/songs/bierlied.ly @@ -0,0 +1,86 @@ +\version "2.18" +\include "articulate.ly" + +\header { + title = "Bierlied" + composer = "" + poet = "Munter" + tagline = "" +} + +musicOne = \relative e' { + \time 3/8 + \key a \major + + \partial 8 e8 | + e (a) a | + a4 a8 | + a gis fis | + fis e e | + fis fis fis | + a gis fis | + fis e d | + d cis a' | + e e d | + d cis a' | + e e d | + cis4\fermata e16 e | + e8 a a16 a | + a8 cis cis16 cis | + d8 (b) b | + e4 cis16 cis | + d8 (b) b | + a4 r8 | + \bar "|." +} + +verseOne = \lyricmode { + Das | + Jahr ist | + gut, braun | + Bier ist ge -- | + ra -- ten, drum | + wünsch ich mir | + nichts als drei -- | + tau -- send Du -- | + ka -- ten, da -- | + mit ich kann | + schüt -- ten braun | + Bier in mein | + Loch; und je | + mehr ich da -- von | + trin -- ke, de -- sto | + besser schmeckt's | + noch, de -- sto | + besser schmeckt's | + noch. | +} + +\book { + \score { + << + \new Voice = "one" { + \musicOne + } + \new Lyrics \lyricsto "one" { + \verseOne + } + >> + \layout { + } + } +} + +\book { + \score { + \unfoldRepeats \articulate + << + \new Voice = "one" { + \musicOne + } + >> + \midi { + \tempo 4 = 100 + } + } +} diff --git a/src/songs/bierlied.tex b/src/songs/bierlied.tex new file mode 100644 index 0000000..e1c0012 --- /dev/null +++ b/src/songs/bierlied.tex @@ -0,0 +1,27 @@ +\par +2. Seh ich ein braun Bier, o welch ein Vergnügen! da tu ich +vor Freuden die Mütze abziegen, betracht das Gewächse, o große Allmacht, +das aus einem Traurigen |: einen Lustigen macht. :| +\par +3. Wenn einer vor Schulden nicht kann bleiben zu Hause, so geht +er ins Wirtshaus und setzt sich zum Schmause, er setzt sich zum Braunen +und tut, was er kann, und wer ihn da fordert, |: der kommt übel an. :| +\par +4. Unser Herrgott muß endlich wohl selber drüber lachen, was die +Menschen für närrische Sachen tun machen: planieren, plattieren, +plattieren, planieren und am Ende da |: tun sie noch gar appellieren. :| +\par +5. Bei der ersten Halben da ist's mäuschenstille, weil keiner mit +einer etwas anfangen wille; die zweite ist kritisch, die dritte muß ziegen, +bei der vierten giebt's Schläg, |: daß die Haar davon fliegen. :| +\par +6. Wenn ich einst sterbe, so laßt mich begraben, nicht unter den +Kirchhof, nicht über den Schragen; hinunter in Keller, wohl unter +das Faß! lieg gar nit gern trocken, |: lieg alleweil gern naß. :| +\par +7. Auf meinem Grabsteine da könnt ihr einst lesen, was ich für +ein närrischer Kauz bin gewesen, beständig betrunken, zuweilen ein +Narr, doch ein ehrlicher Kerl, |: und das letzte ist wahr! :| +\begin{flushright} +1824 +\end{flushright} From c9ed77b42482b7defc22e85877237a7e776f4f81 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 22 Jun 2020 10:36:01 +0200 Subject: [PATCH 07/20] add papst und sultan --- src/songs/papst_und_sultan.ly | 76 ++++++++++++++++++++++++++++++++++ src/songs/papst_und_sultan.tex | 23 ++++++++++ 2 files changed, 99 insertions(+) create mode 100644 src/songs/papst_und_sultan.ly create mode 100644 src/songs/papst_und_sultan.tex diff --git a/src/songs/papst_und_sultan.ly b/src/songs/papst_und_sultan.ly new file mode 100644 index 0000000..1324358 --- /dev/null +++ b/src/songs/papst_und_sultan.ly @@ -0,0 +1,76 @@ +\version "2.18" +\include "articulate.ly" + +\header { + title = "Papst und Sultan" + composer = "" + poet = "Heiter" + tagline = "" +} + +musicOne = \relative a' { + \time 4/4 + \key d \major + + \partial 4 a4 | + d4. d,8 d d fis d | + a'2 r4 cis8 d | + e4. d8 cis b a g | + fis2 r8 a b cis | + + \repeat volta 2 + { + d4. a8 e'4. a,8 | + fis'2 r8 e d cis | + b4 e d cis | + } + \alternative + { + { d2 r8 a b cis } + { d2 r2 } + } + \bar "|." +} + +verseOne = \lyricmode { + Der | + Papst lebt herr -- lich in der | + Welt, es _ | + fehlt ihm nie an Ab -- lass -- | + geld, er trinkt vom | + al -- ler -- bes -- ten | + Wein; drum möcht ich | + auch der Papst wohl | + sein; er trinkt vom | + sein | +} + +\book { + \score { + << + \new Voice = "one" { + \musicOne + } + \new Lyrics \lyricsto "one" { + \verseOne + } + >> + \layout { + } + } +} + +\book { + \score { + \unfoldRepeats \articulate + << + \new Voice = "one" { + \musicOne + } + >> + \midi { + \tempo 4 = 140 + + } + } +} diff --git a/src/songs/papst_und_sultan.tex b/src/songs/papst_und_sultan.tex new file mode 100644 index 0000000..4766d2f --- /dev/null +++ b/src/songs/papst_und_sultan.tex @@ -0,0 +1,23 @@ +\par +2. Doch nein, er ist ein armer Wicht, ein holdes Mädchen küßt +ihn nicht; |: er schläft in seinem Bett allein; ich möchte doch der Papst +nicht sein. :| +\par +3. Der Sultan lebt in Saus und Braus, er wohnt in einem +großen Haus; |: voll wunderschöner Mägdelein; drum möcht ich wohl der +Sultan sein. :| +\par +4. Doch nein, er ist ein armer Mann, denn folgt er seinem Alkoran, +|: so trinkt er keinen Tropfen Wein; ich möchte doch nicht Sultan sein. :| +\par +5. Geteilt veracht ich beider Glück und kehr in meinen Stand +zurück, |: doch das geh ich mit Freuden ein: Bald Papst, bald Sultan +möcht ich sein. :| +\par +6. Drum, Mädchen, gib mir einen Kuß, denn jetzt bin ich der +Sultanus. |: Ihr trauten Brüder, schenket ein, damit ich auch der Papst +kann sein. :| +\\~ +\begin{flushright} +Nach C. G. L. Noack, 1789 +\end{flushright} From 14e37037368785f2308396fd7b670d03f1a41ad3 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Thu, 16 Jul 2020 14:34:05 +0200 Subject: [PATCH 08/20] update to new lyluatex version --- Makefile | 4 +- src/kommersbuch.tex | 29 ++++++- src/lyluatex.lua | 187 -------------------------------------------- src/lyluatex.sty | 71 ----------------- src/song.tex | 9 ++- src/songs.lua | 2 +- 6 files changed, 36 insertions(+), 266 deletions(-) delete mode 100644 src/lyluatex.lua delete mode 100644 src/lyluatex.sty diff --git a/Makefile b/Makefile index 9110593..48bd97e 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ ${BUILD_OPUS_DIR}: ${TMP_SONG_DIR}/%.pdf: ${SONG_DIR}/%.ly ${SONG_DIR}/%.tex cd ${SRC_DIR} && lualatex --jobname='$(notdir $(basename $@))' --output-directory=${WORKING_DIR}/${TMP_SONG_DIR} --shell-escape ${WORKING_DIR}/${SRC_DIR}/song.tex ${WORKING_DIR}/${SONG_DIR}/$(notdir $(basename $@)).ly ${WORKING_DIR}/${SONG_DIR}/$(notdir $(basename $@)).tex - rm -r ${SRC_DIR}/tmp_ly + rm -r ${SRC_DIR}/tmp-ly ${BUILD_MIDI_DIR}/%.midi: ${TMP_MIDI_DIR}/%-1.midi cp $< $@ @@ -67,7 +67,7 @@ ${BUILD_OPUS_DIR}/%.opus: ${BUILD_MIDI_DIR}/%.midi ${TMP_BOOK_DIR}/%.pdf: ${SRC_DIR}/%.tex ${SRC_DIR}/images/title.png latexmk -cd -lualatex -e '$$lualatex=q/lualatex %O -shell-escape %S/' -output-directory=${WORKING_DIR}/${TMP_BOOK_DIR} $< - rm -r ${SRC_DIR}/tmp_ly + rm -r ${SRC_DIR}/tmp-ly ${TMP_BOOK_DIR}/%-folio.pdf: ${TMP_BOOK_DIR}/%.pdf cd ${TMP_BOOK_DIR} && \ diff --git a/src/kommersbuch.tex b/src/kommersbuch.tex index d34508b..363a612 100644 --- a/src/kommersbuch.tex +++ b/src/kommersbuch.tex @@ -1,6 +1,6 @@ % !Mode:: "TeX:UTF-8" -\documentclass[11pt, openany, oneside]{scrbook} +\documentclass[11pt, openany, twoside]{scrbook} \usepackage[utf8]{inputenc} \usepackage{fontspec} \usepackage{fancyhdr} @@ -42,8 +42,25 @@ \renewcommand\addchaptertocentry[2]{\addtocentrydefault{chapter}{}{#2}} \renewcommand{\contentsname}{Inhalt} -\renewcommand{\cfttoctitlefont}{\huge\textbf\rmfamily} -\renewcommand{\cftchapfont}{\large\rmfamily} + +\setlength{\columnseprule}{0.2pt} + +\hypersetup +{ + bookmarks=true, % show bookmarks bar? + unicode=true, % non-Latin characters in Acrobat’s bookmarks + pdftoolbar=true, % show Acrobat’s toolbar? + pdfmenubar=false, % show Acrobat’s menu? + pdffitwindow=false, % window fit to page when opened + pdfstartview={FitH}, % fits the width of the page to the window + pdftitle={Alcolica Kommersbuch}, % title + pdfauthor={Sebastian Hugentobler}, % author + pdfsubject={Kantenprügel der Alcolica Verbindung}, % subject of the document + pdfcreator={Sebastian Hugentobler}, % creator of the document + pdfproducer={Sebastian Hugentobler}, % producer of the document + pdfnewwindow=true, % links in new window + colorlinks=false, % false: boxed links; true: colored links +} \begin{document} \begin{titlepage} @@ -62,6 +79,12 @@ \tableofcontents \newpage + \lysetoption{staffsize}{22} + \lysetoption{quote}{true} + \lysetoption{indent}{false} + \lysetoption{insert}{inline} + \lysetoption{pass-fonts}{true} + \songs \end{document} diff --git a/src/lyluatex.lua b/src/lyluatex.lua deleted file mode 100644 index 255b25f..0000000 --- a/src/lyluatex.lua +++ /dev/null @@ -1,187 +0,0 @@ -local err, warn, info, log = luatexbase.provides_module({ - name = "lyluatex", - version = '0', - greinternalversion = internalversion, - date = "2017/09/30", - description = "Module lyluatex.", - author = "The Gregorio Project (see CONTRIBUTORS.md)", - copyright = "2008-2017 - The Gregorio Project", - license = "MIT", -}) - -local md5 = require 'md5' - - -LILYPOND = 'lilypond' -TMP = 'tmp_ly' -N = 0 - - -function ly_definir_programme(lilypond) - if lilypond then LILYPOND = lilypond end -end - - -function contenuIntegral(contenu) - local content ="" - for i, Line in ipairs(contenu:explode('\n')) do - if Line:find("^%s*[^%%]*\\include") then - local i = io.open(Line:gsub('%s*\\include%s*"(.*)"%s*$', "%1"), 'r') - if i then - content = content .. contenuIntegral(i:read('*a')) - else - content = content .. Line .. "\n" - end - else - content = content .. Line .. "\n" - end - end - return content -end - - -function direct_ly(ly, largeur, facteur) - N = N + 1 - facteur = calcul_facteur(facteur) - ly = ly:gsub('\\par ', '\n'):gsub('\\([^%s]*) %-([^%s])', '\\%1-%2') - print(ly) - local sortie = TMP..'/'..string.gsub(md5.sumhexa(contenuIntegral(ly))..'-'..facteur..'-'..largeur, '%.', '-') - if not lfs.isfile(sortie..'-systems.tex') then - compiler_ly(entete_lilypond(facteur, largeur - 10)..'\n'..ly, sortie) - end - retour_tex(sortie) -end - - -function inclure_ly(entree, currfiledir, largeur, facteur) - facteur = calcul_facteur(facteur) - nom = splitext(entree, 'ly') - entree = currfiledir..nom..'.ly' - if not lfs.isfile(entree) then entree = kpse.find_file(nom..'.ly') end - if not lfs.isfile(entree) then err("Le fichier %s.ly n'existe pas.", nom) end - local i = io.open(entree, 'r') - ly = i:read('*a') - i:close() - local sortie = TMP..'/' ..string.gsub(md5.sumhexa(contenuIntegral(ly))..'-'..facteur..'-'..largeur, '%.', '-') - if not lfs.isfile(sortie..'-systems.tex') then - compiler_ly(entete_lilypond(facteur, largeur - 10)..'\n'..ly, sortie, dirname(entree)) - end - retour_tex(sortie) -end - - -function compiler_ly(ly, sortie, include) - mkdirs(dirname(sortie)) - local commande = LILYPOND.." ".. - "-dno-point-and-click ".. - "-dbackend=eps ".. - "-djob-count=2 ".. - "-ddelete-intermediate-files " - if include then commande = commande.."-I '"..lfs.currentdir().."/"..include.."' " end - commande = commande.."-o "..sortie.." -" - local p = io.popen(commande, 'w') - p:write(ly) - p:close() -end - - -function entete_lilypond(facteur, largeur) - return string.format( -[[%%En-tête -\version "2.18.2" -#(define default-toplevel-book-handler - print-book-with-defaults-as-systems ) - -#(define toplevel-book-handler - (lambda ( . rest) - (set! output-empty-score-list #f) - (apply print-book-with-defaults rest))) - -#(define toplevel-music-handler - (lambda ( . rest) - (apply collect-music-for-book rest))) - -#(define toplevel-score-handler - (lambda ( . rest) - (apply collect-scores-for-book rest))) - -#(define toplevel-text-handler - (lambda ( . rest) - (apply collect-scores-for-book rest))) - - -#(set-global-staff-size %s) - - -%%Paramètres de la partition -\paper{ - indent = 0\mm - line-width = %s\pt -} - -%%Partition originale -]], -facteur, -largeur -) -end - - -function calcul_facteur(facteur) - if facteur == 0 then facteur = fontinfo(font.current()).size/39321.6 end - return facteur -end - - -function retour_tex(sortie) - local i = io.open(sortie..'-systems.tex', 'r') - contenu = i:read("*all") - i:close() - texoutput, _ = string.gsub( - contenu, - [[includegraphics{]], [[includegraphics{]]..dirname(sortie) - ) - tex.print(([[\noindent]]..texoutput):explode('\n')) -end - - -function dirname(str) - if str:match(".-/.-") then - local name = string.gsub(str, "(.*/)(.*)", "%1") - return name - else - return '' - end -end - - -function splitext(str, ext) - if str:match(".-%..-") then - local name = string.gsub(str, "(.*)(%." .. ext .. ")", "%1") - return name - else - return str - end -end - - -function mkdirs(str) - path = '.' - for dir in string.gmatch(str, '([^%/]+)') do - path = path .. '/' .. dir - lfs.mkdir(path) - end -end - - -local fontdata = fonts.hashes.identifiers -function fontinfo(id) - local f = fontdata[id] - if f then - return f - end - return font.fonts[id] -end - - -mkdirs(TMP) diff --git a/src/lyluatex.sty b/src/lyluatex.sty deleted file mode 100644 index 2588452..0000000 --- a/src/lyluatex.sty +++ /dev/null @@ -1,71 +0,0 @@ -\ProvidesPackage{lyluatex} - -% Dépendances -\RequirePackage{luatexbase} -\RequirePackage{luaotfload} -\RequirePackage{kvoptions} -\RequirePackage{graphicx} -\RequirePackage{keycommand} -\RequirePackage{environ} -\RequirePackage{currfile} -% Options -\DeclareStringOption[lilypond]{program}[lilypond] -\ProcessKeyvalOptions* -% Script lua -\directlua{dofile(kpse.find_file("lyluatex.lua"))} -\directlua{LILYPOND = '\lyluatex@program'} - -% Une tricherie un peu sale pour récupérer la largeur de ligne -\let\bs\textbackslash -{\catcode`p=12 \catcode`t=12 \gdef\un#1pt{#1}} -\newcommand*{\largeur}{\expandafter\un\the\linewidth} -% Taille des partitions -% Si la valeur est 0, elle sera automatiquement calculée -% à partir de la taille de police. -\def\staffsize{0} -\let\localstaffsize\staffsize - - -% Commandes principales -% Inclusion d'un fichier ly -\newkeycommand*\includely[staffsize=\staffsize][autres][1]{% -\directlua{% - inclure_ly( - "\luatexluaescapestring{#1}", - "\luatexluaescapestring{\currfiledir}", - \luatexluaescapestring{\largeur}, - \luatexluaescapestring{\commandkey{staffsize}} - )% -}% -} - -% Inclusion d'un fragment intégré au document (environnement de base) -\NewEnviron{compilerly}{% -\directlua{% - direct_ly( - "\luatexluaescapestring{\unexpanded\expandafter{\BODY}}", - \luatexluaescapestring{\largeur}, - \luatexluaescapestring{\localstaffsize} - )% -}% -} - -% Commande et environnement avec paramètres -\newkeycommand{\lily}[staffsize=\staffsize][autres][1]{% -\def\localstaffsize{\commandkey{staffsize}}% -\begin{compilerly}% -#1 -\end{compilerly}% -} - -\newkeyenvironment{ly}[staffsize=\staffsize][autres]{% -\def\localstaffsize{\commandkey{staffsize}}% -\compilerly% -}{% -\endcompilerly% -} - -% Commandes pour la compatibilité avec lilypond-book -\let\lilypondfile\includely -\let\lilypond\ly -\let\endlilypond\endly diff --git a/src/song.tex b/src/song.tex index 9e85542..1fb88bb 100644 --- a/src/song.tex +++ b/src/song.tex @@ -3,7 +3,6 @@ \documentclass[11pt, openany, oneside]{scrbook} \usepackage{fontspec} -%%\usepackage[a4paper,left=3cm,right=3cm, top=3cm, bottom=3cm,includeheadfoot]{geometry} \usepackage[a4paper]{geometry} \usepackage{lmodern} \usepackage{tgschola} @@ -14,8 +13,14 @@ \pagenumbering{gobble} + \lysetoption{staffsize}{22} + \lysetoption{quote}{true} + \lysetoption{indent}{false} + \lysetoption{insert}{inline} + \lysetoption{pass-fonts}{true} + \directlua{ - tex.sprint("\string\\includely[staffsize=16]{" .. arg[5] .. "}") + tex.sprint("\string\\lilypondfile{" .. arg[5] .. "}") } ~\\ \directlua{ diff --git a/src/songs.lua b/src/songs.lua index 703c14b..00c489a 100644 --- a/src/songs.lua +++ b/src/songs.lua @@ -28,7 +28,7 @@ function find_songs(dir) local ly_title = string.match(ly_content, 'title = "(.-)"') tex.sprint('\\unchapter{' .. ly_title .. '}') - tex.sprint('\\includely[staffsize=16]{' .. dir .. '/' .. file .. '}') + tex.sprint('\\lilypondfile{' .. dir .. '/' .. file .. '}') tex.sprint('~\\\\') tex.sprint('~\\\\') tex.sprint('\\input{' .. dir .. '/' .. file:gsub("%.ly", ".tex") .. '}') From 039017ece65847b5d94b61cc25599d10e22e08d0 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 4 Jan 2021 14:22:51 +0100 Subject: [PATCH 09/20] =?UTF-8?q?add=20k=C3=B6nig=20von=20preussen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/songs/koenig_von_preussen.ly | 82 +++++++++++++++++++++++++++++++ src/songs/koenig_von_preussen.tex | 49 ++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 src/songs/koenig_von_preussen.ly create mode 100644 src/songs/koenig_von_preussen.tex diff --git a/src/songs/koenig_von_preussen.ly b/src/songs/koenig_von_preussen.ly new file mode 100644 index 0000000..1d7de03 --- /dev/null +++ b/src/songs/koenig_von_preussen.ly @@ -0,0 +1,82 @@ +\version "2.18" +\include "articulate.ly" + +\header { + title = "O König von Preußen" + composer = "Volksweise (18. Jh.)" + poet = "" + tagline = "" +} + +musicOne = \relative c' { + \time 2/4 + \key d \major + + \partial 8 a8 | + d4 d8 d | + d4 fis8 fis | + fis e e cis | + d4 r8 fis | + fis (a) a a | + b (a) g fis | + fis e e fis | + e4 r8 fis | + fis a a a | + b4. a8 | + a g g b | + a4 a8 (fis) | + d d d d | + e (fis) g e | + d d cis e | + d4 r | + \bar "|." +} + +verseOne = \lyricmode { + O | + Kö -- nig von | + Preu -- ßen, du | + gro -- ßer Po -- ten -- | + tat, ich | + bin__ dei -- nes | + Dien -- stes so | + ü -- ber -- flüs -- sig | + satt. Was | + fan -- gen wir nur | + an, in | + die -- sem Jam -- mer -- | + tal, all -- | + wo ist nicht zu | + fin -- den als | + lau --ter Not und | + Qual. | +} + +\book { + \score { + << + \new Voice = "one" { + \musicOne + } + \new Lyrics \lyricsto "one" { + \verseOne + } + >> + \layout { + } + } +} + +\book { + \score { + \unfoldRepeats \articulate + << + \new Voice = "one" { + \musicOne + } + >> + \midi { + \tempo 4 = 100 + } + } +} diff --git a/src/songs/koenig_von_preussen.tex b/src/songs/koenig_von_preussen.tex new file mode 100644 index 0000000..07e36bb --- /dev/null +++ b/src/songs/koenig_von_preussen.tex @@ -0,0 +1,49 @@ +\par +2. Und kommt das Frühjahr an, +da ist die große Hitz', +da muß man exerzier'n, +daß eim der Buckel schwitzt. +Da muß man exerzier'n +vom Morgen bis Mittag, +und das verfluchte Leben +das währt den ganzen Tag. +\par +3. Vom Exerzieren weg, +geht's wieder auf die Wacht, +kein Teufel tut nicht frag'n, +ob man gefressen hat. +Kein Branntwein in der Flaschen, +kein weißes Brot dabei; +ein schlechtes Tabakrauchen, +das ist er Zeitvertreib. +\par +4. Ihr Herren, nehmt's nicht Wunder, +wann einer desertiert, +wir werden wie die Hunde +mit Schlägen strapeziert; +und bringen sie uns wieder, +sie henken uns nicht auf, +das Kriegsrecht wird gesprochen: +Der Kerl muß Gassen lauf! +5. \par +Und wann wir Gassen laufen, +so spielet man uns auf +mit Waldhorn und Trompeten, +da geht es tapfer drauf; +da werden wir gehauen +von einem Musketier, +der eine hat's Bedauern, +der andre gönnt es mir. +\par +6. Und werden wir dann alt, +wo wenden wir uns hin? +Die Gesundheit ist verloren, +die Kräfte sind dahin! +Und endlich wird es heißen: +Ein Vogel und kein Nest! +Geh', Alter, nimm den Bettelsack, +bist auch Soldat gewest! +\\~ +\begin{flushright} +Volkslied, 1815 +\end{flushright} From d834488e2f6c82b0d2751e7f6fbd9e5722f7799b Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 4 Jan 2021 15:01:51 +0100 Subject: [PATCH 10/20] add die gedanken sind frei --- src/songs/gedanken_sind_frei.ly | 94 ++++++++++++++++++++++++++++++++ src/songs/gedanken_sind_frei.tex | 49 +++++++++++++++++ 2 files changed, 143 insertions(+) create mode 100644 src/songs/gedanken_sind_frei.ly create mode 100644 src/songs/gedanken_sind_frei.tex diff --git a/src/songs/gedanken_sind_frei.ly b/src/songs/gedanken_sind_frei.ly new file mode 100644 index 0000000..f82a605 --- /dev/null +++ b/src/songs/gedanken_sind_frei.ly @@ -0,0 +1,94 @@ +\version "2.18" +\include "articulate.ly" + +\header { + title = "Die Gedanken sind frei" + composer = "Volksweise (um 1815) " + poet = "" + tagline = "" +} + +musicOne = \relative e' { + \time 3/4 + \key a \major + + \partial 4 e8 e | + \repeat volta 2 + { + a4 a cis8 (a) | + e2 e4 | + d b e | + } + \alternative + { + { cis a e'8 e } + { cis4 a a' } + } + gis4 b4. gis8 | + a4 cis a | + gis b4. gis8 | + a4 cis a | + fis fis a8 (fis) | + e2 e8 cis' | + cis (b) a4 gis | + a2 r4 | + \bar "|." +} + +verseOne = \lyricmode { + Die Ge -- | + dan -- ken sind | + frei, wer | + kann sie err -- | + ra -- ten, sie _ | + _ _ _ | + Mensch kann sie | + wis -- sen, kein | + Jä -- ger er -- | + schie -- ßen. Es | + blei -- bet da -- | + bei: Die Ge -- | + dan -- ken sind | + frei. | +} + +verseOneRepeat = \lyricmode { + _ _ | + flie -- hen vor -- | + bei, wie | + nächt -- li -- che | + _ _ _ _ | + Schat -- ten. Kein | +} + +\book { + \score { + << + \new Voice = "one" { + \musicOne + } + \new Lyrics \lyricsto "one" { + \verseOne + } + \new Lyrics \lyricsto "one" { + \verseOneRepeat + } + >> + \layout { + } + } +} + +\book { + \score { + \unfoldRepeats \articulate + << + \new Voice = "one" { + \musicOne + } + >> + \midi { + \tempo 4 = 100 + } + } +} diff --git a/src/songs/gedanken_sind_frei.tex b/src/songs/gedanken_sind_frei.tex new file mode 100644 index 0000000..a6b3979 --- /dev/null +++ b/src/songs/gedanken_sind_frei.tex @@ -0,0 +1,49 @@ +\par +2. Die Gedanken sind frei, +wer kann sie erraten, +sie fliehen vorbei, +wie nächtliche Schatten. +Kein Mensch kann sie wissen, +kein Jäger erschießen. +Es bleibet dabei: +Die Gedanken sind frei. +\par +3. Ich denke, was ich will, +und was mich beglücket, +doch alles in der Still, +und wie es sich schicket. +Mein Wunsch und Begehren +kann niemand verwehren, +es bleibet dabei: +die Gedanken sind frei. +\par +4. Ich liebe den Wein, +mein Mädchen vor allen, +sie tut mir allein +am besten gefallen. +Ich bin nicht alleine +bei meinem Glas Weine, +mein Mädchen dabei: +die Gedanken sind frei. +\par +5. Und sperrt man mich ein +im finsteren Kerker, +das alles sind rein +vergebliche Werke; +denn meine Gedanken +zerreißen die Schranken +und Mauern entzwei: +die Gedanken sind frei. +\par +6. Drum will ich auf immer +den Sorgen entsagen +und will mich auch nimmer +mit Grillen mehr plagen. +Man kann ja im Herzen +stets lachen und scherzen +und denken dabei: +die Gedanken sind frei. +\\~ +\begin{flushright} +Volkslied, 18. Jh. +\end{flushright} From 7d111332eba52bbb7080f0cc4d87a77fd569d390 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Wed, 6 Jan 2021 09:41:03 +0100 Subject: [PATCH 11/20] correct typos --- src/songs/gedanken_sind_frei.ly | 2 +- src/songs/gedanken_sind_frei.tex | 17 ++++------------- src/songs/koenig_von_preussen.ly | 2 +- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/songs/gedanken_sind_frei.ly b/src/songs/gedanken_sind_frei.ly index f82a605..72cd4c8 100644 --- a/src/songs/gedanken_sind_frei.ly +++ b/src/songs/gedanken_sind_frei.ly @@ -3,7 +3,7 @@ \header { title = "Die Gedanken sind frei" - composer = "Volksweise (um 1815) " + composer = "Volksweise, um 1815" poet = "" tagline = "" } diff --git a/src/songs/gedanken_sind_frei.tex b/src/songs/gedanken_sind_frei.tex index a6b3979..4a61148 100644 --- a/src/songs/gedanken_sind_frei.tex +++ b/src/songs/gedanken_sind_frei.tex @@ -1,14 +1,5 @@ \par -2. Die Gedanken sind frei, -wer kann sie erraten, -sie fliehen vorbei, -wie nächtliche Schatten. -Kein Mensch kann sie wissen, -kein Jäger erschießen. -Es bleibet dabei: -Die Gedanken sind frei. -\par -3. Ich denke, was ich will, +2. Ich denke, was ich will, und was mich beglücket, doch alles in der Still, und wie es sich schicket. @@ -17,7 +8,7 @@ kann niemand verwehren, es bleibet dabei: die Gedanken sind frei. \par -4. Ich liebe den Wein, +3. Ich liebe den Wein, mein Mädchen vor allen, sie tut mir allein am besten gefallen. @@ -26,7 +17,7 @@ bei meinem Glas Weine, mein Mädchen dabei: die Gedanken sind frei. \par -5. Und sperrt man mich ein +4. Und sperrt man mich ein im finsteren Kerker, das alles sind rein vergebliche Werke; @@ -35,7 +26,7 @@ zerreißen die Schranken und Mauern entzwei: die Gedanken sind frei. \par -6. Drum will ich auf immer +5. Drum will ich auf immer den Sorgen entsagen und will mich auch nimmer mit Grillen mehr plagen. diff --git a/src/songs/koenig_von_preussen.ly b/src/songs/koenig_von_preussen.ly index 1d7de03..cf3e064 100644 --- a/src/songs/koenig_von_preussen.ly +++ b/src/songs/koenig_von_preussen.ly @@ -3,7 +3,7 @@ \header { title = "O König von Preußen" - composer = "Volksweise (18. Jh.)" + composer = "Volksweise, 18. Jh." poet = "" tagline = "" } From f53f7b13244259d27db526e47fb2c34ba34d94f9 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Wed, 6 Jan 2021 13:47:00 +0100 Subject: [PATCH 12/20] correct typos --- src/songs/koenig_von_preussen.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/songs/koenig_von_preussen.tex b/src/songs/koenig_von_preussen.tex index 07e36bb..e1f5b19 100644 --- a/src/songs/koenig_von_preussen.tex +++ b/src/songs/koenig_von_preussen.tex @@ -25,8 +25,8 @@ und bringen sie uns wieder, sie henken uns nicht auf, das Kriegsrecht wird gesprochen: Der Kerl muß Gassen lauf! -5. \par -Und wann wir Gassen laufen, +\par +5. Und wann wir Gassen laufen, so spielet man uns auf mit Waldhorn und Trompeten, da geht es tapfer drauf; From d0e659cd3e3420b61ffca92dc77f95ef94dcc833 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 18 Apr 2022 13:54:56 +0200 Subject: [PATCH 13/20] update makebook to version 2.2 --- bin/makebook | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/bin/makebook b/bin/makebook index 93913e0..237a79d 100755 --- a/bin/makebook +++ b/bin/makebook @@ -6,10 +6,10 @@ # #**********************************************************# # makebook # -# written by Donald P. Goodman III # -# Copyright (C) 2011 # -# # -# Impose pdf pages for binding # +# written by Donald P. Goodman III # +# Copyright (C) 2011 # +# # +# Impose pdf pages for binding # #**********************************************************# # # This program is free software: you can redistribute it @@ -34,7 +34,7 @@ PATH=/bin:/usr/bin:/usr/local/bin ; export PATH umask 033 # define our revision number variable for rcs -REVISION="2.1" +REVISION="2.2" # define error codes E_WRONG_ARGS=64 # too many or few args E_BAD_SIG_TYPE=65 # invalid type of signature @@ -88,8 +88,7 @@ command -v bc >/dev/null 2>&1 || # print the version information and exit successfully versionfunc () { - echo "makebook v${REVISION}. Copyright (C) 2011, Donald P." - echo "Goodman III." + echo "makebook v${REVISION}. Copyright (C) 2011, Donald P Goodman III." echo "This program comes with ABSOLUTELY NO WARRANTY." echo "This is free software, and you are welcome to " echo "redistribute it under certain conditions; see " @@ -263,6 +262,9 @@ then cp "$FILE_NAME" "$NEW_FILE_NAME" else FILE_NAME="book.pdf" + if [ $VERBOSE -eq 1 ]; then + echo "makebook: No input file named; using stdin..." + fi cat /dev/stdin > "$NEW_FILE_NAME" fi # declare holder variable for pdftk @@ -287,8 +289,8 @@ fi # get some information about our source document NUM_PAGES=`pdfinfo "$NEW_FILE_NAME" | awk '/Pages:/ {print $2}'`; -SRC_PAGE_WIDTH=`pdfinfo "$NEW_FILE_NAME" | awk '/Page\ size:/ {print $3}'`; -SRC_PAGE_HEIGHT=`pdfinfo "$NEW_FILE_NAME" | awk '/Page\ size:/ {print $5}'`; +SRC_PAGE_WIDTH=`pdfinfo "$NEW_FILE_NAME" | awk '/Page size:/ {print $3}'`; +SRC_PAGE_HEIGHT=`pdfinfo "$NEW_FILE_NAME" | awk '/Page size:/ {print $5}'`; # find the number of pages we'll have per signature PAGES_PER_SIG=$(dc -e "$PAGES_PER_SIG $SECT_TYPE * p") # determine if extra pages will be necessary From 660a08779cedddafe50c410043f51a3695d9a9a9 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 18 Apr 2022 14:50:22 +0200 Subject: [PATCH 14/20] start cleaning up directory creation --- Makefile | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 48bd97e..c753bc0 100644 --- a/Makefile +++ b/Makefile @@ -23,11 +23,6 @@ LY_OPUS=$(patsubst %.ly,${BUILD_OPUS_DIR}/%.opus,$(notdir ${LY_FILES})) .PHONY: book songs midi opus clean directories all .DEFAULT_GOAL := all -directories: ${BUILD_DIR} ${BUILD_BOOK_DIR} ${TMP_BOOK_DIR} ${BUILD_SONG_DIR} ${BUILD_MIDI_DIR} ${TMP_DIR} ${TMP_SONG_DIR} ${TMP_MIDI_DIR} ${BUILD_OPUS_DIR} - -${BUILD_DIR}: - mkdir -p ${BUILD_DIR} - ${BUILD_BOOK_DIR}: mkdir -p ${BUILD_BOOK_DIR} @@ -37,9 +32,6 @@ ${BUILD_SONG_DIR}: ${BUILD_MIDI_DIR}: mkdir -p ${BUILD_MIDI_DIR} -${TMP_DIR}: - mkdir -p ${TMP_DIR} - ${TMP_BOOK_DIR}: mkdir -p ${TMP_BOOK_DIR} @@ -52,20 +44,20 @@ ${TMP_MIDI_DIR}: ${BUILD_OPUS_DIR}: mkdir -p ${BUILD_OPUS_DIR} -${TMP_SONG_DIR}/%.pdf: ${SONG_DIR}/%.ly ${SONG_DIR}/%.tex +${TMP_SONG_DIR}/%.pdf: ${SONG_DIR}/%.ly ${SONG_DIR}/%.tex | ${TMP_SONG_DIR} cd ${SRC_DIR} && lualatex --jobname='$(notdir $(basename $@))' --output-directory=${WORKING_DIR}/${TMP_SONG_DIR} --shell-escape ${WORKING_DIR}/${SRC_DIR}/song.tex ${WORKING_DIR}/${SONG_DIR}/$(notdir $(basename $@)).ly ${WORKING_DIR}/${SONG_DIR}/$(notdir $(basename $@)).tex rm -r ${SRC_DIR}/tmp-ly -${BUILD_MIDI_DIR}/%.midi: ${TMP_MIDI_DIR}/%-1.midi +${BUILD_MIDI_DIR}/%.midi: ${TMP_MIDI_DIR}/%-1.midi | ${BUILD_MIDI_DIR} cp $< $@ -${TMP_MIDI_DIR}/%-1.midi: ${SONG_DIR}/%.ly +${TMP_MIDI_DIR}/%-1.midi: ${SONG_DIR}/%.ly | ${TMP_MIDI_DIR} lilypond --output=${TMP_MIDI_DIR} ${WORKING_DIR}/$< -${BUILD_OPUS_DIR}/%.opus: ${BUILD_MIDI_DIR}/%.midi +${BUILD_OPUS_DIR}/%.opus: ${BUILD_MIDI_DIR}/%.midi | ${BUILD_OPUS_DIR} timidity $< -Ow -o - | opusenc - $@ -${TMP_BOOK_DIR}/%.pdf: ${SRC_DIR}/%.tex ${SRC_DIR}/images/title.png +${TMP_BOOK_DIR}/%.pdf: ${SRC_DIR}/%.tex ${SRC_DIR}/images/title.png | ${TMP_BOOK_DIR} latexmk -cd -lualatex -e '$$lualatex=q/lualatex %O -shell-escape %S/' -output-directory=${WORKING_DIR}/${TMP_BOOK_DIR} $< rm -r ${SRC_DIR}/tmp-ly @@ -87,13 +79,13 @@ ${TMP_BOOK_DIR}/%-octavo.pdf: ${TMP_BOOK_DIR}/%.pdf cd ${TMP_BOOK_DIR} && \ ../../bin/makebook -v -t octavo -i $(notdir $<) -o $(notdir $@) -${BUILD_DIR}/%.pdf: ${TMP_DIR}/%.pdf +${BUILD_DIR}/%.pdf: ${TMP_DIR}/%.pdf | ${BUILD_BOOK_DIR} ${BUILD_SONG_DIR} cp $< $@ -book: directories ${BUILD_BOOK_DIR}/${BOOKNAME}.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-folio.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-quarto.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-sexto.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-octavo.pdf ${LY_FILES} -songs: directories ${LY_PDFS} -midi: directories ${LY_MIDIS} -opus: directories ${LY_OPUS} +book: ${BUILD_BOOK_DIR}/${BOOKNAME}.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-folio.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-quarto.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-sexto.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-octavo.pdf ${LY_FILES} +songs: ${LY_PDFS} +midi: ${LY_MIDIS} +opus: ${LY_OPUS} all: book songs midi opus clean: From e8971ac0945dd0d0f3dfbdf47cf6c78dd75d5b44 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 18 Apr 2022 15:03:29 +0200 Subject: [PATCH 15/20] use template target for folder creation --- Makefile | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index c753bc0..1a7a4c4 100644 --- a/Makefile +++ b/Makefile @@ -20,44 +20,26 @@ LY_MIDIS=$(patsubst %.ly,${BUILD_MIDI_DIR}/%.midi,$(notdir ${LY_FILES})) LY_TMP_MIDIS=$(patsubst %.ly,${TMP_MIDI_DIR}/%.midi,$(notdir ${LY_FILES})) LY_OPUS=$(patsubst %.ly,${BUILD_OPUS_DIR}/%.opus,$(notdir ${LY_FILES})) -.PHONY: book songs midi opus clean directories all +.PHONY: book songs midi opus clean all .DEFAULT_GOAL := all -${BUILD_BOOK_DIR}: - mkdir -p ${BUILD_BOOK_DIR} +%.dir: + mkdir -p $* -${BUILD_SONG_DIR}: - mkdir -p ${BUILD_SONG_DIR} - -${BUILD_MIDI_DIR}: - mkdir -p ${BUILD_MIDI_DIR} - -${TMP_BOOK_DIR}: - mkdir -p ${TMP_BOOK_DIR} - -${TMP_SONG_DIR}: - mkdir -p ${TMP_SONG_DIR} - -${TMP_MIDI_DIR}: - mkdir -p ${TMP_MIDI_DIR} - -${BUILD_OPUS_DIR}: - mkdir -p ${BUILD_OPUS_DIR} - -${TMP_SONG_DIR}/%.pdf: ${SONG_DIR}/%.ly ${SONG_DIR}/%.tex | ${TMP_SONG_DIR} +${TMP_SONG_DIR}/%.pdf: ${SONG_DIR}/%.ly ${SONG_DIR}/%.tex | ${TMP_SONG_DIR}.dir cd ${SRC_DIR} && lualatex --jobname='$(notdir $(basename $@))' --output-directory=${WORKING_DIR}/${TMP_SONG_DIR} --shell-escape ${WORKING_DIR}/${SRC_DIR}/song.tex ${WORKING_DIR}/${SONG_DIR}/$(notdir $(basename $@)).ly ${WORKING_DIR}/${SONG_DIR}/$(notdir $(basename $@)).tex rm -r ${SRC_DIR}/tmp-ly -${BUILD_MIDI_DIR}/%.midi: ${TMP_MIDI_DIR}/%-1.midi | ${BUILD_MIDI_DIR} +${BUILD_MIDI_DIR}/%.midi: ${TMP_MIDI_DIR}/%-1.midi | ${BUILD_MIDI_DIR}.dir cp $< $@ -${TMP_MIDI_DIR}/%-1.midi: ${SONG_DIR}/%.ly | ${TMP_MIDI_DIR} +${TMP_MIDI_DIR}/%-1.midi: ${SONG_DIR}/%.ly | ${TMP_MIDI_DIR}.dir lilypond --output=${TMP_MIDI_DIR} ${WORKING_DIR}/$< -${BUILD_OPUS_DIR}/%.opus: ${BUILD_MIDI_DIR}/%.midi | ${BUILD_OPUS_DIR} +${BUILD_OPUS_DIR}/%.opus: ${BUILD_MIDI_DIR}/%.midi | ${BUILD_OPUS_DIR}.dir timidity $< -Ow -o - | opusenc - $@ -${TMP_BOOK_DIR}/%.pdf: ${SRC_DIR}/%.tex ${SRC_DIR}/images/title.png | ${TMP_BOOK_DIR} +${TMP_BOOK_DIR}/%.pdf: ${SRC_DIR}/%.tex ${SRC_DIR}/images/title.png | ${TMP_BOOK_DIR}.dir latexmk -cd -lualatex -e '$$lualatex=q/lualatex %O -shell-escape %S/' -output-directory=${WORKING_DIR}/${TMP_BOOK_DIR} $< rm -r ${SRC_DIR}/tmp-ly @@ -79,7 +61,7 @@ ${TMP_BOOK_DIR}/%-octavo.pdf: ${TMP_BOOK_DIR}/%.pdf cd ${TMP_BOOK_DIR} && \ ../../bin/makebook -v -t octavo -i $(notdir $<) -o $(notdir $@) -${BUILD_DIR}/%.pdf: ${TMP_DIR}/%.pdf | ${BUILD_BOOK_DIR} ${BUILD_SONG_DIR} +${BUILD_DIR}/%.pdf: ${TMP_DIR}/%.pdf | ${BUILD_BOOK_DIR}.dir ${BUILD_SONG_DIR}.dir cp $< $@ book: ${BUILD_BOOK_DIR}/${BOOKNAME}.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-folio.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-quarto.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-sexto.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-octavo.pdf ${LY_FILES} From 6fffc7adb6f40830867c7a225653a08d21a0774d Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 18 Apr 2022 15:26:37 +0200 Subject: [PATCH 16/20] remove editor config --- .editorconfig | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index eae7250..0000000 --- a/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -root = true - -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -indent_style = space -indent_size = 4 - -[Makefile] -indent_style = tab From 49035152d00acb33712667c194cff28b6ed63873 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 18 Apr 2022 15:26:55 +0200 Subject: [PATCH 17/20] run make with j4 in ci --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fcb276c..63f3382 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ build: image: thallian/latex-builder script: - - make + - make -j4 artifacts: paths: - build/* From 33f2a7fa705004d7cf29584ce34d8689d13e3f06 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 18 Apr 2022 15:27:26 +0200 Subject: [PATCH 18/20] Only remove the tmp-ly folder at the clean target. Without that, parallel building of songs fails. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1a7a4c4..35539af 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,6 @@ LY_OPUS=$(patsubst %.ly,${BUILD_OPUS_DIR}/%.opus,$(notdir ${LY_FILES})) ${TMP_SONG_DIR}/%.pdf: ${SONG_DIR}/%.ly ${SONG_DIR}/%.tex | ${TMP_SONG_DIR}.dir cd ${SRC_DIR} && lualatex --jobname='$(notdir $(basename $@))' --output-directory=${WORKING_DIR}/${TMP_SONG_DIR} --shell-escape ${WORKING_DIR}/${SRC_DIR}/song.tex ${WORKING_DIR}/${SONG_DIR}/$(notdir $(basename $@)).ly ${WORKING_DIR}/${SONG_DIR}/$(notdir $(basename $@)).tex - rm -r ${SRC_DIR}/tmp-ly ${BUILD_MIDI_DIR}/%.midi: ${TMP_MIDI_DIR}/%-1.midi | ${BUILD_MIDI_DIR}.dir cp $< $@ @@ -73,3 +72,4 @@ all: book songs midi opus clean: rm -rf ${BUILD_DIR} rm -rf ${TMP_DIR} + rm -r ${SRC_DIR}/tmp-ly From 391ea7059af924634a29873dd10d22af7e345a50 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 18 Apr 2022 15:43:57 +0200 Subject: [PATCH 19/20] ignore src/tmp-ly --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f4d8d16..2232c4d 100755 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ .vscode tmp build -src/tmp_ly +src/tmp-ly From e59d496f0f1c66186640976ceab4c3ed66778a95 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 18 Apr 2022 15:46:53 +0200 Subject: [PATCH 20/20] clean up makefile --- Makefile | 93 +++++++++++++++++++++++++++----------------------------- 1 file changed, 44 insertions(+), 49 deletions(-) diff --git a/Makefile b/Makefile index 35539af..dee7356 100644 --- a/Makefile +++ b/Makefile @@ -1,75 +1,70 @@ mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) WORKING_DIR := $(patsubst %/,%,$(dir $(mkfile_path))) + BOOKNAME=kommersbuch SRC_DIR=src BUILD_DIR=build TMP_DIR=tmp -SONG_DIR=${SRC_DIR}/songs -BUILD_BOOK_DIR=${BUILD_DIR}/books -TMP_BOOK_DIR=${TMP_DIR}/books -BUILD_SONG_DIR=${BUILD_DIR}/songs -TMP_SONG_DIR=${TMP_DIR}/songs -BUILD_MIDI_DIR=${BUILD_DIR}/midi -TMP_MIDI_DIR=${TMP_DIR}/midi -BUILD_OPUS_DIR=${BUILD_DIR}/opus +SONG_DIR=$(SRC_DIR)/songs +BUILD_BOOK_DIR=$(BUILD_DIR)/books +TMP_BOOK_DIR=$(TMP_DIR)/books +BUILD_SONG_DIR=$(BUILD_DIR)/songs +TMP_SONG_DIR=$(TMP_DIR)/songs +BUILD_MIDI_DIR=$(BUILD_DIR)/midi +TMP_MIDI_DIR=$(TMP_DIR)/midi +BUILD_OPUS_DIR=$(BUILD_DIR)/opus -LY_FILES=$(wildcard ${SONG_DIR}/*.ly) -LY_PDFS=$(patsubst %.ly,${BUILD_SONG_DIR}/%.pdf,$(notdir ${LY_FILES})) -LY_TMP_PDFS=$(patsubst %.ly,${TMP_SONG_DIR}/%.pdf,$(notdir ${LY_FILES})) -LY_MIDIS=$(patsubst %.ly,${BUILD_MIDI_DIR}/%.midi,$(notdir ${LY_FILES})) -LY_TMP_MIDIS=$(patsubst %.ly,${TMP_MIDI_DIR}/%.midi,$(notdir ${LY_FILES})) -LY_OPUS=$(patsubst %.ly,${BUILD_OPUS_DIR}/%.opus,$(notdir ${LY_FILES})) +BOOK_TYPES=folio quarto sexto octavo + +LY_FILES=$(wildcard $(SONG_DIR)/*.ly) +LY_PDFS=$(patsubst %.ly,$(BUILD_SONG_DIR)/%.pdf,$(notdir $(LY_FILES))) +LY_TMP_PDFS=$(patsubst %.ly,$(TMP_SONG_DIR)/%.pdf,$(notdir $(LY_FILES))) +LY_MIDIS=$(patsubst %.ly,$(BUILD_MIDI_DIR)/%.midi,$(notdir $(LY_FILES))) +LY_TMP_MIDIS=$(patsubst %.ly,$(TMP_MIDI_DIR)/%.midi,$(notdir $(LY_FILES))) +LY_OPUS=$(patsubst %.ly,$(BUILD_OPUS_DIR)/%.opus,$(notdir $(LY_FILES))) .PHONY: book songs midi opus clean all .DEFAULT_GOAL := all +define BUILDER +$(TMP_BOOK_DIR)/%-$(TYPE).pdf: $(TMP_BOOK_DIR)/%.pdf + cd $(TMP_BOOK_DIR) && \ + ../../bin/makebook -v -t $(TYPE) -i $$(notdir $$<) -o $$(notdir $$@) +endef +$(foreach TYPE,$(BOOK_TYPES),$(eval $(BUILDER))) + %.dir: mkdir -p $* -${TMP_SONG_DIR}/%.pdf: ${SONG_DIR}/%.ly ${SONG_DIR}/%.tex | ${TMP_SONG_DIR}.dir - cd ${SRC_DIR} && lualatex --jobname='$(notdir $(basename $@))' --output-directory=${WORKING_DIR}/${TMP_SONG_DIR} --shell-escape ${WORKING_DIR}/${SRC_DIR}/song.tex ${WORKING_DIR}/${SONG_DIR}/$(notdir $(basename $@)).ly ${WORKING_DIR}/${SONG_DIR}/$(notdir $(basename $@)).tex +$(TMP_SONG_DIR)/%.pdf: $(SONG_DIR)/%.ly $(SONG_DIR)/%.tex | $(TMP_SONG_DIR).dir + cd $(SRC_DIR) && lualatex --jobname='$(notdir $(basename $@))' \ + --output-directory=$(WORKING_DIR)/$(TMP_SONG_DIR) \ + --shell-escape $(WORKING_DIR)/$(SRC_DIR)/song.tex \ + $(WORKING_DIR)/$(SONG_DIR)/$(notdir $(basename $@)).ly $(WORKING_DIR)/$(SONG_DIR)/$(notdir $(basename $@)).tex -${BUILD_MIDI_DIR}/%.midi: ${TMP_MIDI_DIR}/%-1.midi | ${BUILD_MIDI_DIR}.dir +$(BUILD_MIDI_DIR)/%.midi: $(TMP_MIDI_DIR)/%-1.midi | $(BUILD_MIDI_DIR).dir cp $< $@ -${TMP_MIDI_DIR}/%-1.midi: ${SONG_DIR}/%.ly | ${TMP_MIDI_DIR}.dir - lilypond --output=${TMP_MIDI_DIR} ${WORKING_DIR}/$< +$(TMP_MIDI_DIR)/%-1.midi: $(SONG_DIR)/%.ly | $(TMP_MIDI_DIR).dir + lilypond --output=$(TMP_MIDI_DIR) $(WORKING_DIR)/$< -${BUILD_OPUS_DIR}/%.opus: ${BUILD_MIDI_DIR}/%.midi | ${BUILD_OPUS_DIR}.dir +$(BUILD_OPUS_DIR)/%.opus: $(BUILD_MIDI_DIR)/%.midi | $(BUILD_OPUS_DIR).dir timidity $< -Ow -o - | opusenc - $@ -${TMP_BOOK_DIR}/%.pdf: ${SRC_DIR}/%.tex ${SRC_DIR}/images/title.png | ${TMP_BOOK_DIR}.dir - latexmk -cd -lualatex -e '$$lualatex=q/lualatex %O -shell-escape %S/' -output-directory=${WORKING_DIR}/${TMP_BOOK_DIR} $< - rm -r ${SRC_DIR}/tmp-ly +$(TMP_BOOK_DIR)/%.pdf: $(SRC_DIR)/%.tex $(SRC_DIR)/images/title.png | $(TMP_BOOK_DIR).dir + latexmk -cd -lualatex -e '$$lualatex=q/lualatex %O -shell-escape %S/' -output-directory=$(WORKING_DIR)/$(TMP_BOOK_DIR) $< + rm -r $(SRC_DIR)/tmp-ly -${TMP_BOOK_DIR}/%-folio.pdf: ${TMP_BOOK_DIR}/%.pdf - cd ${TMP_BOOK_DIR} && \ - ../../bin/makebook -v -t folio -i $(notdir $<) -o $(notdir $@) - -#long edge binding -${TMP_BOOK_DIR}/%-quarto.pdf: ${TMP_BOOK_DIR}/%.pdf - cd ${TMP_BOOK_DIR} && \ - ../../bin/makebook -v -t quarto -i $(notdir $<) -o $(notdir $@) - -${TMP_BOOK_DIR}/%-sexto.pdf: ${TMP_BOOK_DIR}/%.pdf - cd ${TMP_BOOK_DIR} && \ - ../../bin/makebook -v -t sexto -i $(notdir $<) -o $(notdir $@) - -#short edge binding -${TMP_BOOK_DIR}/%-octavo.pdf: ${TMP_BOOK_DIR}/%.pdf - cd ${TMP_BOOK_DIR} && \ - ../../bin/makebook -v -t octavo -i $(notdir $<) -o $(notdir $@) - -${BUILD_DIR}/%.pdf: ${TMP_DIR}/%.pdf | ${BUILD_BOOK_DIR}.dir ${BUILD_SONG_DIR}.dir +$(BUILD_DIR)/%.pdf: $(TMP_DIR)/%.pdf | $(BUILD_BOOK_DIR).dir $(BUILD_SONG_DIR).dir cp $< $@ -book: ${BUILD_BOOK_DIR}/${BOOKNAME}.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-folio.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-quarto.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-sexto.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-octavo.pdf ${LY_FILES} -songs: ${LY_PDFS} -midi: ${LY_MIDIS} -opus: ${LY_OPUS} +book: $(BUILD_BOOK_DIR)/$(BOOKNAME).pdf $(BUILD_BOOK_DIR)/$(BOOKNAME)-folio.pdf $(BUILD_BOOK_DIR)/$(BOOKNAME)-quarto.pdf $(BUILD_BOOK_DIR)/$(BOOKNAME)-sexto.pdf $(BUILD_BOOK_DIR)/$(BOOKNAME)-octavo.pdf $(LY_FILES) +songs: $(LY_PDFS) +midi: $(LY_MIDIS) +opus: $(LY_OPUS) all: book songs midi opus clean: - rm -rf ${BUILD_DIR} - rm -rf ${TMP_DIR} - rm -r ${SRC_DIR}/tmp-ly + rm -rf $(BUILD_DIR) + rm -rf $(TMP_DIR) + rm -rf $(SRC_DIR)/tmp-ly