Re: how to repeat a scheme function that creates a Score

2022-04-06 Thread Jean Abou Samra
Le 07/04/2022 à 07:55, Jeff Olson a écrit : On 4/6/2022 12:35 AM, Jean Abou Samra wrote: The attached MWE file has lots of my failed attempts commented out (I'm at a teachable moment if someone has a moment to teach).  Or just point me to the right manual page(s). Here is a piece of code

Re: how to repeat a scheme function that creates a Score

2022-04-06 Thread Jeff Olson
On 4/6/2022 12:35 AM, Jean Abou Samra wrote: The attached MWE file has lots of my failed attempts commented out (I'm at a teachable moment if someone has a moment to teach).  Or just point me to the right manual page(s). Here is a piece of code that works: $@(map (lambda (i) (scr)) (iota 10

Re: how to repeat a scheme function that creates a Score

2022-04-06 Thread Jeff Olson
On 4/5/2022 11:58 PM, Aaron Hill wrote: On 2022-04-05 10:40 pm, Jeff Olson wrote: Question (b): My secondary question is very simple.  How do you set the seed for scheme's "random" function (used in my gen-music.ily).  I'd like to get the repeatability of a pseudo-random number generator. ;;;

Re: how to repeat a scheme function that creates a Score

2022-04-05 Thread Jean Abou Samra
Le 06/04/2022 à 07:40, Jeff Olson a écrit : Two questions below re: (a) looping and (b) random seed. In order to investigate some other problems I'm having in a large project (pagination, memory usage) I learned enough scheme (barely) to define a function that generates a new score with each

Re: how to repeat a scheme function that creates a Score

2022-04-05 Thread Aaron Hill
On 2022-04-05 10:40 pm, Jeff Olson wrote: Question (a): My main question is how to write a scheme function that will invoke my scr function N times, where N could be a number like 1000. #(for-each add-score (map (lambda (x) #{ \scr #}) (iota 5))) Replace 5 with whatever. -- Aaron

Re: how to repeat a scheme function that creates a Score

2022-04-05 Thread Valentin Petzel
Hello Jeff, A scheme-function will only be able to output a single top-level-score like this. You should rather do a void-function that calls (add-score #{ \score {...} #}) directly. Similarly you can use (add-text ...) to add top-level markups. Cheers, Valentin Am Mittwoch, 6. April 2022, 07

Re: how to repeat a scheme function that creates a Score

2022-04-05 Thread Aaron Hill
On 2022-04-05 10:40 pm, Jeff Olson wrote: Question (b): My secondary question is very simple.  How do you set the seed for scheme's "random" function (used in my gen-music.ily).  I'd like to get the repeatability of a pseudo-random number generator. (set! *random-state* (seed->random-stat

how to repeat a scheme function that creates a Score

2022-04-05 Thread Jeff Olson
Two questions below re: (a) looping and (b) random seed. In order to investigate some other problems I'm having in a large project (pagination, memory usage) I learned enough scheme (barely) to define a function that generates a new score with each invocation: -- \version "2.22.0" \include