Deutsches Lilypond Forum (Archiv)
Allgemein => Fragen zu Funktionen => Thema gestartet von: Musiker am Sonntag, 4. Dezember 2011, 19:02
-
Hallo Zusammen!
Ich habe mir ein Lied erstellt, bei dem ich aber die Wiederholung nicht richtig hin bekomme.
Die erste alternative soll von Takt 51 bis 52 gehen und die zweite ab 53.
Was habe ich falsch eingegeben, bzw. was muss ich ändern, damit er es mir richtig anzeigt?
Vielen Dank im Voraus!
P.S.: Jede Zeile im Code entspricht der Zeile in der PDF.
\version "2.12.3"
#(set-global-staff-size 22)
\include "deutsch.ly"
\paper{
top-margin = 2\cm
bottom-margin = 2\cm
left-margin = 2\cm
line-width = 17\cm
after-title-space = 4\cm
}
\layout {
indent = #0
}
\header {
tagline = ""
title = "Atlantis"
}
global = {
\clef "treble_8"
\key f \major
\numericTimeSignature
\time 4/4
}
Akkorde = \chords {
\germanChords
\set chordChanges = ##t
\partial 2 r2 f c b f g1
c:7 f2 c b f
es1 c:7 f f c
c b f c c
a:m d h:m e:m c
a:m b g:m c c:7
f f c c b
f c c a:m d h:m
% Seite 2
e:m c a:m b g:m c
c f2 c b f g1 c:7
f2 c b f es1 c
es es f2 c f c
es1 es f2 c f c f c f1
}
Noten = \relative c' {
\partial 2 a4 b \bar "||" c8 c16 c c8 c g'4 e8 c b b16 b b8 b f'4 f, g2( b4 a \break
g2.) a8 b c8 c16 c c8 c g'4 e8 c b8 b16 b b8 b f'4 f, \break
g1~ g c2~( \times 2/3 { c4 d e } f2~ \times 2/3 { f4 g a } c8 g~ g2.~ \break
g2.) b8( c b2 \times 2/3 { b4 c d } c2 a8 f c4 g'1~ g) \break
r2 a4( e fis1~ fis2) d'4( h g1~ g2) e'4( d \break
\times 2/3 { c c h } a g f2) d'4( c \times 2/3 { b b a } g f g2~ g8 a g f g1) \break
\repeat volta 2 { c,2~ \times 2/3 { c4 d e } f2~ \times 2/3 { f4 g a } c8 g~ g2.~ g b8( c b2 \times 2/3 { b4 c d } \break
c2 a8 f c4 g'1~ g) r2 a4( e fis1~ fis2) d'4( h \break
% Seite 2
g1~ g2) e'4( d \times 2/3 { c c h } a g f2) d'4( c \times 2/3 { b b a } g f g1~ \break
g4) r4 a, b c8 c16 c c8 c g'4 e8 c b b16 b b8 b f'4 f, g2( b4 a g2.) a8( b) \break
c8 c16 c c8 c g'4 e8 c b b16 b b8 b f'4 f, } \alternative { g1~ g }\break
{ g2( b, es2.) f'8 g } f4 f~ f8 c4 c8 f4 f~ f8 c4 c8 \break
g2( b es2. f8 g) a4 a~ a8 g4 g8 a4 a~ a8 g4 g8 a4 a~ a8 g4 g8 a4 a2. \bar "||" \break
}
\score {
<<
\Akkorde
\new Staff { \global \Noten }
% \new TabStaff { \set TabStaff.minimumFret = #5 \Noten }
>>
\midi {
\context {
\Score
tempoWholesPerMinute = #(ly:make-moment 120 4) }
}
\layout {}
}
-
hallo Musiker
da musst du wohl die 1. alternative über die takte 51 - 52 laufen lassen und die 2. über den takt 53!
das müsste dann lauten:
\repeat volta 2 { s1*50}
\alternative {
{a1 a}
{b1}
}
nb: es scheint einfacher, pro zeile einen einzelnen takt aufzuzeichnen als sich auf die ausgabezeile festzulegen (die ja i.a. von lilypond gewählt wird)
hdh
ding-dong
-
Ich habe es so eingestellt.
Er gibt aber dann in der PDF die Alternative 1 bei Takt 51 und die 2. bei Takt 52, obwohl ich es so eintrug, wie ding-dong es sagte.
-
hallo Musiker
bitte beachte die klammern genau!
\repeat volta 2 { s1*50}
\alternative {
{a1 a} % 1. alternative
{b1 } % 2. alternative
}
falls das nicht geht schick doch den code nochmals!
ding-dong
-
Ich verstehe es einfach nicht. Ich habe den Code mal extrem vereinfacht und alles Überschüssige rausgeworfen.
Er soll jetzt Folgendes machen:
1. Das Wiederholungszeichen soll bei Takt 3 sein.
2. Die 1. Alternative sollen die Takte 2 und 3 sein.
3. Die 2. Alternative soll ab Takt 4 gehen.
Es wäre gut, wenn Du mir das anhand meines Beispieles erklären könntest!
Vielen Dank!
\version "2.12.3"
global = {
\clef "treble_8"
\key f \major
\numericTimeSignature
\time 4/4
}
Noten = \relative c' {
\repeat volta 2
{ f4 f f f, }
\alternative
{ g1~
g }
{ g2( b,
es2.) f'8 g \bar "||" }
}
\score {
<<
\new Staff { \global \Noten }
>>
\layout {}
}
-
der befehl \alternative ermöglicht es, verschiedene alternativen einzugeben, wobei diese als musikalische ausdrücke eingegeben werden:
\alternative { … … }
wenn eine alternative nicht aus nur einem ton besteht muss sie in klammern gesetzt werden! (oder wenn sie weitere elemente wie \overrides, \bars u.ä. enthält)
\alternative { {…} {…} }
in deinem bsp fehlt demnach die äussere klammer (hier rot)
-
Hallo Musiker,
die Klammern bitte genauso setzen, wie wir sie angeben! Dann klappt es nämlich :)
Dein frisierter Code ist demnach:
\version "2.12.3"
#(set-global-staff-size 22)
\include "deutsch.ly"
\paper{
top-margin = 2\cm
bottom-margin = 2\cm
left-margin = 2\cm
line-width = 17\cm
after-title-space = 4\cm
}
\header {
tagline = ""
title = "Atlantis"
}
mybreak = {
\break
}
global = {
\clef "treble_8"
\key f \major
\numericTimeSignature
\time 4/4
\tempo 4 = 120
\partial 2 s2 \bar "||"
s1*3 \mybreak
s1*3 \mybreak
s1*5 \mybreak
s1*5 \mybreak
s1*5 \mybreak
s1*5 \mybreak
% T.027
s1*5 \mybreak
s1*6 \mybreak
% Seite 02
s1*6 \mybreak
s1*5 \mybreak
s1*4 \mybreak
s1*4 \mybreak
s1*6 \bar "||" \mybreak
}
Akkorde = \chords {
\germanChords
\set chordChanges = ##t
\partial 2 r2 f c b f g1
c:7 f2 c b f
es1 c:7 f f c
c b f c c
a:m d h:m e:m c
a:m b g:m c c:7
\repeat volta 2 {
f f c c b
f c c a:m d h:m
% Seite 02
e:m c a:m b g:m c
c f2 c b f g1 c:7
f2 c b f
}
\alternative {
{ es1 c }
{ es1 }
}
es1 f2 c f c
es1 es f2 c f c f c f1
}
Noten = \relative c' {
\partial 2 a4 b
c8 c16 c c8 c g'4 e8 c b b16 b b8 b f'4 f, g2\( b4 a
g2.\) a8 b c8 c16 c c8 c g'4 e8 c b8 b16 b b8 b f'4 f,
g1~ g c2~( \times 2/3 { c4 d e } f2~ \times 2/3 { f4 g a } c8 g~ g2.~
g2.) b8( c b2 \times 2/3 { b4 c d } c2 a8 f c4 g'1~ g)
r2 a4( e fis1~ fis2) d'4( h g1~ g2) e'4( d
\times 2/3 { c c h } a g f2) d'4( c \times 2/3 { b b a } g f g2~ g8 a g f g1)
\repeat volta 2 { c,2~ \times 2/3 { c4 d e } f2~ \times 2/3 { f4 g a } c8 g~ g2.~ g b8( c b2 \times 2/3 { b4 c d }
c2 a8 f c4 g'1~ g) r2 a4( e fis1~ fis2) d'4( h
% Seite 02
g1~ g2) e'4( d \times 2/3 { c c h } a g f2) d'4( c \times 2/3 { b b a } g f g1~
g4) r4 a, b c8 c16 c c8 c g'4 e8 c b b16 b b8 b f'4 f, g2( b4 a g2.) a8( b)
c8 c16 c c8 c g'4 e8 c b b16 b b8 b f'4 f,
}
\alternative {
{ g1~ g }
{ g2( b, }
}
es2.) f'8 g f4 f~ f8 c4 c8 f4 f~ f8 c4 c8
g2( b es2. f8 g) a4 a~ a8 g4 g8 a4 a~ a8 g4 g8 a4 a~ a8 g4 g8 a4 a2.
}
\score { % nur PDF
<<
\Akkorde
\new Staff { << \global \Noten >> }
>>
\layout {
indent = #0
\context {
\Score
tempoHideNote = ##t
}
}
}
\score { % nur MIDI
\unfoldRepeats
<<
\context Staff = "Akkorde" {
%\set Staff.midiInstrument = #"pan flute"
<< \global \Akkorde >>
}
\context Staff = "Stimme" {
%\set Staff.midiInstrument = #"pan flute"
<< \global \Noten >>
}
>>
\midi {}
}
Damit die MIDI-Datei korrekt (mit Wiederholungen) erzeugt wird, müssen in allen Stimmen die repeat/alternative-Blöcke gesetzt und \unfoldRepeats benutzt werden.
Grüße, Robert
-
Hallo Robert,
vielen Dank für Deine Lösung! Jetzt ist es so, wie ich es mir gewünscht habe!