Denis Leary (“Rescue Me”) returns to FX July 16 with raunchy comedy “Sex & Drugs & Rock & Roll,” in which he plays an egomaniacal fiftysomething has-been musician, vying for the limelight. Leary created the show, exec produces and stars as Johnny Rock. And he wrote the music.

Johnny Rock is a very different character for you. Who did you look to for inspiration?
He’s what happens when David Bowie meets Joe Strummer, in his own mind. In the end, Johnny needs to be his own guy, but I think it’s a combination of Bowie, Sting and also a bit of Mick Jagger.

All of the music is shot live. Why is that?
I think the audience knows. They can tell when you’re lip syncing. I’m not a great singer, but I can scream and I’ve certainly performed the “A–hole” song enough over the years, but I really needed a girl who can sing and can do it live and we found [former Nickelodeon star] Liz Gillies and we were just like, ‘Oh my god.’ If this show works, it’s because of her. It’s really all about her.

Why is Liz Gillies such a star?
She’s gonna be huge. Not only is she a terrific singer, but I asked her to do comedy and drama and to be able to improvise and she pulled all of it off.

What’s the dynamic like between your character and her character, playing your daughter?
Just like the character on the show, I think Gigi [Gillies] acts older than Johnny Rock does. In real life, she’s like 21 going on 40, and I’m like 58 going on 15. So that dynamic was there in real life and it worked great on screen, I think.

There are a lot of popular music shows today. Do you think this could also take off on iTunes?
I certainly don’t think we’re going to be surprised if Liz Gillies sells a lot of songs. She’s really got it. The one ingredient that we have that nobody else has is comic music. There are about five or six songs that are really funny.

The first season features Dave Grohl and Joan Jett. Any dream guest stars, if you get a second season?
If we got picked up, I’d love to write an episode with David Bowie as a guest star and I’d love to write one with Sting because obviously, those guys would be able to pull it off, and I think Johnny would be hilarious. Those guys would be terrific. I’d love to get Bon Jovi on because my girlfriend in the show has such a thing for Bon Jovi, it would be hilarious to have him on. We have to keep our fingers crossed first that the show works.

Why do you think this is a risky show that may not work?
You never know. I’m a true Irishman — an optimistic pessimist. That way, you’re always prepared for the worst.

And why do you think it could work?
You can have a great scene, but the thing that makes it unforgettable is unforgettable actors. This group, I’ve got to be honest with you, they gave me everything I needed. They were all able to improvise and they flushed the characters out from day one. Liz, she’s unbelievable, I feel like I can write anything for her. John Corbett was a dream that I thought I would never get. To me, I would love to be able to work with these people for the next five or seven years.

You wear a lot of hats. What’s most challenging and rewarding?
The music, because I have to write the songs in advance … so it adds an extra month to the schedule. But at the same time, there’s nothing more rewarding than hearing songs work.