Musical Acts and Musical Agents: theory, implementation and practice