San Francisco’s beloved Wave Organ, a strange creation of science and art in the city’s Marina District, is marking its 40th anniversary on Monday. The piece officially opened on June 8, 1986, crafted by artist Peter Richards and stone mason George Gonzalez.

On a narrow inlet that winds past the San Francisco Yacht Club, the piece was crafted around Richards’ concept of extending 20 pipes into the waves with visitors able to listen to the gurgling on the other end. Gonzalez, a local stone mason trained in France, built terraces and sculptures using stones rescued from the bay or recycled from a former cemetery.

“I just wanted to capture the sound at first,” said Richards, sitting in the small stone vestibule at the site. “At the same time, particularly working with George, we wanted to create a place that was special so that people come here and have a different kind of experience.”

The piece was funded by the Exploratorium, where Richards worked at the time, back when the science museum was located in the nearby Palace of Fine Arts. Richards took inspiration from an exhibit in the museum called Pipes of Pan, which demonstrated how different length tubes amplify sound waves of different frequencies.

“Grabbed a few pipes and came out,” Richards said. “Stuck the pipes in the water and there it was, this very musical gurgling.”

The Wave Organ in San Francisco’s Marina opened 40 years ago Monday.

Joe Rosato Jr./NBC Bay AreaJoe Rosato Jr./NBC Bay Area

The Wave Organ in San Francisco’s Marina opened 40 years ago Monday.

The two creators visited the site last for the first time in many years. They plunked down in the vestibule where small openings connected to pipes out in the bay. The various lengths of tube change the sound, which is most audible during high tides.

“It felt like we got a permit from God to build this,” Gonzalez said, taking in the scene. “When I came here I went, ‘Oh my God, this is a fantastic spot.’ It’s a dream place to leave your work.”

Richards first learned of Gonzalez after admiring a stone bench Gonzalez had created outside Smiley’s Saloon in the West Marin town of Bolinas. He tracked down the stone mason and offered him the project.

Gonzalez, with aid from the California Conservation Corps, used nets to harvest cobblestones from the jetty, which were originally used as ballast for sailing vessels. He also got materials from a city salvage yard, which included many ornate carved stones that were once part of the Laurel Hill Cemetery, relocated in 1939. The old stones give the site the look of an ancient ruined empire — while the tubes transmitting the wave sounds look more like periscopes from a comic book submarine.

“That makes me feel really good that somehow I had a hand in creating a place that allows people to be themselves and create their own stories,” Richards said, admiring the site.

The piece has drawn people for 40 years – some who stumble on it by accident, many who seek it out. For locals, visits feel like an insider’s scoop on a secret destination. The soundtrack of the bay and the mysterious gurgling feels remote, even though it directly faces the bustling city.

“I’ve been out here at three in the morning and it’s fantastic,” said Ken Finn, an Exploratorium educator who leads studies of the wave organ. “If someone asked me the best time to come here, I think my first answer is anytime.”

The creators of the Wave Organ, Peter Richards and George Gonzalez, visit the site they built.

Joe Rosato Jr./NBC Bay AreaJoe Rosato Jr./NBC Bay Area

The creators of the Wave Organ, Peter Richards and George Gonzalez, visit the site they built.

Richards said years ago there was a proposal to redo the yacht harbor, which would’ve shifted the bay waters in the channel and render the Wave Organ useless. Richards said he turned down an offer to relocate the piece across the channel. He said what made the Wave Organ magic was its remote location.

“It’s strange, it’s wonderful,” Richards said. “It’s not really land but it’s not really sea. It encompasses both.”

Forty years after its opening, the Wave Organ is essentially the same as when it opened. The one big change is 15 years ago when a fan of the project left money to build a ramp to make it ADA accessible. The structure also survived the Loma Prieta earthquake, which moved one stone a couple inches.

“I was 38 years old when I built this,” recalled Gonzalez, who says he guaranteed the work for 500 years. “It’s endured well and that’s kind of like where I’m looking at it. This really stood the test of time so far.”

In today’s world of increased restrictions and permits, it’s difficult to imagine someone being allowed to build a permanent project of such magnitude. As Finn pressed his ear against one of the tubes to listen to the musical gurgling, he marveled that the project even exists.

“I’m really grateful they had the foresight and tenacity to get through all the different hoops and hurdles to get this built and to build it in a way that it’ll be here for a long time,” Finn said. “Hopefully 40 more years.”

The Wave Organ in San Francisco’s Marina opened 40 years ago Monday.

Joe Rosato Jr./NBC Bay AreaJoe Rosato Jr./NBC Bay Area

The Wave Organ in San Francisco’s Marina opened 40 years ago Monday.