Notationsspezifisch > Noten für Schlagzeug
Ghost Notes Global Ändern
Arnold:
Hallo,
ich habe noch mal versucht, unabhängig von der Überschricht, Dein Problem zu beschreiben.
So wie ich die Bescheibung verstehe, geht es darum, an einzelnen Noten bzw. Notenköpfen eine »kurze« Information anzuhängen, damit anschließend en Kreuz-Notenkopf benutzt wird.
Nur eine Lösungsmöglichkeit könnte eine «globale Funktion« sein, welche einen (einfach einzugebenen) »Stellvertreter« in ein anderes (das gewünschte) Objekt umwandelt.
Die aktuelle Lösung mit tweak macht die Änderung direkt am Notenkopf. Der ganze tweak-Befehl kann zu einem kurzen Schlässelwort zusammengefaßt werden, welches dann im Akkord (einfache spitze Klammer) der Tonhöhe vorangestellt wird - anstelle des \parenthesize.
Würde die Information als Artikulation angehängt (wie das Staccato »-.« ) müßte ich auch auf getrennte Notenhälse (mehrere parallele Stimmen) ausweichen.
Da das ganze in einer Schlagzeugstimme geschehen soll, stelle ich mir noch die Frage, ob man nicht einen (oder mehrere) passende weitere »Schlaginstumentpitches« definieren kann, die dann mit Kreuzkopf dargestellt werden. Aber mit Schlagzeugnotation (Drumstaff) habe ich leider keine Erfahrung.
Und zu guter Letzt, ich glaube mich zu entsinnen, in der Version 2.15.30 irgendwas mit Ghostnotes als neues Feature gelesen zu haben. (Handbuch notation.pdf in englisch, für 2.15.31, Kaptitel 2.5.1, Seite 353 - aber das ist nur ein Einklammern)
Vielleicht ist auch eine Funktion machbar, welche das \parenthesize in ein entsprechendes \tweak umwnadelt. Doch sinnvoll ist da nur noch, wenn ich Quellen, die \parenthesize benutzen, ohne Änderung in der Quelle mit den anderen Notenköpfen anstelle des Einklammerns darstellen will.
Arnold
harm6:
Hallo,
@Arnold
--- Zitat ---So wie ich die Bescheibung verstehe, geht es darum, an einzelnen Noten bzw. Notenköpfen eine »kurze« Information anzuhängen, damit anschließend en Kreuz-Notenkopf benutzt wird.
--- Ende Zitat ---
Ich glaube eher, daß die erstmal eingeklammerten Noten so bearbeitet werden sollen, daß anderer Output möglich wird. (Der Kreuz-Notenkopf wird ja schon in der mydrums-alist als default-Notenkopf für für zwei verschiedene Schlagzeuginstrumente benutzt)
@Schlomo
Ich hab' mal affect-parenthesized-note-heads definiert. Es werden nur eingeklammerte Noten ausgelesen, d.h. eingeklammerte Pausen bleiben unberücksichtigt)
Diese Definition verlangt noch ein property und einen value.
Ich habe dann mal ein paar Anwendungsmöglichkeiten in den Code gepackt. Warum mir die Änderung der Größe nicht gelingt weiß ich allerdings nicht. Arnold: weißt Du Rat?
--- Code: ---\version "2.14.0" % necessary for upgrading to future LilyPond versions.
#(define ((affect-parenthesized-note-heads property value) grob)
(let* ((sys (ly:grob-system grob))
(array (ly:grob-object sys 'all-elements))
(grob-name (lambda (x) (assq-ref (ly:grob-property x 'meta) 'name)))
(note-heads (ly:grob-object grob 'note-heads))
(note-heads-grobs (if (not (null? note-heads))
(ly:grob-array->list note-heads)
'()))
(par-lst (filter (lambda (x) (eq? 'ParenthesesItem (grob-name x)))
(ly:grob-array->list array)))
(rel-coord (lambda (z) (ly:grob-relative-coordinate z sys X)))
(proc (lambda (x)
(if (eq? (ly:prob-property (ly:grob-property x 'cause) 'parenthesize ) #t)
(begin
(ly:grob-set-property! x property value)
(map (lambda (y)
(if (= (rel-coord x) (rel-coord y))
(ly:grob-set-property! y 'transparent #t)
#f))
par-lst))
#f))))
(map proc note-heads-grobs)))
colorParenthesizedNoteHeads = \override Staff.NoteColumn #'after-line-breaking =
#(affect-parenthesized-note-heads 'color (x11-color 'grey66))
makeTransparentParenthesizedNoteHeads = \override Staff.NoteColumn #'after-line-breaking =
#(affect-parenthesized-note-heads 'transparent #t)
% Funktioniert nicht. Warum?
smallerParenthesizedNoteHeads = \override Staff.NoteColumn #'after-line-breaking =
#(affect-parenthesized-note-heads 'font-size -3)
#(define (new-stil grob)
(grob-interpret-markup grob (markup
#:with-color red
#:fontsize -2
#:rotate -90 ":)")))
newStencilParenthesizedNoteHeads = \override Staff.NoteColumn #'after-line-breaking =
#(affect-parenthesized-note-heads 'stencil new-stil)
%--- Test
\layout {
}
\header { tagline = ##f }
#(set-global-staff-size 20)
\paper {
system-system-spacing #'basic-distance = #20
indent = #(* mm 0)
top-margin = #(* mm 20)
}
\layout {
\context {
\Score
%\remove "Bar_number_engraver"
}
}
#(define mydrums '(
(bassdrum default #f -5)
(snare default #f 0)
(hihat cross #f 5)
(pedalhihat cross #f -3)
(openhihat xcircle #f 5)
(lowtom default #f 1)
(hightom default #f 3)
(lowfloortom default #f -1)
(ridecymbal harmonic-black #f 6)
(ridebell harmonic-black #f 5)
(crashcymbal harmonic-black #f 7)
)
)
oben = \drummode {
\numericTimeSignature
\time 4/4
{
\override TextScript #'script-priority = #100
cymc8\upbow rb
rb16 rb16 rb8
rb8 rb16 rb16
rb8 rb16 rb16
}
}
unten = \drummode
{
%\override Beam #'damping = #+inf.0
\override Beam #'positions = #'(-5 . -5)
bd16 hhp sn hhp
sn16 hhp8 < sn hhp >16
bd16 < \parenthesize sn hhp >16 << \parenthesize sn >> hhp
r16 << sn8 hhp >> hhp16
}
\markup \bold "Original"
\new DrumStaff <<
\set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
\new DrumVoice { \voiceOne \oben }
\new DrumVoice { \voiceTwo \unten }
>>
\markup \bold "Mit Farbe, hier: grau"
\new DrumStaff <<
\set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
\new DrumVoice { \voiceOne \oben }
\new DrumVoice { \voiceTwo \colorParenthesizedNoteHeads \unten }
>>
\markup \bold "Transparent"
\new DrumStaff <<
\set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
\new DrumVoice { \voiceOne \oben }
\new DrumVoice { \voiceTwo \makeTransparentParenthesizedNoteHeads \unten }
>>
% Funktioniert nicht. Warum?
% \new DrumStaff <<
% \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
% \new DrumVoice { \voiceOne \oben }
% \new DrumVoice { \voiceTwo \smallerParenthesizedNoteHeads \unten }
% >>
\markup \bold "Neuer Notenkopf"
\new DrumStaff <<
\set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
\new DrumVoice { \voiceOne \oben }
\new DrumVoice { \voiceTwo \newStencilParenthesizedNoteHeads \unten }
>>
--- Ende Code ---
HTH,
Harm
schlomo:
Hallo Harm, hallo Arnold
Fantastisch!
es klappt
die "Gohstys" sind genau so wie ich es wollte.
- Ohne Notenkopf.
- Global geregelt.
- Es besteht aber trotzdem noch die Möglichkeit Sonderzeichen für Artikulation und Handsatz hinzuzufügen.
@ Harm
mit
bd16 hhp sn hhp
\once\override Beam #'positions = #'(-5 . -5)
klappt es sogar einzelne Notenbalken waagrecht auszurichten!
Mit "<< >>" hatte ich bisher noch keine Probleme, und immerhin ist die Schlagzeugpartitur schon 32 Takte lang
allerdings hat die log-File manchmal gemeckert wenn ich nur "< >" benutzt habe.
Ich muss aber eingestehen, dass mir die Syntax von Lilypond noch "etwas" Schleierhaft ist.
Ansonsten gilt:
Danke, Danke, Danke!
Schönes WE
viele Grüße
Schlomo
harm6:
Hallo Schlomo,
schön, daß es Dir gefällt!
Mir ließ es aber keine Ruhe, daß ich die Größenveränderung nicht hinbekommen habe.
Jetzt schon! Allerdings mußte ich den 'stencil manipulieren und mir ist nach wie vor schleierhaft, warum dieser Aufwand nötig war:
--- Code: ---\version "2.14.0" % necessary for upgrading to future LilyPond versions.
#(define ((affect-parenthesized-note-heads property value) grob)
(let* ((sys (ly:grob-system grob))
(array (ly:grob-object sys 'all-elements))
(grob-name (lambda (x) (assq-ref (ly:grob-property x 'meta) 'name)))
(note-heads (ly:grob-object grob 'note-heads))
(note-heads-grobs (if (not (null? note-heads))
(ly:grob-array->list note-heads)
'()))
(par-lst (filter (lambda (x) (eq? 'ParenthesesItem (grob-name x)))
(ly:grob-array->list array)))
(rel-coord (lambda (z) (ly:grob-relative-coordinate z sys X)))
(proc (lambda (x)
(if (eq? (ly:prob-property (ly:grob-property x 'cause) 'parenthesize ) #t)
(begin
(ly:grob-set-property! x property value)
;(ly:prob-set-property! x 'tweak (cons 'font-size 8))
(map (lambda (y)
(if (= (rel-coord x) (rel-coord y))
(ly:grob-set-property! y 'transparent #t)
#f))
par-lst))
#f))))
(map proc note-heads-grobs)))
colorParenthesizedNoteHeads = \override Staff.NoteColumn #'after-line-breaking =
#(affect-parenthesized-note-heads 'color (x11-color 'grey66))
makeTransparentParenthesizedNoteHeads = \override Staff.NoteColumn #'after-line-breaking =
#(affect-parenthesized-note-heads 'transparent #t)
#(define (smaller-stencil grob)
(let* ((sys (ly:grob-system grob))
(rel-coord (lambda (z) (ly:grob-relative-coordinate z sys X)))
(note-heads (ly:grob-object grob 'note-heads))
(note-heads-grobs (if (not (null? note-heads))
(ly:grob-array->list note-heads)
'()))
(n-c-coord (rel-coord (ly:grob-parent grob X)))
(n-h-coord (rel-coord grob))
(stencil (ly:note-head::print grob))
(stencil-length-x (interval-length (ly:stencil-extent stencil X)))
(new-stencil (ly:stencil-scale stencil 0.7 0.7))
(new-stencil-length-x (interval-length (ly:stencil-extent new-stencil X)))
(stem (ly:grob-object grob 'stem))
(stem-dir (ly:grob-property stem 'direction))
(diff (- stencil-length-x new-stencil-length-x)))
(ly:stencil-translate-axis
new-stencil
(cond ((< stem-dir 0)
(if (> n-c-coord n-h-coord)
diff
0))
((> stem-dir 0)
(if (>= n-c-coord n-h-coord)
diff
0)))
X)))
smallerParenthesizedNoteHeads = \override Staff.NoteColumn #'stencil =
#(affect-parenthesized-note-heads 'stencil smaller-stencil)
#(define (new-stil grob)
(grob-interpret-markup grob (markup
#:with-color red
#:fontsize -2
#:rotate -90 ":)")))
newStencilParenthesizedNoteHeads = \override Staff.NoteColumn #'after-line-breaking =
#(affect-parenthesized-note-heads 'stencil new-stil)
%--- Test
\layout {
}
\header { tagline = ##f }
#(set-global-staff-size 20)
\paper {
system-system-spacing #'basic-distance = #20
indent = #(* mm 0)
top-margin = #(* mm 20)
}
\layout {
\context {
\Score
%\remove "Bar_number_engraver"
}
}
#(define mydrums '(
(bassdrum default #f -5)
(snare default #f 0)
(hihat cross #f 5)
(pedalhihat cross #f -3)
(openhihat xcircle #f 5)
(lowtom default #f 1)
(hightom default #f 3)
(lowfloortom default #f -1)
(ridecymbal harmonic-black #f 6)
(ridebell harmonic-black #f 5)
(crashcymbal harmonic-black #f 7)
)
)
oben = \drummode {
\numericTimeSignature
\time 4/4
{
\override TextScript #'script-priority = #100
cymc8\upbow rb
rb16 rb16 rb8
rb8 rb16 rb16
rb8 rb16 rb16
}
}
unten = \drummode
{
%\override Beam #'damping = #+inf.0
\override Beam #'positions = #'(-5 . -5)
bd16 hhp sn hhp
sn16 hhp8 < sn hhp >16
bd16 < \parenthesize sn hhp >16 << \parenthesize sn >> hhp
r16 << sn8 hhp >> hhp16
}
\markup \bold "Original"
\new DrumStaff <<
\set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
\new DrumVoice { \voiceOne \oben }
\new DrumVoice { \voiceTwo \unten }
>>
\markup \bold "Mit Farbe, hier: grau"
\new DrumStaff <<
\set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
\new DrumVoice { \voiceOne \oben }
\new DrumVoice { \voiceTwo \colorParenthesizedNoteHeads \unten }
>>
\markup \bold "Transparent"
\new DrumStaff <<
\set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
\new DrumVoice { \voiceOne \oben }
\new DrumVoice { \voiceTwo \makeTransparentParenthesizedNoteHeads \unten }
>>
\markup \bold "Kleiner Notenkopf"
\new DrumStaff <<
\set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
\new DrumVoice { \voiceOne \oben }
\new DrumVoice { \voiceTwo \smallerParenthesizedNoteHeads \unten }
>>
\markup \bold "Neuer Notenkopf"
\new DrumStaff <<
\set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
\new DrumVoice { \voiceOne \oben }
\new DrumVoice { \voiceTwo \newStencilParenthesizedNoteHeads \unten }
>>
\markup \bold "Mit Noten im Sekundabstand"
\relative c'' {
%\colorParenthesizedNoteHeads
%\makeTransparentParenthesizedNoteHeads
\smallerParenthesizedNoteHeads
%\newStencilParenthesizedNoteHeads
<d \parenthesize f \parenthesize g b>4
<d, \parenthesize f \parenthesize g b>
}
--- Ende Code ---
Gruß,
Harm
P.S.
--- Zitat ---allerdings hat die log-File manchmal gemeckert wenn ich nur "< >" benutzt habe.
--- Ende Zitat ---
Bei "< ... >" muß der Notenwert hinter die Klammer z.B. <c e g>8. Zumindest vermute ich, daß das Problem so lag.
Arnold:
Hallo Harm,
ich habe auch ein bischen herumprobiert und nachgedacht und bin zum Schluß gekommen, daß es mit einem Caching Mechanismus zusammenhängt. Dafär spricht sowohl deine Beobachtung, daß ein Überladen des Stencil im »after-line-breaking« zum Ergebnis führt, und genauso die Beobachtung bei meinen »pitched Accidentals«, daß diese Callbacks nur einmal aufgerufen werden (und nicht zweimal, mämlich zuerst für die Größendefinition, und später für die Ausgabe nocheinmal).
Ich habe noch nicht untersucht, ob ein anderer YIELD-Wert zu einem anderen Caching-Verhalten führt.
Nun zu ein bischen Theorie.
Ich sehe drei praktikable Wege für diese Veränderungen:
- eine Music-Function, welche ein ly:music? mit parenthesize liest, und eine modifizierte ly:muisc? mit \tweak ... zurückgibt.
- eine »before-line-breaking«-Funktion, die abläuft noch bevor die Ausdehnung der GROBs evaluiert wird.
- eine »after-line-breaking«-Funktion (wie du es programmiert hast), bevor die Grafik (in die PS-Datei) ausgegeben wird.
Den zweiten Weg habe ich ein bischen ausprobiert - also bevor der Notenkopf und der Notenhals »gerückt« werden - und da funktionierts mit dem Setzen des font-size. Wie ich vom Notehead-Grob zum Parenthesize grob komme, habe ich aber noch nicht herausgefunden. Und alle ParenthesesItem-Grobs in die Aptose zu schicken, habe ich auch noch nicht ausprobiert. Da bin ich mir aber noch nicht sicher, ob ich nicht zuviel entferne.
--- Code: ---\version "2.14.0" % necessary for upgrading to future LilyPond versions.
#(define (twitter notehead-grob)
(let*
((is-par (ly:event-property (event-cause notehead-grob) 'parenthesize))
)
(if (not (null? is-par))
(begin
; (display "\nis-par = ") (display is-par)
(if is-par
(begin
; (display "\n Parenthesized Notehad ... ")
; (ly:grob-set-property! notehead-grob 'color (x11-color 'green))
(ly:grob-set-property! notehead-grob 'font-size -4)
(ly:grob-set-property! notehead-grob 'parenthesize #f) ; no effect (parenthesis grob allready exists?)
(ly:event-set-property! (event-cause notehead-grob) 'parenthesize #f) ; no effect (parenthesis grob allready exists?)
; How to find the associated parenthesis grob, to execute 'ly:grob-suicde!' ?
)
)
)
)
)
)
% Funktioniert nicht mit after-line-breaking. Warum?
% #(define (affect-parenthesized-note-heads-size-three grob) ((affect-parenthesized-note-heads 'font-size -3) grob))
smallerParenthesizedNoteHeads = \override Staff.NoteHead #'before-line-breaking =
#twitter
% #(lambda (grob) ((affect-parenthesized-note-heads 'font-size -3) grob))
% #affect-parenthesized-note-heads-size-three
% #(affect-parenthesized-note-heads 'font-size -3)
%--- Test
\layout {
}
\header { tagline = ##f }
#(set-global-staff-size 20)
\paper {
system-system-spacing #'basic-distance = #20
indent = #(* mm 0)
top-margin = #(* mm 20)
}
\layout {
\context {
\Score
%\remove "Bar_number_engraver"
}
}
#(define mydrums '(
(bassdrum default #f -5)
(snare default #f 0)
(hihat cross #f 5)
(pedalhihat cross #f -3)
(openhihat xcircle #f 5)
(lowtom default #f 1)
(hightom default #f 3)
(lowfloortom default #f -1)
(ridecymbal harmonic-black #f 6)
(ridebell harmonic-black #f 5)
(crashcymbal harmonic-black #f 7)
)
)
oben = \drummode {
\numericTimeSignature
\time 4/4
{
\override TextScript #'script-priority = #100
cymc8\upbow rb
rb16 rb16 rb8
rb8 rb16 rb16
rb8 rb16 rb16
}
}
unten = \drummode
{
%\override Beam #'damping = #+inf.0
\override Beam #'positions = #'(-5 . -5)
bd16 hhp sn hhp
sn16 hhp8 < sn hhp >16
bd16 < \parenthesize sn hhp >16 << \parenthesize sn >> hhp
r16 << sn8 hhp >> hhp16
}
\markup \bold "Original"
\new DrumStaff <<
\set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
\new DrumVoice { \voiceOne \oben }
\new DrumVoice { \voiceTwo \unten }
>>
\markup \bold \column {
"Funktioniert nicht mit 'after-line-breaking', allenfalls 'before-line-breakomg'. Warum?"
"Und wie bekommt man dann die Klammern weg,"
"wenn nicht durch ein weiteres after-line-breaking?"
}
\new DrumStaff <<
\set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
\new DrumVoice { \voiceOne \oben }
\new DrumVoice { \voiceTwo \smallerParenthesizedNoteHeads \unten }
>>
--- Ende Code ---
Ich hoffe, diese Informationen helfen weiter.
Navigation
[0] Themen-Index
[#] Nächste Seite
[*] Vorherige Sete
Zur normalen Ansicht wechseln