This week, in a New York district court, one of music’s least sympathetic characters, the Brooklyn rapper Tekashi 6ix9ine, took the stand to testify against alleged members of the Nine Trey Gangsta Bloods, the gang with which he associated himself. The rapper, whose real name is Daniel Hernandez, became a star witness, pointing out gang members who appeared in his music videos, explaining gang signs, and detailing the hierarchy of Nine Trey and its alleged leaders. At one point, prosecutors asked him about the lyrics for his hit song “GUMMO,” and whether the words included any threats against rivals. “It’s a song towards, like, somebody who I didn’t get along with,” the rapper said. “I don’t know. I thought it was cool at the time.”

It’s a cautionary tale; 6ix9ine’s outlandish antics rocketed his music up the charts, but he thought he needed street clout. His efforts to skirt one hip-hop faux pas—being a poser—crash-landed him into another: snitching. And, in doing so, he had to confirm what many had already figured out: nothing about his persona or his lyrics was authentic, which cast a light on the disconnect between the optics of hip-hop music and reality. The independent journalist Matthew Russell Lee reported on Twitter that 6ix9ine claimed he was never initiated into the gang, but he had an arrangement to “keep making hits and giving financial support,” and, in return, he got his “career, credibility, protection, all of the above.”

The extraordinary confession of 6ix9ine comes on the heels of several trials involving high-profile rappers, such as those of the Texas rapper Tay-K, the Florida rapper YNW Melly, and the California rapper Drakeo the Ruler, where rap videos and lyrics have been introduced into the courtroom. Andrea Dennis, a professor at the University of Georgia School of Law and the co-author of the forthcoming book “Rap on Trial: Race, Lyrics, and Guilt in America,” described how law enforcement weaponizes rap lyrics to convict and incarcerate rappers, a legal assault that is unique to hip-hop. “We have searched widely, and, based on our research, rap is the only fictional art form treated this way,” she said. “No other musical genre and no other art is used in the same way or to the same extent.”

In April of 2017, the rapper Tay-K was under house arrest and awaiting trial, in Texas, for capital murder after his involvement in a 2016 robbery that left one person dead. He cut off his ankle monitor and fled the state, evading authorities for three months; he was arrested in New Jersey, in June, and brought to trial in July. The rapper’s music, particularly his single “The Race”—which, as its title suggests, was built around his status as a fugitive (and some otherwise cliché shit-talk)—was not really needed as evidence in the courtroom. Though he pleaded not guilty to the murder charge, Tay-K and his co-defendants had already taken deals that confirmed his role in the robbery. Nevertheless, during sentencing, prosecutors introduced the video and lyrics for “The Race,” along with the cover of his EP, “#LivingLikeLarry,” which depicts the then sixteen-year-old rapper holding a gun. The goal, it seems, was to dehumanize the rapper in the eyes of a jury through the use of his music.

Dennis says that bringing rap lyrics into a trial is common because “prosecutors often argue the lyrics are either the defendant’s confession to the crime or circumstantial evidence the defendant committed the crime, e.g., proof of intent, knowledge, ability, motive,” she said. (Dennis said that prosecutors then use lyrics during sentencing to portray rappers as dangers to their communities.) The case of YNW Melly could hinge on this misguided idea. His lawyer has said that Melly’s harrowing single “Murder on My Mind” will likely be entered as evidence for his alleged role in the shooting deaths of two of his associates, in October, 2018. (Melly has pleaded not guilty to both murder charges. He faces the death penalty.) Never mind that the song was released a year and a half before the killings. Certainly, the music of a rapper such as Melly is reframed by his alleged actions: how we hear and enjoy it shifts once the feeling of being intrigued is replaced by the uncomfortable weight of potential real-life bad behavior. But it’s way too far a leap to suggest that these songs constitute proof of that bad behavior.

In many of these cases, an artist’s very participation in hip-hop is painted as a moral shortcoming that suggests a propensity for real-world violence and degeneracy. One Louisiana judge went so far as to tell the perpetually troubled rapper YoungBoy Never Broke Again, “Your genre has a lot to do with the mindset people have. Your genre has normalized violence.” It’s a stunning statement. Violence has been embedded in the fabric of this country since its inception, and hip-hop, like all great art, tells you something about the society that cultivated it. “In other cases,” Dennis said, “prosecutors use music or video to show gang membership or connections between gang members. In an increasing number of cases, the lyrics are allegedly themselves a crime,” Dennis said. “In particular, prosecutors have convicted defendants on the theory that their lyrics were used to make a threat to another person.”

The scrutiny of lyrics is what happened in the case of Drakeo the Ruler, the details of which are so nonsensical that the story could be read as satire. He was charged in the murder of a man outside a warehouse party in California in December, 2016. Investigators found that Drakeo was not the gunman, nor did he have a hand in the violence, but prosecutors sought to present the murder as the result of an old beef between Drakeo and another rapper, who was not even at the party or otherwise connected to it. When those ties proved nonexistent, prosecutors combed Drakeo’s music for menacing gestures and proximity to weapons, in an attempt to, as the writer Jeff Weiss observed in his comprehensive and damning reporting for The Fader, “terrify the jury into believing that there is no difference between real life and rap videos.” (Drakeo was acquitted of the murder charge, though prosecutors refiled charges of gang conspiracy and shooting from a moving vehicle after the previous jury was unable to reach a verdict.)

The admissibility of rap lyrics and videos as evidence is often framed as a legal matter, but it is really about race. By introducing the work of a rapper into the courtroom, prosecutors are relying on racism to do its job—insisting that those in the courtroom accept, as fact, the worst kinds of stereotypes about this music and the people who make it. We live in a time when music videos are treated as irrefutable evidence in court, but real-life cell-phone footage of police killing an unarmed person is met with skepticism and suggestions that we should doubt our eyes. The hypocrisy relies on racist ideas, in both cases, about who deserves their rights and humanity. Yet, Dennis says, the practice of indicting rappers based on lyrics and imagery has been allowed to continue because of “the difficulty of convincing police and prosecutors that the evidence is inherently unreliable,” and it’s compounded by a law that “does not give judges the authority to ban the evidence.”