Schemefunktionen für horizontale Spanner

Begonnen von rgree, Donnerstag, 5. Januar 2023, 12:44

« vorheriges - nächstes »

rgree

Hallo,

inspiriert durch die von Harm vorgeschlagene Lösung von "Musikausdruck mit HorizontalBracket versehen"
habe ich mir folgende music-functions gebastelt:

cr_span_down
cr_span_up
decr_span_down
decr_span_up
group_span_down
group_span_up
measure_count_span_down
measure_count_span_up
slur_span_down
slur_span_up
stem_span_down
stem_span_up
text_span_down
text_span_up
trill_span_down
trill_span_up

Sie sind im folgenden Code definiert, der auch für jede ein Anwendungsbeispiel enthält :

\version "2.20.0"
% --------------------------------------
group_span_up =
#(define-music-function (m) (ly:music?)
   #{
     {
       \override HorizontalBracket.direction = #UP
       <>\startGroup
       $m
       \stopGroup
       \revert HorizontalBracket.direction
     }
   #})
% --------------------------------------
group_span_down =
#(define-music-function (m) (ly:music?)
   #{
     {
       \override HorizontalBracket.direction = #DOWN
       <>\startGroup
       $m
       \stopGroup
       \revert HorizontalBracket.direction
     }
   #})
% --------------------------------------
trill_span_up =
#(define-music-function (m) (ly:music?)
   #{
     {
       \override TrillSpanner.direction = #UP
       <>\startTrillSpan
       $m
       \stopTrillSpan
       \revert TrillSpanner.direction
     }
   #})
% --------------------------------------
trill_span_down =
#(define-music-function (m) (ly:music?)
   #{
     {
       \override TrillSpanner.direction = #DOWN
       <>\startTrillSpan
       $m
       \stopTrillSpan
       \revert TrillSpanner.direction
     }
   #})
% --------------------------------------
text_span_up =
#(define-music-function (m) (ly:music?)
   #{
     {
       \override TextSpanner.direction = #UP
       <>\startTextSpan
       $m
       \stopTextSpan
       \revert TextSpanner.direction
     }
   #})
% --------------------------------------
text_span_down =
#(define-music-function (m) (ly:music?)
   #{
     {
       \override TextSpanner.direction = #DOWN
       <>\startTextSpan
       $m
       \stopTextSpan
       \revert TextSpanner.direction
     }
   #})
% --------------------------------------
slur_span_up =
#(define-music-function (m) (ly:music?)
   #{
     {
       <> ^(
       $m
       )
     }
   #})
% --------------------------------------
slur_span_down =
#(define-music-function (m) (ly:music?)
   #{
     {
       <> _(
       $m
       )
     }
   #})
% --------------------------------------
cr_span_down =
#(define-music-function (m) (ly:music?)
   #{
     {
       <>\<
       $m
       \!
     }
   #})
% --------------------------------------
decr_span_down =
#(define-music-function (m) (ly:music?)
   #{
     {
       <>\>
       $m
       \!
     }
   #})
% --------------------------------------
cr_span_up =
#(define-music-function (m) (ly:music?)
   #{
     {
       <> ^\<
       $m
       \!
     }
   #})
% --------------------------------------
decr_span_up =
#(define-music-function (m) (ly:music?)
   #{
     {
       <> ^\>
       $m
       \!
     }
   #})
% --------------------------------------
measure_count_span_up =
#(define-music-function (m) (ly:music?)
   #{
     {
       \override Staff.MeasureCounter.direction = #UP
       <> \startMeasureCount
       $m
       \stopMeasureCount
       \revert Staff.MeasureCounter.direction
     }
   #})
% --------------------------------------
measure_count_span_down =
#(define-music-function (m) (ly:music?)
   #{
     {
       \override Staff.MeasureCounter.direction = #DOWN
       <> \startMeasureCount
       $m
       \stopMeasureCount
       \revert Staff.MeasureCounter.direction
     }
   #})
% --------------------------------------
stem_span_up =
#(define-music-function (m) (ly:music?)
   #{
     {
       <> \stemUp
       $m
       \stemNeutral
     }
   #})
% --------------------------------------
stem_span_down =
#(define-music-function (m) (ly:music?)
   #{
     {
       <> \stemDown
       $m
       \stemNeutral
     }
   #})
% --------------------------------------
music = { c'8 d' e' f' g' a' b' c'' c'8 d' e' f' g' a' b' c'' }
\score {
    \context StaffGroup <<
      \new Staff
      {
% \keepWithTag #'(partsOnly formatiertNachVorlage) \satz_I_ViolineEins
<> ^"(ohne alles)"
\music
%
<> ^"(stem_span_up)"
        \stem_span_up { \music }
        %
<> ^"(stem_span_down)"
        \stem_span_down { \music }
        % --------------------------------------
        \break
\override Staff.MeasureCounter.color = #grey
<> ^"(measure_count_span_up)"
        \measure_count_span_up { \music }
        %
<> ^"(measure_count_span_down)"
        \measure_count_span_down { \music }
        %
<> ^"(cr_span_up)"
        \cr_span_up { \music }
        % --------------------------------------
        \break
<> ^"(cr_span_down)"
        \cr_span_down { \music }
        %
<> ^"(decr_span_up)"
        \decr_span_up { \music }
        %
<> ^"(decr_span_down)"
        \decr_span_down { \music }
        % --------------------------------------
        \break
<> ^"(slur_span_up)"
        \slur_span_up { \music }
        %
<> ^"(slur_span_down)"
        \slur_span_down { \music }
        %
\override TextSpanner.bound-details.left.text = \markup\italic "<span-text> "
<> ^"(text_span_up)"
        \text_span_up { \music }
        % --------------------------------------
        \break
<> ^"(text_span_down)"
        \text_span_down { \music }
        %
<> ^"(trill_span_up)"
        \trill_span_up { \music }
        %
<> ^"(trill_span_down)"
        \trill_span_down { \music }
        % --------------------------------------
        \break
<> ^"(group_span_up)"
        \group_span_up { \music }
        %
<> ^"(group_span_down)"
        \group_span_down { \music }
%
<> ^"(ohne alles)"
\music
      }
    >>
    \layout {
      indent = 0.0 % rückt erste Zeile nicht ein
      #(layout-set-staff-size 14)
      \context { \Voice \consists "Horizontal_bracket_engraver"}
      \context { \Staff \consists Measure_counter_engraver }
    }
}


Für mich machen sie manches einfacher .

Viel Vergnügen,
Reinhard

harm6


Manuela

Danke Reinhard. Der Betreff des Threads ist leider nicht sehr aussagekräftig, vielleicht möchtest du ihn ändern? z.B. "Schemefunktionen für horizontale Spanner"
Danke für eure Hilfe
viele Grüße
-- Manuela

rgree


Manuela

Danke für eure Hilfe
viele Grüße
-- Manuela