There is an unsolved mystery at the heart of one of the most popular Jewish songs in history.

Every Friday evening, Jews around the world recite the poetic prayer “Lecha Dodi” to welcome the Sabbath. Written by the 16th-century mystic Shlomo Alkabetz, the hymn has been put to many melodies over the generations. But whatever the tune, something strange happens midway through the song: The congregation changes the melody, often switching from a slower dirge to an upbeat march or energetic dance. And no one seems to know why.

I once asked Velvel Pasternak, perhaps the greatest modern Jewish musicologist, for the explanation behind this practice. He told me that he had spent years researching this very question, and that the only plausible answer he’d received had come from a Hasidic rabbi in Pittsburgh, who told him in Yiddish: Shoyn genug genidzet mit dem ershtn nigun. They got tired of the first melody.

For years, this was the best explanation I could find. When I began working on my own original Jewish music album of Sabbath songs, I dutifully composed two tunes for “Lecha Dodi”—one slow, one fast. That album came out this week, and you can listen to it wherever you get your music here. (No, seriously, go listen!) But in the process of composing the second, faster melody, I arrived at a different, far more meaningful reason for the musical switch. And it turned out to hinge on a song from the streets of Shanghai.

My grandfather, Rabbi Israel David Rosenberg, was the only member of his family who survived the Holocaust. He fled Poland with a group of seminary students and was saved by the Japanese diplomat Chiune Sugihara, who acted against orders to funnel thousands of Jews to safety. Armed with a transit visa, my grandfather arrived in Shanghai, where he and his fellow refugees spent the rest of the war, before ultimately immigrating to the United States.

My grandfather was a gifted composer, and it was during this dark time that he wrote his most enduring melody. The song was called “Shir Hageulah”: “Song of the Redemption.” Its lyrics were drawn from a letter of encouragement that had come to my grandfather’s fellow students from the United States, attributed to the grand rebbe of Lubavitch. The song became an anthem for the orphans of Shanghai and is still sung by Jews to this day, including Hasidic pop stars.

And here’s the thing: My grandfather’s melody also changes in the middle from downbeat to upbeat.

It begins as a mournful dirge, full of sadness and longing: Hachayeinu kel ad mo’ed, yitgaleh ozer v’soed. “Keep us alive, God, until the redemption, when the Messiah will be revealed.” The song culminates in a stark lament: Takifim yardu dumah, otanu hish’ir le’umah. “The righteous ones have gone down into the ground, and we have been left as a remnant.” So far, so sad. But then my grandfather did something strange: He took those same devastating words and turned them into a march. The song repeats those lyrics not as a melancholic elegy, but as a celebratory crescendo:

The righteous ones have gone down into the ground, and we have been left as a remnant.

Let us live many more days, and when the Third Temple [i.e., messianic redemption] arrives, we will be among those standing.

By changing the melody, my grandfather changed the meaning. What was once a lament became a charge. A plaintive cry became a call to arms. Yes, so many of the students had lost their families and teachers. Yes, it seemed as though the greatest among them were no more. But they were to persevere and take on the task left by those they had lost.

The words and the melody change were a protest against despair, a refusal to concede to calamity.

The same is true, it turns out, in “Lecha Dodi.”

In mid-2020, I received an early draft of my upbeat “Lecha Dodi” composition from the studio. My producer, Charles Newman, had outdone himself, marrying the energetic acoustics of a banjo and guitar to the electric oomph of a digital beat. The song sounded like what you’d get if Avicii and Mumford & Sons had a baby that inexplicably converted to Judaism. It made you want to clap, and it made you want to dance.

But when I first listened to it, it made me want to cry. Listening to the track in my apartment during lockdown, I didn’t know if there would ever be anyone to sing and dance to it. Our synagogue had gone remote; many others had shut down. Communal singing wasn’t just on hiatus. It was dangerous. In this context, the joyous nature of the song—the switch from slow to fast, meditative to ecstatic—felt almost perverse.

But then I remembered my grandfather’s song. And I looked at “Lecha Dodi” again. The prayer traditionally changes tunes at the sixth stanza, which begins with the words Lo tevoshi. Loosely translated, the lyrics declare, “Do not despair, do not be despondent … The city shall be rebuilt on its foundations.” Today, most Jews sing these words from a place of comfort and security. But that was not always the case. Throughout Jewish history, “Lo Tevoshi” wasn’t just recited in synagogues; it was mumbled in concentration camps, while fleeing expulsions, and in the aftermath of pogroms. I can only imagine the strength it took for these Jews to stand up each Friday night and tell themselves not to despair, and insist that they still had a future to claim. But they did. Seen in this light, my upbeat “Lo Tevoshi” melody wasn’t at odds with our difficult moment; it was the traditional response to it: a defiant refusal to surrender to circumstance.

When my grandfather composed his “Shir Hageulah,” he could not possibly have conceived of me writing these words to you today. His entire family had been murdered, his village decimated, his life destroyed. He was exiled in a foreign country where he did not speak the language, and did not know if there was even a future for Jewish people like him. But he never stopped hoping, and he never stopped singing. He changed the melody and he changed the meaning.

And we can too.

Takifim yardu dumah, otanu hish’ir le’umah.

Lo tevoshi.

Az Yashir: Songs for Shabbat is available on all major online music platforms here and can be purchased on CD here. If you’d like to listen but can’t afford it, email me and we’ll find a way to get it to you. And be sure to subscribe to the newsletter if you haven’t already.