lilypond-user
[Top][All Lists]
Advanced

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

context-sensitive context creation


From: Jordan DeLong
Subject: context-sensitive context creation
Date: Sun, 8 Jul 2007 23:08:36 -0500
User-agent: Mutt/1.5.13 (2006-08-11)

[ I sent this once, and then read that the list requires people to be
subscribed to post by email.  Hopefully it doesn't come through
twice... ]

Hey all; I'm trying to figure out how I can structure an input file
that should be displayed in both a normal Staff and a TabStaff without
writing the actual music twice.  I've found examples and stuff in the
list archives that work fine as long as the number of voices stays
basically constant, but for this, some parts of it should be
polyphonic and some parts not.

What I'd like to do, is declare a scheme function or something that
allows me to make new contexts that are either Voice or TabVoice
depending whether it can find a TabStaff context.

The ly:context-find function looked potentially promising.  But I
couldn't figure out how to use it from the documentation.  (Or for
that matter whether it can do this.)

In case the above isn't making sense, I want to do something along the
lines of:

\version "2.8.7"
makeCorrectVoice = #(define-music-function ... something-or-another)

piece = {
  \time 4/4
  \relative { c4 g c g }
  % now it becomes polyphonic
  <<
    \makeCorrectVoice { \relative { c4 g c g } }
    \makeCorrectVoice { \relative c' { c8 c g. g16 g4 g } }
  >>
  % now back to a single voice
  \relative c { c4 c c c }
}

% put it together
\new StaffGroup {
  \new Staff {
    \clef "G_8"
    \tempo 4=500
    \piece
  }
  \new TabStaff { \piece }
}

Any ideas?

Thanks,
-- 
Jordan DeLong
address@hidden

Attachment: signature.asc
Description: Digital signature


reply via email to

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