The moment of inspiration for Geraldine Brooks’s new novel, The Secret Chord, occurred about 10 years ago, when her son Nathaniel told his parents he wanted to learn to play the harp.

“This was unexpected,” the Pulitzer-Prize-winning author told a standing-room-only crowd on Wednesday night at State Road Restaurant. Nine-year-old boys don’t usually suddenly decide to play the harp. But it was while watching her son play, during those early lessons, that something shifted in her mind and “threw me into a reverie about that other boy harpist, David.”

Ms. Brooks realized she knew nothing really about the character of David from the Bible, other than perhaps his fight with Goliath. So she read the Bible and discovered, “everything happened to him. Every good thing. Every terrible thing. He’s the first man we know from soup to nuts — from child to terrible father and then redeemed in old age.”

And then she was hooked.

Ms. Brooks often works in the genre of historical fiction. People of the Book used a rare illuminated Hebrew manuscript to provide the motor for a journey through five centuries, from medieval Spain to the Inquisition to Naziism in Sarajevo. March, which won a Pulitzer in 2006, focused on the American Civil War, and Caleb’s Crossing told the story of a Wampanoag man from Martha’s Vineyard who was the first Native American to graduate from Harvard.

But The Secret Chord proved to be an even tougher challenge. Usually, she said, a book of historical fiction has guideposts to follow, moving “fact by fact.” But when digging about in the second Iron Age “you don’t get a lot of handholds. You’re lucky if you get a potsherd.”

The Secret Chord will be published by Viking this fall, and Ms. Brooks said she had “finished, finished the book only a week ago.” Those at the State Road Speakeasy event, which was a benefit for the West Tisbury Free Public Library, received a sneak preview, the first public reading in fact.

Ms. Brooks welcomed friends from down the road and across the country, and then “with fear and trembling” began to read from her novel. But there was nothing to fear. Ms. Brooks said that she can’t start writing a book until she has the voice down. “I have to wait until someone rises out of the grave and starts to talk to me.” The voice that carries this novel is Nathan, a prophet who is not afraid to “tell the king that he sucks.”

Ms. Brooks read a scene from her novel when the two men meet, when Nathan is still a boy, that ends with the death of Nathan’s father at the hands of David and his men. The dining room at State Road, completely full and completely silent, was transported back in time, with very secure handholds, to a desert battlefield in the Age of Iron.

After the reading, Ms. Brooks was asked about her research and what she drew on for inspiration. For People of the Book, she was able to tap into her time as a war correspondent for the Wall Street Journal, she said. She covered Sarajevo during the war there, when the reporters all stayed at the Holiday Inn, “but no one asked for a room with a view,” for fear of sniper fire. And when she conjured up a lepidopterist as a character in that book, she spent time at Harvard studying the butterfly collections of Vladimir Nabokov.

For The Secret Chord she traveled to Israel with her youngest son Bizu. And because so many leaders in the Bible started as shepherds, together they herded goats and sheep in the desert. “Which is really hard until you understand the nature of sheep and goats under stress,” she said. “Sheep cluster, goats scatter.” It was good training for leading people, the key to which is understanding their nature, she said.

And although the landscape of the country had changed over the centuries, Ms. Brooks was able to look out over the actual sites of former battlefields. “There are certain similarities to all battlefields,” she said. “The way they smell, what bodies look like. Unfortunately, I have 10 years of experience with that.”

The Secret Chord takes its title from the Leonard Cohen song Hallelujah which begins:

Now I’ve heard there was a secret chord that David played, and it pleased the Lord. But you don’t really care for music, do you? It goes like this. The fourth, the fifth, the minor fall, the major lift, the baffled king composing Hallelujah. Hallelujah. Hallelujah. Hallelujah. Hallelujah.

The Secret Chord will be available in bookstores on Oct. 6.