SANTOS, Brazil (AP) _ Carlos Alberto Pereira fiddled with his black baseball cap and said softly into the microphone: ''Listen to the words of madmen and prophets and recover your mind.''

The ''madmen'' are disc jockey Pereira and everyone else who works on Tam Tam Radio, an entertainment and therapy program run by and for the mentally ill. Tam tam is Brazilian slang for crazy.

Renato Di Renzo, coordinator of the project, said the show helps integrate patients into society.

''By using their creativity to do something they feel is useful, they develop a sense of status and of belonging to a society that has always shunned them or locked them away in asylums,'' he said in an interview.

''At the same time, it helps so-called sane society accept these people as productive human beings and not as a bunch of loonies.''

The daily 30-minute program offers rock 'n' roll, humor, skits and interviews. It is broadcast on Radio Clube de Santos, a station owned by Pele, the former soccer star.

On this day, Pereira opened it by declaring cheerfully: ''This is Tam Tam Radio, a program the size of your own madness, a program with no harmful side effects.''

He then interviewed a foreign journalist, asking the visitor how it felt to be a ''star among madmen.''

Pereira, 29, keeps the tone light with skits that poke fun at Brazilian personalities, tongue-in-cheek comments on issues like pollution and transportation, and information on cultural events.

His goal, he explained, is ''to combine madness with lucidity and create a new form of insanity based on happiness, creativity and irreverence. This is how we try to show society that the boundaries between insanity and sanity are hazy.''

Di Renzo said the program is very popular, but that he did not have audience figures. During one daily show, 20 people telephoned to say how much they enjoyed it.

Yvette Piha, a psychology professor at the University of Sao Paulo, said the Tam Tam project, of which the show is a part, ''tries to erase the stereotypes of sanity and insanity while offering society an opportunity to deal with its own fears toward the insane.''

The project began in 1989 when Mayor Telma de Souza investigated hundreds of complaints about the Anchieta Health Center, the main asylum for the mentally ill in Santos, a city of 500,000.

Di Renzo said Anchieta was built in the 1950s as a modern treatment center, but had become a ''veritable house of horrors.''

''Patients were mistreated, locked up in isolation cells, given electric shocks and injected with tranquilizers,'' he said.

Tam Tam, developed by Di Renzo and a team of 18 psychologists and volunteers, changed all that.

The city government built several therapy centers where mental patients can be treated while living at home.

Only 100 of the 700 patients who packed Anchieta two years ago remain there, and they will leave when enough treatment centers are ready. The old asylum has been re-created as an arts and crafts school.

Patients who remain at Anchieta ''are encouraged to abandon their passivity and play an active role in their treatment,'' Di Renzo said.

They produce bracelets and necklaces from scrap wood, metal and plastic; paint colorful, original greeting cards and T-shirts for sale in many of the city's better boutiques, and present plays based on their experiences.

Half the money from product sales goes to the patients and the rest is used to buy paints and other materials.

''With a bit of humanity and by helping them express their creativity, their fears, hopes and frustrations,'' Di Renzo said, the mentally ill ''learn to deal with their insanity in a productive way.''