A couple of months ahead of the premiere of “Matlock” on CBS, I went back and revisited episodes of the original legal drama starring Andy Griffith. It ran from 1986 to 1995 and its case-of-the-week structure still makes for easy viewing all these years later. A funny thing I noticed as I made my way through its nine seasons: I wasn’t compelled to fast-forward through the opening credits. It’s such a great jazz melody. I wanted to hear it every time.

The new “Matlock” doesn’t have a theme song. Few shows these days do.

Often, the opening credits have been reduced down to a title card and maybe a few bars of music. There’s no time for a theme song, which can — or at least used to — do important subconscious work of re-introducing you to the world of a show.

Maybe network TV executives think main titles are a waste of real estate that could be better sold to advertisers. On streaming platforms, maybe there’s data showing viewers hit the “skip intro” more often than not. But the trend of abandoning theme songs actually predates streaming. As early as 2006, The Associated Press ran a story with a headline riffing on a lyric from “The Brady Bunch” opening credits: “Here’s the story … of the dying TV theme song.”

This isn’t a new phenomenon, but I was struck by a cognitive dissonance that defined the Emmy broadcast earlier this year. Paying homage to shows from decades past, theme songs from old favorites were heard throughout the night, including the theme from “Hill Street Blues” — one of the best melodies to come out of Hollywood, courtesy of Mike Post — and it was just a reminder that so many current shows have given up on this altogether.

As a composer, Post’s career has made him a ubiquitous presence on television. His resume includes “Law & Order,” “The Rockford Files,” “Quantum Leap,” “The A-Team,” “Magnum P.I.,” “ChiPs,” “The Greatest American Hero,” “Doogie Howser M.D.” and “NewsRadio,” to name a few.

His approach, he told me, is to “write a memorable signature for the whole show that’ll tell you, in an artistic way, what the show is.”

Is it crass to think of the theme song as another way to brand a show for viewers? “It’s not crass at all, it’s 100% correct. It is branding. You could be in the other room and when you hear the opening credits, you know it’s ‘Law & Order’ — let’s go!”

Even as shows have moved away from main titles, there are outliers. The restless sweeping and punching of Nicholas Britell’s piano melody for HBO’s “Succession” and Siddhartha Khosla’s plinking-meditative theme for “Only Murders in the Building,” with a melody that twirls and twirls like a spinning top. Both are gorgeous pieces of music that also feel indelibly connected to their respective shows and make the viewing experience that much richer.

But by and large, it can feel like theme songs are becoming a lost art.

The “Matlock” theme was composed by Dick DeBenedictis, who told me he was inspired by the show’s star. “Andy Griffith personified the South and the idiosyncrasies we associate with that, so I thought I would try to write a theme that would encompass him as well as the mystery and the tension of the show.”

DeBenedictis had a long working relationship with the show’s creator, Dean Hargrove.

“It wasn’t even a decision when it came time for ‘Matlock,’ it was just automatic,” Hargrove told me. “He’s a marvelous pianist and I really liked his work. He’s very inventive and he has a warmth to the stuff that he does, as well as a sense of humor. We didn’t want the theme to be heavy and melodramatic, like ‘Perry Mason.’ So he did the theme and I loved it. Right out of the box I thought, this is as good as it gets.”

Sometimes theme songs explain the show’s origin story, from “Gilligan’s Island” (by George Wyle and Sherwood Schwartz) to “The Beverly Hillbillies” (by Paul Henning) to “The Jeffersons” (by Jeff Barry and Ja’Net DuBois, the latter of whom sang the theme song; she also played Willona on the show) to “The Nanny” (by Ann Hampton Callaway).

Whatever the approach, lyrics or no lyrics, the best main titles get you in the right headspace. Ramin Djawadi’s rousing, high-stakes drama and majestic strings of the “Game of Thrones” theme felt as important to the show’s success as anything that transpired in any given episode. But I also like the counterintuitive approach for comedies, like John Sebastian’s wistful theme for “Welcome Back, Kotter” or the slinky, bass-heavy melody Jack Elliott composed for “Night Court.”

The right theme song can make it feel like you’re “connecting you with an old dear friend,” said Post. “When you heard the opening to ‘Cheers’ (by Gary Portnoy and Judy Hart-Angelo), you just smiled because you were comfortable and you could count on it to make you forget about whatever was on your mind.”

There’s a reason theme songs existed in the first place. Music serves an important psychological function and plays a role in our emotional investment in a show. It also extends a show’s emotional pull on us long after we’ve watched, so that the song — but also the show itself — becomes part of the pop cultural fabric.

Theme songs can be so powerful that they permeate our consciousness even if we haven’t watched the show. I don’t think I’ve seen a single episode of “Bonanza,” the Western that ran from 1959 to 1973, but I know its rolling, galloping theme song (by Jay Livingston and Raymond Evans).

But I also like it when theme songs are just weird. I was rewatching “The Practice” not long ago and its distinctive theme song (from Tom Hiel and Peter Scaturro) is less a melody but a crash of sounds banging up against each other, as if someone had knocked over an aluminum trash can labeled “city sounds” — sirens and car horns honking over a crash of drums and saxophone riffs.

Creative people spent decades figuring out how to get audiences engaged. There’s never just one way to do that and things will always change. But when you toss away so many tried-and-true elements (like theme songs), and then add in so many other complications that make building an audience more challenging (like short seasons and fewer renewals), you’re giving viewers fewer reasons to care.

For “Law & Order,” creator Dick Wolf told Post he wanted something “sort of cold and a little backed off, emotionally, but I want something slick, like New York.”

Post is not only responsible for all the music on “Law & Order,” but he also came up with the distinctive chung-chung sound that introduces a new scene.

“When the pilot to the original ‘Law & Order’ was made, I scored the episode and then he called me and he said, ‘I need a favor. I’m going to date-stamp and identify scene changes.’ And I said, ‘That’s a good idea, I like that. It’s different, nobody’s doing that.’

“And he said, ‘I need a sound to go with it.’ I said, ‘Terrific, congratulations — call sound effects. I’m your (expletive) composer, why are you calling me?’

“So it took me four or five hours. I sampled a bunch of drums in my studio and then I accessed the sound of a jail door slamming and then another sample of a guy hitting an anvil with a hammer, and then another sample of men stomping on a wood floor. So I sent it over and he called me and he goes, ‘Man, that is exactly what I was hoping for.’

“A year later, Dick sends me a note: ‘At the end of your life, you’re going to be best known for two notes that aren’t even notes and that you didn’t even want to do. You’re an idiot. Chung-chung.’ ”