On Fri, Apr 17, 2015 at 10:06 AM, Calixte Faure <calixte.fa...@gmail.com> wrote:
> Hi all, > > Thanks for all this solutions! > Of course using a script with sed would do the work, but like Urs, I > prefer keeping input file unmodified. > Therefore the snippet solution of Klaus is not the best, because we can’t > use variables properly: the "[" and "]" redefinition has to be before any > \include{file.ly} to affect the following code. So we’ll need several > files in every case. > Paul's function works pretty great with my score! Thanks a lot! > > In every case we still have the problem of very long melisma where slurs > must be used with beams, for example when there is a bar line. > > Thanks again! and sorry for the « undefined » title… > > Regards, > Calixte. > > > > > 2015-04-17 16:38 GMT+02:00 Paul Morris <p...@paulwmorris.com>: > >> > On Apr 17, 2015, at 5:05 AM, Calixte Faure <calixte.fa...@gmail.com> >> wrote: >> > >> > and a magic command (say \beamToSlur) would switch [ ] to ( ). >> >> Hi Calixte, Here’s a music function for this. Seems to do the trick, but >> untested on actual music. >> >> HTH, >> -Paul >> >> %%%%%%%%%%%%% >> \version "2.18.2" >> >> beamsToSlurs = >> #(define-music-function (parser location music) >> (ly:music?) >> (music-map >> (lambda (m) >> (if (ly:music-property m 'articulations) >> (let ((arts (ly:music-property m 'articulations))) >> (for-each >> (lambda (a) >> (if (music-is-of-type? a 'beam-event) >> (ly:music-set-property! a 'name 'SlurEvent))) >> arts))) >> m) >> music)) >> >> %%%%%%%%% >> % uncomment both \displayMusic lines to see before and after >> >> % \displayMusic >> \beamsToSlurs >> % \displayMusic >> { >> c8 [ d ] >> } > > > Nice function! I think you also need to set types to reflect the change to a slur. DN
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user