Hi

Ah the dreaded Yamaha instrument number trap.

Normal midi patch numbers 0 to 127 (that is zero based)
Yamaha use one based numbering 1 to 127. for its voice list in the manuals and on the keyboard. But write the midi file 0 based to conform.
This is why its so important to have a pat file if you use a Yamaha voice set .
To be fair BIAB allows you to use one or zero based numbering .

Daws like cakewalk achieve this with .ins file (Instrument definition files)

Obviously things like coyote wave table dxi use standard gm 0 based names.

Extract from Yamaha xg lite pat file.
ZEROBASED
0.0.0=1 Grand Piano
1.0.0=2 Bright Piano
2.0.0=3 Electric Grand Piano
3.0.0=4 Honky-tonk Piano
4.0.0=5 Electric Piano 1
5.0.0=6 Electric Piano 2
6.0.0=7 Harpsichord
7.0.0=8 Clavi
8.0.0=9 Celesta
9.0.0=10 Glockenspiel
10.0.0=11 Music Box
11.0.0=12 Vibraphone
12.0.0=13 Marimba
13.0.0=14 Xylophone
14.0.0=15 Tubular Bells
15.0.0=16 Dulcimer
16.0.0=17 Drawbar Organ
17.0.0=18 Percussive Organ
18.0.0=19 Rock Organ
19.0.0=20 Church Organ
20.0.0=21 Reed Organ
21.0.0=22 Accordion
22.0.0=23 Harmonica


Extract from Cakewalk ins file

[XG lite Bank 0]
0=1 Grand Piano
1=2 Bright Piano
2=3 Electric Grand Piano
3=4 Honky-tonk Piano
4=5 Electric Piano 1
5=6 Electric Piano 2
6=7 Harpsichord
7=8 Clavi
8=9 Celesta
9=10 Glockenspiel
10=11 Music Box
11=12 Vibraphone
12=13 Marimba
13=14 Xylophone
14=15 Tubular Bells
15=16 Dulcimer
16=17 Drawbar Organ
17=18 Percussive Organ
18=19 Rock Organ
19=20 Church Organ
20=21 Reed Organ
21=22 Accordion
22=23 Harmonica

Hope this helps more than confuse.
Mike


BIAB2021 UltraPlus,AsusN55S1Tbssd, W10/64,Akai EIEpro
Yamaha CVP405,SquireStrat, CoolsoftVMidSynth
Novatation Impulse61 Ctr kbd, Cwalk blab Kontakt

http://mikesmusic.byethost16.com/