Skip to content

Commit

Permalink
Merged revision(s) 22330 from trunk/OpenMPT:
Browse files Browse the repository at this point in the history
[Fix] When importing a soundfont instrument, its bank number was off by one.
........


git-svn-id: https://source.openmpt.org/svn/openmpt/branches/OpenMPT-1.31@22331 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
sagamusix committed Nov 28, 2024
1 parent 6d83943 commit 5f0be19
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions soundlib/Dlsbank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2127,9 +2127,9 @@ bool CDLSBank::ExtractInstrument(CSoundFile &sndFile, INSTRUMENTINDEX nInstr, ui
}
}
pIns->nFadeOut = 1024;
pIns->nMidiProgram = (uint8)(dlsIns.ulInstrument & 0x7F) + 1;
pIns->nMidiChannel = (uint8)(isDrum ? 10 : 0);
pIns->wMidiBank = (uint16)(((dlsIns.ulBank & 0x7F00) >> 1) | (dlsIns.ulBank & 0x7F));
pIns->nMidiProgram = static_cast<uint8>(1 + (dlsIns.ulInstrument & 0x7F));
pIns->nMidiChannel = static_cast<uint8>(isDrum ? 10 : 0);
pIns->wMidiBank = static_cast<uint16>(1 + (((dlsIns.ulBank & 0x7F00) >> 1) | (dlsIns.ulBank & 0x7F)));
pIns->nNNA = NewNoteAction::NoteOff;
pIns->nDCT = DuplicateCheckType::Note;
pIns->nDNA = DuplicateNoteAction::NoteFade;
Expand All @@ -2146,7 +2146,7 @@ bool CDLSBank::ExtractInstrument(CSoundFile &sndFile, INSTRUMENTINDEX nInstr, ui
const DLSREGION &rgn = dlsIns.Regions[nRgn];
if(rgn.IsDummy())
continue;
// Elimitate Duplicate Regions
// Eliminate Duplicate Regions
uint32 dupRegion;
for(dupRegion = minRegion; dupRegion < nRgn; dupRegion++)
{
Expand Down

0 comments on commit 5f0be19

Please sign in to comment.