• Willkommen im Forum „Archiviertes Lilypond Forum (2017)“.
 

Dies ist das Archiv des alten Forums (bis März 2017). Das aktuelle Forum ist unter lilypondforum.de zu finden.
This is the archive of the old forum (until March 2017). You can find the current forum at lilypondforum.de.

Hauptmenü

Griffschrift-Kreuz

Begonnen von stefanhuglfing, Dienstag, 9. September 2014, 22:07

Vorheriges Thema - Nächstes Thema

stefanhuglfing

ich habe mal mit diesem Vorbild:

https://archiv.lilypondforum.de/index.php?topic=989.msg5529#msg5529

mit Postscript ein Griffschrift-Kreuz entworfen:


x = {
\once \override NoteHead  #'stencil = #ly:text-interface::print
\once \override NoteHead #'text = \markup
   
    \postscript
    #"
       0.08     setlinewidth
      -0.1  -0.5 moveto
      -0.3  -0.5 lineto
                      -1.1   0.3 lineto
                      -1.1   0.5 lineto
                      -0.9   0.5 lineto
                      -0.1  -0.3 lineto
                                 closepath
                      -0.1   0.5 moveto
                      -0.3   0.5 lineto
                      -1.1  -0.3 lineto
                      -1.1  -0.5 lineto
                      -0.9  -0.5 lineto
                       -0.1    0.3 lineto
                       closepath
       fill
      "
}

y = {
\once \override NoteHead  #'stencil = #ly:text-interface::print
\once \override NoteHead #'text = \markup
   
    \postscript
    #"
      0.08     setlinewidth
      -0.1  -0.5 moveto
      -0.3  -0.5 lineto
                      -1.1   0.3 lineto
                      -1.1   0.5 lineto
                      -0.9   0.5 lineto
                      -0.1  -0.3 lineto
                                 closepath
                      -0.1   0.5 moveto
                      -0.3   0.5 lineto
                      -1.1  -0.3 lineto
                      -1.1  -0.5 lineto
                      -0.9  -0.5 lineto
                       -0.1    0.3 lineto
                       closepath
      stroke
      "
}

z = {
\once \override NoteHead  #'stencil = #ly:text-interface::print
\once \override NoteHead #'text = \markup
   
    \postscript
    #"
      0.1   -0.5 moveto
      0.3   -0.5 lineto
                      1.1    0.3 lineto
                      1.1    0.5 lineto
                      0.9    0.5 lineto
                      0.1   -0.3 lineto
                      0.1   -0.5 lineto
      0.1    0.5 moveto
                      0.3    0.5 lineto
                      1.1   -0.3 lineto
                      1.1   -0.5 lineto
                      0.9   -0.5 lineto
                      0.1    0.3 lineto
                      0.1    0.5 lineto
      stroke
      "
}

\relative c
{
  \y c'2 \x d4 \x e \x f \z b2
  c2 d4 e
}


Mir gefällt es noch nicht ganz, aber bevor ich es verschönere habe ich noch drei Probleme:

Kann man es erreichen, dass lilypond von selbst

- Hilfslinien reinmacht? (Im Beispiel fehlt sie beim eingestrichenen c)
- die Notenköpfe rechts oder links an den Hals setzt, so wie es üblich ist?
- den nicht ausgemalten Kopf verwendet, wenn man halbe Noten (oder länger) schreibt?

Es wäre schön, wenn mir jemand Ideen schreibt

Pierre

Hallo Stefan,

die Länge der "ledger-lines" ist  der Grösse der Notenkoepfe angemessen. Diese Grösse muss also unbedingt  für Dein "postscript" angegeben werden.

Versuch mal
\version "2.18.2"

#(define (ly:note-head::my-note-heads grob)
  (let ((duration (ly:grob-property grob 'duration-log)))
    (case duration
      ((0) (grob-interpret-markup grob
             #{
               \markup
               %% ??????? %%
               \with-dimensions #'(-1.15 . -.05) #'(0 . .6)
               \postscript #
          "
                   0.08      setlinewidth
                  -0.1  -0.5 moveto
                  -0.3  -0.5 lineto
                  -1.1   0.3 lineto
                  -1.1   0.5 lineto
                  -0.9   0.5 lineto
                  -0.1  -0.3 lineto
                             closepath
                  -0.1   0.5 moveto
                  -0.3   0.5 lineto
                  -1.1  -0.3 lineto
                  -1.1  -0.5 lineto
                  -0.9  -0.5 lineto
                  -0.1   0.3 lineto
                  closepath
                  stroke
                 "
             #}))
      ((1) (grob-interpret-markup grob
             #{
               \markup
               \with-dimensions #'(-1.15 . -.05) #'(0 . .6)
               \postscript #
          "
                   0.08      setlinewidth
                  -0.1  -0.5 moveto
                  -0.3  -0.5 lineto
                  -1.1   0.3 lineto
                  -1.1   0.5 lineto
                  -0.9   0.5 lineto
                  -0.1  -0.3 lineto
                             closepath
                  -0.1   0.5 moveto
                  -0.3   0.5 lineto
                  -1.1  -0.3 lineto
                  -1.1  -0.5 lineto
                  -0.9  -0.5 lineto
                  -0.1   0.3 lineto
                  closepath
                  stroke
                 "
             #}))
      ((2)(grob-interpret-markup grob
             #{
             \markup
             \with-dimensions #'(-1.1 . -.1) #'(0 . .6)
             \postscript #
"
0.08      setlinewidth
-0.1  -0.5 moveto
-0.3  -0.5 lineto
                -1.1   0.3 lineto
                -1.1   0.5 lineto
                -0.9   0.5 lineto
                -0.1  -0.3 lineto
                           closepath
                -0.1   0.5 moveto
                -0.3   0.5 lineto
                -1.1  -0.3 lineto
                -1.1  -0.5 lineto
                -0.9  -0.5 lineto
                -0.1   0.3 lineto
                 closepath
fill
        "
           #}))
       (else (ly:note-head::print grob)))))   

myNoteHead = {
\override NoteHead.stencil = #ly:note-head::my-note-heads
}

\relative c {
  \myNoteHead
  c'1 d2 e4 f8 g16 a'32 b64 c128
}


Grüße
Pierre

stefanhuglfing

toll! Alle drei Probleme gelöst.

Danke