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 (load "../lib/libmusic.scm")
16 ;; Rhythm shortcuts -----------------------------------------------;
17 (make-simple-function lang:tuplet-letter ; default: \t
20 (make-simple-function lang:tuplet-letter-double ; \tt
23 (make-simple-function lang:tuplet-letter-triple ; \ttt
26 (make-simple-function lang:tuplet-letter-quad ; \tttt
29 ;; Auto octavation ------------------------------------------------;
31 (define-music-function (parser location mus) (ly:music?)
34 ;; Articulation shortcuts -----------------------------------------;
35 ;;TODO: how about an alist? (see libmusic.scm)
36 (make-script '(st . "staccato"))
37 (make-script '(acc . "accent"))
38 (make-script '(det . "tenuto")) ; as in "détaché"
39 (make-script '(stdet . "portato"))
40 (make-script '(accdet . '("tenuto" "accent")))
41 (make-script '(accst . '("accent" "staccato")))
42 (make-script '(dwnb . "downbow"))
44 ;; Polyphony shortcuts --------------------------------------------;
46 (define-music-function (parser location one two)
48 #{ << { \voiceTwo $one } \\ { \voiceOne $two } >> #}))
50 (staff-change-command lang:upper-hand) ;; depending on your input language:
51 (staff-change-command lang:lower-hand) ;; \rh or \md etc. for switching staves.
55 \once \override Dots #'transparent = ##t
56 \once \override NoteHead #'transparent = ##t
57 \once \override NoteHead #'no-ledgers = ##t
58 \once \override Stem #'transparent = ##t
59 \once \override Beam #'transparent = ##t
60 \once \override Accidental #'transparent = ##t
63 (define hideNoteHead #{
64 \once \override NoteHead #'transparent = ##t
68 (define-music-function (parser location x) (ly:music?)
69 #{\override NoteHead #'transparent = ##t $x \revert NoteHead #'transparent #}))
72 \once \set fontSize = #-2
76 (define-music-function (parser location x) (ly:music?)
77 #{ \tiny $x \normalsize #}))
80 \once \override Beam #'beam-thickness = #0.36
81 \once \override Beam #'gap = #0.5
85 (define-music-function (parser location x) (ly:music?) #{
86 \override Beam #'beam-thickness = #0.36
87 \override Beam #'gap = #0.5
89 \revert Beam #'beam-thickness
94 (define-music-function (parser location arg) (ly:music?)
95 (set! (ly:music-property arg 'tweaks)
96 (acons 'duration-log 1
97 (ly:music-property arg 'tweaks)))
101 (define-music-function (parser location arg) (ly:music?)
102 (set! (ly:music-property arg 'tweaks)
103 (acons 'duration-log 4
104 (ly:music-property arg 'tweaks)))