3

I'm writing python code to automatically annotate jazz solo transcriptions (with their corresponding chord progressions) and to produce midi output using Lilypond. I'd like to instruct Lilypond to lower the volume of the chord progression with respect to the melody, but haven't been able to find a solution. Any advice would be welcome!

Here is an example of my output:

\include "swing.ly"
\version "2.24.1"\language "english"
\header { title = "Untitled Tune I"
 composer = "Charlie Christian"}

chord_progression = \chords { \set chordChanges = ##t 
 df1 df1 df1 df1 gf1:7 gf1:7 df1 df1 af1:7 af1:7 df1 af1:7 }

melody = \fixed c'
{\clef treble\numericTimeSignature \time 4/4 \override NoteHead.color = orangered  df'8  \override NoteHead.color = orangered  df'8  \override NoteHead.color = #black  r4  \override NoteHead.color = #black  r4  \override NoteHead.color = orangered  df'4  \override NoteHead.color = orangered  df'4  \override NoteHead.color = #black  r4  \override NoteHead.color = #black  r4  \override NoteHead.color = orangered  df'4  \override NoteHead.color = orangered  df'1  \override NoteHead.color = #black  r2  \override NoteHead.color = orangered  df'8  \override NoteHead.color = orangered  f'8  \override NoteHead.color = #black  gf'8  \override NoteHead.color = orangered  f'8  \override NoteHead.color = orangered  gf'8  \override NoteHead.color = #black  f'8  \override NoteHead.color = orangered  gf'8  \override NoteHead.color = #black  f'8  \override NoteHead.color = orangered  gf'8  \override NoteHead.color = #black  f'8  \override NoteHead.color = orangered  gf'8  \override NoteHead.color = #black  f'8  \override NoteHead.color = orangered  gf'8  \override NoteHead.color = #black  f'8  \override NoteHead.color = orangered  gf'8  \override NoteHead.color = #black  f'8  \override NoteHead.color = orangered  gf'8  \override NoteHead.color = #black  af'8  \override NoteHead.color = orangered  gf'8  \override NoteHead.color = #black  f'8  \override NoteHead.color = orangered  df'8  \override NoteHead.color = #black  bf8  \override NoteHead.color = orangered  af4  \override NoteHead.color = #black  c'8  \override NoteHead.color = orangered  df'4 df'8  \override NoteHead.color = orangered  df'4  \override NoteHead.color = #black  r8  \override NoteHead.color = orangered  af'8  \override NoteHead.color = #black  ef''32  \override NoteHead.color = #black  e''16 e''32  \override NoteHead.color = #black  ef''8  \override NoteHead.color = orangered  df''8  \override NoteHead.color = #black  bf'8  \override NoteHead.color = orangered  af'8  \override NoteHead.color = orangered  gf'8  \override NoteHead.color = #black  e'8  \override NoteHead.color = #black  f'8  \override NoteHead.color = orangered  af'8  \override NoteHead.color = #black  bf'8  \override NoteHead.color = #black  r8  \override NoteHead.color = #black  df''8  \override NoteHead.color = #black  df''4  \override NoteHead.color = #black  b'8  \override NoteHead.color = #black  bf'8  \override NoteHead.color = orangered  af'8  \override NoteHead.color = #black  e'8  \override NoteHead.color = #black  f'8  \override NoteHead.color = orangered  af'8  \override NoteHead.color = orangered  f'8  \override NoteHead.color = orangered  df'8  \override NoteHead.color = #black  bf4  \override NoteHead.color = orangered  df'8  \override NoteHead.color = orangered  f'8  \override NoteHead.color = orangered  af'4  \override NoteHead.color = #black  df''4 df''8  \override NoteHead.color = #black  f''8  \override NoteHead.color = #black  r2}

\score { 
\tripletFeel 8 
<< 
\new ChordNames { \chord_progression } 
\new Staff  \with { instrumentName = "Chorus 1" } 
 { \melody }
 >> 
\layout { }
\midi { \tempo 4 = 192 }
}
2
  • It'd be nice if you put some line breaks in the code for the melody, say every measure or so. Jul 4, 2023 at 19:03
  • Yes, that's a sensible comment. As the output is automatically generated with a Python script, and isn't otherwise needed, I opted against unnecessary newline characters.
    – C. Bunks
    Jul 4, 2023 at 21:03

1 Answer 1

4

The simplest solution is probably to just add a dynamic mark — such as \p for piano (soft), or \f for forte (loud) — to the first chord: df1\p

A list of dynamic marks can be found on this page:
https://lilypond.org/doc/v2.24/Documentation/notation/expressive-marks-attached-to-notes#dynamics

Dynamics won't show up in a ChordNames context, but they will affect the midi "volume" (velocity).


You can of course add dynamics to the melody as well. They will appear in the Staff context below the notes (as p, f, etc.), but if you don't want them to be visible you can omit them: df'8\omit\f

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.