diff options
-rw-r--r-- | Konzerte/2019_09_29/alles.ly | 8 | ||||
-rwxr-xr-x | Konzerte/2019_09_29/make | 88 |
2 files changed, 96 insertions, 0 deletions
diff --git a/Konzerte/2019_09_29/alles.ly b/Konzerte/2019_09_29/alles.ly new file mode 100644 index 0000000..bbabb04 --- /dev/null +++ b/Konzerte/2019_09_29/alles.ly @@ -0,0 +1,8 @@ +\version "2.19.80" +\paper { + first-page-number = #1 + print-first-page-number = ##t +} + +%LOOP%\include "../../%TEIL%/%TEIL-BASE%.pre" +%LOOP%\pageBreak diff --git a/Konzerte/2019_09_29/make b/Konzerte/2019_09_29/make new file mode 100755 index 0000000..a4478ee --- /dev/null +++ b/Konzerte/2019_09_29/make @@ -0,0 +1,88 @@ +#!/bin/bash + +set -e + +cd "$(dirname "$0")" + +teile_params=( + 'Den_Tag_an_dem_wir_feiern_segne_Gott' + 'Denn_er_hat_seinen_Engeln_' + 'Kanons/Er_ist_wie_ein_Baum' +) + +rm -f *.pre + +for teil_params in "${teile_params[@]}" +do + if [ -z "${teil_params%%'"'*}" ]; then + continue + fi + teil="${teil_params%%:*}" + params="${teil_params#${teil}}" + params="${params#:}" + ( + cd ../../${teil} + sed -n ' + s/^\([^:]*%\|'"${teil##*/}"'\)\.pdf.*:\s*// + T + :a + /\\$/ { + N + s/\\\n/ / + ta + } + s/\n.*$// + s/%/'"${teil##*/}"'/g + p + ' Makefile | \ + tr ' ' '\n' | \ + grep '\.pre$' | \ + xargs -r make ${params} "$@" + ) +done + +{ + printf '\n\n' + cat alles.ly + printf '\n\n' +} | \ + while read -r line + do + if [[ "${line}" = '%LOOP%'* ]] + then + loopLines="${loopLines} +${line#%LOOP%}" + else + if [ -n "${loopLines}" ] + then + for teil_param in "${teile_params[@]}" + do + teil="${teil_param%%:*}" + echo "${loopLines}" | \ + if [ -z ${teil%%'"'*} ]; then + sed ' + s/\\include "[^"]*"/\\markup { '"${teil_param}"'" }/g + ' + else + cat + fi | \ + sed " + s|%TEIL%|${teil}|g + s|%TEIL-BASE%|${teil##*/}|g + /%IF \([^=%]\+\)!=\1%/d + s|%IF [^=%]\+!=[^=%]\+%||g + s|%IF \([^=%]*[^=!%]\)=\1%||g + /%IF [^=%]\+=[^=%]\+%/d + " + done + unset loopLines + fi + echo "${line}" + fi + done > alles.pre + +lilypond alles.pre + +#ps2pdf -sPAPERSIZE=a4 - empty.pdf </dev/null +#pdfunite empty.pdf alles.pdf alles_.pdf +#mv alles_.pdf alles.pdf |