lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: improving Janek's \dynamic function (for combo dynamics)


From: Thomas Morley
Subject: Re: improving Janek's \dynamic function (for combo dynamics)
Date: Sun, 27 Aug 2017 10:40:46 +0200

2017-08-26 21:35 GMT+02:00 David Kastrup <address@hidden>:
> Thomas Morley <address@hidden> writes:
>
>> 2017-08-26 20:24 GMT+02:00 David Kastrup <address@hidden>:
>>>
>>> Uh, this was a proposal for a user interface that does not need to look
>>> at punctuation etc but rather goes by [...] for figuring out where the
>>> "true" dynamics are, likely defaulting to taking the first pair for
>>> alignment as well as Midi dynamics.
>>
>> Ok, lol
>>
>> Valentins original code used underscores, iirc.
>
> Hm, [...] might actually be used for editorial annotations.  So maybe
> not the best markup for this application.  {...} maybe?
>
> --
> David Kastrup

Do you mean something at the lines below?
(Only the markup-part for now)

#(define char-set:dynamics
  (char-set #\f #\m #\p #\r #\s #\z))

#(define (split-string strg char-pair)
;; split a string at all occurrences of both characters in char-pair
;; remark: with guilev2 string-split accepts a char-set as second argument
  (append-map
    (lambda (s) (string-split s #\}))
    (string-split strg #\{)))


#(define-markup-command (dyn-test layout props strg)(string?)
#:properties ((chars (cons #\{ #\})))
  (interpret-markup layout props
    (make-concat-markup
      (map
        (lambda (word)
          (if (string-every char-set:dynamics word)
              (make-dynamic-markup word)
              word))
      (split-string strg chars)))))

\markup \dyn-test #"poco {f}, but {p} sub. ma non troppo"

Cheers,
  Harm



reply via email to

[Prev in Thread] Current Thread [Next in Thread]