Mozart, Bach, and Beethoven were able to precisely identify musical notes and there is certainly a genetic component to music like there is math or sprinting - while anyone can be functional with practice being truly great may take biology. Perfect (absolute) pitch is rare, even among expert musicians, and the relative contribution of genetics and experience to this ability remains debated.
To try and determine how much was nature versus nurture, researchers compared auditory cortex structure and activity of three groups of 20 participants, including musicians with perfect pitch, musicians of similar musical expertise who lack perfect pitch, and a control group of individuals with minimal musical training.
Population receptive field (pRF) maps of tonotopy (center frequency) and tuning sharpness (Q) in auditory cortex in representative subjects from each group. Credit: McKetton et al., JNeurosci (2019)
They found that the musicians with absolute pitch had a significantly larger auditory cortex capable of representing distinct tones without a reference note.
The study is too small to be more than a datapoint but it does suggest perfect pitch may be more strongly under genetic control than previously thought, given that nearly one quarter of the musicians with absolute pitch report they did not begin musical training until adolescence.