Add \hideNote
[opus_libre.git] / bin / macros.scm
blob7e67e494b1ab39cbfea79703e917403f86a08482
1 ;------------------------------------------------------------------;
2 ; opus_libre -- macros.scm                                         ;
3 ;                                                                  ;
4 ; (c) 2008-2010 Valentin Villenave <valentin@villenave.net>        ;
5 ;                                                                  ;
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     ;
9 ;                                                                  ;
10 ;------------------------------------------------------------------;
12 ; Input macros.
14 (load "../lib/libmusic.scm")
16 ;; Rhythm shortcuts -----------------------------------------------;
17 (make-simple-function lang:tuplet-letter ; default: \t
18                       #{ \times 2/3 $x #})
20 (make-simple-function lang:tuplet-letter-double ; \tt
21                       #{ \times 4/5 $x #})
23 (make-simple-function lang:tuplet-letter-triple ; \ttt
24                       #{ \times 4/6 $x #})
26 (make-simple-function lang:tuplet-letter-quad ; \tttt
27                       #{ \times 4/7 $x #})
29 ;; Auto octavation ------------------------------------------------;
30 (define oct
31   (define-music-function (parser location mus) (ly:music?)
32     (octavize mus)))
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 --------------------------------------------;
45 (define pl
46   (define-music-function (parser location one two)
47     (ly:music? ly:music?)
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.
54 (define hideNote #{
55 \once \override NoteHead  #'transparent = ##t
56 \once \override NoteHead  #'no-ledgers = ##t
57 \once \override Stem  #'transparent = ##t
58 \once \override Beam  #'transparent = ##t
59 \once \override Accidental  #'transparent = ##t
60 #})