Still, the clarinet in B-flat is often used for music in D major. It is probably the key with the most sharps that it can play well. However, when some composers write a piece in D minor with B-flat clarinets, they change to clarinets in A if the music changes to D major.