Kendrick Lamar is always moving forward. The Compton rhymer has made each of his studio albums sound different from its predecessor: Section.80 is smooth, almost Southern at times, and jazz-influenced. His major label debut, Good Kid M.A.A.D. City, added conceptual depth and narrative to a West Coast-tinged version of mainstream rap. To Pimp a Butterfly mixed jazz, funk, spoken word, blues, and other genres from the black diaspora to make one of the most musically rich rap albums of all time. His latest record, Damn, is a more back-to-basics project, with a contemporary sound boosted by a left-of-center pop sensibility and proven mainstream producers like Mike Will Made-It.

Los Angeles producer/musician Terrace Martin has been alongside Kendrick the whole time. He produced songs on each of those albums, including the lion’s share of To Pimp a Butterfly with Robert Glasper, Thundercat, and others. He only has one song on Damn—“Loyalty,” a silky collaboration with Rihanna—but it has the potential to be the album’s biggest hit. Martin has built a strong career outside of K-Dot, with his own album Velvet Portraits earning a Grammy nomination, and everyone from Stevie Wonder to Snoop Dogg enlisting his services. In a conversation with Complex, Martin talked about their future smash with Rihanna, the decision to make Damn a contemporary rap album, and what Kendrick has in common with Herbie Hancock.

You worked on “Loyalty” with DJ Dahi. How did that song come together?
I was actually in the process of working on a few other different records than I normally do. I was in the process of working on the Polly Seeds (a band signed to his label, Sounds of Crenshaw) record, then my record. Me and 9th Wonder work closely together on everything each other do, so 9th Wonder sent me a record like, “Yo, I want this record to be with Rapsody.” I said, who did this beat? Khrysis had did this beat, and Khrysis had a Bruno Mars sample in the beat. I heard the sample and I was like, That would be cool, that’s a nice little sample. I kept it to the family, but I was like, I want to make that different. I took it, sped it up. and slowed it down a million times. I replayed it about five times, and I kept doing stuff. Then I brought it to Kendrick and said “Yo, I’ve got an idea for a song.” He said, “Come by the studio.” Dahi was there, we did the record that day. Sounwave walked in, he did what he did to it. It was like a seven-day party extravaganza. Dahi messed with it, and we kept going back and forth like playing flag football or some shit. A group effort amongst brothers and honorable musicians.

The record had Rihanna on it. Where did the idea to get her on the song come from?
Yeah, that was fun, really fun. Dot said that’s what he wanted. He said, “This would be crazy if Rihanna was on it.” And then lo and behold, all the stars aligned and it happened.

The song had Rihanna in a way we don’t hear her, with her and Kendrick spitting back and forth. Was that the idea off the top?
I think it just morphed into that. I don’t think none of us look at—some things you kind of have a plan, you have a road map. Just like in life, every time you plan something, some things go as planned, but most of the great things in your life probably didn’t go as planned if you really think about it. That kind of thing just happened, where that’s where the energy was going, Kendrick being the amazing artist that he is and Rihanna being who she is, that energy just came together with that palette of music.

I do know, the only conscious thing we always think about is to not do something that’s been heard before, and not do something that’s been done before—at least by us, I think that we can remember. Once the record comes out, the record belongs to the people anyway. So our thing is just try to provide a moment, the same moment that we feel as we write these songs, no matter who we work with or what we do.

On Butterfly, you were all over it, and you’re only credited on “Loyalty” here. Did you work on other songs that you weren’t credited on?
Nope. I would come by the studio of course, and hang out every day. But I was only involved in that song. The last record I was involved a lot, this record I was involved in one particular special song. But spiritually, vibing and supporting my brothers. And just being a fan, sitting back for a minute, learning from other producers and learning from other songwriters. I was able to sit back and do one record with Rihanna, got to hang out, and really just observe. It was a blessing just to be there and see some of the magical things that went down with DJ Dahi and Sounwave, some of the magical moments of that album. To say, as a fan, “Whoa.”

Do you think that prompted the decision for Kendrick to do a contemporary rap album? The idea of doing something that he hadn’t done before? Or do you think there was more of a mission?
I think always wanting to be different has prompted all of us, from the time we started wanting to do music. So there’s no one album that sounds like another album, no matter what we do. With this situation, it was just thing where OK, we did Section.80, we did Good Kid M.A.A.D. City, we did To Pimp a Butterfly. Now, let’s just do something different. Every chapter is a different chapter in the book. I think it happens naturally, the way we just discuss things we did in the past and move on, because life moves on.

I can’t give you the scientific reason for why this album came to be, all I can give you is the root and point of direction. Every time we do a new album, we start at the point of direction and find the route. This is just another route to take. Any time I’m working on my records, or anyone else I’m producing, my whole thing is, let me do something I haven’t done. We all have that in common, and that’s why we’re loyal to each other.

After this, where do you think Kendrick is going next?
Shit, I don’t know. Forward, though. He’s going forward. To me, he is a leader of forward-moving art right now. There’s many leaders, but he is one of the top leaders to me, of pushing art further in the right direction. I know it’s going to be forward, and I’m with him till the wheels fall off.

A few months ago I spoke to Robert Glasper, and he said you guys were working on Herbie Hancock’s next album, and that you formed a trio with James Fauntleroy. What is it like to work with Herbie Hancock, and how would you compare that to working with Kendrick?
Working with Herbie is amazing, in a few different ways. He’s such a great person, and he’s such an icon, with all this information. And he’s so giving, he’ll give you all the information, whatever you want to know.

It’s different, and the same. It’s different because...shit. [Pauses.] The only difference is age. One is seventy-something, one is twenty-something. Because they’re both artists still pushing the lines, and every record sounds different, and you can hear the growth from the last record with every record. Herbie has records since the ‘60s. But every record of Herbie’s, you hear the growth. Every record with Kendrick, you hear the growth. I feel in my spirit that Kendrick will be around here to see the day that Herbie saw as well in his career.

Of course, Herbie has done more monumental things, and broken way more barriers. But I definitely see Kendrick in the making of a legend, because he has the support of the greats like Herbie. I took Kendrick to Herbie’s house, and we spent all day together talking about life, about music, about where different things go, about love and everything. It was great seeing me, Herbie, Kendrick, and Sounwave in one room, talking about everything. About life, our views on music. Then me and Sounwave chopping up a beat for Herbie, when Kendrick is sitting there vibing out. We walk into the room, no one is no different age. Everybody is the same age. It’s just love. The same thing when it was me, Pharrell and Herbie in the room. These are two giants, and I’m sitting there, and we’re all writing music together, but it’s like yo, this is just having a conversation.

the only conscious thing we always think about is to not do something that’s been heard before

With Damn, two issues got a lot of people talking. Some people thought Kendrick was dissing Big Sean, and then another group of people had conspiracy theories that Kendrick was putting out another album. As far as dissing Sean, does stuff like that ever come up in the studio?
We don’t bring up other artists in our sessions at all. [Laughs.] Except John Coltrane, Kurupt, 2Pac, Snoop, Dr. Dre. We all tell each other stories of the hood, and we find out one of the homies got shot where we come from. So our sessions are a little bit different. We never talk about other rappers at all. We talk about life shit, and just keep pressing. We aren’t even thinking about them, honestly. I don’t think so. I’m not. And honestly, hey man, who knows.

When the rumors were out there about another album to drop on Easter Sunday, what was your reaction?
I’m a Beatles fan, and there’s a lot of conspiracies based on the Beatles and other shit. A part of me is like, “Man that’s just crazy.” And then the other part is, shit, Kendrick may go to bed and may say, “Hey.” I don’t know. We have a lot of music. We’re always recording, we’re always ready. That’s a Kendrick question right there.

This past year you were nominated for your first solo Grammy. So many know you from making other artists’ work better. What’s it like to get that recognition as a solo artist?
It’s a great feeling to me. The best thing about that nomination was, it was cool to be recognized against all these other giants, and my peers. I get to go to the Grammys and sit back and watch the queen Lalah Hathaway take home a few. Watch my dear friend BJ the Chicago Kid, we came up together. Watch Anderson .Paak. Watch KING. It was such a beautiful thing. It was dope, man. It was dope letting people know that you could be a true independent label, and get to a major situation. It brings awareness. I want to make sure I’m spreading the word of my music, which is spreading the word of love. That’s my only goal. So it was a huge honor being part of the Grammys this year. I hope to keep on going back. It’s always a fun event at the Grammys.

But, but, but. You have to write this. The Grammys aren’t mine, or any of the crew’s, drive to create music that will help lives out. It has nothing to do with that. The Grammys is not the push for that. It’s great to get accolades, it’s great to be recognized, and it’s beautiful to be heard. But once you sign up to be a true artist, it’s something to do till the day you die, whether they love you or they don’t love you. But it’s fun to be loved. We do appreciate the Grammys, as much as we appreciate people that step to the police when they march in Baltimore. We appreciate everybody else as much as we appreciate if we can stop a kid from committing suicide and we can save a life, or we can inspire a single parent to keep on going, and we can inspire young kids from all different walks of life to keep on going. We can really target the black community, and put self-love in us, so we can try to kill the spirit of self-hate. Those situations are a lot more important. But we do appreciate the Grammys.