1 ;------------------------------------------------------------------;
2 ; opus_libre -- macros.scm ;
4 ; (c) 2008-2010 Valentin Villenave <valentin@villenave.net> ;
6 ; opus_libre is a free framework for GNU LilyPond: you may ;
7 ; redistribute it and/or modify it under the terms of the GNU ;
8 ; General Public License, version 3 or later: gnu.org/licenses ;
10 ;------------------------------------------------------------------;
14 ;; Rhythm shortcuts -----------------------------------------------;
15 (make-simple-function lang:tuplet-letter ; default: \t
18 (make-simple-function lang:tuplet-letter-double ; \tt
21 (make-simple-function lang:tuplet-letter-triple ; \ttt
24 (make-simple-function lang:tuplet-letter-quad ; \tttt
28 ;; Composite dynamics ---------------------------------------------;
30 ;;syntax: -\dyn instead of \dyn (see Issue #1264).
31 (define-music-function (parser location arg) (markup?)
32 (make-music 'AbsoluteDynamicEvent
35 (if (string-every char-set:dynamics arg)
37 (markup #:dynamic-string arg)))
41 ;; Auto octavation ------------------------------------------------;
43 (define-music-function (parser location mus) (ly:music?)
46 ;; Articulation shortcuts -----------------------------------------;
47 ;;TODO: how about an alist? (see libmusic.scm)
48 (make-script '(st . "staccato"))
49 (make-script '(acc . "accent"))
50 (make-script '(det . "tenuto")) ; as in "détaché"
51 (make-script '(stdet . "portato"))
52 (make-script '(accdet . '("tenuto" "accent")))
53 (make-script '(accst . '("accent" "staccato")))
54 (make-script '(dwnb . "downbow"))
57 (define-music-function (parser location music) (ly:music?)
59 (equal? (ly:music-property music 'name) 'EventChord)
60 (set! (ly:music-property music 'elements)
61 (append (ly:music-property music 'elements)
62 (list (make-music 'TextScriptEvent 'text
63 ;; ugh. Haphazard alignment.
64 (markup #:translate-scaled (cons 4 0)
65 #:indic "(ten.)"))))))
69 ;; Polyphony shortcuts --------------------------------------------;
71 (define-music-function (parser location one two)
73 #{ << { \voiceTwo $one } \\ { \voiceOne $two } >> #}))
75 (staff-change-command lang:upper-hand) ;; depending on your input language:
76 (staff-change-command lang:lower-hand) ;; \rh or \md etc. for switching staves.