His parents own hundreds of Broadway cast albums; his mother blasted “Camelot” in the car and his father is obsessed with “The Unsinkable Molly Brown.”

His school bus driver had a passion for rap, drilling him in lyrics by Boogie Down Productions, Geto Boys and the Sugarhill Gang.

In the Venn diagram of contemporary music, hip-hop and musical theater have little overlap, but that is the space in which Lin-Manuel Miranda lives, the space that birthed the new hit musical, “Hamilton,” which opened last week to some of the strongest reviews in years.

The story of “Hamilton,” as is now well known, was inspired by a best-selling biography, “Alexander Hamilton,” written by the historian Ron Chernow. But the music of “Hamilton” is a product of Mr. Miranda’s own polyglot palate, shaped by the listening habits of his family and his friends, and the sounds of his neighborhood and his generation.