Nancy Cartwright has spent more than three decades immersed in the world of “The Simpsons” — first with “The Tracey Ullman Show” shorts, and then with the spinoff to its own franchise in 1989, as the voice of forever-10-year-old prankster Bart Simpson and a gaggle of other supporting characters. But it took Cartwright co-writing the 2017 independent film “In Search of Fellini,” which was loosely based on her own life, for the actress to consider penning an episode of the animated series.

“I never saw myself as a writer on the show, to be honest with you,” Cartwright tells Variety. “I wrote a book in 2000, [‘My Life as a 10-Year-Old Boy,’] but that was a memoir. To me, that was so easy to do, because that was my life. It’s not the same thing, with the structure of a three-act sitcom.”

But with “Fellini” under her belt, Cartwright decided to take the leap, and her episode, “Girl’s in the Band,” airs Mar. 31.

“I like the idea of challenging myself and getting out of my comfort zone,” she says. “Having been a voice, I’m trying things I’ve never done before as an artist, because I’ve got things to communicate. I’ve found in writing, I can do that. That’s what was the catalyst for writing this particular episode.”

In the episode, Lisa (voiced by Yeardley Smith) is recruited to join the Capitol City Philharmonic by a “Whiplash”-like conductor, played by guest star J.K. Simmons. But the trek to the neighboring town — and the costs associated with the group — takes its toll on everyone.

“The whole family gets involved with it, and there are a lot of sacrifices that are made to help her out,” Cartwright previews. “Any artist, I believe, you’re trying to communicate something. And in this case, with Lisa Simpson, if you watch the show, hopefully you will understand I’m trying to say there. What good is art if it doesn’t inspire people and make them feel good? That’s where I live. I want to make a difference.”

Here, Cartwright speaks with Variety about her experience in the writers’ room and how it’s reinvigorated her — on and off the series.

What led to penning an episode centered around Lisa, specifically?

This goes back to when I was a teenager: I was on the speech team back in Ohio and I would do these competitions. This was my background and playground of how to do voices. I would compete on the speech team, and I’d win; I’d win a lot. It was through the course of doing that, from the judges’ comments, [they said,] “You have an unusual voice. You should do cartoons for a living,” I realized, “Wow, I could actually do that.” It was really interesting. It never really occurred to me to do a show about Bart, because Lisa stood out. She is the middle child, she’s striving to be heard all of the time. She’s the voice of reason. To put her in a situation where she’s being artistically challenged, I thought that was something I could relate to. I took [my experience] and put it in the band room.

Since this came from your experience, how was the writing process handled? Did you sit in the traditional writers’ room or was it a bit more removed?

The first thing I did was write the script and then I turned it in. I was out of the country when they got together to start to work on my script. I was sad I wasn’t there for the first week, but I was reassured, don’t worry, it’ll be fine. [When I got back,] I sat down with them and saw the whole process. The first day I was there was the most revealing. I was introduced to this procedure. There are so many writers that some of the writers are in one room and the others are in a whole different building. Al Jean, who is brilliant and I trust so eminently, and as the showrunner, he’s going to be the guy making the decisions in that room. They go line by line, and when there’s a question, the writers were contributing an alternate line. I sat there, and it was pretty bizarre, because nobody was laughing except me. Gosh, if you’re the only one laughing in the room, pretty soon you don’t keep laughing. Then I thought, “I’m going to speak up, because I have an idea.” For my script! I threw out another line to replace my line. It didn’t get a laugh, and I said, “Well, I guess I’m officially a ‘Simpsons’ writer.” And obviously, I meant that lighthearted — and that got a huge laugh. So that’s how we did it. It was just exhausting. The conversation would weave in and out and then we’d get back to the subject, because it is highly, highly challenging on your mental creativity. From the very beginning, my eyes and ears were wide open. I don’t feel like I know it all. I feel like there’s a lot I can learn about this industry and life — and I know it. I’m grateful for the opportunity.

With more than 650 episodes produced before this, what steps did you have to take as a group to not repeat beats that had been done before?

They’re very aware of that. I don’t have to say anything; all of the writers are not wanting to duplicate and replicate anything that has been done before. Even I had an idea that was something similar that had been done before, but different enough that I thought it would be okay. It didn’t make the cut. And that’s fine! One thing, for sure, I learned, as a writer on the show: you cannot be precious with what you write. You have to be able to recognize anything can be cut. You can’t be attached to one thing or take it personal. That was really hard for me, to let it go. There are certain writers on the show I’m closer with, and I would talk with them, and they’d go, “No, no, no, it happens with everyone, Nancy. Your story is so brilliant and we’re going to make it even better. You just have to trust the process.” And I had to trust them — and I think I did a pretty good job — because ultimately, when I saw [the early version], I was like, wow, it’s evolving. It’s different. It’s my story, but better. My name is on the script, but I am so buffered by 20 writers. Any show that’s done on television, there is a writers’ room. It is definitely something I’ve never experienced before, and quite a privilege to be amongst those guys who do it day in and day out and been doing it as long as they’ve been doing it.

The show is still doing unique couch gags every episode. Was that something you were able to pen or is that done by someone else?

I wish I could claim that! I am responsible for the chalkboard message [during the theme song]. I’ve wanted to do [the chalkboard in the past], but I’m glad it never got done before now so I could use it for my episode. It’s kind of a throwback, that’s all I’ll say.

How has writing the episode impacted both your relationship to the show and the way you’ve approached voicing your characters?

I have so much more understanding of the whole process. It’s only when you can go in there and roll up your sleeves and sit down with the guys where this is their job…it gave me a better conceptual understanding of how much a collaborative process writing for television is. It was extraordinary. I cherish this experience; I thought it was amazing. And I’m changed forever now, because of that. I’ve got a couple of animated children’s shows I’m working on. I just finished writing a feature-length romantic comedy. It has boosted me and given me a whole different arena to play in.

What other writing are you currently working on?

I’m taking advantage of this new enlightenment I have from working on “The Simpsons.” I’ve got my own production company, Spotted Cow, and the first movie we did was “Fellini,” but now I’m putting some attention on television. “Rhea the Naked Birdie,” it’s not for primetime television, it’s for little guys. It’s such a cute little show, and I have a two-year-old granddaughter, so in the course of her being a baby, she’s going to get to see this show. It is based on this real-life love bird named Rhea. This young girl found her and took care of her. She worked at an animal sanctuary for animals who were broken, if you will, and she found this bird that didn’t have feathers. She took it to a special vet who [diagnosed her as not being able to grow feathers]; she was a naked little birdie. This little gal, Isabella, started video taping it and went viral. There were like 500,000 fans [of the real bird]. My co-producers found it and brought me into the game on it. Now we’re developing [it as a series] — I’m executive producing and doing voices. I’m wearing a lot of hats on it. It’s just really, really fun.

With the show already renewed for two more years, are you looking to pen another “Simpsons”?

I felt like it was maybe a little premature. [Laughs.] It definitely is something I will consider since we got two more years and a change of the guard. It’s something I can look at…[but] I’m also doing an updated version of “My Life as a 10-Year-Old Boy.” I have an art exhibition that will be happening some time in the fall; I’ve got about 30 pieces. I’m just being an artist. Whatever turns me on in terms of inspiring myself so I can hopefully inspire others, that’s where I put my attention.

“The Simpsons” airs Sundays at 8 p.m. on Fox.