[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: rall. autocalculation function in Scheme
From: |
Valentin Petzel |
Subject: |
Re: rall. autocalculation function in Scheme |
Date: |
Mon, 06 Feb 2023 08:01:37 +0100 |
Hello Adam,
your problem is that you are feeding the whole list of tempi into each \tempo
command. Instead you should do something like
myRall =
#(define-music-function
(steps duration)
(integer? ly:duration?)
(let* ((tempi-list (iota steps 100 -1))
(tempi-mus (map (lambda (t) #{ \tempo 4 = $t s$duration #}) tempi-
list)))
#{ #@tempi-mus #}))
Instead of creating tempo events you might want to use \applyContext to
relatively change tempoWholesPerMinute though.
Cheers,
Valentin
Am Montag, 6. Februar 2023, 06:19:57 CET schrieb Adam M. Griggs:
> Hello list,
>
> I'm trying to create a Scheme function that will automatically calculate
> and enact a *rall*. as a sequence of \tempo assignments. I am aware of the
> basic *rall*., *rit*., and *accel*. functions in "articulate.ly" but I
> wanted something I have a little more control over.
>
> I need help, and I don't know if it's just in the implementation details or
> my overall approach to the problem.
>
> For now, it's just a *rall*. The algorithm describing the rate of slowdown
> is extremely basic but that can be adjusted later.
>
> My approach so far has been to create a list of values starting at 100
> (let's assume percentages of the initial tempo and work that in later) and
> then have them trickle down. Using #(display ...), I see this is working
> just fine.
>
> Clearly my \repeat call isn't appropriate here and I should replace it with
> a recursive function call containing just its body (the {\tempo 4 = ...
> \skip ...} part). And I'm sure I'm not really going to get anywhere with
> #@tempi-list but I hope it communicates what I'm aiming for. I've been
> playing with this for a few hours but I haven't been able to get the parts
> to mesh together. I could keep stabbing at it, or ask for help here.
>
> Code attached, and thank you!
signature.asc
Description: This is a digitally signed message part.