NEW YORK (AP) _ As the Kool Jazz Festival ends a 10-day run Sunday, impresario George Wein might well be humming ''Thanks for the Memories.''

''The biggest thrill was getting Benny Goodman to come out,'' Wein said. ''It's one of the most thrilling moments of all the years of the festivals, one of the real happenings.''

Another high point was the return of Nina Simone, who left a lot of bad memories the last time she was scheduled to appear in the festival when she failed to show up.

Goodman made a surprise appearance during Tuesday night's tribute to John Hammond, the legendary talent scout who discovered stars from Billie Holiday to Bob Dylan and Stevie Ray Vaughan. The 76-year-old clarinetist delighted his audience with his light, swinging playing on ''Lady Be Good,'' ''Body and Soul,'' ''Back Home in Indiana'' and ''Don't Be That Way.''

''I called Benny the night before. I knew he wanted to play, but he is getting a little older and he's more or less retired,'' Wein said. ''I knew if I called him too soon he wouldn't make up his mind.

''He said, 'I think I'll do it.' He came to rehearsal but he didn't rehearse. He was too tense. When he left he wasn't going to perform. Twenty minutes after he got home, he called me and said he'd perform.

''They didn't rehearse. Benny told me they talked about some songs but didn't discuss what keys they'd play them in. That group that played for him played like they'd never done anything else. That's what jazz is.''

Another pleasant surprise for the promoter was Ms. Simone's ''Welcome Back Nina'' concert. The last time she was scheduled to appear in the festival, in the 1970s, she didn't show up.

''I think she has straightened her life out. I was very happy she called me, about three months ago, when we were planning the festival. It was an emotional thing,'' Wein said.

''When one who has disappeared comes back and maintains a public and talent, you're very happy about that.''