From 9af86708afada4c96798c2a8398fe042c93fd5a0 Mon Sep 17 00:00:00 2001 From: Mats Bengtsson Date: Tue, 27 Aug 2002 12:21:58 +0000 Subject: [PATCH] * tex/titledefs.tex: Define \fetafont for use in titles. * scm/music-functions.scm (shift-duration-log), lily/parser.yy (Repeated_music): Handle dots correctly for \repeat tremolo. --- lily/parser.yy | 7 ++++--- scm/music-functions.scm | 33 +++++++++++++++++---------------- tex/titledefs.tex | 7 +++++++ 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/lily/parser.yy b/lily/parser.yy index 32084a3e3e..357baad39b 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -747,11 +747,12 @@ Repeated_music: /* we can not get durations and other stuff correct down the line, so we have to add to the duration log here. - - TODO: do dots. */ SCM func = scm_primitive_eval (ly_symbol2scm ("shift-duration-log")); - gh_call2 (func, r->self_scm (), gh_int2scm(-intlog2 ($3))); + if (($3 % 3) == 0) + gh_call3 (func, r->self_scm (), gh_int2scm(-intlog2 ($3*2/3)),gh_int2scm(1)); + else + gh_call3 (func, r->self_scm (), gh_int2scm(-intlog2 ($3)), gh_int2scm(0)); } set_music_properties (r, result); diff --git a/scm/music-functions.scm b/scm/music-functions.scm index cab888da17..047a0114eb 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -10,38 +10,39 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(define (shift-duration-log music shift ) - "Recurse through music, adding SHIFT to duration-log to any note -encountered. This scales the music up by a factor 2^k." +(define (shift-duration-log music shift dot) + "Recurse through music, adding SHIFT to duration-log and optionally + a dot to any note encountered. This scales the music up by a factor + 2^shift." (let* ((es (ly-get-mus-property music 'elements)) (e (ly-get-mus-property music 'element)) (n (ly-music-name music)) - (f (lambda (x) (shift-duration-log x shift))) + (f (lambda (x) (shift-duration-log x shift dot))) ) (if (or (equal? n "Note_req") (equal? n "Rest_req")) (let* ( - (d (ly-get-mus-property music 'duration)) - (cp (duration-factor d)) - (nd (make-duration (+ shift (duration-log d)) - (duration-dot-count d) - (car cp) - (cdr cp))) - - ) + (d (ly-get-mus-property music 'duration)) + (cp (duration-factor d)) + (nd (make-duration (+ shift (duration-log d)) + (+ dot (duration-dot-count d)) + (car cp) + (cdr cp))) + + ) (ly-set-mus-property! music 'duration nd) - )) - + )) + (if (pair? es) (ly-set-mus-property! music 'elements (map f es))) - + (if (music? e) (ly-set-mus-property! music 'element (f e))) - + music)) diff --git a/tex/titledefs.tex b/tex/titledefs.tex index fd680ff7e4..653afeb09c 100644 --- a/tex/titledefs.tex +++ b/tex/titledefs.tex @@ -8,6 +8,13 @@ %% makes LaTeX break on the \\ in: %% \ifx\lilypondfoo\undefined\else{\lilypondfoo\\}\fi %% +% The feta characters for use in titles +\input feta20.tex +% +\font\fetasixteen=feta16 +\def\fetafont{\fetasixteen} +\def\fetachar#1{\hbox{\fetasixteen#1}} +% \def\makelilypondtitle { \begin{center} -- 2.39.5