Took exam involving working with a piece of music (6)
I believe the answer is:
sonata
'piece of music' is the definition.
(type of musical composition)
'took exam involving working with a' is the wordplay.
'took exam' becomes 'sat' (as in sitting an exam).
'involving' is an insertion indicator.
'working' becomes 'on' (e.g. a machine is working or on).
'with' means one lot of letters go next to another.
'sat' placed around 'on' is 'sonat'.
'sonat'+'a'='SONATA'
(Other definitions for sonata that I've seen before include "Chamber work" , "Musical composition for one or two instruments" , "Musical work for a solo instrument" , "piece for instrumental soloist" , "Type of musical composition" .)