The link between the music and the crime has been largely circumstantial, and Amnesty International, for one, has criticized the police database as “stigmatizing young black men for the type of music they listen to or their social media behavior.”

Fears about popular culture, like violent video games and gangster rap, are not new. But the way music is now distributed allows drill to be especially personal and ominous.

Rather than waiting months for a record company to release their music, drill groups are quickly writing songs that directly threaten specific people or groups and disseminating them on YouTube. Their rivals respond likewise or on social media platforms like Snapchat, Instagram and Twitter, in an escalating contest of bravado that sometimes crosses over to the real world.

Drill music originated in Chicago, which has endured an epidemic of violence and where one rapper in a drill feud, Joseph Campbell, known as Lil JoJo, was shot dead in 2012. The motive for the killing was unclear. The music is not always menacing, and some groups have achieved commercial recognition.

Other groups are considered by the authorities to be barely distinguishable from gangs.

Image Dean Pascal-Modeste, 22, was killed as part of a rivalry between rap groups that played out over YouTube. Credit... Metropolitan Police

The two men recently convicted in Mr. Pascal-Modeste’s death, Devone Pusey, 20, and Kai Stewart, 18, had appeared in a YouTube drill video that mocked and threatened a rival gang. “Dip splash till the splash is done,” the group rapped in one video. Prosecutors said that Mr. Pascal-Modeste was targeted because he was friendly with members of the rival gang, but he was not in the gang himself.