A capriccio or caprice is a piece of music, usually fairly free in form and of a lively character.
The term has been applied to a variety of works: in the Baroque era is was often used for short keyboard pieces (by Girolamo Frescobaldi, for example), Niccolo Paganini usd it for a set of twenty four viruoso solo violin works, and Pyotr Ilyich Tchaikovsky and Nicolai Rimsky-Korsakov used it for orchestral works (the Capriccio Italien and Capriccio espagñol respectively).
Capriccio is also an opera by Richard Strauss; see Capriccio (opera).