The shack is home to Son Batá, a cultural initiative founded by young black migrants from the Chocó region of Colombia. Son Batá promotes Chocano music and dance, and it benefits from yet another Medellín initiative: participatory budgeting. Residents here have voted to direct a share of government financing to new schools, clinics and college scholarships. Son Batá got to hire music teachers and bought instruments and is adding a new recording studio to its headquarters. A group of players showed me the studio under construction. From another room, music drifted over the barrio and into the warm night air.

I arrived in Medellín to see the ambitious and photogenic buildings that have gone up, but also to find what remains undone. The murder rate, while hardly low, is now under 60 per 100,000. Architecture alone obviously doesn’t account for the drop in homicides, but the two aren’t unrelated, either. Around the world, followers of architecture with a capital A have focused so much of their attention on formal experiments, as if aesthetics and social activism, twin Modernist concerns, were mutually exclusive. But Medellín is proof that they’re not, and shouldn’t be. Architecture, here and elsewhere, acts as part of a larger social and economic ecology, or else it elects to be a luxury, meaningless except to itself.

The story of Medellín’s evolution turns out to be neither as rosy nor as straightforward as fans of new architecture have tended to portray it. It’s generally told as a triumph for Sergio Fajardo, the son of an architect who is the governor of the region and who was the city’s visionary mayor from 2004 to 2007. He pushed an agenda that linked education and community development with infrastructure and glamorous architecture.

But the city’s transformation established roots before Mr. Fajardo took office, in thoughtful planning guidelines, amnesties and antiterrorism programs, community-based initiatives by Germany and the United Nations and a Colombian national policy mandating architectural interventions as a means to attack poverty and crime.

What sets Medellín apart is the particular strength of its culture of urbanism, which acts now almost like a civic calling card. The city’s new mayor, Aníbal Gaviria, spent an hour describing to me his dreams for burying a congested highway that runs through the middle of town, building an electric tram along the hillsides to stem the sprawl of the slums, adding a green belt of public buildings along the tram, rehabilitating the Medellín River and densifying the city center — smart, public-spirited, improvements. It’s as if, in this country whose relatively robust economy has underwritten many forward-thinking projects, every mayor here has to have enormous architectural and infrastructural plans, or risk coming across as small-minded or an outsider.