5

I have this code:

\new StaffGroup <<                                                                  
  \override StaffGroup.SystemStartBracket.stencil = ##f                             
  \new Staff \with {                                                                
  } \relative {                                                                     
    g'8 ais8 dis2                                                                   
  }                                                                                 
>> 

This produces following

in treble clef: G4 A#4 D#5

I want exact same melody to be played by Alto Sax. So I did this:

\new StaffGroup <<                                                               
  \override StaffGroup.SystemStartBracket.stencil = ##f                          
  \new Staff \with {                                                             
  } \transpose c a, {                                                            
    \relative {                                                                  
    g'8 ais8 dis2                                                                
  }                                                                              
}                                                                                
>>    

But lilypond produces this:

in treble clef: E4 Gx4 B#4

I would prefer to have just E G C in the output instead of the double sharps.

3 Answers 3

6

The simplest solution would be to change the notes from G A# D# to G Bb Eb. Then the transposition will become E G C.

However, if this is not possible, you could use the "smart transpose" code snippet included in the LilyPond documentation. See 1.1.2 Changing multiple pitches: Transpose. Its purpose is to

enforce enharmonic modifications for notes in order to have the minimum number of accidentals.

7

Frankly, I cannot imagine a melody where your original notation makes any sense. Once the pitches and accidentals make sense regarding the scale degrees of the notenames and intervals within the current key signature (it doesn't help that you don't even include and thus transpose one), players will prefer the correctly transposed accidentals because they put the notes better into melodic context.

This probably does not apply to strict dodecaphonic/serial music, but then sax would be an unusual instrumentation for that purpose.

1

In general, a good practice is to figure out what key your song (or part of your song) is in, and then whenever you need an accidental, use the one that belongs to that key.

For example, the key of B♭ major contains the following notes: B♭, C, D, E♭, F, G, A, B♭. If you had written your score using notes from B♭ major, this problem wouldn't have happened.

There is no key that contains both G and A♯, and that's a good indication that you usually don't want to use the notes G and A♯ nearby each other. That partly explains why this problem happened in the first place: you provided unusual input, so you got unusual output.

(Of course, you should usually use a key signature, and that will make your scores easier to read by eliminating most of the accidentals. If I remember correctly, Lilypond still makes you type the accidentals even if you have a key signature, and so it's still important—but also easy—to know what key you're in and stick mainly to notes from that key.)

2
  • I am more of a programmer and less of a musician :-)
    – kargirwar
    Commented Mar 26, 2023 at 3:57
  • Yes, in lilypond you have to type the accidentals. Not being a trained musician, I just use sharps for all black keys :-(
    – kargirwar
    Commented Mar 26, 2023 at 4:06

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.