Deutschsprachiges LilyPond-Forum

Allgemeine Fragen und Probleme => Fragen und Probleme aller Art => Thema gestartet von: rgree am Freitag, 5. Mai 2017, 18:02

Titel: zusätzliches temporäres Staff - Position (gelöst)
Beitrag von: rgree am Freitag, 5. Mai 2017, 18:02
Liebe Leute,

ich habe erfolgreich zu einer Stimme temporär eine zweite hinzugefügt:

\version "2.18.0"

#(define (override-color-for-all-grobs color)
  (lambda (context)
   (let loop ((x all-grob-descriptions))
    (if (not (null? x))
     (let ((grob-name (caar x)))
      (ly:context-pushpop-property context grob-name 'color color)
      (loop (cdr x)))))))

staffSize = #(define-music-function (parser location new-size) (number?)
  #{
    \set fontSize = #new-size
    \override StaffSymbol.staff-space = #(magstep new-size)
    \override StaffSymbol.thickness = #(magstep new-size)
    \override Staff.Clef.font-size = #new-size
    \override Staff.KeySignature.font-size = #new-size
    \override Staff.NoteHead.font-size = #new-size
  #})
%
makeGrey = {
  \applyContext #(override-color-for-all-grobs (x11-color 'grey35))
  \override Staff.Clef.color = #(x11-color 'grey35)
  \override Staff.BarLine.color = #(x11-color 'black) % die soll scharz beleiben
}
%
\score {
  <<
    \new StaffGroup \relative c'' {
      \new Staff {
        c1 | c
        <<
          {
            c1 | d
          }
          \new Staff \with { \staffSize #-2 \makeGrey}   {
            \once \omit Staff.TimeSignature
            c1  | b
          }
        >>
        c1
      }
    }
  >>
}



Wie man im Ergebnis sieht, entsteht die neue verkleinerte Stimme unter der alten.

Nun die Fragen:

- kann ich die verkleinerte Stimme auch ÜBER der anderen platzieren
- kann ich den Abstand zwischen beiden verkleinern

LG,
Reinhard
Titel: Antw:zusätzliches temporäres Staff - Position
Beitrag von: Manuela am Freitag, 5. Mai 2017, 18:27
\version "2.18.0"

#(define (override-color-for-all-grobs color)
  (lambda (context)
   (let loop ((x all-grob-descriptions))
    (if (not (null? x))
     (let ((grob-name (caar x)))
      (ly:context-pushpop-property context grob-name 'color color)
      (loop (cdr x)))))))

staffSize = #(define-music-function (parser location new-size) (number?)
  #{
    \set fontSize = #new-size
    \override StaffSymbol.staff-space = #(magstep new-size)
    \override StaffSymbol.thickness = #(magstep new-size)
    \override Staff.Clef.font-size = #new-size
    \override Staff.KeySignature.font-size = #new-size
    \override Staff.NoteHead.font-size = #new-size
  #})
%
makeGrey = {
  \applyContext #(override-color-for-all-grobs (x11-color 'grey35))
  \override Staff.Clef.color = #(x11-color 'grey35)
  \override Staff.BarLine.color = #(x11-color 'black) % die soll scharz beleiben
}

\score {
  <<
    \new StaffGroup \with {
    \override StaffGrouper.staffgroup-staff-spacing.basic-distance = #5
    \override StaffGrouper.staffgroup-staff-spacing.minimum-distance = #1
  }
    \relative c'' {
      \new Staff=unten {
        c1 | c
        <<
          {
            c1 | d
          }
          \new Staff \with { \staffSize #-2 \makeGrey
          alignAboveContext = unten
          }   {
            \once \omit Staff.TimeSignature
            c1  | b
          }
        >>
        c1
      }
    }
  >>
}
Titel: Antw:zusätzliches temporäres Staff - Position
Beitrag von: Malte am Samstag, 6. Mai 2017, 00:24
Zitat von: Manuela am Freitag,  5. Mai 2017, 18:27

    \override StaffGrouper.staffgroup-staff-spacing.basic-distance = #5
    \override StaffGrouper.staffgroup-staff-spacing.minimum-distance = #1

Zitat

          alignAboveContext = unten

Das sind die beiden relevanten Änderungen, nur für die Übersicht ;)
Titel: Antw:zusätzliches temporäres Staff - Position (gelöst)
Beitrag von: rgree am Samstag, 6. Mai 2017, 08:14
Vielen Dank !
Das wollte ich wissen.

LG,
Reinhard
Titel: Antw:zusätzliches temporäres Staff - Position
Beitrag von: Manuela am Samstag, 6. Mai 2017, 09:13
Zitat von: Malte am Samstag,  6. Mai 2017, 00:24

Das sind die beiden relevanten Änderungen, nur für die Übersicht ;)

Ich würde die Änderungen gerne einfärben, so wie es Harm immer gemacht hat.
Geht leider nicht, hier ein Beispiel:

[color=red]\language "deutsch"[/color]
Titel: Antw:zusätzliches temporäres Staff - Position (gelöst)
Beitrag von: Malte am Samstag, 6. Mai 2017, 10:51
Hat er das? In [ code ]-Tags ging das doch noch nie, oder?
Titel: Antw:zusätzliches temporäres Staff - Position (gelöst)
Beitrag von: harm6 am Samstag, 6. Mai 2017, 11:05
In [b]code[/b] kann man nicht [color=red]einfärben[/color]
oder
sonstwie formatieren
[u]außer[/u] durch
    indentation.
:)


ZitatAber wenn man quote benutzt
geht
das
alles
;)

quote erstellt allerdings kein komprimiertes Fenster, welches man dann scrollen kann

Gruß,
  Harm
Titel: Antw:zusätzliches temporäres Staff - Position (gelöst)
Beitrag von: Manuela am Samstag, 6. Mai 2017, 11:15
Ich bilde mir ein, dass ich irgendwo gefärbten Code gesehen habe.

Falls ich einen einschlägigen Thread finden sollte, werde ich hier einen Link einstellen.