contestada

When a composer wrote a piece of music for a certain occasion, what was that called?