Whoa Derr!

A man who allegedly threatened to shoot Ne-Yo in the head was detained for a psychiatric evaluation in L.A. ... and top ranking execs at Sony Music believe they are also on the hit list.

Sony Music Entertainment has just obtained a temporary restraining order against Jeff Choi -- who allegedly has been making deranged, escalating threats for months ... because he believes the music company released several songs ABOUT HIM without permission.

 
According to court docs, Choi believes Ne-Yo, Sony honcho Clive Davis and Sony CFO Kevin Kelleher are all to blame ... and he's made threats to "shoot people in the head" unless Sony pays him $800,000.

Currently a temporary ban on  Choi --- stopping him from going near the Sony offices and requiring him to stay 100 yards away from Davis and Kelleher.

The court will determine whether to extend the restraining order on Sept. 28.