I'm only beginning play with midi code but I was under the impression once you send note-on it would play until you send note-off?
Apart from that... it might also depend on how your how yamaha keyboard interprets midi signals... best bet is to add debounce...