Earlier this year, Mac DeMarco locked himself inside his crammed home studio on Los Angeles’ east side for two weeks straight and made a record titled “Here Comes the Cowboy.”

The laid-back 29-year-old indie rocker, who is originally from Canada, did everything on his fourth studio album himself — he wrote the songs, sang them, played all the instruments, produced and mixed it. When DeMarco was all done he took the songs to the Coachella Music and Arts Festival in Indio (Riverside County), his third time, and played them for tens of thousands of people.

That’s just how he rolls.

Since putting out his independently released debut on CD-R, an EP called “Heat Wave” under the name Makeout Videotape, the gap-toothed musician’s simple tunes quickly outgrew the small stages that once held him. He has become a festival fixture, popping up onstage at places like the Bay Area’s own mega fests like Outside Lands and Treasure Island, cigarette in one hand and a beer in the other.

The Chronicle caught up with DeMarco at his L.A. home shortly before he set off on a headlining tour that will open at Gundlach Bundschu Winery in Sonoma on Tuesday, May 7, before taking him across the Western United States and Europe.

Q: You went from two weeks of complete isolation in your garage to playing your first set of live shows in support of “Here Comes the Cowboy” at Coachella. What was that like?

A: It’s funny because the last time we did it, it was exactly the same. It’s like, “Well, let’s try to play these songs in front of people.”

It’s a very interesting place to play new material for the very first time. It’s a pretty strange festival. Especially because I haven’t been on tour in a long time, there’s a weird pleasure in being backstage and seeing these people I have met and got to know but only see when I’m backstage.

Q: Do you fall into the usual work-from-home trappings? Like, if “Ferris Bueller’s Day Off” is on TV, will you stop everything to watch it?

A: No. If I’m trying to make something, everything else will get shut out. I get pretty locked in.

My girlfriend knocks every few hours to say, “Hey, you forgot to eat!” My hygiene becomes really poor. I develop some interesting smells. It’s a binge workflow. Some people have an issue of doing it at their home, but I really like it.

Q: Does the isolation make you socially awkward when you’re out in the real world?

A: You know what the funny thing is, I never had to leave. Everything can be delivered via cell phone. Even music gear. I would hop on Postmates or my girlfriend would call and check in and pick me up other amenities. I literally did not leave — at all — for two weeks.

Q: You play all the music yourself. Do you keep yourself organized with spreadsheets and stuff, or are you just all over the place?

A: It’s a process for me. I’ll do some version of the song in a quick manner before I go for the final version. It’s mapped out in my head.

The demo doesn’t have all the elements in it. I have a computer now, so you can save something and come back to it. It’s not like the old style. I miss the old style I used to do, in a way, where it’s like, “Well, that’s that. Now I’m doing a bit of this and that over there.”

Q: Do you work on your own because you’re a bad delegator, or do you have trust issues?

A: I just never really felt comfortable letting anyone else in. Making music for me is a pretty personal experience. It would be difficult to find someone to say, “Can you come to my house and sit in your underwear for a month straight and eat garbage?”

I don’t know, there’s something that comes out of doing your own thing in your own space. It gives the record a different feel. Most records these days have 20 songwriters and 900 different features and are recorded in 15 different studios. It’s almost refreshing to do it on my own.

Q: Since making your albums is such a personal experience, do you find it difficult to let your music go after the recording is finished?

A: There’s two sides to that. There is a certain stress, like, “Oh, boy, I made these weird songs and now I’m showing them to people.” It’s like, “Hey everybody, look at my diary!” I like to keep things relatable and vague. When they’re put out in the world, they don’t belong to me anymore. People can do want they want with them. It’s almost liberating.

Q: Why did you dress like a smoking cowboy lizard in the video for the single “Nobody”?

A: That’s just how I looked when I finished the record. I always wanted to do that sit-down-in-the-makeup-chair-for-hours level of dressing up. It turned out cool. The best part is we did the makeup for six to seven hours and shot the video in 20 minutes.

Q: Being on the road has been kind of rough for you in the past. How are you coping with the prospect of setting out on another long tour?

A: I still love it. I’ve been off the road long enough to be excited about it. The real trudging on the road comes once you’ve played the songs for a long time. Now we have a whole new album to do, so it feels fresh. It’s going to be great. We’re much more organized. I bring a little setup with me, and I can make things out there. It should be cool. We’re in a good space right now. It should be peaceful.

Q: You put your first release, a CD-R, out when you were living in Vancouver 10 years ago. What has been the best part of all this for you?

A: I don’t know. It’s always felt relatively similar to me. That CD-R that you’re talking about was really exciting because I was living in a new city and everybody was like, “Hey, who’s this mysterious new guy? This kid is cool.” That’s what got me hooked on doing this thing, having something I made and giving it to people and having people respond to it positively or negatively.

Q: You were considering studying early childhood education for a while. Do you think you would have made a good teacher?

A: Maybe. I don’t know. What’s really funny about that is I moved to Vancouver from my hometown and all my friends were in school. That was my gut reaction — “I should do this, too.” I thought, teachers get the summer off so that would be cool.

Who knows? It’s hard to say. I would have turned out to be a completely different person.

Q: All your albums are loosely about growing up. Do you feel like you’ve changed much?

A: I almost feel like I’ve regressed in a lot of ways. There was a certain version of me when things were popping off and even I thought, “Who the f— is this guy?” I’m more in tune with what I was like as a teenager or a kid now. I’m just doing me. I don’t really have a person who was a role model or idol. I’m playing a lot of video games like I did when I was a kid. I’m done being cool by being something I’m not. There are things who make you who you are. I’m done with pretending I’m something I’m not.

Q: You recently said you only listen to the Beatles and video game music from when you were a kid. Is that why your music sounds the way it does?

A: Yeah, I think so. I think they both hold the same torch. It’s masterful simplicity. Super Nintendo games especially — they can make a loop out of something that you can hear 9,000 times and it’s not annoying. It’s like making perfect scrambled eggs.

Mac DeMarco: 7 p.m. Tuesday, May 7. $65. Gundlach Bundschu Winery, Outdoor Amphitheater Stage, 2000 Denmark St., Sonoma. www.gunbun.com; 8:30 p.m. May 16. Sold out. Ace of Spades, 1417 R St., Sacramento. www.aceofspadessac.com; 8 p.m. May 18. $39.50. Bill Graham Civic, 99 Grove St., S.F. billgrahamcivic.com; 9 p.m. May 19. $55.99-$60.99. The Catalyst, 1011 Pacific Ave., Santa Cruz. www.catalystclub.com; 7 p.m. May 20. $150-$600. Henry Miller Memorial Library, 48603 Highway 1, Big Sur. www.folkyeah.com

Related articles

Pop Quiz: Jessica Pratt on the secret to creating your own musical universe

Pop Quiz: Rocker Kurt Vile on balancing ambition and weirdness

Pop Quiz: How Beach House got permission to make a weird-sounding record

Pop Quiz: Soccer Mommy’s Sophie Allison on bringing lo-fi songs to big stages