When I started Middlesex, I didn't know that the book would end up being anything like as long as it turned out to be. I did know, however, that I wanted to treat my hero, Cal Stephanides, in a new way. Traditionally, literary characters who change sex have been mythical figures such as Tiresias, or fanciful creations such as Virginia Woolf's Orlando. I wanted to write about a realistic person and be as accurate as I could with respect to the biological facts. Therefore, my first course of action was to spend time at the Columbia Medical School library, reading the surprisingly multiform varieties of "pseudo-hermaphroditism". The one I chose to use – 5 alpha-reductase deficiency syndrome – is distinguished by the dramatic physical shift that occurs in those affected. People born with the condition appear female at birth but then virilise at puberty. The salient fact of the syndrome is that it results from a recessive genetic mutation, occurring only among inbred populations in isolated regions of the globe. When I learned that, my conception of the book changed in an instant. Instead of a slim fictional autobiography of an intersex person, the novel would tell a much larger story, following the transmission of this mutated gene as it passes down through three generations of a Greek-American family. The story would begin in 1960, with the birth of my narrator. It would then go back to 1922 to tell the story of Cal's grandparents in Asia Minor, the Greco-Turkish war, and the burning of Smyrna. Finally, it would follow the gene across the ocean to America, where the recessive mutation would be inherited in turn by Cal's parents, until two copies ended up in Cal's own body, and he began to tell the story of his unusual life. The entire structure for the novel appeared in my head, fully formed, as ravishing as a crystal palace on a distant hill. I remember leaving the library that day, passing into the sunshine on the green, overwhelmed with the grandeur of this design and filled with a sense of personal magnificence, and this euphoria lasted for another minute until I realised that I had no idea how to write such a book.

First of all, I didn't know what kind of narrative voice to use. Should Cal, who'd grown up as Callie, sound like a woman or a man? And what, in fact, did that mean? Do women write differently than men? Some theorists claimed so, but I was dubious. I was living in Brooklyn at the time and, over the following year, I began experimenting with various possibilities, writing 50 pages in one voice, then starting over again with a different tone, only to abandon this attempt after 75 pages to begin the novel from a different angle entirely. In the end, I analysed my narrator the way a paediatric endocrinologist would. Cal possessed XY chromosomes. He was exposed to normal levels of testosterone in utero, neonatally, and at puberty. If it so happens that these things affect brain chemistry, and if this results in syntactic patterning that is recognisably masculine or feminine, then Cal might write the way a man would, in other words, like me. I didn't need to make him sound "feminine," "masculine, "or even "hermaphroditic". All I needed was to invent a voice that would be Cal's alone and, by using this voice, to tell a convincing story of his girlhood in Detroit.

This solved one problem, but others awaited me. I'd always known that I wanted to tell the book in the first-person. I wanted to be as intimate as possible about Cal's metamorphosis. I also wanted to avoid the pronominal ugliness of beginning a book with "she" and switching to "he" halfway through, or worse, the dreaded "s/he". "I" saved me from that. But here too I found limitations. The first-person was fine when I was describing events Cal had experienced personally, but when the book went back in time, and I had to present the lives of Cal's grandparents, the first-person voice walled me off from them.Try as I might, I couldn't animate Desdemona or Lefty. All I could do was describe them from the outside, and they became, as characters, static and lifeless.

My response was to throw out everything I'd done over the previous year and re-start the book, this time in the third-person. Soon I had a hundred pages of this new version. At that point, little by little, without telling myself what I was doing, I broke the rules and began to re-insert first-person narration into this third-person account, to combine both points of view, as needed. Cal was writing the story of his grandparents' lives in the first person, but whenever he needed to, he switched into third, giving himself access to Desdemona and Lefty's thoughts. To my surprise, the strategy worked.

It occurred to me that if you were born with a genetic condition like Cal's, your need to understand your peculiar fate might be so great as to compel you to break the bonds of ego in order to figure out why such a thing had happened. Cal's moments of omniscience, therefore, weren't merely handy from a narrative perspective; they proceeded from his character.

During this time, I moved from Brooklyn to Manhattan and then back to Brooklyn. I should have been making good progress with the book by now, but I wasn't. Even though I could now go into Desdemona and Lefty's heads, I still had qualms about the historical nature of their story. The problem was this: I dislike historical novels. Their omniscience strikes me as fraudulent. Who can know what the weather was like on a certain day in 1810, or what the mist looked like as it rose over the corpse-strewn battlefield at Appomattox? Conjuring the city of Smyrna in 1922, I couldn't help feeling that I was being insincere with the reader. And so, experimentally, I began to inject moments of self-reflexivity into Cal's narration. In asides, he confesses that he doesn't know everything that happened in 1922, that he's making it up. Cal is trying to be as truthful as possible but he's also embellishing his story because his need to write it outweighs his own qualms (and mine) as to the limits of his knowledge. And this, too, proceeds directly from his character.

As soon as I added this self-consciousness to Cal's voice, I stopped feeling as though I was pulling something over on the reader. The reader could decide to accept Cal's willed omniscience or not, but I had established my bona fides and was ready to move on. Finally, I had my voice, a voice that could switch between the first person and the third, that recounted historical events in a manner that admitted to a degree of artifice without being untruthful, that was capable of describing intimate, psychologically nuanced self-discoveries as well as epic events – a voice, in short, whose tone was the blend of mock epic, postmodernism and realism that I thought the proper literary hybrid for my hybridised hero.

A couple of years went by, while I flailed around like this. But one day I sat down at my desk and wrote the first page of Middlesex, 500 words that contained the DNA for the protein synthesis of the entire book. I still had a million things to figure out about the plot and the characters, but I had my voice, my tone, and I was on my way.