It is definitely at least part genetic. I have perfect pitch. Actually, there's no such thing, without a reference tuning e.g. concert pitch to work to. A isn't A to everyone at every time and in every culture. I never understood Yngwie Malmsteen - who professes to have perfect pitch - and deliberately detunes his guitar from E to Eb - the guy even wrote a concerto for Electric Guitar and Orchestra in Eb Minor. WHY! I suppose he *had* to, since he never tunes to E, but most people wouldn't have known any different.
Perfect/Absolute pitch is a curse. I once sang solo at Durham Cathedral where the organ is quite sharp in pitch. I couldn't follow the music, it was as if every note was between two other notes and I couldn't discern the actual pitch. I once spent a very rainy August vacation in Scotland with only a very, very flat upright grand for company. For several days, I could barely play it as to me, every C was Bb etc etc. After a while I became accustomed to it but had to re-program myself to concert pitch when I returned home.
(This one time, at band camp...)
Also it is a nightmare singing unaccompanied with a choir, as most people's sense of pitch will drift and if you have "perfect pitch" you constantly feel yourself trying to correct the choir's tuning. A conductor I once sang under had the organist transpose the Harwood in Ab canticles into A - at sight - because he said flat keys caused flat singing.
To me, every key has a "flavour" even though in theory we're working with equal temperament and they shouldn't. Single notes to me sound like they have particular moods. I can't easily play in something like Werckmeister III as I find it excruciating in the "remote" keys, which I suppose is the point, or anti-point.
I say it is partly genetic because my mother has it (demonstrably) and doesn't play an instrument or even read music. She can sing jingles and TV signature tunes perfectly in key before they start on the TV.
I also don't think *everyone* can be taught it, even if they are extremely musical/have a high level of exposure to playing music. My Stepdad is constantly immersed in Beethoven and Bach but his tuning when playing Violin is quite approximate. I really do think he's blissfully unaware of the "problem"
I say *partly* genetic because I think exposure to music and a "musical memory" are also very important. I think my "note flavours" are partly due to remembering fragments of music where chordal voicings give individuality to separate notes. It is as if I "remember" notes with a "history" behind them. Beto-Music thinks he's odd. I doubt he's as odd as I am. I can't "do" background music, I can't concentrate with even the TV on in the background. Music is to be enjoyed, not used to conceal silence
Best//Neil