From 3fe50f3688822dbb7c5bc850bd3aa9088b4a6727 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sun, 1 Jan 2012 19:27:50 +0100 Subject: [PATCH] Copy snippets changed in ffb5c20633459831cea21859f3423ea50060d705 to snippets/new --- ...adding-orchestral-cues-to-a-vocal-score.ly | 80 ++++++++++++++++++ ...-notation-for-guitar--with-text-spanner.ly | 84 +++++++++++++++++++ .../new/string-number-extender-lines.ly | 34 ++++++++ 3 files changed, 198 insertions(+) create mode 100644 Documentation/snippets/new/adding-orchestral-cues-to-a-vocal-score.ly create mode 100644 Documentation/snippets/new/bar-chords-notation-for-guitar--with-text-spanner.ly create mode 100644 Documentation/snippets/new/string-number-extender-lines.ly diff --git a/Documentation/snippets/new/adding-orchestral-cues-to-a-vocal-score.ly b/Documentation/snippets/new/adding-orchestral-cues-to-a-vocal-score.ly new file mode 100644 index 0000000000..ba53f5963e --- /dev/null +++ b/Documentation/snippets/new/adding-orchestral-cues-to-a-vocal-score.ly @@ -0,0 +1,80 @@ +\version "2.15.20" + +\header { + lsrtags = "staff-notation, vocal-music" + + texidoc = " +This shows one approach to simplify adding many orchestral cues to the +piano reduction in a vocal score. The music function @code{\\cueWhile} +takes four arguments: the music from which the cue is to be taken, as +defined by @code{\\addQuote}, the name to be inserted before the cue +notes, then either @code{#UP} or @code{#DOWN} to specify either +@code{\\voiceOne} with the name above the staff or @code{\\voiceTwo} +with the name below the staff, and finally the piano music in parallel +with which the cue notes are to appear. The name of the cued +instrument is positioned to the left of the cued notes. Many passages +can be cued, but they cannot overlap each other in time. + +" + doctitle = "Adding orchestral cues to a vocal score" +} + +cueWhile = +#(define-music-function + (parser location instrument name dir music) + (string? string? ly:dir? ly:music?) + #{ + \cueDuring $instrument #dir { + \once \override TextScript #'self-alignment-X = #RIGHT + \once \override TextScript #'direction = $dir + s1*0-\markup { \tiny #name } + $music + } + #}) + +flute = \relative c'' { + \transposition c' + s4 s4 e g +} +\addQuote "flute" { \flute } + +clarinet = \relative c' { + \transposition bes + fis4 d d c +} +\addQuote "clarinet" { \clarinet } + +singer = \relative c'' { c4. g8 g4 bes4 } +words = \lyricmode { here's the lyr -- ics } + +pianoRH = \relative c'' { + \transposition c' + \cueWhile "clarinet" "Clar." #DOWN { c4. g8 } + \cueWhile "flute" "Flute" #UP { g4 bes4 } +} +pianoLH = \relative c { c4 e, } + +\score { + << + \new Staff { + \new Voice = "singer" { + \singer + } + } + \new Lyrics { + \lyricsto "singer" + \words + } + \new PianoStaff << + \new Staff { + \new Voice { + \pianoRH + } + } + \new Staff { + \clef "bass" + \pianoLH + } + >> + >> +} diff --git a/Documentation/snippets/new/bar-chords-notation-for-guitar--with-text-spanner.ly b/Documentation/snippets/new/bar-chords-notation-for-guitar--with-text-spanner.ly new file mode 100644 index 0000000000..0c1100af4b --- /dev/null +++ b/Documentation/snippets/new/bar-chords-notation-for-guitar--with-text-spanner.ly @@ -0,0 +1,84 @@ +\version "2.15.20" + +\header { + lsrtags = "chords, fretted-strings" + + texidoc = " +Here is how to print bar chords, or half-bar chords (just uncomment the +appropriate line for to select either one). + +The syntax is @code{\\bbarre #'fret_number' @{ notes @} } + + + + +" + doctitle = "Bar chords notation for Guitar ( with Text Spanner)" +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% %%%%%%% Cut here ----- Start 'bbarred.ly' + +%% PostScript ------------------------------- +pScript= \markup { + \with-dimensions #'(0 . 0.8) #'(0 . 2.0) + \postscript #" + 0.15 setlinewidth + /Times-Roman findfont + 2.0 scalefont + setfont + (C)show %%change with B if you prefer + %(B)show %%change with C if you prefer + stroke + 0.7 -0.5 moveto + 0.7 1.7 lineto + stroke" +} +%% Span ----------------------------------- +%% Syntax: \bbarre #"text" { notes } - text = any number of box +bbarre= #(define-music-function (barre location str music) (string? ly:music?) + (let ((spanned-music + (let ((first-element #f) + (last-element #f) + (first-found? #f)) + (music-map (lambda (m) + (if (eqv? (ly:music-property m 'name) 'EventChord) + (begin + (if (not first-found?) + (begin + (set! first-found? #t) + (set! first-element m))) + (set! last-element m))) + m) + music) + (if first-found? + (begin + (set! (ly:music-property first-element 'elements) + (cons (make-music 'TextSpanEvent 'span-direction -1) + (ly:music-property first-element 'elements))) + (set! (ly:music-property last-element 'elements) + (cons (make-music 'TextSpanEvent 'span-direction 1) + (ly:music-property last-element 'elements))))) + music))) + (make-music 'SequentialMusic + 'origin location + 'elements (list #{ + \once \override TextSpanner #'font-size = #-2 + \once \override TextSpanner #'font-shape = #'upright + \once \override TextSpanner #'staff-padding = #3 + \once \override TextSpanner #'style = #'line + \once \override TextSpanner #'to-barline = ##f + \once \override TextSpanner #'bound-details = #'((left (Y . 0) (padding . 0.25) (attach-dir . -2)) (right (Y . 0) (padding . 0.25) (attach-dir . 2))) + \once \override TextSpanner #'bound-details #'right #'text = \markup { \draw-line #'( 0 . -.5) } + \once \override TextSpanner #'bound-details #'left #'text = \markup { \pScript #str } +%% uncomment this line for make full barred + % \once \override TextSpanner #'bound-details #'left #'text = \markup { "B" #str } + #} + spanned-music)))) + +%% %%%%%%% Cut here ----- End 'bbarred.ly' +%% Copy and change the last line for full barred. Rename in 'fbarred.ly' +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Syntaxe: \bbarre #"text" { notes } - text = any number of box +\relative c'{ \clef "G_8" \stemUp \bbarre #"III" { 16[ c' d c d8] } } diff --git a/Documentation/snippets/new/string-number-extender-lines.ly b/Documentation/snippets/new/string-number-extender-lines.ly new file mode 100644 index 0000000000..4b0f039db1 --- /dev/null +++ b/Documentation/snippets/new/string-number-extender-lines.ly @@ -0,0 +1,34 @@ +\version "2.15.20" + +\header { + lsrtags = "editorial-annotations, text, fretted-strings, tweaks-and-overrides" + + texidoc = " +Make an extender line for string number indications, showing that a +series of notes is supposed to be played all on the same string. + +" + doctitle = "String number extender lines" +} + +stringNumberSpanner = +#(define-music-function (parser location StringNumber) (string?) + #{ + \override TextSpanner #'style = #'solid + \override TextSpanner #'font-size = #-5 + \override TextSpanner #'(bound-details left stencil-align-dir-y) = #CENTER + \override TextSpanner #'(bound-details left text) = \markup { \circle \number #StringNumber } + #}) + + +\relative c { + \clef "treble_8" + \stringNumberSpanner "5" + \textSpannerDown + a8\startTextSpan + b c d e f\stopTextSpan + \stringNumberSpanner "4" + g\startTextSpan a + bes4 a g2\stopTextSpan +} + -- 2.39.5