Re: Cowell clusters
Thank you! I should have checked the files more carefully. Pretty easy fix, problem solved. Dimitris On Fri, Mar 19, 2021 at 10:26 PM Robin Bannister wrote: > Dimitris Marinakis wrote: > > > I get some errors: version 2.23.0 > > a lot of Unsupported SCM value for format (various values that look like > > 0.287106 -0.72778135 ) > > These error messages are probably due to the internal changes that were > made to LilyPond stencils between v2.20.4 and v2.20.5. > > > The file cowell-clusters.ly uses ly:make-stencil in two places. > You will find comments inserted there, telling you how to cope. > > > Cheers, > Robin >
Re: Cowell clusters
Dimitris Marinakis wrote: I get some errors: version 2.23.0 a lot of Unsupported SCM value for format (various values that look like 0.287106 -0.72778135 ) These error messages are probably due to the internal changes that were made to LilyPond stencils between v2.20.4 and v2.20.5. The file cowell-clusters.ly uses ly:make-stencil in two places. You will find comments inserted there, telling you how to cope. Cheers, Robin
Re: Cowell clusters
I get some errors: version 2.23.0 a lot of Unsupported SCM value for format (various values that look like 0.287106 -0.72778135 ) Also some warnings warning: `(gs -q -dNODISPLAY -dNOSAFER -dALLOWPSTRANSPARENCY -dNOPAUSE -dBATCH -dAutoRotatePages=/None -dPrinted=false ./tmp--tmp-3759464)' failed (1)
Re: Cowell clusters
Hi Thomas, Thank you so much for the files, this is super useful! Cheers, Gilberto On 24/12/2020 20:38, Thomas Morley wrote: Hi Gilberto, I reworked the code, see https://lilypondforum.de/index.php/topic,820.msg4562.html#msg4562 You'll need an account there to get the files, thus I attach them here as well. Cheers, Harm
Re: Cowell clusters
Am Mo., 21. Dez. 2020 um 20:41 Uhr schrieb Klaus Blum : > > Hi Gilberto, > > Am 21.12.2020 um 17:51 schrieb lilypond-user-requ...@gnu.org: > > > Ideally, I think applying it to a chord (something like \cowellCluster > > 4) would be the ideal solution. It also does not handle whole > > notes, as those do not have stems to be hacked. If I come up with > > something interesting I will make sure to post it here. > > please have a look at the link to the German forum (the thread there > continues in English): > https://lilypondforum.de/index.php/topic,820.msg4546.html?PHPSESSID=6djk9rm3a7m81mmuqu25mjiehb#msg4546 > > I've posted an improved version there, and Harm has an even more > interesting solution. > > Cheers, > Klaus > Hi Gilberto, I reworked the code, see https://lilypondforum.de/index.php/topic,820.msg4562.html#msg4562 You'll need an account there to get the files, thus I attach them here as well. Cheers, Harm \version "2.20.0" \include "cowell-clusters.ly" \include "other-stuff.ly" upI = { \tempo "Allegro feroce" r2 r8 \ff \repeat unfold 10 ^-\< \break \pseudoIndent 8.5 <>^\tweak padding #2 -\markup \override #'(box-padding . 0.8) \box \fontsize #0 \italic "For explanations and playing instructions also see inside back cover" \voiceOne --\! \clef "bass" <>-\tweak X-offset #-3 \mf _\markup \fontsize #-1.2 \whiteout "Mit flacher Hand zu spielen" \cluster { \repeat unfold 8 } \clef "treble" <>-\tweak Y-offset #-4 -\tweak X-offset #-3 \ff \repeat unfold 7 e'' e''4. e''8 c'''2 \oneVoice r8\fermata \override Slur.details.edge-attraction-factor = 200 \once \override Beam.positions = #'(-8 . -6) ais''^>( \change Staff = "down" b'^> d''-\tweak avoid-slur #'inside ^>) \change Staff = "up" cis'''8.^>-\shape #'((0 . 0) (1.5 . 1.5) (-1 . 0) (0 . -3))-( fis''16-\tweak avoid-slur #'inside ^> \eraseShortInstrumentName \change Staff = "down" g'4)^> \clef "bass" \break \change Staff = "up" fis'''2->~ 8 \noBeam -\f \override TupletBracket.bracket-visibility = ##t \tuplet 5/4 { } \tuplet 5/4 { } \time 2/4 [ ] } downI = { \clef "bass" r2 r8 \repeat unfold 10 _- \repeat unfold 7 ^- b,!^> gis,^> ais,^> e,^> fis,^> c,^> bes,,^> a,,^>\noBeam -\tweak X-offset #2 -\tweak padding #5 _"C" <>_\markup \fontsize #-1.2 \whiteout "Mit beiden Vorderarmen gleichzeitig zu" _\markup \fontsize #-1.2 "spielen" \cluster ##t { \autoBeamOff \repeat unfold 7 c,, c,,4. c,,8 \once\override Score.NoteColumn.X-offset = 0.5 a,,2 } \autoBeamOn \clef "treble" s1 \eraseShortInstrumentName \once \override Staff.Clef.before-line-breaking = #(lambda (grob) (if (= (ly:item-break-dir grob) -1) (ly:grob-set-property! grob 'X-extent '(-1.2 . 2 \clef "bass" r2 r8 \repeat unfold 2 q \repeat unfold 7 q [ \repeat unfold 2 q q] } upII = { s1*3 R1*2 <>_\markup \fontsize #-1.2 \whiteout "Die Tasten lautlos niederzudrücken" r2 r4 \set shapeNoteStyles = ##(do do do do do do do) 4~ -\tweak ParenthesesItem.font-size #0 \parenthesize ^\pp q1\fermata s1*2 s2 } downII = { \clef "bass" s1*3 R1*2 \set shapeNoteStyles = ##(do do do do do do do) r2 r4 ~ q1_\fermata s1*2 s2 } pedal = { \howellPedalStyle s2 s8 s4.\sostenutoOn s1 s1\sostenutoOff s1 s8 \once \override Dynamics.PianoPedalBracket.shorten-pair = #'(0 . 1) s2..\sostenutoOn s1 s8\sostenutoOff s2.. \sostenutoOn s2 s8\sostenutoOff s4. s1 s2 } \paper { indent = 19 short-indent = 4 ragged-last-bottom = ##f top-markup-spacing.padding = 1 first-page-number = 20 print-first-page-number = ##t top-margin = 20 bottom-margin = 8 last-bottom-spacing.padding = 8 tagline = \markup \fill-line { "AMP-95611" \null } } \header { title = "8. Tiger" composer = \markup \center-column { "Henry Cowell" "(1928)" } } \score { \new GrandStaff << \new Staff = "up" \with { shortInstrumentName = \markup \hcenter-in #9 \center-column { "Rechte" "Hand" } } \upI \new Staff = "down" \with { shortInstrumentName = \markup \hcenter-in #9 \center-column { "Linke" "Hand" } } \downI \new Staff = "upII" \with { shortInstrumentName = \markup \hcenter-in #9 "Rechte" } \upII \new Staff = "downII" \with { shortInstrumentName = \markup \hcenter-in #9 "Linke" } \downII \new Dynamics \pedal >> \layout { \context { \Voice \override Stem.details.cluster-thick-short = 0.3 } \context { \Staff \RemoveAllEmptyStaves \numericTimeSignature } \context { \GrandStaff \consists #Cluster-span_stem_engraver \omit SystemStartBrace \override
Re: Cowell clusters
Hi Gilberto, Am 21.12.2020 um 17:51 schrieb lilypond-user-requ...@gnu.org: Ideally, I think applying it to a chord (something like \cowellCluster 4) would be the ideal solution. It also does not handle whole notes, as those do not have stems to be hacked. If I come up with something interesting I will make sure to post it here. please have a look at the link to the German forum (the thread there continues in English): https://lilypondforum.de/index.php/topic,820.msg4546.html?PHPSESSID=6djk9rm3a7m81mmuqu25mjiehb#msg4546 I've posted an improved version there, and Harm has an even more interesting solution. Cheers, Klaus
Re: Cowell clusters
Hi Klaus, thanks for your reply! Yes, that function is great, that's the kind of thing I am looking for! This is already so much better than working on it manually. I have tweaked it a bit to my liking, particularly by setting \tweak Stem.thickness #6 for the stem that represents the cluster. I will try to see if I can come up with a way to automatically handle the stem up/down, as it would be so much easier if this function automatically detected those. Ideally, I think applying it to a chord (something like \cowellCluster 4) would be the ideal solution. It also does not handle whole notes, as those do not have stems to be hacked. If I come up with something interesting I will make sure to post it here. Many thanks once again! Gilberto
Re: Cowell clusters
Ooops, sorry for that mess in my last post. This time, I'll copy-past my code straight from Frescobaldi. Hope it works now... Cheers, Klaus % -- \version "2.20.0" toneClusterDown = #(define-music-function (note1 note2) (ly:music? ly:music?) (let* ( (p1 (ly:music-property note1 'pitch)) (p2 (ly:music-property note2 'pitch)) (y1 (+ (* 7 (ly:pitch-octave p2)) (ly:pitch-notename p2))) (y2 (+ (* 7 (ly:pitch-octave p1)) (ly:pitch-notename p1))) (steps (if (> y1 y2) (- y1 y2) (- y2 y1) ) ) (note-a (if (> y1 y2) note1 note2 )) (note-b (if (> y1 y2) note2 note1 )) ) #{ { \once \voiceTwo << #note-a \new Voice { \voiceTwo \tweak NoteHead.stem-attachment #'(0 . 0.7) \tweak Stem.length #(- steps 1.4) \tweak Stem.thickness #2 \tweak Flag.stencil ##f #note-b } >> } #}) ) toneClusterUp = #(define-music-function (note1 note2) (ly:music? ly:music?) (let* ( (p1 (ly:music-property note1 'pitch)) (p2 (ly:music-property note2 'pitch)) (y1 (+ (* 7 (ly:pitch-octave p2)) (ly:pitch-notename p2))) (y2 (+ (* 7 (ly:pitch-octave p1)) (ly:pitch-notename p1))) (steps (if (> y1 y2) (- y1 y2) (- y2 y1) ) ) (note-a (if (> y1 y2) note1 note2 )) (note-b (if (> y1 y2) note2 note1 )) ) #{ { \once \voiceOne << #note-b \new Voice { \voiceOne \tweak NoteHead.stem-attachment #'(0 . 0.7) \tweak Stem.length #(- steps 1.4) \tweak Stem.thickness #2 \tweak Flag.stencil ##f #note-a } >> } #}) ) %% Test: { \toneClusterDown f'1 f'' \toneClusterDown f'2 f'' \toneClusterDown g'' g' \toneClusterDown a' a'' \toneClusterDown b'' b' \toneClusterDown c''4. a'' \toneClusterDown d''8 g'' \toneClusterDown g'8 c'' \toneClusterDown g'8 c'' \toneClusterDown a cis''' \toneClusterDown a cis''' \bar "||" \toneClusterUp f'1 f'' \toneClusterUp f'2 f'' \toneClusterUp g'' g' \toneClusterUp a' a'' \toneClusterUp b'' b' \toneClusterUp c''4. a'' \toneClusterUp d''8 g'' \toneClusterUp g'8 c'' \toneClusterUp g'8 c'' \toneClusterUp a cis''' \toneClusterUp a cis''' } % --
Re: Cowell clusters
Hi Gilberto, Am 18.12.2020 um 20:00 schrieb lilypond-user-requ...@gnu.org: I am notating a score which uses a lot of clustered chords, to be notated in the style of Henry Cowell. just today I saw a similar question on the German list: https://lilypondforum.de/index.php/topic,820.0.html Here is what I have so far: % |\version "2.20.0" toneClusterDown = #(define-music-function (note1 note2) (ly:music? ly:music?) (let* ( (p1 (ly:music-property note1 'pitch)) (p2 (ly:music-property note2 'pitch)) (y1 (+ (* 7 (ly:pitch-octave p2)) (ly:pitch-notename p2))) (y2 (+ (* 7 (ly:pitch-octave p1)) (ly:pitch-notename p1))) (steps (if (> y1 y2) (- y1 y2) (- y2 y1) ) ) (note-a (if (> y1 y2) note1 note2 )) (note-b (if (> y1 y2) note2 note1 )) ) #{ { \once \voiceTwo << #note-a \new Voice { \voiceTwo \tweak NoteHead.stem-attachment #'(0 . 0.7) \tweak Stem.length #(- steps 1.4) \tweak Stem.thickness #2 \tweak Flag.stencil ##f #note-b } >> } #}) ) toneClusterUp = #(define-music-function (note1 note2) (ly:music? ly:music?) (let* ( (p1 (ly:music-property note1 'pitch)) (p2 (ly:music-property note2 'pitch)) (y1 (+ (* 7 (ly:pitch-octave p2)) (ly:pitch-notename p2))) (y2 (+ (* 7 (ly:pitch-octave p1)) (ly:pitch-notename p1))) (steps (if (> y1 y2) (- y1 y2) (- y2 y1) ) ) (note-a (if (> y1 y2) note1 note2 )) (note-b (if (> y1 y2) note2 note1 )) ) #{ { \once \voiceOne << #note-b \new Voice { \voiceOne \tweak NoteHead.stem-attachment #'(0 . 0.7) \tweak Stem.length #(- steps 1.4) \tweak Stem.thickness #2 \tweak Flag.stencil ##f #note-a } >> } #}) ) %% Test: { \toneClusterDown f'1 f'' \toneClusterDown f'2 f'' \toneClusterDown g'' g' \toneClusterDown a' a'' \toneClusterDown b'' b' \toneClusterDown c''4. a'' \toneClusterDown d''8 g'' \toneClusterDown g'8 c'' \toneClusterDown g'8 c'' \toneClusterDown a cis''' \toneClusterDown a cis''' \bar "||" \toneClusterUp f'1 f'' \toneClusterUp f'2 f'' \toneClusterUp g'' g' \toneClusterUp a' a'' \toneClusterUp b'' b' \toneClusterUp c''4. a'' \toneClusterUp d''8 g'' \toneClusterUp g'8 c'' \toneClusterUp g'8 c'' \toneClusterUp a cis''' \toneClusterUp a cis''' } | |% Cheers, Klaus |
Cowell clusters
Hi everyone, I am notating a score which uses a lot of clustered chords, to be notated in the style of Henry Cowell. I found a post from 2008 from the Lilypond user list but the solution is very cumbersome, unfortunately. The code below is adapted from that post: ( https://lists.gnu.org/archive/html/lilypond-user/2008-10/msg00555.html ) \version "2.20.0" qLinkCowell = #(ly:make-stencil (list 'embedded-ps "gsave currentpoint translate newpath 0.3 0.51 moveto 1.0125 0.51 lineto 1.0125 -0.51 lineto 0.3 -0.51 lineto closepath fill grestore") (cons 0 1.3125) (cons 0 0)) % Example 1 { \time 2/4 \override NoteHead #'X-offset = #0 \override NoteHead #'stem-attachment = #'(1 . 4.75) < f' \tweak #'stencil \qLinkCowell g' \tweak #'stencil \qLinkCowell a' \tweak #'stencil \qLinkCowell b' \tweak #'stencil \qLinkCowell c'' d'' >4 < g' \tweak #'stencil \qLinkCowell a' \tweak #'stencil \qLinkCowell b' \tweak #'stencil \qLinkCowell c'' \tweak #'stencil \qLinkCowell d'' e'' >4 } % Example 2 { \time 4/4 \override NoteHead #'X-offset = #0 \override NoteHead #'stem-attachment = #'(1 . 4.75) < f' \tweak #'stencil \qLinkCowell g' \tweak #'stencil \qLinkCowell a' \tweak #'stencil \qLinkCowell b' \tweak #'stencil \qLinkCowell c'' d'' >2 < g' \tweak #'stencil \qLinkCowell a' \tweak #'stencil \qLinkCowell b' \tweak #'stencil \qLinkCowell c'' \tweak #'stencil \qLinkCowell d'' e'' >2 } % Example 3 { \time 2/4 \override NoteHead #'X-offset = #0 \override NoteHead #'stem-attachment = #'(1 . 4.75) < d' \tweak #'stencil \qLinkCowell e' \tweak #'stencil \qLinkCowell f' g' >4 < b' \tweak #'stencil \qLinkCowell c'' \tweak #'stencil \qLinkCowell d'' \tweak #'stencil \qLinkCowell e'' \tweak #'stencil \qLinkCowell f'' \tweak #'stencil \qLinkCowell g'' \tweak #'stencil \qLinkCowell a'' b'' >4 } Producing: https://i.postimg.cc/xdmMRpkh/clusters.png As can be seen from the image above, the topmost example (which is the original one from that post) is notated perfectly fine, but this approach fails when using notes with white note heads (example 2). The stem-attachment value is also hard-coded, and needs to be tweaked manually for every single cluster (see example 3), which is an absolute pain. Ideally, the best approach would be a function that would take a chord of two notes (i.e. the bottom and topmost notes of the cluster only), attach the stem to the correct notehead only (i.e. top notehead when stem up or bottom notehead when stem down) and find an elegant way of adding a vertical connector between the noteheads. So that usage would be something as simple as \cowellCluster 4 \cowellCluster 2 Unfortunately I am not very good at writing LilyPond functions myself, so I was wondering if anyone here could give me a hand with this one, or perhaps give me some advice on how to tackle this. Many thanks! Gilberto