He didn’t start deaf, he became deaf over time and still retained some hearing well into his 30s. He would have been able to hear partially up to his 5th symphony, and understand how an orchestra fit together so he could still compose 4 more.
At that point if you have a genius level musical theory background, use cues like feeling vibrations etc. and just kinda knowing what works from composing several he could likely practically hear it just by looking at the paper he was writing on.
It affected his work too though, his later symphonies definitely evolved.
Latest Answers