> It was not intentional, that was the actual problem.  When I compiled it
> without the dynamics it came out in the same order as the input, but that was
> only a lucky coincidence then, right? 


Yes.


> Do you have any suggestions for how to get them ordered?

When you need to process grobs ordered by time, use an engraver:



\version "2.24.2"

typing-text = "Goddag Fru Direktör
Det meddelande du sände den andra har landat."
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
}


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

#(define (Letters_engraver context)
   (let ((index 0))
     (make-engraver
      (acknowledgers
       ((note-head-interface engraver grob source-engraver)
        (let ((char (string-ref transformed-text index)))
          (set! index (modulo (1+ index) (string-length transformed-text)))
          (ly:grob-set-property! grob 'text (string char))))))))

\new RhythmicStaff \with {
  \override StaffSymbol.line-count = #0
  \override NoteHead.stem-attachment = #'(0 . 2)
  \consists #Letters_engraver
  \override NoteHead.stencil = #ly:text-interface::print
}
\rhythm

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to