Murder accused Andrew Innes gave three separate accounts of how he killed Bennylyn Burke three times, jurors have heard.
The software engineer and Aberdeen University graduate initially said he defended himself when she attacked him with a sushi knife.
He later told a psychologist he heard a voice in his head, asking him to kill her.
This week, the 52-year-old told a jury at his trial he struck her with a lump hammer, then stabbed her with a sword after she appeared to transform into a hybrid of his wife and a woman he had an affair with.
Innes admits killing Mrs Burke and her two-year-old daughter Jellica but claims he acted with diminished responsibility.
His lawyers say he lacked criminal responsibility for the alleged murders.
He is further accused of raping and sexually assaulting a primary-age girl at his Troon Avenue Home.
And he faces allegations he attempted to defeat the ends of justice by – among other acts – burying the bodies of Mrs Burke, 25, and Jellica in rubble sacks under his kitchen.
He denies all charges.
A kind of entity
On the fourth day of the trial at the High Court in Edinburgh, consultant psychiatrist Dr Gordon Cowan said he had met Innes several times.
He said: “It is clear that Mr Innes held resentment to his ex-partners and the lady in front of him reminded him of these ladies and he became uncontrollably angry at her.
Dr Cowan said: “When he was first asked about it, he said he was defending himself from attack.
“He then spoke of an internal monologue with a voice, a kind of entity, advising him to hurt the woman.”
The court heard Innes told a previous psychologist: “I think the other guy wanted me to get angry and he was asking me to kill her.
“I said: ‘Don’t be stupid, she’s done nothing wrong.'”
Dr Cowan said Innes latterly spoke about the hybrid “vision”.
Psychotic behaviour?
The trial heard Innes took a double dose of prescription steroid medication before he killed Mrs Burke on February 21 2021.
Defence advocate Brian McConnachie KC asked if his client’s behaviour could have been as a result of steroid-induced psychosis.
Dr Cowan pointed out prior to the killing, Innes had gone out to get petrol and shopped at B&Q.
“If someone is so floridly psychotic that they were exhibiting hallucinations and delusions and that they were acting so erratically and disordered that they were killing people then no, they would not be going around doing their day-to-day business without anyone noticing.
“It does not fit in with the account of florid psychosis.
“It does not fit in with the crime.”
Dr Cowan said, in his view, there was no evidence to support acquittal due to mental disorder, if he was found to have perpetrated the offences.
He added: “I am not of the opinion that his actions were indicative of mental disorder.”
Dr Cowan said his findings did not support the claim Innes acted with diminished responsibility.
The trial, before judge Lord Beckett, adjourned until Monday.