Deutsches Lilypond Forum (Archiv)
Allgemein => Hilfe beim Einstieg in Lilypond => Thema gestartet von: sf am Dienstag, 1. Januar 2008, 17:57
-
Hallo,
meine Tochter hat ein Xylophone bekommen. Zum leichten Lernen ist es farbig markiert. Nun hat offenbar jeder Hersteller andere Farben (wie auch nicht anders zu erwarten).
Also suche ich ein Programm, mit dem ich Notehblätter mit der für dieses Xylophone gültigen Farbskala drucken kann. Dabei bin ich über Rosegarden und Lilypond gestolpert. Im Onlinehandbuch habe ich bereits gefunden, dass man mit \override farbig hervorheben kann.
Kann man auch Noten entsprechend der Tonhöhe hervorheben? Hilfreich wäre notfalls auch ein Script, mit dem man die Rohdatei bearbeiten kann. Google konnte mir nicht helfen, habe nur was für capella finden können ( http://www.whc.de/download/Plugins/FarbigeNoten.py ).
-
Hallo,
es scheint mir, dass das mit Lilypond leider nicht so einfach wird. Es gibt eine Funktion, mit der man die Notenköpfe in verschiedenen Formen ausgeben kann, aber ich habe nicht gefunden, dass man das auf Farben anwenden kann. Frag aber mal nach auf der Lilypond-Mailingliste, es kann sein, dass jemand dort das alles so gut durchschaut, dass er dir eine Funktion schreiben kann, mit der das automatisch erreicht wird.
Eine, etwas mühsame, Möglichkeit wäre es, manuell zu jeder Note die passende Farbe zu schreiben. Dazu kann man sich wohl Farbfunktionen erstellen, etwa so:
grün = {\override NoteHead #'color = #green }
blau = {\override NoteHead #'color = #(x11-color "medium turquoise")}
Hier zeigt das erste Beispiel die simplen Farben (Namen gibt es in einer Tabelle im Anhang der Dokumentation),
das zweite zeigt sog. x11-Farben, die haben eine größere Vielfalt an Auswahl, die Namen finden sich auch im
Anhang.
Dann kann man das in der Notationsdatei benutzen:
c8 \blau d4 \grün e8 f g a2 g1 b c
Das Problem ist nur: vor jeder neuen Note muss die Farbe gewechselt werden, weil sonst die folgende Note, unabhängig von ihrer Tonhöhe, in der gleichen Farbe gedruckt wird.
Aber wie gesagt, es gibt keine direkte Funktion, die das automatisch erledigen würde.
Gruß
Till
-
Hallo,
die Möglichkeit eine Farbfunktion zu erstellen spart zumindest Schreibarbeit. Ich hatte gehofft, dass schon mal jemand eine einsprechende Funktion oder alternativ ein Script, dass die Lilypond-Datei automatisch durchläuft geschrieben hat.
Vielen Dank jedenfalls für den Hinweis.
Sebastian
-
Hallo Sebastian,
das unten angegebene Beispiel zeigt verschiedene Noten farbig an.
\header {
filename = "AmazingGrace-Sweet-Ads.ly"
enteredby = "Gordon Gilbert"
composer = "Traditional American Melody"
poet = "words: Rev'd John Newton, 1779"
arranger = "arr. Gordon Gilbert 2007"
date=""
title = "Amazing Grace"
subtitle = "Arr. for Barbershop Chorus"
metre = ""
meter = \metre
copyright = "Public Domain - Permission granted to perform this arrangement in a not-for-profit setting"
style = "Hymn"
}
\version "2.11.23"
\paper{
#(set-paper-size "letter")
}
global= {
\time 3/4
\key g \major
}
tenor = \context Voice = "tenor" \relative c' {
\voiceOne
\override NoteHead #'color = #green
\override Stem #'color = #green
\override Beam #'color = #green {
\partial 4 r4
b'2 d8 b d2 dis4 e2 c4 b2
a4 b2 d4 e2 e4 fis2 e4 ^ "like" d4( ^ "me" c)
b4 b2 d4 d2 b4 c4.( e8 e c) b2
a4 b2 d4 d cis c b4( d) c4 ^ "I" b2 ^ "see"
r4
b4 c \times 2/3 {d8( c b)} d2 dis4 e( d) c4 b4 c
a4 b2 \times 2/3 {d8( c b)} e4( fis) g4 fis4( g) ( e4 d c)
b4 d2 \times 2/3 {d4 e8} f2 d4 c2 c4 b2
a4 b4 c d4 d( cis) c b2 c4 b2
r4
b2 ^ \markup \italic {"Bluesy"} d4 d2 d4 ees2 c4 b2
a4 b2 d4 ees2 ees4 f2 e4 d2
d4 b2 d4 d2 b4 c4.( ees8 ees c) b2
a4 b2 d4 d cis c b2.
e2. d e b2
\new Voice = tenorDivisi { \voiceOne
\transpose g b'
{
\override NoteHead #'color = #green
\override Stem #'color = #green
\override Beam #'color = #green {
r4 r b4 b r4 r d'4 d'4 dis' e'2. c'4 b2. r4
r d' e' e'4 fis'4 fis'4 fis' g' a' g' fis' e'
d'( e'4 f'2 ~ f'4) f'4 d'2. d'4 g'2. d'4 c'2. c'4 b a
b2. d'4 c'( d' e') g' g'2
a'2 gis'1
}}
}}
}
lead = \context Voice = "lead" \relative c' {
\voiceTwo
\override NoteHead #'color = #red
\override Stem #'color = #red
\override Beam #'color = #red {
\partial 4 d4
g2 b8( g) b2 a4 g2 e4 d2
d4 g2 b8( g) b2 a4 d2. ~ d2
b4 d4.^ "x"( b8) d( b) g2 d4 e4.( g8) g( e) d2
d4 g2 b8( g) b2 a4 g2 ( fis4 g2)
%verse 2
d4
g2 \times 2/3 {b8( a g)} b2 a4 g2 e4 d2
d4 g2 \times 2/3 {b8( a g)} b2 \times 2/3 {a4( b8)} d2. ~ d2
b4 d2 \times 2/3 {b8( a g)} b2 \times 2/3{b4( a8)} g2 \times 2/3 {e4( d8)} d2
\times 2/3 {d4( e8)} g2 \times 2/3 {b8( a g)} b2 a4 g2. ~ g2
%verse 3
d4
g2 b8( g) b2 a4 g2 e4 d2
d4 g2 b8( g) b2 a8( b) d2. ~ d2
b4 d4.^ "x"( b8) d( b) g2 d4 e4.( g8) g( e) d2
d4 g2 b8( g) b2 a4 g2.
%bridge
a ^ \markup \italic {"Bridge"} b g fis2
%verse 4
\key b \major
\transpose g b'
{
d4 \time 4/4
g2. b8( g) b2. a4 g2. e4 d2.
d4 g2. b8( g) b2. a8( b) d'1 ~ d'2.
b4 d'2 ~ d'8( b8) d'( b) g2. d4 e2 ~ e8 ( g8) g( e) d2.
d4 g2. b8( g) b2. a4 g2 g2
b1 ^ \markup \italic {"Tag"}
a4 ^ \fermata b ^ \fermata c' ^ \fermata
r8 ^ \fermata d'8 d'1 d' ^ \fermata
}
\bar "||"
}
}
bari = \context Voice = "bari" \relative c'' {
\voiceOne
\override NoteHead #'color = #blue
\override Stem #'color = #blue
\override Beam #'color = #blue {
\partial 4 d,4
g2 g4 g2 fis4 g2 a4 g2
a4 b2 b4 cis2 a4 d2 a4 ^ "like" a2 ^ "me"
g4 g2 g4 d2 g4 c2 a4 g2
a4 b2 g4 fis4. g8 fis4 g4( b) a ^ "I" g2 ^ "see"
d4
g2 g4 d'2 b4 c2 a4 g2
a4 b2 b4 a2 a4 d2 a4 a2
g4 b2 b4 d2 b4 c2 a4 g2
a4 b2 g4 fis4. e8 fis4 g2. ~ g2
d4
f2 ^ \markup \italic {"Bluesy"} f4 c'2 b4 bes2 bes4 g2
a4 f'2 f4 g2 g4 d2 a'4 a2
g4 f2 f4 d2 b4 bes2 a4 g2
a4 d2 f,4 fis4. e8 fis4 g2.
cis2. g b dis2
\new Voice = bariDivisi { \voiceOne
\transpose g b'
{
\override NoteHead #'color = #blue
\override Stem #'color = #blue
\override Beam #'color = #blue {
r4 r f f r r b b
fis bes2. c'4 b?2.
r4 r d' d' e' fis'2. e'4 d'
}}}
}
}
bass = \context Voice = "bass" \relative c' {
\voiceTwo
\override NoteHead #'color = #magenta
\override Stem #'color = #magenta
\override Beam #'color = #magenta {
\partial 4 d4
d2 b4 d2 b4 c2 e4 g2
fis4 e2 e4 a2 cis,4 d2 e4 _ "like " fis( _ "me " e)
d b2 d4 g,2 d'4 c2 e4 g2
fis4 e2 e4 d e fis g2 d4 _ "I" g,2 _ "see"
d'4
g,4 b d4 g4 d4 b c4. d8 e fis g2
fis4 e2 e4 a,4 b c4 b2.( a2) d4
g2 g4 g2 b4 c2 a4 g4( g)
fis4 e2 e4 d e fis g2 d4 g2
d4
g,2 b4 f'2 f4 c2 e4 e2
fis4 g2 g4 a2 cis4 d2( e4 fis d) d
b2 d4 g,2 b,4 c2 e4 g2
f4 e2 e4 d e fis f2.
fis2. e cis b2
\key b \major
\new Voice = bassDivisi { \voiceTwo
\transpose g b
{
\override NoteHead #'color = #magenta
\override Stem #'color = #magenta
\override Beam #'color = #magenta {
r4 r
g4 g r r g4 g b4 c'2. e'4 f'2.
r4 r g'4 a' a'4 a2. cis'4 d' d' d' e'4 fis' e' d'4 r r d'
b' r r d'4 g' b4 c'2. e'4 g'2.
r4 r fis'4 e' r r e'4 e'4 fis' g'2 f'2 e'1
c'4 b a r8 g g1 ~ g
}}}
}}
%accomp=\chordmode \chords
stanzaa = \lyricmode {
\set stanza = "1."
A -- ma -- zing Grace, how sweet the sound
That saved a wretch like me;__
I once was lost, but now am found,
Was blind but now I see.
\set stanza = "2."
'Twas grace that taught my heart to fear,
And grace my fears re -- lieved;
How pre -- cious did that grace ap -- pear
The hour I first be -- lieved._
\set stanza = "3."
Thro' ma -- ny dan -- gers, toils and snares
I have al -- rea -- dy come;
'Tis grace hath brought me safe thus far,
And grace will lead me home.
%bridge
Lead us home, Lord!
\set stanza = "4."
When we've been there ten thou -- sand years
Bright shin -- ing as the sun,
We've no less days to sing God's praise
Than when we first be -- gun!
%tag
be -- gun! We've on -- ly just be -- gun!!
}
tenorwords = \lyricmode {
When we've been there ten thou -- sand years
Bright shi -- ning as the sun,
Bright shi -- ning as the sun,
We've no less days to sing God's praise
Than when we first be -- gun!
%tag
be -- gun
}
bariwords = \lyricmode {
When we've been there ten thou -- sand years
Bright shi -- ning as the sun,
We've no less days to sing God's praise
Than when we first be -- gun!
}
basswords = \lyricmode {
When we've been there ten thou -- sand years
Bright shi -- ning as the sun,
Bright shi -- ning as the sun,
We've no less days to sing God's praise
Than when we first be -- gun!
%tag
be -- gun!
}
\score {
\transpose g ees
\context ChoirStaff <<
% \new ChordNames
%\unset ChoirStaff.melismaBusyProperties
\context Staff ="upper" { \clef "G" <<
\global
\tenor
\lead
>>}
\new Lyrics \with{ alignAboveContext = "upper" } \lyricsto
"tenorDivisi" \tenorwords
\lyricsto "lead" \context Lyrics = "stanza-1" {
%\set stanza = "1."
\stanzaa }
\context Staff = "lower" { \clef "F^8"<<
\global
\bari
\bass
>>}
\new Lyrics \with { alignAboveContext = "lower" } \lyricsto
"bariDivisi" \bariwords
\new Lyrics \with { alignBelowContext = "lower" } \lyricsto
"bassDivisi" \basswords
>>
\layout{
indent = 0.0\pt
\context {
\ChordNames
\override ChordName #'style = #'american
chordChanges = ##t
}
}
\midi {
\context {
\Score
tempoWholesPerMinute = #(ly:make-moment 60 2)
}
}}
Gruß
D.
-
Hehe, hier jetzt die Lösung, befindet sich im LM:
#(define (color-notehead grob)
"Color the notehead according to its position on the staff."
(let ((mod-position (modulo (ly:grob-property grob 'staff-position) 7)))
(case mod-position
;; Return rainbow colors
((1) (x11-color 'red )) ; for C
((2) (x11-color 'orange )) ; for D
((3) (x11-color 'yellow )) ; for E
((4) (x11-color 'green )) ; for F
((5) (x11-color 'blue )) ; for G
((6) (x11-color 'purple )) ; for A
((0) (x11-color 'violet )) ; for B
)
)
)
\relative c' {
% Arrange to obtain color from color-notehead procedure
\override NoteHead #'color = #color-notehead
c2 c' |
b4 g8 a b4 c |
c,2 a' |
g1 |
}
\addlyrics {
Some -- where o -- ver the Rain -- bow, way up high,
}
Mit der Funktion wird automatisch verschiedene Tonhöhe mit unterschiedlicher Farbe gekennzeichnet. Tolle Sache!
-
8) echt cool!
sollte man es vielleicht umbenennen - zb "pitch-colors" - da ja viel allgemeiner jedes objekt auf einer bestimmten tonhöhe eingefärbt werden kann, also auch pausen:
\override Rest #'color = #pitch-colorsund dann:
{ c \rest d \rest e \rest f \rest g \rest }
und ist es möglich die 7 farben irgendwie mit einem \set pitch-colors = ... zu definieren?! (ich kenne leider scheme nicht)
vielen dank!
-
und ist es möglich die 7 farben irgendwie mit einem \set pitch-colors = ... zu definieren?! (ich kenne leider scheme nicht)
vielen dank!
Hmm, geht bestimmt, aber ich weiß auch nicht, wie...
-
Super tolle Lösung!
Hab ich gleich in OOoLilypond eingefügt - und siehe da, es Funktioniert!
(http://digitale-schule-bayern.de/dsdaten/239/19.jpeg)
PS
Oh, sorry für das riesen Bild...
Hier noch der Link zum OOoLilypond-Thread:
https://liarchiv.joonet.de/index.php?topic=166.0 (https://liarchiv.joonet.de/index.php?topic=166.0)
-
und ist es möglich die 7 farben irgendwie mit einem \set pitch-colors = ... zu definieren?! (ich kenne leider scheme nicht)
vielen dank!
Nochmal dazu: es war wohl gedacht, die während des STückes zu ändern? Innerhalb der Scheme-Funktion kann man ja jede beliebige x11-Farbe nehmen, die Liste findet sich wenn ich recht erinnere im NR.
Und wenn du irgendwo ändern willst, kannst du ja eine anders genannte Funktion erstellen und dann mit einem weiteren \override hierzu wechseln.
Till
-
ich meinte so etwas wie
#(define (color-notehead grob)
"Color the notehead according to its position on the staff."
(let ((mod-position (modulo (ly:grob-property grob 'staff-position) 7)))
(case mod-position
;; Return rainbow colors
((1) (x11-color arg1 )) ; for C
((2) (x11-color arg2 )) ; for D
((3) (x11-color arg3 )) ; for E
((4) (x11-color arg4 )) ; for F
((5) (x11-color arg5 )) ; for G
…
…
)
)
)
und dann:
\set (override) pitch-color = ( rot green magent … … …) ( oder wie auch immer das in scheme geschrieben wird)
das wäre etwas flexibler und bei stimmungsschwankungen müsste man nicht wieder die funktion hart kodieren
vielleicht müsste man das noch ausarbeiten?!
ding-dong