1690s as a term in music for a kind of free composition, from Italian capriccio "sudden start or motion" (see caprice). Earlier it meant "a prank, a trick" (1660s); "a caprice" (c. 1600).
Entries linking to capriccio
caprice n.
"sudden change or start of the mind without apparent motive," 1660s, from French caprice "whim" (16c.), from Italian capriccio "whim," originally "a shivering," a word of uncertain origin. Some guesses from 19c. are that it is from capro "goat," with reference to frisking, from Latin capreolus "wild goat," or that the Italian word is connected with capo "head" + riccio "curl, frizzled," literally "hedgehog" (from Latin ericius). The notion in this case would be of the hair standing on end, hence a person shivering in fear.