Dear List!

I am trying to put custom notation for a piece for typewriter and electronics 
together and have devised a function for merging text and rhythm. It works fine 
as long as nothing else is involved, but interferes in some way with scripts 
and dynamics. Could any of you figure how and why? (The text becomes offset 
when dynamics or scripts are added)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\version "2.25.1"

typing-text = "Goddag Fru Direktör
Det meddelande du sände den andra har landat."
%When I uncomment these dynamics the text jumps around
rhythm = { 4%\f 
           8 8 16 16 8 16 8%\p 
           16 16 8 16 r16 16 r8 8 r8 4 16 16 16 16 4}

typing-list = #(string->list 
                (string-map
                 (lambda (char)
                   (case char
                       ((#\space) #\x2423)
                       ((#\nl) #\x21B5)
                       (else char)))
                 typing-text))

typing-index = 0

\new RhythmicStaff \with {
  \override StaffSymbol.line-count = #0
  \override NoteHead.stem-attachment = #'(0 . 2)
  \override NoteHead.stencil = #(lambda (grob)
                                  (let
                                   ((character (list-ref typing-list 
typing-index)))
                                    (set! typing-index (modulo (+ typing-index 
1) (length typing-list)))
                                    (grob-interpret-markup grob
                                                           #{ \markup 
\typewriter \fontsize #-2 #(string character) #}
                                                           )
                                    ))
  }
\rhythm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Thanks a lot!
/Leo


Reply via email to