instruments: get parent by name and handle midi in one function

This was possible thanks to David Kastrup.  There is still code duplication,
but I hope to get rid of it sooner or later.  Anyway, the interface is now
quite user-friendly!