Re: Help with scheme

2024-08-22 Thread Silvain Dupertuis
A good explanation of the difference between define and set! in Scheme here: https://docs.scheme.org/schintro/schintro_16.html Silvain Le 22.08.24 à 11:10, Valentin Petzel a écrit : Hi Michael, the problematic line in question is (#t (define *use-gamba-clefs* #t)) If you use set! instead of d

Re: Help with scheme

2024-08-22 Thread Valentin Petzel
Hi Michael, the problematic line in question is (#t (define *use-gamba-clefs* #t)) If you use set! instead of define it will work. The problem here lies probably in the switch from guile 1.8 to guile 2. I suppose in that the context of case changed somehow to not allow definitions. Keep in mi

Re: Help with scheme

2024-08-21 Thread Michael Gerdau
Dear William, thanks a lot for your help. With your changes I got the scores to compile. With the problem of getting the score compiled solved I investigated how possibly those options could be set or used. There is no documentation included as to how the option clefs is supposed to work. Ther

Re: Help with scheme

2024-08-21 Thread William Rehwinkel via LilyPond user discussion
Dear Michael, When I change #(define *clefs-option* (ly:get-option 'clefs)) to #(define *clefs-option* 'gamba) and (#t (define *use-gamba-clefs* #t)) to (#t (set! *use-gamba-clefs* #t)) ; note "set!" lilypond 2.25.18 compiles the code without any errors. But I don't know if this will ma

Help with scheme

2024-08-21 Thread Michael Gerdau
Dear lilyponders, I've donwloaded some older lilypond sources (version 2.18.2) from cpdl.org and am trying to make them work with 2.25.18. Most things are straight forward however there is some scheme code that allows to switch between different clefs. Could someone with better scheme fu th

Re: newbie: help with Scheme functions

2020-10-18 Thread Dave Seidel
Thanks, Aaron. On Sun, Oct 18, 2020 at 4:46 PM Aaron Hill wrote: > On 2020-10-18 1:38 pm, Dave Seidel wrote: > > Very cool, thanks! I'm curious -- could aBook and aBookPart have been > > written as a lambda, or is it cleaner to use a void function? > > (Re-adding the mailing list on the thread f

Re: newbie: help with Scheme functions

2020-10-18 Thread Aaron Hill
On 2020-10-18 1:38 pm, Dave Seidel wrote: Very cool, thanks! I'm curious -- could aBook and aBookPart have been written as a lambda, or is it cleaner to use a void function? (Re-adding the mailing list on the thread for visibility.) To get the benefits of LilyPond's Scheme functions, you would

Re: newbie: help with Scheme functions

2020-10-18 Thread Aaron Hill
On 2020-10-18 7:52 am, Dave Seidel wrote: Having articulated the question, I figured out that apparently one can't return a \bookpart from a Scheme function, but it's ok to return a \score, so I am restructuring my code. You cannot return a \book or \bookpart but you can do this: \versi

Re: newbie: help with Scheme functions

2020-10-18 Thread Dave Seidel
Having articulated the question, I figured out that apparently one can't return a \bookpart from a Scheme function, but it's ok to return a \score, so I am restructuring my code. On Sun, Oct 18, 2020 at 10:28 AM Dave Seidel wrote: > Hi, > > I have a multi-section piece, with a master .ly file th

newbie: help with Scheme functions

2020-10-18 Thread Dave Seidel
Hi, I have a multi-section piece, with a master .ly file that uses \include for each of the sections of the piece. Each included file more or less follows the pattern of the string quartet template that ships with Lilypond: a series of macros, one per voice, followed by a \bookpart section that bu

Re: Need help with Scheme code

2019-12-19 Thread Paolo Prete
t) >> >> Thanks, >> P >> >> On Wed, Dec 18, 2019 at 6:57 PM wrote: >> >>> Without giving you any solution, I can give you a hint: >>> >>> >>> >>> Write the music in the traditional way, with and without your >>> modi

Re: Need help with Scheme code

2019-12-19 Thread Stefano Troncaro
with and without your >> modification. >> >> >> >> In your lilypond file put: >> >> \displayMusic oldmusic >> >> \displayMusic newmusic >> >> >> >> And what you can see wht you have to write by observing the differences >> >>

Re: Need help with Scheme code

2019-12-18 Thread Paolo Prete
m:* lilypond-user > *On Behalf Of *Paolo Prete > *Sent:* Wednesday, December 18, 2019 3:30 PM > *To:* Aaron Hill > *Cc:* lilypond-user > *Subject:* Re: Need help with Scheme code > > > > Thanks again. > > Now, from what I see, I can extract if #mus is a Beam >

RE: Need help with Scheme code

2019-12-18 Thread lilypond
Jaap From: lilypond-user On Behalf Of Paolo Prete Sent: Wednesday, December 18, 2019 3:30 PM To: Aaron Hill Cc: lilypond-user Subject: Re: Need help with Scheme code Thanks again. Now, from what I see, I can extract if #mus is a Beam with (ly:music-property mus 'name) --> B

Re: Need help with Scheme code

2019-12-18 Thread Paolo Prete
Thanks again. Now, from what I see, I can extract if #mus is a Beam with (ly:music-property mus 'name) --> BeamEvent After that, how can I set, inside the same function you wrote, a variable with the beam-thickness value of the corresponding Beam? something like (pseudo code): (set! myVar curre

Re: Need help with Scheme code

2019-12-17 Thread Aaron Hill
On 2019-12-17 6:01 pm, Paolo Prete wrote: And thanks again to the Scheme-master Aaron. I appreciate the kind words, though I doubt my experience rises to the level of "master". One last thing: how can I arrange that function so to obtain output-attributes = output-attributes + id ? For ex

Re: Need help with Scheme code

2019-12-17 Thread Paolo Prete
And thanks again to the Scheme-master Aaron. One last thing: how can I arrange that function so to obtain output-attributes = output-attributes + id ? For example: if output-attributes is (('a' . 'aa') ('i' . 'ii')) it must become:(('a' . 'aa') ('i' . 'ii') ('id' . 'foobar_1')) On Wed,

Re: Need help with Scheme code

2019-12-17 Thread Aaron Hill
On 2019-12-17 4:21 pm, Paolo Prete wrote: Hi Stefano, unfortunately, it doesn't increment the counter globally, and the two ids in the SVG file are identical You will need to define a music function so that the (serial) procedure is called on each occurrence. Here's an option that rolls in

Re: Need help with Scheme code

2019-12-17 Thread Paolo Prete
Hi Kieren, yes, of course! please let me know how to use it On Wed, Dec 18, 2019 at 1:32 AM Kieren MacMillan < kieren_macmil...@sympatico.ca> wrote: > Hi Paolo, > > > The ids must be: foobar_1, foobar_2 etc. > > Can they be foobar.1, foobar.2, etc. instead? > Lilypond has a nice built-in mechan

Re: Need help with Scheme code

2019-12-17 Thread Kieren MacMillan
Hi Paolo, > The ids must be: foobar_1, foobar_2 etc. Can they be foobar.1, foobar.2, etc. instead? Lilypond has a nice built-in mechanism for that naming/pointer convention. Hope that helps! Kieren. Kieren MacMillan, composer (he/him/his) ‣ website: www.kierenm

Re: Need help with Scheme code

2019-12-17 Thread Paolo Prete
Hi Stefano, unfortunately, it doesn't increment the counter globally, and the two ids in the SVG file are identical On Wed, Dec 18, 2019 at 12:12 AM Stefano Troncaro wrote: > Hi Paolo, > > After some googling and tweaking I managed to make the counter you wished: > > \version "2.19.83" > > #(de

Re: Need help with Scheme code

2019-12-17 Thread Stefano Troncaro
Hi Paolo, After some googling and tweaking I managed to make the counter you wished: \version "2.19.83" #(define* (make-counter #:optional (cnt 0) (inc 1)) (lambda () (set! cnt (+ cnt inc)) cnt)) #(define serial (make-counter)) token = -\tweak output-attributes #`((id . ,(string-a

Re: Need help with Scheme code

2019-12-17 Thread Paolo Prete
In addition, Stefano, If you have time, please try the snippet for tuning the beams (second attachment). Any test of these things are very helpful for me. On Tue, Dec 17, 2019 at 11:18 PM Stefano Troncaro wrote: > Hi Paolo, > > Look at this: > > \version "2.19.83" > > token = -\tweak output-attr

Re: Need help with Scheme code

2019-12-17 Thread Paolo Prete
Thanks Stefano! On Tue, Dec 17, 2019 at 11:18 PM Stefano Troncaro wrote: > Hi Paolo, > > Look at this: > > \version "2.19.83" > > token = -\tweak output-attributes #'((id . "foobar")) \etc > > \relative { c'4 d8 -\token [ e ] f2 } > > That achieves half of what you want. Now, how to make "foobar

Re: Need help with Scheme code

2019-12-17 Thread Stefano Troncaro
Hi Paolo, Look at this: \version "2.19.83" token = -\tweak output-attributes #'((id . "foobar")) \etc \relative { c'4 d8 -\token [ e ] f2 } That achieves half of what you want. Now, how to make "foobar" automatically increment I don't know, perhaps someone else can help with that. Hope that h

Need help with Scheme code

2019-12-17 Thread Paolo Prete
Hello all, In order to automate the reverse process of the lilypond+javascript snippets (write the GUI modifications of the grobs to the .ly file) I need to make the following code work: % token = \tweak output-attributes #'((id . "foobar")) \score { { a8 \token

Re: help with scheme function [solved]

2011-03-26 Thread Damian leGassick
although #(define (bar m) etc gave me some weird problems with \bar "" etc >> #(define (baz m) sorted it On 26 Mar 2011, at 14:30, Damian leGassick wrote: > Thanks Mike that works perfectly > > Damian > > > On 26 Mar 2011, at 13:26, m...@apollinemike.com wrote: > >> On Mar 26, 2011, at

Re: help with scheme function [solved]

2011-03-26 Thread Damian leGassick
Thanks Mike that works perfectly Damian On 26 Mar 2011, at 13:26, m...@apollinemike.com wrote: > On Mar 26, 2011, at 8:58 AM, Damian leGassick wrote: > >> hi all >> >> as you can see below I've got some very repetitive note entry >> >> my attempt at a scheme substitution is not working >> >

Re: help with scheme function

2011-03-26 Thread m...@apollinemike.com
On Mar 26, 2011, at 8:58 AM, Damian leGassick wrote: > hi all > > as you can see below I've got some very repetitive note entry > > my attempt at a scheme substitution is not working > > can anyone help me out here? > > cheers > > Damian > > > \version "2.13.54" > > xenAccGliss = #(define-

help with scheme function

2011-03-26 Thread Damian leGassick
hi all as you can see below I've got some very repetitive note entry my attempt at a scheme substitution is not working can anyone help me out here? cheers Damian \version "2.13.54" xenAccGliss = #(define-music-function (parser location nOne nTwo) (ly:music? ly:music?) #{

help with scheme and midi output

2008-07-07 Thread Bainos
[\code] I searched google, the forum and the manual, but I didn't find any hint... the question is: can I add midi output to this function? if yes.. how? Thanks in andvance for any help! regards bainos -- View this message in context: http://www.nabble.com/help-wi