lilypond-user
[Top][All Lists]
Advanced

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

Re: transposing and changePitch


From: Stefan Thomas
Subject: Re: transposing and changePitch
Date: Mon, 1 Feb 2010 08:49:37 +0100

Dear Gilles,
Wow, thats great!
I'm always wondering what scheme and lilypond can do.
I think, I should learn it.

2010/2/1 Gilles THIBAULT <address@hidden>
 
I wanted to get the output:
{ c'8 c'' d' d'' e' e'' } %etc.
by typing:
{ \changePitch \test { c' d' e' } }
Ok, i understand now.
Well, i think the \brokenOctaves has to be a little more complex.
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\version "2.12"
\include "changePitch.ly"
 

brokenOctaves = #(define-music-function (parser location music) (ly:music?)
(let loop ((x music))
  (let ((e (ly:music-property x 'element))
        (es (ly:music-property x 'elements)))
    (cond
      ((eq? 'EventChord (ly:music-property x 'name))
        (if (and (pair? es)
                   (eq? 'NoteEvent (ly:music-property (car es) 'name)))
           (set! x (make-sequential-music (list
                      x
                      #{\transpose c c' $x #})))))
      (else
         (if (ly:music? e) (ly:music-set-property! x 'element (loop e)))
         (if (pair? es)(ly:music-set-property! x 'elements (map loop es))))))
  x))
 

test = { c8. c16}
\new Staff {  \changePitch \test  \brokenOctaves  { c' d' e' } }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 
Gilles



reply via email to

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