\version "2.12.3" % Accordion piece template. To create an accordion piece from this, % save it as e.g. MyPiece.ly and % create MyPieceDefinitions.ly from accTemplateDefinitions.ly. \header { % adapt title, composer etc. to your piece title = "MyPiece" composer = "traditional" } \include "accDefinitions.ly" % these are constant, define e.g. accTremolo % Melody parts definition per piece, for both layout and MIDI; adapt these aBase = { e1-5~ | e4 d(c-.) d-. | e2 d2 | c1-3 | c1-4~ | c4 d(c-.) b-. | \break c2 a2-2 | g1-1 | e4-1(g-2 c-.-3) d | } bBase = { e4-1(g-.-2)g-.g-.| a(g-.-2) g2-1 | a4-2 (c-.-4) c-. c-. | d-5(c-.-4) c2-3 | g4-1 (c-.-3) c-. d-. | } % Melody and chords definition per piece, for both layout and MIDI; adapt these upperIntro = \relative g' { g4-.-1\accTremolo g \( fis-2 g-1 | e'2-5 d2 | c1~ \) | c4 r4 r2 | } chordIntro = \chordmode { c1 | g:7 | c | c | } upperAa = \relative e'' { \aBase e2-5 c2-3 | d1-4~ | d1 | \break } chordAa = \chordmode { c1 | c | c | c | f | f | f | c | c | d:7 | g | g | } upperAb = \relative e'' { \aBase e2-5 d2-4 | c1-3~ | c4-5 r4 r2 | \break } chordAb = \chordmode { c1 | c | c | c | f | f | f | c | c | g:7 | c | c | } upperBa = \relative e' { \bBase e2 c2 | d1-4~ | d1-5 | \break } chordBa = \chordmode { c1 | c | f | f | c | c2 d2:7 | g1 | g | } upperBb = \relative e' { \bBase e2 d2 | c1~ | c4 r4 r2 | \break } chordBb = \chordmode { c1 | c | f | f | c | g:7 | c | c | } upperCa = \relative e'' { \aBase e2-5 c2-3 | d1-4~ | d1 | \break } chordCa = \chordmode { c1 | c | c | c | f | f | f | c | c | c2 d2:7 | g1 | g | } upperCb = \relative e'' { \aBase e2-5 d2-4 | c1-3~ | c4-5 r4 r2 | \break } chordCb = \chordmode { c1 | c | c | c | f | f | f | c | c | c2 g2:7 | c1 | c | } upper = { \upperIntro \break \upperAa \upperAb \pageBreak \upperBa \upperBb \upperCa \upperCb } chord = { \chordIntro \chordAa \chordAb \chordBa \chordBb \chordCa \chordCb } % layout part: make sure accLayoutDefinitions.ly contains all definitions you need \include "accLayoutDefinitions.ly" % should be constant, but make sure it's complete first = { \qxc } % MIDI here needs a \p \include "accTemplateDefinitions.ly" % copy this file and edit the copy; rename the included file \score { << \new PianoStaff << \set PianoStaff.instrumentName = #"Accordion" \new Staff = "upper" { % adapt key, time if necessary \clef treble \key c \major \time 4/4 \upper } % RhythmicStaff advantages: chords line closer to bass staff; disadvantage: not PianoStaff brace % \new RhythmicStaff = "lower" { % (normal) Staff advantage: PianoStaff brace; disadvantage: distance chords line - bass staff \new Staff = "lower" { \autoBeamOff \clef bass \override Staff.Stem #'transparent = ##t % tell Stem_engraver not to print stems \override Staff.Beam #'transparent = ##t \override Staff.StaffSymbol #'line-count = 1 % or ledger-line-thickness \lower } >> \new ChordNames { \override VerticalAxisGroup #'nonstaff-unrelatedstaff-spacing = #'((basic-distance . 0) (minimum-distance . 0) (padding . 0) ( stretchability . 0)) % \override VerticalAxisGroup #'nonstaff-relatedstaff-spacing = #'((basic-distance . 1)) % \override VerticalAxisGroup #'staff-staff-spacing = #'((basic-distance . 1) (minimum-distance . 1) (padding . 1) ( stretchability . 0)) % \override VerticalAxisGroup #'Y-extent = #'(0 . 0)%} \set chordChanges = ##t \chord } >> \layout { } } %{ \include "accMidiDefinitions.ly" first = { c4\p } % bass usually needs lower volume; for this to work, we need a \p (piano) sign \include "accTemplateDefinitions.ly" % rename the included file \score { << \new Staff = "upper" { % adapt key, time if necessary \clef treble \key c \major \time 4/4 \set Staff.midiInstrument = #"accordion" \upper } \new Staff = "lower" { \set Staff.midiInstrument = #"accordion" \set Staff.midiMinimumVolume = #0.3 % set bass volume \set Staff.midiMaximumVolume = #0.6 \lower } >> \midi { \context { \Score tempoWholesPerMinute = #(ly:make-moment 200 4) % adapt MIDI tempo } } }%}