From 3b88471ab8ed28ff66657957c2a3f3882cc6aeac Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 1 Jun 2022 21:41:57 -0300 Subject: Generate LilyPond files in dynamic.mk --- Makefile | 33 ++++++--------------------------- dynamic.mk | 24 ++++++++++++++++++++++-- music/choro-da-saudade.ly | 6 +++--- music/common.ly | 15 --------------- music/common.ly.include | 15 +++++++++++++++ music/dengoso.ly | 6 +++--- music/guitar.ly | 33 --------------------------------- music/guitar.ly.include | 33 +++++++++++++++++++++++++++++++++ music/marcha-dos-marinheiros.ly | 6 +++--- src/development/dynmake.sh | 30 +++++++++++++++++++----------- 10 files changed, 104 insertions(+), 97 deletions(-) delete mode 100644 music/common.ly create mode 100644 music/common.ly.include delete mode 100644 music/guitar.ly create mode 100644 music/guitar.ly.include diff --git a/Makefile b/Makefile index 9624c56..235dde5 100644 --- a/Makefile +++ b/Makefile @@ -2,42 +2,21 @@ FQDN = euandre.org .SUFFIXES: -.SUFFIXES: .ly .flac .midi .ogg .pdf - -.ly.midi: - lilypond -o $* $< - -.midi.ogg: - timidity -Ov $< +.SUFFIXES: .flac .ogg .flac.ogg: ffmpeg -y -i $< -ar 48000 -vn -c:a libvorbis -b:a 320k $@ -lilypond.ly = \ - music/choro-da-saudade.ly \ - music/dengoso.ly \ - music/marcha-dos-marinheiros.ly -lilypond.pdf = $(lilypond.ly:.ly=.pdf) -lilypond.midi = $(lilypond.ly:.ly=.midi) -lilypond.ogg = $(lilypond.midi:.midi=.ogg) -lilypond = \ - $(lilypond.pdf) \ - $(lilypond.midi) \ - $(lilypond.ogg) - favicons = static/lord-favicon.png static/lord-favicon.ico favicon.ico derived-assets = \ - $(pastebins) \ - $(lilypond) \ $(favicons) \ - $(podcasts.ogg) \ TODOs.html \ -all: public dynamic +all: public dynamic: generated.mk $(MAKE) -f dynamic.mk all @@ -52,8 +31,6 @@ JEKYLL_COMPAT: # always considered stale. ALWAYS: -$(lilypond.pdf): $(lilypond.midi) - static/lord-favicon.png: static/lord-favicon.svg inkscape -o $@ -w 2048 -h 2048 -b white static/lord-favicon.svg @@ -79,14 +56,16 @@ check: dev-check: check clean: + $(MAKE) -f dynamic.mk clean rm -rf \ public/ .jekyll-cache \ $(derived-assets) \ - src/content/ generated.mk \ + src/content/ + # rm -f generated.mk JEKYLL = JEKYLL_ENV=production jekyll -public: $(derived-assets) +public: $(derived-assets) dynamic $(JEKYLL) build run: all diff --git a/dynamic.mk b/dynamic.mk index d16d99b..7510067 100644 --- a/dynamic.mk +++ b/dynamic.mk @@ -1,7 +1,7 @@ .POSIX: .SUFFIXES: -.SUFFIXES: .md .env .html +.SUFFIXES: .md .env .html .ly .flac .midi .ogg .pdf .md.env: sh src/development/frontmatter-env.sh < $< > $@ @@ -9,14 +9,34 @@ .md.html: sh src/development/genhtml.sh $< > $@ +.ly.midi: + lilypond -o $* $< + +.midi.ogg: + timidity -Ov $< + include generated.mk pastebins.env = $(pastebins.md:.md=.env) pastebins.html = $(pastebins.md:.md=.html) +pastebins = $(pastebins.env) $(pastebins.html) -all: $(pastebins.env) $(pastebins.html) $(torrent-files) +lilypond.pdf = $(lilypond.ly:.ly=.pdf) +lilypond.midi = $(lilypond.ly:.ly=.midi) +lilypond.ogg = $(lilypond.ly:.ly=.ogg) +lilypond = $(lilypond.pdf) $(lilypond.midi) $(lilypond.ogg) + +ALL = \ + $(pastebins) \ + $(lilypond) \ + $(torrent-files) +all: $(ALL) $(torrent-files): mktorrent -f -v -d -n $@ -o $@ -c '' "$(@D)/`basename $@ .torrent`" + +clean: + rm -f \ + $(ALL) diff --git a/music/choro-da-saudade.ly b/music/choro-da-saudade.ly index f8fe7ff..2f6e686 100644 --- a/music/choro-da-saudade.ly +++ b/music/choro-da-saudade.ly @@ -2,8 +2,8 @@ \pointAndClickOff #(ly:set-option 'embed-source-code #t) -\include "common.ly" -\include "guitar.ly" +\include "common.ly.include" +\include "guitar.ly.include" \header { title = "Choro da Saudade" @@ -230,4 +230,4 @@ staff = \new Staff << \score { \unfoldRepeats \staff \midi { } -} \ No newline at end of file +} diff --git a/music/common.ly b/music/common.ly deleted file mode 100644 index b6ba93a..0000000 --- a/music/common.ly +++ /dev/null @@ -1,15 +0,0 @@ -copyright = \markup { - \with-url #"https://creativecommons.org/licenses/by-sa/4.0/" \line { - CC BY-SA 4.0 - } -} -tagline = \markup { - \with-url #"https://euandre.org/music.html" \line { - euandre.org/music.html - } -} - -rall = { - \override TextSpanner.bound-details.left.text = "rall." - \override TextSpanner.bound-details.right.text = "a tempo" -} diff --git a/music/common.ly.include b/music/common.ly.include new file mode 100644 index 0000000..b6ba93a --- /dev/null +++ b/music/common.ly.include @@ -0,0 +1,15 @@ +copyright = \markup { + \with-url #"https://creativecommons.org/licenses/by-sa/4.0/" \line { + CC BY-SA 4.0 + } +} +tagline = \markup { + \with-url #"https://euandre.org/music.html" \line { + euandre.org/music.html + } +} + +rall = { + \override TextSpanner.bound-details.left.text = "rall." + \override TextSpanner.bound-details.right.text = "a tempo" +} diff --git a/music/dengoso.ly b/music/dengoso.ly index e771bd4..b5a3fae 100644 --- a/music/dengoso.ly +++ b/music/dengoso.ly @@ -2,8 +2,8 @@ \pointAndClickOff #(ly:set-option 'embed-source-code #t) -\include "common.ly" -\include "guitar.ly" +\include "common.ly.include" +\include "guitar.ly.include" \header { title = "Dengoso" @@ -307,4 +307,4 @@ staff = \new Staff << \score { \unfoldRepeats \staff \midi { } -} \ No newline at end of file +} diff --git a/music/guitar.ly b/music/guitar.ly deleted file mode 100644 index 592ad5c..0000000 --- a/music/guitar.ly +++ /dev/null @@ -1,33 +0,0 @@ - -pestanaPrivate = \markup { - \fontsize #-2 - \combine - \roman C - \translate #'(0.6 . -0.4) \draw-line #'(0 . 2.0) -} - -pestanaSingle = - #(define-music-function (fret-number music) (string? ly:music?) - #{ - $music ^\markup { \pestanaPrivate \fontsize #-2 $fret-number } - #}) - -pestanaSpan = - #(define-music-function (fret-number) (string?) - #{ - \once \override TextSpanner.font-shape = #'upright - \once \override TextSpanner.style = #'solid - \once \override TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER - \once \override TextSpanner.bound-details.right.text = \markup { \draw-line #'(0 . -.5) } - \once \override TextSpanner.bound-details.left.text = \markup { \pestanaPrivate \fontsize #-2 $fret-number } - #}) - -corda = - #(define-music-function (string-number) (string?) - #{ - \once \override TextSpanner.style = #'solid - \once \override TextSpanner.font-size = #-5 - \once \override TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER - \once \override TextSpanner.bound-details.right.text = \markup { \draw-line #'( 0 . -.5) } - \once \override TextSpanner.bound-details.left.text = \markup { \circle \number $string-number } - #}) diff --git a/music/guitar.ly.include b/music/guitar.ly.include new file mode 100644 index 0000000..592ad5c --- /dev/null +++ b/music/guitar.ly.include @@ -0,0 +1,33 @@ + +pestanaPrivate = \markup { + \fontsize #-2 + \combine + \roman C + \translate #'(0.6 . -0.4) \draw-line #'(0 . 2.0) +} + +pestanaSingle = + #(define-music-function (fret-number music) (string? ly:music?) + #{ + $music ^\markup { \pestanaPrivate \fontsize #-2 $fret-number } + #}) + +pestanaSpan = + #(define-music-function (fret-number) (string?) + #{ + \once \override TextSpanner.font-shape = #'upright + \once \override TextSpanner.style = #'solid + \once \override TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER + \once \override TextSpanner.bound-details.right.text = \markup { \draw-line #'(0 . -.5) } + \once \override TextSpanner.bound-details.left.text = \markup { \pestanaPrivate \fontsize #-2 $fret-number } + #}) + +corda = + #(define-music-function (string-number) (string?) + #{ + \once \override TextSpanner.style = #'solid + \once \override TextSpanner.font-size = #-5 + \once \override TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER + \once \override TextSpanner.bound-details.right.text = \markup { \draw-line #'( 0 . -.5) } + \once \override TextSpanner.bound-details.left.text = \markup { \circle \number $string-number } + #}) diff --git a/music/marcha-dos-marinheiros.ly b/music/marcha-dos-marinheiros.ly index 66830f4..48cc1c6 100644 --- a/music/marcha-dos-marinheiros.ly +++ b/music/marcha-dos-marinheiros.ly @@ -2,8 +2,8 @@ \pointAndClickOff #(ly:set-option 'embed-source-code #t) -\include "common.ly" -\include "guitar.ly" +\include "common.ly.include" +\include "guitar.ly.include" \header { title = "Marcha dos Marinheiros" @@ -75,4 +75,4 @@ staff = \new Staff << \score { \unfoldRepeats \staff \midi { } -} \ No newline at end of file +} diff --git a/src/development/dynmake.sh b/src/development/dynmake.sh index 9b74a9f..15251e7 100755 --- a/src/development/dynmake.sh +++ b/src/development/dynmake.sh @@ -66,17 +66,14 @@ varlist() { # pastebins() { - find src/content/pastebin -name '*.md' + find src/content/pastebin/ -name '*.md' } printf 'pastebins.md = \\\n' -pastebins | - varlist - +pastebins | varlist printf '\n' -pastebins | - sed 's/^\(.*\)\.md$/\1.html: \1.env/' +pastebins | sed 's/^\(.*\)\.md$/\1.html: \1.env/' @@ -85,18 +82,29 @@ pastebins | # torrents() { - find resources \ + find resources/ \ -name '*.flac' -or \ -name '*.ogg' -or \ -name '*.webm' } printf 'torrent-files = \\\n' +torrents | sed 's|$|.torrent|' | varlist +printf '\n' + +torrents | awk '{ printf "%s.torrent: %s\n", $0, $0 }' + -torrents | - sed 's|$|.torrent|' | - varlist +# +# Lilypond files +# +lilyponds() { + find music/ -name '*.ly' +} + +printf 'lilypond.ly = \\\n' +lilyponds | varlist printf '\n' -torrents | awk '{ printf "%s.torrent: %s\n", $0, $0 }' +lilyponds | sed 's/^\(.*\)\.ly$/\1.pdf: \1.midi/' -- cgit v1.2.3