Adding to the narrative in other answers, here is a chart that might help further explain why brass players tend to prefer sheet music written in keys with flats. As shown, written keys that avoid the “worst usual fingerings/positions” (elaborated below) on common brass instruments (except French horn) are overwhelmingly keys with flats.
Natural Worst Written keys WITHOUT Name of Version of (open) key usual the worst fingering instrument instrument --------------- fingering/ --------------------- on score considered Concert Written position How many How many flats sharps F French horn 4-rotor F C 2-3 2,1 0 1,2 Bb Trumpet 3-valve Bb " 1-2-3 4,3,2,1 0 1 Baritone T.C. " " " " 4,3,2,1 0 1 Eb Mellophone " Eb " " 4,3,2,1 0 1 Alto/Tenor horn " " " " 4,3,2,1 0 1 Tuba C tuba C " 1-2-3 / 2-4 4,3,2,1 0 1 Tuba Eb tuba Eb Eb " 6,5,4,3,2 7,6 Tuba Bb tuba Bb Bb " 5,4,3,2,1 7 Baritone horn 4-valve " " " 5,4,3,2,1 7 Euphonium " " " " 5,4,3,2,1 7 Baritone horn 3-valve " " 1-2-3 5,4,3,2,1 7 Euphonium " " " " 5,4,3,2,1 7 Trombone slide " " 7th 5,4,3,2,1 7 Trombone F attach. " " 5th 3,2,1 0
The “worst usual fingering/position”
is an ad hoc designation
likely to find agreement by many players due to these factors:
•
The fingering/position is for a note
in the usual scored range of the instrument.
•
With 3 valves but no fingered slide,
timbre is compromised when a note is lipped into tune.
•
With 3 valves and a fingered tuning slide,
coordinating the slide quickly is difficult.
•
With an in-line 4th valve, pinkie-vs-ring-finger agility
is anatomically limited.
•
With a left-hand 4th valve, coordinating the hands quickly is difficult.
•
On a trombone, a quick slide excursion is a gymnastic feat.
Admittedly:
•
The worst usual fingerings/positions of some instruments
aren't as bad as those of others.
•
Some rarer fingerings/positions are worse than those shown,
but also tend to avoid flat keys.
•
Almost-worst fingerings and convenient fingering sequences
do play circumstantial roles as well.
The specific keys mentioned in the question — A♭ and E, for B♭ trumpet— are written with 4 flats and 4 sharps, respectively. If these keys are equally playable for you, it could well be thanks to orchestral experience. Trumpet key of A♭ (concert G♭) is quite rare but should be slightly more natural to play than trumpet key of E, which is quite common as concert D in orchestral music.
This comes from a community band and orchestra member who fills for whatever non-percussion parts are needed during rehearsals, playing the most appropriate brass instruments that happen to be along or available.