Convert between Music clefs
Befunge, 70 64 bytes
~0~:70p##~+2%00p+&quot;A&quot;-~7%2++7%:3%2%00g*:10p+&quot;A&quot;+,00g!10g+#@_&quot;#&quot;,@

Try it online!
The input should be in the form C# Treble or F Bass, although the clef can simply be the first letter (i.e. T or B), since the rest of the input is ignored anyway.
Explanation
~0        Read the note and push a zero (the purpose of this will become apparent later).
~:70p     Read the following sharp or space and write that out as the next instruction.

As a result of this code modification, the next sequence of instructions will take one of two forms:
##~       The first # jumps over the second, and thus we perform the read instruction.
 #~       But if there's only one #, we'll ending up skipping the read instruction.

At this point the stack either contains note,0,sharp,space or note,0,space.
+2%       Add the top two stack items mod 2, returning 1 if we read a sharp, else 0 if not.
00p       Save this 'sharp' boolean for later use.

At this point the stack either contains note,0 or just note (with an implicit zero below).
+         By adding the top two items, we combine the 0 (if present) onto the note below.
&quot;A&quot;-      We can then subtract 'A' to convert the note into a number in the range 0 to 6.
~7%2+     Read the T/B clef, then mod 7 and add 2, returning 2 or 5 (the conversion offset).
+7%       Add that offset to our note number, then mod 7, to get the converted note number.
:3%2%     Make a dup, and calculate mod 3 mod 2 to determine the special cases (B# or E#).
00g*      Multiply that by the 'sharp' boolean, since we only care if the input was sharp.
:10p      Duplicate and save this special case boolean for later.
+         Now add it to the note number, since the special cases need to be offset by 1.
&quot;A&quot;+,     Then we can finally convert the number back into a character and output it.
00g!10g+  Now we check if the original note was not sharp, or if this was a special case.
#@_       If so, we exit immediately.
&quot;#&quot;,@     Otherwise, we output a '#'.