Ok, I need some clarification here, and with your background, I think you might be able to solve my confusion. So, is it seNpai, or seMpai?
I’m probably the worst person to ask this to, because I’ll give you the answer that you don’t want to hear: it’s neither and both at the same time.
The phrase in question is: 先輩、or せんぱい。Romanized, you would have se-n-pa-i, according to most teachers of the language.
This is where language teaching fails miserably.
Do you see that ん? The “n” letter in there? That’s not really an n sound. That’s what’s called a moraic nasal, which basically means that it’s a nasal sound that takes up a syllable on its own (note, this is NOT a precise definition, but if you want to know more, look into syllable vs. mora). Just to confuse you further, it’s not even produced in the same place as an n sound. It’s a uvular nasal (note, that this is disputed by scholars as to what the base sound actually is, but that’s irrelevant for this discussion).
What should you take away from the last paragraph? ん =/= n. They’re not the same thing. To English speakers, who don’t have uvular sounds in their inventory, it sounds like an “n”, so that’s what it’s taught as, and because there’s no letter in the English alphabet that can represent it, it becomes “n”.
So, that should be it, right? It should be “senpai”?
It’s not that simple. See, when you hear a native speaker saying it, what do they say? “Sempai”. Seriously, I’m not joking. Go listen to someone native saying it. No one says “senpai”. It’s “sempai”.
This is because of assimilation (place assimilation, for those of you fellow Linguists). You make a “p” sound with your lips (voiceless bilabial stop), and so in order to exert the least amount of work when you speak, you move the nasal to the lips (bilabial nasal, or “m”).
Assimilation is pretty common in languages. Want an example? In English, we have the prefix “in-”, which means “not”. So, to say that something is not possible, we get:
in- + possible –> impossible
Almost the same change, different language.
So, final verdict? I will always write it as “sempai”. For one, we don’t write “inpossible”. Secondly, sticking to romanization rules is kind of asinine for various reasons when it comes to phonemes which don’t exist in the target language (which I will illustrate if it gets asked, but I’ll refrain from my rant for now), and thirdly, it makes it easier to learn the proper pronunciation. That being said, you’re not wrong if you write “senpai”.
tl;dr? Write it whichever way you want and tell the people who are trying to reinforce their prescriptive English to shove off.