BASEBALL and music have a long history together, as evidenced by “Take Me Out to the Ballgame,” “Damn Yankees,” “There Used to Be a Ballpark” and “Talkin’ Baseball” — not to mention the novelty songs played in stadiums during the seventh inning stretch, like “Lazy Mary” at Citi Field, home of the New York Mets.

The Houston Astros looked to that heritage during the 2012 season, when the team borrowed from “Take Me Out to the Ballgame” for its marketing efforts. The campaign, which carried the theme “Root. Root. Root.” was meant to rally fans after 2011, when the team finished in the cellar of the National League Central Division with 56 wins and 106 losses — a .346 win-loss percentage, its worst since joining the league in 1962.

The “Root. Root. Root.” campaign proved popular, although the Astros finished last in the division again with an even worse win-loss record: 55 wins and 107 losses, a .340 percentage.

Now, in getting ready for the 2013 season — when the team plans a number of major changes, including a switch to the American League — a second song is providing inspiration for the Astros’ advertising. Although the tune is not baseball-related, it is safe to say that fans know it: “Deep in the Heart of Texas,” often referred to jocularly as the Texas national anthem, is played during the seventh inning stretch at the Astros’ ballpark, Minute Maid Park, after “Take Me Out to the Ballgame.”