Skip to content

Commit

Permalink
MT32: Sync with the latest changes in munt
Browse files Browse the repository at this point in the history
The major change is the addition of a refined wave generator based on
logarithmic fixed-point computations and LUTs
  • Loading branch information
bluegr committed Mar 2, 2013
1 parent 8884c24 commit f4cc45d
Show file tree
Hide file tree
Showing 14 changed files with 1,278 additions and 421 deletions.
8 changes: 6 additions & 2 deletions audio/softsynth/mt32/LA32Ramp.cpp
Expand Up @@ -82,9 +82,13 @@ void LA32Ramp::startRamp(Bit8u target, Bit8u increment) {
if (increment == 0) {
largeIncrement = 0;
} else {
// Using integer argument here, no precision loss:
// Three bits in the fractional part, no need to interpolate
// (unsigned int)(EXP2F(((increment & 0x7F) + 24) / 8.0f) + 0.125f)
largeIncrement = (unsigned int)(EXP2I(((increment & 0x7F) + 24) << 9) + 0.125f);
Bit32u expArg = increment & 0x7F;
largeIncrement = 8191 - Tables::getInstance().exp9[~(expArg << 6) & 511];
largeIncrement <<= expArg >> 3;
largeIncrement += 64;
largeIncrement >>= 9;
}
descending = (increment & 0x80) != 0;
if (descending) {
Expand Down

3 comments on commit f4cc45d

@lordhoto
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change broke compilation on our MacOS X PPC target on buildbot:

../../src-master/src/audio/softsynth/mt32/Tables.cpp: In constructor 'MT32Emu::Tables::Tables()':
../../src-master/src/audio/softsynth/mt32/Tables.cpp:85: error: 'sinf' was not declared in this scope

@bluegr
Copy link
Member Author

@bluegr bluegr commented on f4cc45d Mar 2, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I am aware of this. sinf is missing in that toolchain, but I'm not sure what to do. Should we replace sinf with sin, should we declare it or should we try and fix the toolchain?

@lordhoto
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sinf is C99. I don't think we want to require all our toolchains to support C99 just yet. So changing the toolchain is not an option IMHO.

Otherwise I don't have any strong opinion on what you do to fix it. Please try to get it into Munt's upstream though so that they are aware of this and we won't have too many divergencies from Munt's upstream.

Please sign in to comment.