Why wouldn't they insist that the boatswain learn to play a real pipe? And, I believe there aren't a lot of notes... so even something like a flute wouldn't be that complicated!
Point of realism-- in one of the first Trek movies Spock tells the boatswain to pipe Kirk on board. Unless there's a speaker in the airlock, he isn't going to hear anything! I think it would be a more ceremonious welcome if they waited until the airlock opened so Kirk could see the ceremony.
--Paul E Musselman