Your attempt can be simplified, see below. However, after having tried it
on a simple example, I'm no longer so convinced that it's a good idea, since
you typically might want the notes before the breath to be beamed together,
whereas the (equivalent of ) \noBeam removes the beam completely.
This means that you still will have to manually specify the start and
end of the beam.

% Alternative definition of \breathe that also does \noBeam
breathenobeam =
#(define-music-function (parser location) ()
           (make-music 'EventChord
             'origin location
             'elements (list (make-music 'BreathingEvent)
                         (make-music 'BeamForbidEvent))))

% Using default \breathe
\relative c'{
c8 d e \breathe f g f e \breathe d }

% Using the new one
\relative c'{
c8 d e \breathenobeam f g f e \breathenobeam d }

% What you probably want typeset => \breathe and \breathenobeam are just as bad
\relative c'{
c8[ d e] \breathenobeam f g[ f e] \breathe d }


   /Mats

Valentin Villenave wrote:
2008/3/5, Mats Bengtsson <[EMAIL PROTECTED]>:
Changing the default behaviour to always include the equivalent of \noBeam
 is very easy, just add a line to the definition of \breathe in
 ly/music-functions-init.ly

I tried to achieve it but it's the first time I write such an advanced function.
Can you please review it?

breathe=
#(define-music-function (parser location) ()
            (make-music 'SequentialMusic
              'origin location
              'elements   (list (make-music 'EventChord
              'elements   (list
                (make-music 'BeamForbidEvent)))
        (make-music  'EventChord
          'elements (list
       (make-music 'BreathingEvent))))))


{
        c'8 \breathe d'
}

 Making it customizable with a context property setting is slightly more
 advanced
 but can still be done in Scheme.

I have to confess I have no idea how to create the property (nor how
to name it :)

Since this will lead to an incompatible change of the default layout, I
 would
 propose to let convert-ly write out a warning about this change, if \breathe
 is used in the file.

Yes... However, I'm happy to see that you regard it as a potentially
good idea ;)

Cheers,
Valentin

--
=============================================
        Mats Bengtsson
        Signal Processing
        School of Electrical Engineering
        Royal Institute of Technology (KTH)
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463                         
       Fax:   (+46) 8 790 7260
        Email: [EMAIL PROTECTED]
        WWW: http://www.s3.kth.se/~mabe
=============================================



_______________________________________________
lilypond-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to