Re: Scheme function to affect a compound music expression?

2014-10-25 Thread David Nalesnik
Hi again, Peter-- On Sat, Oct 25, 2014 at 11:01 AM, Peter Crighton wrote: > 2014-10-25 17:51 GMT+02:00 David Nalesnik : > >> Hi Peter, >> >> On Sat, Oct 25, 2014 at 10:41 AM, Peter Crighton >> wrote: >> >>> I now wanted to improve the function to also skip MultiMeasureRests and >>> first tried

Re: Scheme function to affect a compound music expression?

2014-10-25 Thread David Nalesnik
On Sat, Oct 25, 2014 at 11:01 AM, Peter Crighton wrote: > > > Thanks, David, that indeed does the trick! > > I'm curious--what example was Robin's suggestion not working for? Removing the check for 'MultiMeasureRestEvent works fine for me with multi-measure rests. --David __

Re: Scheme function to affect a compound music expression?

2014-10-25 Thread Peter Crighton
2014-10-25 17:51 GMT+02:00 David Nalesnik : > Hi Peter, > > On Sat, Oct 25, 2014 at 10:41 AM, Peter Crighton > wrote: > >> I now wanted to improve the function to also skip MultiMeasureRests and >> first tried replacing 'rest-event with 'multi-measure-rest-event to see if >> that would work, whi

Re: Scheme function to affect a compound music expression?

2014-10-25 Thread David Nalesnik
Hi Peter, On Sat, Oct 25, 2014 at 10:41 AM, Peter Crighton wrote: > 2014-10-24 23:01 GMT+02:00 Peter Crighton : > >> 2014-10-24 16:54 GMT+02:00 Robin Bannister : >> >>> So it looks like LilyPond wants to merge the rests, >>> but will do this only if they seem identical. >>> >>> >>> Having read t

Re: Scheme function to affect a compound music expression?

2014-10-25 Thread Peter Crighton
2014-10-24 23:01 GMT+02:00 Peter Crighton : > 2014-10-24 16:54 GMT+02:00 Robin Bannister : > >> So it looks like LilyPond wants to merge the rests, >> but will do this only if they seem identical. >> >> >> Having read through the regression snippet >> and been inspired by the way it removes things

Re: Scheme function to affect a compound music expression?

2014-10-24 Thread Paul Morris
Robin Bannister wrote > A more workable approach is to modify similar snippets. Maybe this is a good example of music-map to add to the LSR? http://lsr.di.unimi.it/LSR/Search Cheers, -Paul -- View this message in context: http://lilypond.1069038.n5.nabble.com/Scheme-function-to-affect-a-comp

Re: Scheme function to affect a compound music expression?

2014-10-24 Thread Peter Crighton
2014-10-24 16:54 GMT+02:00 Robin Bannister : > So it looks like LilyPond wants to merge the rests, > but will do this only if they seem identical. > > > Having read through the regression snippet > and been inspired by the way it removes things, > we can modify bgr to make it remove rests: > > bgr

Re: Scheme function to affect a compound music expression?

2014-10-24 Thread Robin Bannister
Peter Crighton wrote: > I don’t know why the \bgr function causes it. > Any ideas? > ... > Are there other places to learn about Scheme in LilyPond > than the Scheme tutorial? Welcome to Scheme in LilyPond. This example shows that knowing Scheme isn't enough. You have to cooperate with Lilypond

Re: Scheme function to affect a compound music expression?

2014-10-24 Thread Peter Crighton
2014-10-24 13:57 GMT+02:00 Peter Crighton : > 2014-10-24 11:05 GMT+02:00 Robin Bannister : > >> >> The source file music-functions.scm defines >> music-map >> which you can use for this: >> >> >> bgr = #(define-music-function (parser location music) (ly:music?) >>(music-map (lambda (note) >>

Re: Scheme function to affect a compound music expression?

2014-10-24 Thread Peter Crighton
2014-10-24 11:05 GMT+02:00 Robin Bannister : > Peter Crighton wrote: > > But I would like to be able to use the function [...] >> > > so it doesn’t only affect the next note, > > but a sequence of notes enclosed in { … }: > > > The source file music-functions.scm defines > music-map > which you

Re: Scheme function to affect a compound music expression?

2014-10-24 Thread Robin Bannister
Peter Crighton wrote: But I would like to be able to use the function [...] > so it doesn’t only affect the next note, > but a sequence of notes enclosed in { … }: The source file music-functions.scm defines music-map which you can use for this: bgr = #(define-music-function (parser locat

Re: Scheme function to affect a compound music expression?

2014-10-23 Thread Simon Albrecht
Hello all, I tried to write such a function, but failed at the point you’ll see in the attachment. I’d like to learn how this can be made to work ;-) … The problem is in extracting the list from SequentialMusic’s 'element property. And I suspect it has to do with the following question: With