Rock musician Frank Zappa came to town today, and one by one, for brief moments, elected officials were star-struck.

Zappa, who in 1964 founded the rock group The Mothers of Invention, enlarged his reputation as a defender of rock music by testifying against a bill approved by the House of Delegates that would ban the sale, to anyone under age 18, of records considered to be obscene.

Zappa, 45, wore a conservative dark suit and tie for his role as legislative lobbyist at a Monday evening reception in his honor and during his testimony before the Senate Judicial Proceedings Committee today. At the reception, he shook hands and posed for pictures with legislators. With Sen. Frank Shore (D-Montgomery), an advocate of mandatory use of seat belts, Zappa froze for the lens while buckling a seat belt around Shore's neck. In the hallway outside the Senate chamber, he alternated between lobbying legislators and signing autographs for them.

The House voted 96 to 31 last month to approve the bill after Judiciary Committee Chairman Joseph E. Owens (D-Montgomery) called obscene lyrics "probably the worst kind of child abuse we've got." Support in the Senate appears to be lukewarm.

Zappa, who has spoken out strongly against what he views as a crusade to censor musicians' right to free speech, outraged members of a congressional panel last summer when he called a similar measure backed by the Parents Music Resource Center "an ill-conceived piece of nonsense."

His visit to Maryland came at the request of Bruce Bereano, an influential lobbyist who was hired by the Recording Industry Association of America to kill a bill many senators have already said has little chance of passing. Bereano estimated that he spent about half of his $5,000 fee feting Zappa.

Several delegates who voted for the bill have since admitted that they felt political pressure to support it. Zappa said four politicians told him Monday night that they would retract their votes if they could.

"Some of them said they wished they hadn't voted for that awful bill," Zappa testified at a crowded hearing. As evidence, he produced strips of paper signed by Dels. Diane Kirchenbauer (D-Montgomery), Joan Pitkin (D-Prince George's), Clarence Davis (D-Baltimore) and W. Timothy Finan (D-Allegany). "I think these people deserve another chance. They made an honest mistake."

As Zappa testified before the cameras, including a crew from MTV -- the cable network that specializes in rock music -- uniformed protesters who had been bused in from a Christian school in upstate New York demonstrated outside.

Several of the teen-agers prayed on the steps of the building where the committee hearing was held, while others carried signs that read "Murder Music: It's gone too far."

"When you hear people talking about rock causing suicide, the single largest case of suicide in the last decade was at Jonestown," said Zappa, who has children named Moon Unit and Dweezil and has recorded albums with titles such as "Weasels Rip My Flesh" and "Uncle Meat." "There wasn't a single Ozzy Osbourne song down there. That was good old-time religion."

Del. Judith Toth (D-Montgomery), the bill's sponsor, said she introduced the bill simply to close a loophole in existing obscenity law. When it came time to describe rock lyrics she considered offensive, she could not say the words. Instead, she asked a colleague to do it for her.

"Incest is everything it's said to be," intoned Del. Jerry H. Hyatt (D-Montgomery), reciting lyrics from a recording by Prince entitled "Sister."

"Thank goodness for legislative immunity," Toth said when Hyatt concluded. "I believe you could be arrested for saying things like this to teen-aged children on the street."

But members of the Senate committee, including its chairman, have been cool to Toth's bill.

Sen. John A. Pica Jr. (D-Baltimore) said his parents allowed him to see Zappa in concert three times when he was growing up "and I don't think they would say I turned out so bad."

Committee chairman Thomas V. Mike Miller Jr., a Prince George's County Democrat, said tearful testimony from teen-agers who said they turned to drugs and illicit sex because of rock music merely reinforced his opposition to the bill.

Toth insisted that her bill was neither "politically motivated" nor a move to censor music, but an effort to forward her feminist principles by discouraging the dissemination of materials that glorify rape and sexual violence.

"I am truly suprised at the fuss that is being made," she said.