1 % DO NOT EDIT this file manually; it is automatically
2 % generated from Documentation/snippets/new
3 % Make any changes in Documentation/snippets/new/
4 % and then run scripts/auxiliar/makelsr.py
6 % This file is in the public domain.
7 %% Note: this file works from version 2.15.30
11 lsrtags = "chords, fretted-strings"
14 Here is how to print bar chords, or half-bar chords (just uncomment the
15 appropriate line for to select either one).
17 The syntax is @code{\\bbarre #\"@var{fret number}\" @{ notes @} }.
19 doctitle = "Bar chords notation for Guitar (with Text Spanner)"
23 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
24 %% %%%%%%% Cut here ----- Start 'bbarred.ly'
26 %% C with slash -------------------------------
27 cWithSlash = \markup {
28 \combine \roman C \translate #'(0.6 . -0.4) \draw-line #'(0 . 2.0)
30 %% Span -----------------------------------
31 %% Syntax: \bbarre #"text" { notes } - text = any number of box
33 #(define-music-function (barre location str music) (string? ly:music?)
34 (let ((elts (extract-named-music music '(NoteEvent EventChord))))
36 (let ((first-element (first elts))
37 (last-element (last elts)))
38 (set! (ly:music-property first-element 'articulations)
39 (cons (make-music 'TextSpanEvent 'span-direction -1)
40 (ly:music-property first-element 'articulations)))
41 (set! (ly:music-property last-element 'articulations)
42 (cons (make-music 'TextSpanEvent 'span-direction 1)
43 (ly:music-property last-element 'articulations))))))
45 \once \override TextSpanner #'font-size = #-2
46 \once \override TextSpanner #'font-shape = #'upright
47 \once \override TextSpanner #'staff-padding = #3
48 \once \override TextSpanner #'style = #'line
49 \once \override TextSpanner #'to-barline = ##f
50 \once \override TextSpanner #'bound-details =
52 (text . ,#{ \markup { \draw-line #'( 0 . -.5) } #})
57 (text . ,#{ \markup { \cWithSlash #str } #})
61 %% uncomment this line for make full barred
62 % \once \override TextSpanner #'bound-details #'left #'text = \markup { "B" #str }
66 %% %%%%%%% Cut here ----- End 'bbarred.ly'
67 %% Copy and change the last line for full barred. Rename in 'fbarred.ly'
68 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
70 %% Syntaxe: \bbarre #"text" { notes } - text = any number of box
71 \relative c'{ \clef "G_8" \stemUp \bbarre #"III" { <f a'>16[ c' d c d8] } }