...
But when I send the same to the Yamaha PSR 340, everything gets played on the same instrument and obviously sounds awful....
Thanks,
TLF
Years ago, I purchased a PSR740. If I remember it correctly, it supported only MIDI Type 0 not MIDI Type 1. When a device doesn't support the MIDI file Type 1, that's exactly what happens. If that is the case with your PSR340, you can convert type 0 to type 1. You can read more about it here.
https://www.sweetwater.com/sweetcare/articles/what-difference-between-midi-type-0-midi-type-1/