X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=ly%2Fsatb.ly;h=36e9dc367af947fd8b92be3cbd42ac750adb9b7d;hb=50ba2171c6a88789ef5ed3673a4c6a4549400113;hp=eed79d1cbbf2066b5e713f51202610ba14c54fbd;hpb=7225065e1958c770f4e450ebc6f32366afd78a83;p=lilypond.git diff --git a/ly/satb.ly b/ly/satb.ly index eed79d1cbb..36e9dc367a 100644 --- a/ly/satb.ly +++ b/ly/satb.ly @@ -1,4 +1,4 @@ -%\version "2.19.17" +%\version "2.19.19" %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% @@ -11,10 +11,13 @@ context structure for a score arrangement consisting of the following staves: - Descant Staff - Soprano and Alto (optionally on two Staves or one Staff) + Solo Staff (outside Choir grouping) + Descant Staff (within Choir grouping) + Women Staff (single voice on one staff) + Soprano and Alto (optionally on two Staves or one Staff each) Multiple verses (up to 9) - Tenor and Bass (optionally on two Staves or one Staff) + Tenor and Bass (optionally on two Staves or one Staff each) + Men Staff (single voice on one staff) Piano Staff It is intended primarily to hide the complexity of the context @@ -29,12 +32,13 @@ \paper { ... } \header { ... } - TwoVoicesPerStaff = ##f or ##t Key = { ... } Time = { ... } - Layout = \layout { ... } + SoloMusic = \relative { ... } DescantMusic = \relative { ... } DescantLyrics = \lyricmode { ... } + WomenMusic = \relative { ... } + WomenLyrics = \lyricmode { ... } SopranoMusic = \relative { ... } SopranoLyrics = \lyricmode { ... } AltoMusic = \relative { ... } @@ -47,182 +51,145 @@ TenorLyrics = \lyricmode { ... } BassMusic = \relative { ... } BassLyrics = \lyricmode { ... } + MenMusic = \relative { ... } + MenLyrics = \lyricmode { ... } PianoRHMusic = \relative { ... } PianoDynamics = { ... } PianoLHMusic = \relative { ... } + TwoVoicesPerStaff = ##f \include "satb.ly" All of the definitions are optional. Staves with no music will be omitted from the output. - Other variables, such as the instrumentName, can also be changed by - defining variables like AltoInstrumentName. The key is defined in - the variable Key, and the structure of time and repeats in the - variable Time, using spacer rests. A \layout block may be defined in - the variable Layout. There is no default \header block and no default - \paper block. + Other variables, such as the instrumentName, shortInstrumentName + and MidiInstrument can also be changed by defining variables like + AltoInstrumentName, BassMidiInstrument, etc. The prefixes for staves + containing two divided voices are WomenDivided and MenDivided, hence + the corresponding variables would be WomenDividedInstrumentName, etc. + The key is defined in the variable Key, and the structure of time + and repeats in the variable Time, using spacer rests. + + A \layout block may be defined in the variable Layout. There is + no default \header block and no default \paper block. Music may be tagged with #'print or #'play to be included only in the printed score or in the MIDI file respectively. %} -#(defmacro satb-defaulting (name . default) - (if (defined? name) name (if (pair? default) (car default) *unspecified*))) - -#(define (satb-sym . strings) (string->symbol (apply string-append strings))) - -#(defmacro satb-short-name (part) - "Use PartShortInstrumentName, or the first letter of -PartInstrumentName or its default." - (if (defined? (satb-sym part "Music")) - (let ((sname (satb-sym part "ShortInstrumentName"))) - (if (defined? sname) - sname - `(substring (satb-defaulting ,(satb-sym part "InstrumentName") ,part) - 0 1))) - "")) - -#(defmacro satb-lyrics-if-defined (name voice . optionals) - (let ((above (and (pair? optionals) (car optionals)))) - (if (defined? name) - `(make-music 'ContextSpeccedMusic - 'create-new #t - 'context-type 'Lyrics - 'property-operations ',(if above `((assign alignAboveContext ,above)) '()) - 'element (make-music 'LyricCombineMusic - 'associated-context ,voice - 'element ,name)) - *unspecified*))) - -#(defmacro satb-one-voice-staff (name clef) - `#{ << - \new Staff = #,name \with { - instrumentName = \markup \smallCaps - #(satb-defaulting ,(satb-sym name "InstrumentName") ,name) - shortInstrumentName = \markup \smallCaps #(satb-short-name ,name) - midiInstrument = "clarinet" - } { - #(satb-defaulting Key) - \clef #,clef - \new Voice = #,name << - #(satb-defaulting Time) - \dynamicUp - #(satb-defaulting ,(satb-sym name "Music")) - >> - } - #(satb-lyrics-if-defined ,(satb-sym name "Lyrics") ,name) - #(satb-lyrics-if-defined ,(satb-sym name "LyricsOne") ,name) - #(satb-lyrics-if-defined ,(satb-sym name "LyricsTwo") ,name) - #(satb-lyrics-if-defined ,(satb-sym name "LyricsThree") ,name) - >> #}) - -#(defmacro satb-two-voice-staff (name clef v1name v2name) - `#{ << - \new Staff = #,name \with { - instrumentName = \markup \right-column \smallCaps { - #(satb-defaulting ,(satb-sym v1name "InstrumentName") ,v1name) - #(satb-defaulting ,(satb-sym v2name "InstrumentName") ,v2name) - } - shortInstrumentName = \markup \right-column \smallCaps { - #(satb-short-name ,v1name) - #(satb-short-name ,v2name) - } - midiInstrument = "clarinet" - } << - #(satb-defaulting Key) - \clef #,clef - \new Voice = #,v1name << - #(satb-defaulting Time) - \voiceOne - \dynamicUp - #(satb-defaulting ,(satb-sym v1name "Music")) - >> - \new Voice = #,v2name << - #(satb-defaulting Time) - \voiceTwo - #(satb-defaulting ,(satb-sym v2name "Music")) - >> - >> - #(satb-lyrics-if-defined ,(satb-sym v1name "Lyrics") ,v1name ,name) - #(satb-lyrics-if-defined ,(satb-sym v1name "LyricsOne") ,v1name ,name) - #(satb-lyrics-if-defined ,(satb-sym v1name "LyricsTwo") ,v1name ,name) - #(satb-lyrics-if-defined ,(satb-sym v1name "LyricsThree") ,v1name ,name) - #(satb-lyrics-if-defined ,(satb-sym v2name "Lyrics") ,v2name) - #(satb-lyrics-if-defined ,(satb-sym v2name "LyricsOne") ,v2name) - #(satb-lyrics-if-defined ,(satb-sym v2name "LyricsTwo") ,v2name) - #(satb-lyrics-if-defined ,(satb-sym v2name "LyricsThree") ,v2name) - >> #}) - -SATB = << - \new ChoirStaff - \with { - \override VerticalAxisGroup.remove-empty = ##t - \override VerticalAxisGroup.remove-first = ##t - } - << - #(satb-one-voice-staff "Descant" "treble") - - #(if (satb-defaulting TwoVoicesPerStaff #f) - (satb-two-voice-staff "Women" "treble" "Soprano" "Alto") - (make-simultaneous-music (list (satb-one-voice-staff "Soprano" "treble") - (satb-one-voice-staff "Alto" "treble")))) - - #(satb-lyrics-if-defined VerseOne "Soprano") - #(satb-lyrics-if-defined VerseTwo "Soprano") - #(satb-lyrics-if-defined VerseThree "Soprano") - #(satb-lyrics-if-defined VerseFour "Soprano") - #(satb-lyrics-if-defined VerseFive "Soprano") - #(satb-lyrics-if-defined VerseSix "Soprano") - #(satb-lyrics-if-defined VerseSeven "Soprano") - #(satb-lyrics-if-defined VerseEight "Soprano") - #(satb-lyrics-if-defined VerseNine "Soprano") - - #(if (satb-defaulting TwoVoicesPerStaff #f) - (satb-two-voice-staff "Men" "bass" "Tenor" "Bass") - (make-simultaneous-music (list (satb-one-voice-staff "Tenor" "treble_8") - (satb-one-voice-staff "Bass" "bass")))) - >> % End ChoirStaff - - \new PianoStaff - \with { - instrumentName = \markup \smallCaps - #(satb-defaulting PianoInstrumentName "Piano" ) - shortInstrumentName = \markup \smallCaps #(satb-short-name "Piano" ) - \override VerticalAxisGroup.remove-empty = ##t - \override VerticalAxisGroup.remove-first = ##t - } - << - \new Staff { - \clef "treble" - #(satb-defaulting Key) - \new Voice << - #(satb-defaulting Time) - #(satb-defaulting PianoRHMusic) - >> - } - \new Dynamics { - #(satb-defaulting PianoDynamics) - } - \new Staff { - \clef "bass" - #(satb-defaulting Key) - \new Voice << - #(satb-defaulting Time) - #(satb-defaulting PianoLHMusic) - >> - } +\include "vocal-tkit.ly" +\include "piano-tkit.ly" + +#(define satb-voice-prefixes + ;; These define the permitted prefixes to various names. + ;; They are combined with a fixed set of postfixes to form + ;; names such as AltoMusic, BassInstrumentName, etc. + ;; These names may be redefined. + '("Alto" + "Bass" + "Descant" + "Men" + "MenDivided" + "Piano" + "PianoLH" + "PianoRH" + "Solo" + "Soprano" + "Tenor" + "Women" + "WomenDivided")) + +#(define satb-lyrics-postfixes + ;; These define the permitted postfixes to the names of lyrics. + ;; They are combined with the prefixes to form names like + ;; AltoLyrics, etc. + ;; These names may be redefined or extended. + '("Lyrics" + "LyricsOne" + "LyricsTwo" + "LyricsThree" + "LyricsFour")) + +#(define satb-lyrics-variable-names + ;; These define the names which may be used to specify stanzas + ;; which go between the two two-voice staves when TwoVoicesPerStaff + ;; is set to #t. They may be redefined or extended. + '("VerseOne" + "VerseTwo" + "VerseThree" + "VerseFour" + "VerseFive" + "VerseSix" + "VerseSeven" + "VerseEight" + "VerseNine")) + +%% make the above definitions available +#(set-music-definitions! + satb-voice-prefixes + satb-lyrics-postfixes + satb-lyrics-variable-names) + +%% override the usual default value +#(if (not SoloShortInstrumentName) + (set! SoloShortInstrumentName "")) + +SATB = +<< + \make-one-voice-vocal-staff "Solo" "treble" + \new ChoirStaff << + \make-one-voice-vocal-staff "Descant" "treble" + \make-one-voice-vocal-staff "Women" "treble" + #(if TwoVoicesPerStaff + #{ + \make-two-vocal-staves-with-stanzas + "WomenDivided" "treble" "MenDivided" "bass" + "Soprano" "Alto" "Tenor" "Bass" + #satb-lyrics-variable-names + #} + #{ + << + \make-one-voice-vocal-staff "Soprano" "treble" + \make-one-voice-vocal-staff "Alto" "treble" + \make-one-voice-vocal-staff "Tenor" "treble_8" + \make-one-voice-vocal-staff "Bass" "bass" + >> + #} ) + \make-one-voice-vocal-staff "Men" "bass" >> >> +Piano = \make-pianostaff + \tagGroup #'(print play) +\layout { + \context { + \Staff + \override VerticalAxisGroup.remove-empty = ##t + \override VerticalAxisGroup.remove-first = ##t + } +} + \score { - \keepWithTag #'print \SATB - \layout { $(satb-defaulting Layout) } + \keepWithTag #'print + #(if have-music + #{ << \SATB \Piano >> #} + #{ { } #} ) + \layout { $(if Layout Layout) } } + \score { - \keepWithTag #'play \SATB - \midi { } + \keepWithTag #'play + #(if have-music + #{ << \SATB \Piano >> #} + #{ { } #} ) + \midi { + \context { + \Score + midiChannelMapping = #'instrument + } + } }