lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: no braces or brackets (quitar paréntesis)


From: Gilles
Subject: Re: no braces or brackets (quitar paréntesis)
Date: Mon, 31 Oct 2011 17:16:37 +0100
User-agent: Opera Mail/11.52 (Win32)


I get { { f' f' f' f' } { bflat' bflat' bflat' bflat' } { f' f' f' f' } } and I would like to get { f' f' f' f' bflat' bflat' bflat' bflat' f'
f' f' f'  }

1-
You can try the following function :

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    
#(define (clean-music mus)
"Try to reduce the number of sequential musics"
(let ((name (ly:music-property mus 'name)))
  (cond
    ((eq? name 'SequentialMusic)
       (ly:music-set-property! mus 'elements (fold-right
          (lambda (evt prev-list)
            (if (eq? (ly:music-property evt 'name) 'SequentialMusic)
(append (ly:music-property (clean-music evt) 'elements) prev-list)
              (cons (clean-music evt) prev-list)))
          '()
          (ly:music-property mus 'elements))))
    ((eq? name 'SimultaneousMusic)
       (ly:music-set-property! mus 'elements
                (map clean-music (ly:music-property mus 'elements))))
    ((memq name (list 'RelativeOctaveMusic 'UnrelativableMusic))
         (ly:music-set-property! mus 'element (clean-music
                  (ly:music-property mus 'element)))))
 mus))  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

you just have to modify your \chuchu function like that :

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
chuchu = #(define-music-function (parser location music)(ly:music?)
(clean-music
   (music-map
        (lambda (x)
          (if (eq? 'EventChord (ly:music-property x 'name))
           (toma x)
            x))
        music)))
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


2-
However, i don't know exactly what your are trying to achieve, but perhaps you will be interested by this thread :

http://lists.gnu.org/archive/html/lilypond-user/2011-08/msg00002.html

I have joined the latest version of chordsToSeq.ly

Gilles






Attachment: chordsToSeq.ly
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]