I'm currently in New Orleans. Last night, I wandered past a music store in which a jazz band was playing, and I paused to have a listen.
The basic tune was "The Man on the Flying Trapeze." While the bass and the piano kept up the chord progression, and the drums kept tempo, the sax, the trumpet, the clarinet, and the trombone all took turns riffing on it - and at one point, the piano had a go, too. The other melody instruments were quiet as the soloists did their improvs. Then everybody came back together for the finale - I'm not sure how many of the riffs and ornaments there were rehearsed, and how many were spontaneous, but it was a glorious riot of sound.
They did another piece, the melody I didn't recognize, and even the bass got to take a turn soloing. It was the same format - everyone played together to open the piece, then each took a turn as a soloist, and then they came back together to finish it.
It took me a while to figure out what the melody was in the first case - I'd heard snatches of a tune that was familiar, but then the riffs would carry it off someplace and I couldn't fix it in my head. It was very interesting to hear how the improvisation was clearly based around the tune, yet also very free in wandering away from it. That is something that would be good to learn how to do, even if the exact technique in "wandering" should be different for a modern medieval musician than for a jazz man.
