lilypond-user
[Top][All Lists]
Advanced

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

Re: context-sensitive context creation


From: Mats Bengtsson
Subject: Re: context-sensitive context creation
Date: Mon, 09 Jul 2007 22:25:05 +0200
User-agent: Internet Messaging Program (IMP) H3 (4.0.5)

A low-tech solution is to let all voices start at the top
of the score and use s1*15 or \skip 1*15 constructs to skip the sections where the voice shouldn't be active.

  /Mats

Quoting Jordan DeLong <address@hidden>:

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?

[ I'd appreciate being CC'd on any replies, since I am not a list
member. ]

Thanks,
--
Jordan DeLong
address@hidden








reply via email to

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