Untitled

 avatar
unknown
plain_text
a year ago
1.2 kB
13
Indexable
# Create the score
score = stream.Score()
part = stream.Part()
part.append(clef.BassClef())
score.metadata = metadata.Metadata()
score.metadata.title = "Lyrical Reflection"
score.metadata.composer = "Composed for ChatGPT User"

# Time and key signature
part.append(key.KeySignature(0)) # C major / A minor
part.append(meter.TimeSignature('4/4'))
part.append(tempo.MetronomeMark(number=66)) # Lento

# Melody notes
melody_notes = [
note.Note('C3', quarterLength=2),
note.Note('E3', quarterLength=2),
note.Note('G3', quarterLength=1.5),
note.Rest(quarterLength=0.5),
note.Note('A3', quarterLength=2),
note.Note('B3', quarterLength=2),
note.Note('C4', quarterLength=4),
note.Note('B3', quarterLength=1.5),
note.Rest(quarterLength=0.5),
note.Note('A3', quarterLength=2),
note.Note('G3', quarterLength=2),
note.Note('E3', quarterLength=4),
note.Note('F3', quarterLength=1),
note.Note('G3', quarterLength=1),
note.Rest(quarterLength=2),
note.Note('C4', quarterLength=4),
]

melody_notes[0].lyric = "dolce"
melody_notes[6].lyric = "espressivo"
melody_notes[12].lyric = "poco rit."

for n in melody_notes:
part.append(n)

score.append(part)

# Save as PDF (requires LilyPond installed)
score.write('lily.pdf', fp='lyrical_reflection.pdf')

Editor is loading...
Leave a Comment