jsawrapdr: extract determine_instrument subroutine