CarleBot — whose niggun is that?

On Shabbat, Shlomo Tannor often encounters a problem common to regular synagogue-goers: He’ll hear a tune that sounds familiar but he can’t place it. When Shabbat is over, he’ll have no way to look it up.

Shlomo Tannor created the CarleBot, a piece of software capable of detecting the music of Rabbi Shlomo Carlebach when users hum or sing into the computer microphone. (Courtesy)
Shlomo Tannor created the CarleBot, a piece of software capable of detecting the music of Rabbi Shlomo Carlebach when users hum or sing into the computer microphone. (Courtesy)

Frequently, those tunes come from one source: Rabbi Shlomo Carlebach, the most prominent composer of Jewish religious music in the postwar era.

To solve the problem, Tannor, an artificial intelligence engineer and amateur musician who lives in Riverdale, NY, created CarleBot — a melody detection software that, like the music-identifying app Shazam, can tell its users the source of Jewish prayer melodies.

More specifically, the app can tell users whether the song was one of Carlebach’s many niggunim, or wordless melodies, along with its name.

The bot lets users sing or hum up to 20 seconds of a song into the microphone of a computer before working to identify it.

So far, CarleBot has about 200 songs in its library.

“Sometimes there are just these tunes that circulate around and I’m not really sure where they’re from,” Tannor said.

“I thought it would be interesting to start with a well-defined library of songs, which is Carlebach music, and try to see if I could get something to work with that.”

The tool, Tannor says, will benefit both fans and critics of “the singing rabbi.” Carlebach’s catchy melodies — recorded on 25 albums spanning four decades — have become so ubiquitous across Jewish sanctuaries, schools and summer camps that sometimes singers don’t even realize they come from one composer.

But in the post-MeToo era, many Jewish spaces have begun to reckon with longstanding sexual assault allegations against Carlebach, which emerged in the years after his death in 1994. Now, some prayer leaders strive to avoid his work — which is difficult when much of it has become synonymous with modern Jewish music.

“Some people just love his music, some try to avoid using the tunes,” Tannor said. “But he was a major influence of Jewish music and he just composed many, many tunes that are widely used — and many people aren’t aware that they’re Carlebach.”

Ethnomusicologist Jessica Rode said CarleBot was the latest in a series of projects seeking to catalog and preserve traditional Jewish music from across the globe.

She pointed to Gharamophone. com, launched in 2017, which aims to collect music of the North African Jewish community, and larger archives like SephardicMusic.org.

The National Library of Israel also has a section on piyyutim, or liurgical songs, with tunes from different regions around the world.

Such archives can help people understand which songs have been passed down in Jewish communities for generations and which, like Carlebach’s compositions, are relatively recent, said Rode, a professor at Georgetown University.

“There is the idea of something that is preserved,” said Rode. “Then, of course, there’s the work of musicologists to uncover it, to say, ‘No, this is actually not that old a song.’”

There’s also the work of noting when art is created by problematic people.

“This is one of the most controversial figures in the recent development of Jewish music,” Rode said of Carlebach. “So that’s interesting. But on the other hand, there’s always the question of the separation between the artist” and the works.

The bot, named by Tannor’s wife Dena, was built over the course of 10 hours spread over a few weeks.

It is loosely based on a previous bot created by Tannor, called MishnahBot, which summarizes arguments and rulings from the compendium of Jewish oral law.

On that site, sample questions include “Is it permitted to build a sukkah on the back of a camel?” (The answer is yes.)

While Shazam identifies recorded songs, Jewish ritual music is often paired with a range of prayers or hummed, rather than played, and can sound different depending on the singer and the tempo. CarleBot is sensitive to the a cappella voice.

To gather the melodies, Tannor downloaded and then converted YouTube videos of the Carlebach songs into files that can easily be transposed onto different musical scales, accounting for a user’s imperfect pitch.

“I’m curious about learning about their history or what was the given tune originally composed to —  which words was it supposed to go to originally,” Tannor said.

“I think that’s something that’s a little bit unique to chasidic niggunim, that you could just sort of use them on a lot of different words.”

He says niggunim are similar to melodies of nursery rhymes such as “Twinkle, Twinkle, Little Star,” whose melody is also sung to the alphabet, and “Baa, Baa, Black Sheep.” (That tune is itself an adaptation of an 18th century melody from the French-language song, “Ah! vous dirai-je, maman.”)

“It’s unique in the landscape of music in general, where these melodies are just sort of attached to different words,” Tannor said. “There’s something similar to that also in children’s songs.”

For Joey Weisenberg, founder and director of the Rising Song Institute at Hadar, the malleability and improvisational nature of niggunim — and the way they spread by word-of-mouth — is all part of the fun.

“All of us who do this kind of thing, one of the joys of not knowing a niggun, which happens all the time, is then asking friends if they know it,” Weisenberg said.

“And sometimes it’s very obvious to somebody else where this came from, and most of the time it isn’t.”

While Weisenberg said “it would be great to have a tool like this,” he added that for those in the know, “If it’s a Carlebach melody, many times there’s somebody who’s going to know the answer to that pretty quickly.”