Another (more thought through) example... this time with voltas.
There would of course be some work in the export code deciding when to
export repeats and when not to... The will be the problem for
export-code. The sequencer would work with simple concepts like
shadow-segments and a few tags on segments.
Peter
\version "2.6.3"
\header {
title = "Template"
subtitle = "subtitle"
composer = "Traditional"
arranger = "Arranger"
enteredby = "I typed this"
maintainerEmail = "[EMAIL PROTECTED]"
meter = "moderato"
}
\paper {
linewidth = 16.0 \cm
#(set-paper-size "a4")
raggedlastbottom = ##t
raggedbottom = ##t
betweensystempadding = 1.0\cm
betweensystemspace = 0.30\in
leftmargin = 2\cm
scoreTitleMarkup = \markup {
\fill-line {
\fromproperty #'header:instrument
}
}
}
#(set-global-staff-size 14)
\layout {
\context { \RemoveEmptyStaffContext }
}
%%%%%%%%%%%%%%%% General %%%%%%%%%%%%%%%%%%%%%
globaltime = {
\time 2/2
}
%%%%%%%%%%%%%% Rehearsal marks %%%%%%%%%%%%%%%
globalinfo = {
s1*2 \mark \default
\repeat "volta" 2 {s1*2 }
\alternative { {s1*2} {s1*2} } \mark \default
s1*2
}
%%%%% Note elements / Rosegarden segments %%%%%%%%%
melodysegment = \relative c' {
% one segment , no repeats
c'4 c c c
e e e e
g,4 a b c
g4 a b c
g4 a b c
g4 a b c
e4 d c b
e4 d c b
e4 d c b
e4 d c b
e2 d2
c1
}
%%%% A track with repeated segments
% Normal segment
segmentA = \relative c' {
c1
c1
}
% This segment has a shadow starting at measure 7
segmentB = \relative c' {
d1
d1
}
% This segment starts at measure 5 and is marked "volta"
segmentC = \relative c' {
e1
e1
}
% This segment starts a measure 9 (after the shadow) and is marked "volta"
segmentD = \relative c' {
f1
f1
}
% Normal segment
segmentE = \relative c' {
c1
c1
}
%%%%%% Voices / Rosegarden Tracks %%%%%%%%
melodyvoice = \new Voice {
\clef treble
\key c \major
\melodysegment
}
% This RG track has 3 segments.
secondvoice = \new Voice {
\clef treble
\key c \major
\segmentA
\repeat "volta" 2 { \segmentB }
\alternative { {\segmentC} {\segmentD} }
\segmentE
}
%%%%%%%%%%%%%%%% Staffs %%%%%%%%%%%%%%%%%%%%%%
% Since "melodysegment" has no repeats. Other tracks are unfolded.
melodystaff = \new Staff <<
\set Staff.instrument = "Melodi"
\set Staff.instr = "Mel"
\melodyvoice
\unfoldRepeats { \secondvoice }
\unfoldRepeats { \globalinfo }
>>
secondstaff = \new Staff <<
\set Staff.instrument = "2. stemme"
\set Staff.instr = "2"
\secondvoice
\globalinfo
>>
%%%%%%%%%%%%%%%%%%%%% Score %%%%%%%%%%%%%%%%%%%
\book {
\score {
\header {
instrument = "Partitur"
}
<<
\globaltime
\new StaffGroup <<
\melodystaff
>>
>>
}
\score {
\header {
instrument = "2. stemme"
breakbefore = ##t
}
<<
\secondstaff
>>
}
}