mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 15:02:39 +00:00
- Re-enabled TiMidity's loop and envelope stripping for instruments that look
like they weren't really meant to be played by the GUS MIDI library. SVN r941 (trunk)
This commit is contained in:
parent
c27ee7faa1
commit
8de6217f66
2 changed files with 42 additions and 11 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
April 25, 2008
|
||||||
|
- Re-enabled TiMidity's loop and envelope stripping for instruments that look
|
||||||
|
like they weren't really meant to be played by the GUS MIDI library.
|
||||||
|
|
||||||
April 25, 2008 (SBarInfo Update #18)
|
April 25, 2008 (SBarInfo Update #18)
|
||||||
- Simplified the DrawGraphic function in sbarinfo_display.cpp
|
- Simplified the DrawGraphic function in sbarinfo_display.cpp
|
||||||
- Added xOffset, yOffset, and alpha to every drawing function in
|
- Added xOffset, yOffset, and alpha to every drawing function in
|
||||||
|
|
|
@ -370,8 +370,21 @@ fail:
|
||||||
{
|
{
|
||||||
sp->modes |= PATCH_SUSTAIN;
|
sp->modes |= PATCH_SUSTAIN;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
/* [RH] Alas, eawpats has percussion instruments with bad envelopes. :(
|
||||||
|
* (See cymchina.pat for one example of this sadness.)
|
||||||
|
* Do this logic for instruments without a description, only. Hopefully that
|
||||||
|
* catches all the patches that need it without including any extra.
|
||||||
|
*/
|
||||||
|
for (j = 0; j < DESC_SIZE; ++j)
|
||||||
|
{
|
||||||
|
if (header.Description[j] != 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (j == DESC_SIZE)
|
||||||
|
{
|
||||||
/* Strip any loops and envelopes we're permitted to */
|
/* Strip any loops and envelopes we're permitted to */
|
||||||
|
/* [RH] (But PATCH_BACKWARD isn't a loop flag at all!) */
|
||||||
if ((strip_loop == 1) &&
|
if ((strip_loop == 1) &&
|
||||||
(sp->modes & (PATCH_SUSTAIN | PATCH_LOOPEN | PATCH_BIDIR | PATCH_BACKWARD)))
|
(sp->modes & (PATCH_SUSTAIN | PATCH_LOOPEN | PATCH_BIDIR | PATCH_BACKWARD)))
|
||||||
{
|
{
|
||||||
|
@ -380,13 +393,27 @@ fail:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strip_envelope == 1)
|
if (strip_envelope == 1)
|
||||||
{
|
|
||||||
if (sp->modes & PATCH_NO_SRELEASE)
|
|
||||||
{
|
{
|
||||||
cmsg(CMSG_INFO, VERB_DEBUG, " - Removing envelope\n");
|
cmsg(CMSG_INFO, VERB_DEBUG, " - Removing envelope\n");
|
||||||
|
/* [RH] The envelope isn't really removed, but this is the way the standard
|
||||||
|
* Gravis patches get that effect: All rates at maximum, and all offsets at
|
||||||
|
* a constant level.
|
||||||
|
*/
|
||||||
|
for (j = 1; j < ENVELOPES; ++j)
|
||||||
|
{ /* Find highest offset. */
|
||||||
|
if (patch_data.EnvelopeOffset[j] > patch_data.EnvelopeOffset[0])
|
||||||
|
{
|
||||||
|
patch_data.EnvelopeOffset[0] = patch_data.EnvelopeOffset[j];
|
||||||
}
|
}
|
||||||
sp->modes &= ~PATCH_NO_SRELEASE;
|
|
||||||
}
|
}
|
||||||
|
for (j = 0; j < ENVELOPES; ++j)
|
||||||
|
{
|
||||||
|
patch_data.EnvelopeRate[j] = 63;
|
||||||
|
patch_data.EnvelopeOffset[j] = patch_data.EnvelopeOffset[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#if 0
|
||||||
else if (strip_envelope != 0)
|
else if (strip_envelope != 0)
|
||||||
{
|
{
|
||||||
/* Have to make a guess. */
|
/* Have to make a guess. */
|
||||||
|
@ -418,7 +445,7 @@ fail:
|
||||||
for (j = 0; j < 6; j++)
|
for (j = 0; j < 6; j++)
|
||||||
{
|
{
|
||||||
sp->envelope_rate[j] = convert_envelope_rate(song, patch_data.EnvelopeRate[j]);
|
sp->envelope_rate[j] = convert_envelope_rate(song, patch_data.EnvelopeRate[j]);
|
||||||
// GF1NEW clamps the offsets to the range [5,251], so we do too.
|
/* [RH] GF1NEW clamps the offsets to the range [5,251], so we do too. */
|
||||||
sp->envelope_offset[j] = convert_envelope_offset(clamp<BYTE>(patch_data.EnvelopeOffset[j], 5, 251));
|
sp->envelope_offset[j] = convert_envelope_offset(clamp<BYTE>(patch_data.EnvelopeOffset[j], 5, 251));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue