lilypond-devel
[Top][All Lists]
Advanced

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

Customization of which directions \voiceOne changes


From: gnomino
Subject: Customization of which directions \voiceOne changes
Date: Wed, 1 Jul 2009 03:22:49 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

> I'm not top-posting

Hello,

I was typesetting a bit of polyphonic music and wanted \voiceOne to put dynamics
above the staff. Looking at the code I realized that \voiceOne, \voiceTwo, etc.
automatically change the directions of the grobs in the hardcoded list
direction-polyphonic-grobs in the file music-functions.scm.

I made the following two patches, which make direction-polyphonic-grobs public
and also \voiceOne, \voiceTwo, ... into music functions, so that the list of
grobs can be modified by the user. Example:

\new Staff <<
        % both f and mf appear below staff
        \new Voice \relative { \voiceOne c'4\f c c c }
        \new Voice \relative { \voiceTwo g'4\mf g g g }
>>
\new Staff <<
        % f appears above staff
        #(set! direction-polyphonic-grobs (append direction-polyphonic-grobs
'(DynamicLineSpanner)))
        \new Voice \relative { \voiceOne c'4\f c c c }
        \new Voice \relative { \voiceTwo g'4\mf g g g }
>>

I think that this slight modification would be useful for typesetting of
polyphonic music. Any comments would be appreciated.


Patch #1:
--- a/scm/music-functions.scm
+++ b/scm/music-functions.scm
@@ -339,7 +339,7 @@
              'symbol grob
              'grob-property gprop))
 
-(define direction-polyphonic-grobs
+(define-safe-public direction-polyphonic-grobs
   '(DotColumn
     Dots
     Fingering


Patch #2:
--- a/ly/property-init.ly
+++ b/ly/property-init.ly
@@ -165,11 +165,16 @@
 }
 
 % dynamic ly:dir?  text script, articulation script ly:dir? 
-oneVoice = #(context-spec-music (make-voice-props-revert) 'Voice)
-voiceOne = #(context-spec-music (make-voice-props-set 0) 'Voice)
-voiceTwo = #(context-spec-music (make-voice-props-set 1) 'Voice)
-voiceThree = #(context-spec-music (make-voice-props-set 2) 'Voice)
-voiceFour = #(context-spec-music (make-voice-props-set 3) 'Voice)
+oneVoice = #(define-music-function (parser location) ()
+  (context-spec-music (make-voice-props-revert) 'Voice))
+voiceOne = #(define-music-function (parser location) ()
+  (context-spec-music (make-voice-props-set 0) 'Voice))
+voiceTwo = #(define-music-function (parser location) ()
+  (context-spec-music (make-voice-props-set 1) 'Voice))
+voiceThree = #(define-music-function (parser location) ()
+  (context-spec-music (make-voice-props-set 2) 'Voice))
+voiceFour = #(define-music-function (parser location) ()
+  (context-spec-music (make-voice-props-set 3) 'Voice))
 
 voiceOneStyle = {
   \override NoteHead #'style = #'diamond






reply via email to

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