[Scummvm-tracker] [ScummVM :: Bugs] #13460: SCUMM: DOTT: Incorrect MIDI pitch bending
ScummVM :: Bugs
trac at scummvm.org
Sat May 7 12:18:48 UTC 2022
#13460: SCUMM: DOTT: Incorrect MIDI pitch bending
----------------------+----------------------------------
Reporter: AndywinXp | Owner: (none)
Type: defect | Status: new
Priority: normal | Component: Engine: SCUMM
Version: | Resolution:
Keywords: adlib | Game: Day of the Tentacle
----------------------+----------------------------------
Comment (by AndywinXp):
Here's what's different for SAMNMAX with respect to DOTT, loosely adapted
from the newer iMUSE system to the older one which appears to be what
ScummVM's one is based on:
{{{
// Appears to be sent track by track instead of globally
IMUSE_SetTranspose(partPtr, relative, transpose) {
if ( value < -12 || value > 12 ) {
if ( value != 0 ) {
partPtr->transpose = partPtr->effTranspose =
IMUSE_UTILS_ClampTuning(value + partPtr->transpose, -12, 12);
} else {
partPtr->transpose = partPtr->effTranspose = 0;
}
IMUSE_PART_SendTransposeToMIDIDevice(partPtr);
}
}
}}}
{{{
// Appears to be sent track by track instead of globally
IMUSE_SetDetune(partPtr, detune) {
if ( value < -9216 || value > 9216 ) {
partPtr->detune = partPtr->effDetune = detune;
IMUSE_PART_SendTransposeToMIDIDevice(partPtr);
}
}
}}}
{{{
IMUSE_PART_SendTransposeToMIDIDevice(partPtr) {
effTranspose = partPtr->pitchbend + partPtr->effDetune +
(partPtr->effTranspose * 256);
partPtr->effTranspose = effTranspose;
if ( partPtr->midiChannel) {
midiPartId = midiChannel->chanNum;
if ( midiPartsTransposeValues[midiPartId] != effTranspose ) {
midiPartsTransposeValues[midiPartId] = effTranspose;
// 8192 is added because this number appears to be the center
// value for the pitchbend in this case; SAMNMAX multiplies the
transpose by 2
sendPitchWheelValueToMIDIDevice(partPtr->midiChannel, 2 *
partPtr->effTranspose + 8192);
}
}
}
}}}
--
Ticket URL: <https://bugs.scummvm.org/ticket/13460#comment:7>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM
More information about the Scummvm-tracker
mailing list