On Thu, Oct 31, 2013 at 12:24 PM, David Kastrup <d...@gnu.org> wrote:
> First you have to figure out what you want to happen here.  Do you want
> two Dynamics contexts with different orientation and settings?  In that
> case, you'll need to provide a superior context aliased to Staff where
> it can anchor those Dynamics contexts.

I still must be missing something: in the following example, the new
dynamics-"voice" context is created *below* the PianoStaff, and not
inserted inside the DynamicsStaff context as intended.

\layout {
  \context {
    \type "Engraver_group"
    \name "DynamicsStaff"
    \alias "Staff"
    \accepts "Dynamics"
    \defaultchild "Dynamics"
  }
  \context {
    \PianoStaff
    \accepts DynamicsStaff
    %\denies Dynamics % doesn't change anything here.
  }
}

one = \relative c' {
  c1 d << {g a} \\ {e d\mf} >>
}

two = \relative c' {
  d1 e\f f g
}

#(define (dynamic? x)
  (let ((name (ly:music-property x 'name)))
    (or
     (eq? name 'DynamicEvent)
     (eq? name 'AbsoluteDynamicEvent)
     (eq? name 'CrescendoEvent)
     (eq? name 'DecrescendoEvent)
     (eq? name 'SpanDynamicEvent))))

removeDynamics =
#(define-music-function (parser location music) (ly:music?)
  (music-filter
    (lambda (x)
      (not (dynamic? x)))
    music))

\new PianoStaff <<
  \new Staff \removeDynamics \one
  \new DynamicsStaff << \one \two >>
  \new Staff \removeDynamics \two
>>

I'm stumped. Why aren't there any such problems with DrumVoice/DrumStaff?

Cheers,
Valentin.

_______________________________________________
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond

Reply via email to