In the darkest moments of a family tragedy, when the playwright Mona Pirnot couldn’t find the strength to verbalize her feelings to her boyfriend or her therapist, she tried something a little unorthodox: She typed her thoughts into her laptop, and prompted a text-to-speech program to voice them aloud.

It was a coping mechanism that also sparked a creative pivot: Pirnot’s then-boyfriend, now-husband, Lucas Hnath, is also a playwright, with a longtime interest in sound and a more recent history of building shows around disembodied voices. His last play, “A Simulacrum,” featured a magician re-creating his side of a conversation with Hnath, whose voice was heard via a tape recording; and his play before that, “Dana H.,” featured an actress lip-syncing interviews in which the playwright’s mother recounted the trauma of having been abducted.

Now Hnath is directing Pirnot, who wrote and is the lone actor in “I Love You So Much I Could Die,” a diaristic exploration of how she was affected by a life-altering incident that incapacitated her sister at the start of the pandemic. In the 65-minute show, in previews Off Broadway at New York Theater Workshop, Pirnot sits on a ladderback chair, facing away from the audience, while a Microsoft text-to-speech program reads her lines. Between chapters of storytelling, Pirnot plays the guitar and sings songs that she wrote.

The computer’s voice is male, robotic, and, of course, unemotional; its cadence, and the length of pauses, varies based on how Pirnot and Hnath have punctuated the text. The program makes occasional mistakes — a running joke concerns the pronunciation of Shia LaBeouf — that the artists cherish. Hearing a machine recount stories of very human pain can be awkwardly funny, and audiences are laughing, particularly early in the show, as they adjust to the disorienting experience.

“I like the relentlessness that I can get with [the computer’s] voice that’s kind of shocking and surprising, and I find it to be at times very moving but at times extremely anxiety provoking,” Pirnot said. “This actually feels like I’m capturing and sharing a little bit of what this felt like.”

The production features some of Hnath’s signature fingerprints. Like “The Christians,” his 2015 play set in an evangelical church, “I Love You So Much I Could Die” includes snaking cords and cables, reflecting his preference for transparent stagecraft. The set, designed by Mimi Lien, is extraordinarily spare — a folding table, a lamp from the couple’s bedroom, some speakers, and, in the corner, a purple canister for the show’s one, almost imperceptible, haze effect.

“It’s so not slick,” Hnath said. “It basically announces ‘We’re not pretending. We’re just getting to work.’ I got worried about it turning into a pristine art installation. Anytime something gets slick, I stop trusting it, or I question, ‘What are they hiding?’”

Hnath has been experimenting with unsettling uses of audio for some time. “The Thin Place,” his 2019 play about a psychic, and “Dana H.” include moments of deeply jarring sound. And in “Dana H.,” “A Simulacrum” and now “I Love You So Much I Could Die,” there is the separation of speech from speaker, in different ways.

“I think there’s part of me that, deep down, is a frustrated composer. My first love was music, and I always wanted to compose music, so a lot of how I approach playwriting is very compositional,” Hnath said. He enjoys “the level of control I could have over the sonic qualities and the rhythm,” he added. “I can build it so it does not change and it’s exactly what I mean.”

Hnath’s plays have often involved what he unapologetically calls “a gimmick” — a task for a performer that leaves little room for error, like an actress perfectly imitating the words, breaths and pacing of another woman. His next play is about line memorization, and dramatizes an older performer running lines with a younger performer; Hnath describes it as “a nightmare to learn — somebody getting a line wrong five different ways — I don’t know how you learn that.”

For “I Love You So Much I Could Die,” which has sound design by Mikhail Fiksel and Noel Nichols, Pirnot and Hnath settled on the text-to-speech solution gradually. At first, in 2020 and 2021, Pirnot was writing about her sadness just as a way to process her feelings. Some of it was akin to journal entries; some was almost a transcription of conversations with family members. At one point, Hnath thought Pirnot should turn the material into a memoir.

When they began talking about staging the work, it was still peak pandemic, when in-person gatherings were complicated. So they held an early reading, with actors, via video meeting; Pirnot and Hnath briefly discussed having her script performed each time by a different actor reading the words cold.

Pirnot test-drove the text-to-speech idea with a short podcast monologue. And at home, she would work at a desk by the foot of their bed, meaning that sometimes, when he was seated on the bed, she would play the material with her back to him, and that setup informed the play as it moved to their living room, Ensemble Studio Theater, Dartmouth (for a residency), and now New York Theater Workshop, where it opens on Wednesday.

Over time, the story became more about Pirnot’s feelings, and less about her sister’s medical situation, which she does not detail in the play.

“Everything that’s included in the show is very intentionally to report on the experience of when life breaks open and completely falls apart, and what you do with all those pieces and how it makes you feel and how you continue to move forward,” she said. “I felt like I could provide that experience without saying, ‘And by the way, here’s the exact order of extremely excruciating, relentless series of events that made for my new understanding.’”

Why write about something so painful if you don’t want to share the specifics?

“After fighting so hard to keep a loved one alive, the question becomes for what and why?,” she said. “This is what I have to share. This is really what I want to express. Even though I question every night, ‘How could I be doing this? How could I be sharing this much?,’ it feels less sad to me than doing something that I’ve only put half of myself into.”

For Hnath, the collaboration fits into his own longstanding storytelling interests.

“One of the earliest projects I did in grad school was an adaptation of the Zen koan about Sen-jo. Sen-jo separates from her soul — there’s the soul and then there’s the body. And which one is the real Sen-jo? I think I’ve been kind of fixated on the tension between physical and mental or intellectual. So that’s always been in the background.”