Capriccio has 2 different meanings across 1 category:
Noun
an instrumental composition that doesn't adhere to rules for any specific musical form and is played with improvisation
A sudden and unexpected or fantastic motion; a caper (from same etymology, see below); a gambol; a prank, a trick.