There's a question being asked today in San Francisco, between sets at concerts, between takes in recording studios, and after band practice:

Is the music scene here doomed?

Given this city's storied reputation for music and the arts, it seems inconceivable that it could not have a vibrant scene — that it wouldn't host experimental jazz jams and scrappy shows from local rock bands, that it won't lure ambitious players from all over the world, that it may no longer launch artists into the upper echelons of the music industry.

But then, plenty that once seemed inconceivable in San Francisco has come to pass.

Looking around at a city in the midst of its second tech-fueled economic boom, with housing prices reaching surreal heights and a culture that's more work-focused than ever permeating these 49 square miles, many involved with the city's arts and entertainment scenes find themselves asking: How will noncommercial creativity — and especially loud, space-demanding music — survive? Can the city that hosted the titans of jazz, that spawned the Grateful Dead and psychedelic rock, that cradled West Coast punk, that inspired countless singer-songwriters, that helped birth the modern LGBT movement on its dancefloors, continue to nurture a vital musical culture of its own?

It no longer seems safe to assume so. Many of the forces that have long been changing San Francisco are working against a vibrant music scene, not in concert with it. Higher housing costs make it more difficult for musicians, especially bands, to live and create here. But they also make property owners less likely to lease space to music venues and recording studios, when building housing would be more profitable. And as more housing goes up and the city becomes denser, existing clubs and performance spaces find themselves surrounded by people who don't want to hear loud music or see raucous crowds late at night. When artists move, they take some of their audience with them. And if the artists and their audience are gone, a crucial part of the energy and character that have defined this city will be gone, too.

Many see similarities between the Bay Area and New York City, with the migration of music and arts from Manhattan to Brooklyn, and then farther out. When the Talking Heads' David Byrne wrote last year that "most of Manhattan and many parts of Brooklyn are virtual walled communities, pleasure domes for the rich ... there is no room for fresh creative types," he could have been describing a big swath of San Francisco today — and, perhaps, Oakland tomorrow. Byrne's worry that "bit by bit, the resources that keep the city vibrant are being eliminated" is a common refrain here. As with New York, it's not the big clubs that host touring acts, or the nationally successful names who already live here, that are most at risk. San Francisco is losing the young, broke artists with potential, the under-the-radar performance spaces, and the offbeat, weeknight shows that have long given the city its unique vibe — and that end up making tremendous contributions to the music world later on.

This new, more musically barren San Francisco became suddenly easier to picture in the last year, when a handful of small but important institutions folded, left, or changed drastically. First, in the spring, Tenderloin dance club 222 Hyde — a tiny, divey space that hosted much of the city's up-and-coming electronic music talent — closed its doors. Nothing comparable has filled its place in the city's constellation of clubs. In November, word spread that longtime Upper Market rock venue Cafe Du Nord was being sold and undergoing extensive renovations, to be turned into restaurants with, hopefully, some live music. Later came news that the nearly 20-year-old Red Devil Lounge, a live club on Polk Street, was closing in February. And then Viracocha, the antiques and oddities store and illegal performance space on Valencia beloved by the Mission arts underground, announced that it was looking to go legit — likely in the hands of new owners.

By mid-December, when Thee Oh Sees' John Dwyer quipped onstage that this might be the band's last show in S.F. for a while, people were nervous. Thee Oh Sees are a psychedelic garage rock band beloved around the world and closely associated with San Francisco. As it turned out, Dwyer was moving to Los Angeles — the latest in an exodus of S.F. musicians to Southern California, including his garage-rock protege Ty Segall. Dwyer told Pitchfork that he was seeking "a breath of fresh air," and that "[San Francisco] has filled up with phone-scrolling, blank-faced wanderers."

And so, like every cultural issue in the city these days, the future of music has become intertwined with the argument over the current tech boom. Dwyer and others believe the smartphone-toting "noobs" are to blame for the metastasis of $12 cocktail bars and the sad parade of evictions. DJs will lament the white mainstream maleness of their audiences while acknowledging that tech money helps pay their rent. But music and tech have a long history of cooperation in San Francisco. Kevin Arnold was working at Oracle when he started Noise Pop in 1993; he's founded a spate of tech firms since then. Plenty of local musicians take advantage of the region's flexible, plentiful, and creative digital economy jobs. Some of them even work at music-tech companies like Apple and Pandora — and enjoy it.

So we must also ask if there isn't a reason for optimism amid the tumult and gloom. San Francisco is again filling up with young people who have money. Those people want to go out. Many of them want to go see music — whether it's performed by a DJ or a jazz-funk band. Clubs, at least the ones managing to stay open, are doing well. The city's recording studios have more bookings than they can handle. If San Francisco is unaffordable, there's cheaper housing a BART ride away in Oakland. And if the struggle, inequality, and rapid transformation of the city piss off the local artists, won't that inspire them to make interesting work?