Where a Career in Hip-Hop Starts With a Court Sentence Less than two years ago, Torey Baker was an 18-year-old high-school dropout facing prison time for robbery. When a judge in the Bronx sentenced him instead to six months in an alternative program, plus probation, he considered himself lucky. But he didn't know the half of it. On his first day, the counselor who administered his drug test asked Mr. Baker if he had any interest in hip-hop. Because if he did, there was a recording studio right down the hall. "My mind was blown," Mr. Baker said one recent evening as he hunched over a laptop in a conference room, fiddling with beats. I showed up at the studio the first day, and then I just kept showing up. The studio belonged to One Mic, a project that teaches young offenders life skills while honing their rhyming, producing and writing skills. In a twist on rap boasts about crime and punishment, the place that helps save minors from hard time is also where they record their first tracks. Mr. Baker attended One Mic's workshops as part of his sentence with the jail-alternative agency, which also included daily drug tests and other educational programs. About a year after completing his court-ordered stint, Mr. Baker, a slim, soft-spoken 20-year-old with a piano tattoo on his forearm, has found a home in One Mic. Its parent nonprofit,Art Start, paid for him to attend audio engineering school. He helped found a crew of producers, M.C."s and vocalists, the "One Mic Collective," that has toured locally and plans to tour in Germany. This evening, Mr. Baker was in the studio, a primary-colored back room in a warren of offices belonging to the Center for Community Alternatives, which provides space to One Mic in a graffiti-scarred building near the Brooklyn end of the Brooklyn Bridge. At the control board, he adjusted the levels as one of his main collaborators, Miguel Solano, who is known as Miky, spit a verse, his hands erratic with motion. One Mic's program director, Billy Martin, who goes by the name Spiritchild, leaned against the door frame, listening to the two young men discuss a lyric. Would "hidden" be misheard as "hittin" "? Who are you writing this for? Mr. Martin asked Mr. Solano. Mr. Solano, 21, who came to One Mic three years ago after a drug arrest in Brooklyn, took a moment to consider. "The hood," he answered. This is for the hood. Which hood? Mr. Martin asked. There are a lot of hoods. There are hoods in India, Afghanistan, Brooklyn. Who are you writing for? What's the message? Mr. Solano took a thought break on the couch in the adjacent library, a room with lime-green walls and inspirational posters that quote Japanese proverbs, Maya Angelou and Jay-Z. He began reworking the lyrics on his BlackBerry. "Yo, M.B.," he yelled to Mr. Baker, who is also known as Mad Bangers. Can you send me the beat? Soon they were back in the booth. "Hi," Mr. Solano called out, "my name is Miky and this song is called "Walk Inside My Mind."" Mr. Baker laughed, his finger hovering over the record button. You're on in five ... four ... three ... two ... one. Mr. Baker, who grew up in Tremont in the Bronx, taught himself piano when he was 8 and made his first hip-hop beat with a metal spoon and a chair, he said. But in high school, "I was hanging around with the wrong crew." On a summer night in 2010, he said, he was out with the wrong crew, and his friends were smashing car windows when a man rode up on his bicycle. The friends beat and robbed the man while Mr. Baker distracted a passing cab. Then Mr. Baker rode home on the man's bike. He was arrested on second-degree robbery charges and faced up to 15 years in prison. Instead, he wound up assigned to the Center for Alternative Sentencing and Employment Services, one of many programs that have sprung up as New York has reformed its juvenile-justice system and the number of juvenile offenders sent to state correctional facilities has dropped by 60 percent over 10 years. One Mic, which operated out of the center's lower Manhattan office at the time, has since moved to its current Brooklyn home. Mr. Martin said that when Mr. Baker first walked through the door, he was uncooperative, insecure and spent most of the time acting out. "I was just like, "Let him be,"" Mr. Martin said. I never kicked him out of a workshop no matter how crazy he was, and I let him know we had space for him. Gradually, Mr. Martin said, Mr. Baker "learned how to be himself without taking up other people's space." In order to earn time in the studio and a slot performing when the One Mic Collective goes on tour, Mr. Baker mentors younger students in One Mic and volunteers at programs for at-risk youth. The day after his evening with Mr. Solano at the One Mic studio, he helped teach a music workshop at a homeless shelter in the South Bronx, the Prospect Family Inn. The cacophony could be heard across the street: frantic, discordant, drumming noises; children shrieking with laughter, or just shrieking for the fun of it. In a basement playroom, 20 children arranged chairs in an imperfect circle, divided up buckets and passed around drumsticks. "They're actually pretty calm today," Mr. Baker said. He held his drumsticks above his head, the sign for "be quiet." One by one, the children followed suit. Mr. Baker made beats on an upside-down bucket for them to mimic - faster, then slower, then quieter. At the end of the workshop, Mr. Baker performed a drum solo, rousing several children to dance. He headed home on a No. 4 train to his family's apartment on 183rd Street in the Bronx to work on an old school hip-hop beat Mr. Solano had asked for. No artwork or posters graced the white walls of his room, just taped-up instructions for using mixing software. Mr. Baker, who has been signed as a producer to a small label, Pyramid Records, dug through a cardboard box of old records. He listened to a few tracks, beatboxed a beat with his hands and mouth, and then replicated the beat on his laptop. Then he got to work on the melody. His fingers wandered across an electric keyboard, freestyling until he found something ethereal, reminiscent of A Tribe Called Quest. One finger slipped slightly, brushing against the wrong key before hitting the right one. Mr. Baker liked the mistake: it was an old school hip-hop kind of slip-up. He kept it in. Looking down the road, Mr. Baker said he wanted to do commercials, make music for video games - and continue collaborating with Mr. Solano. "I want to be working with Miky in the industry, doing our own stuff," Mr. Baker said. He's the best rapper, in my eyes. The next day, Mr. Baker played the beat for Mr. Solano in a conference room at New York University - One Mic Collective's borrowed practice space. Mr. Martin listened and nodded along to the languid beat. "This is a feel-good track," he said. It's the kind of song that could really engage an audience at concerts. Mr. Solano tried to freestyle the hook. "As the world spins around, we enhancing the sound, something, something, something, something around, cause that's cool," he said. Another One Mic Collective M.C., Robert Cornegy III, known as Krhazey 80, took it from there. "As the world spins around, enhancing the sound, romancing the snare, move your body all around, cause that's cool," he said. "That's cool," Mr. Martin said. I like that.