Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few potential tiny issues #255

Open
BleuBleu opened this issue Mar 7, 2025 · 0 comments
Open

A few potential tiny issues #255

BleuBleu opened this issue Mar 7, 2025 · 0 comments

Comments

@BleuBleu
Copy link

BleuBleu commented Mar 7, 2025

Hi!

Im writing my own little SF synth (much simpler) than yours and I am comparing my output to Polyphone. I think I have found a couple of tiny issues, but I may be super wrong. Apologies in advance if I am.

  1. Im fairly sure the little recorder tool swaps the L/R channels. The ordering in a stereo wave file is L/R/L/R.

    _dataWav[2 * i + 1] = dataL[i];

  2. Im not 100% confident that Polyphone loads the sm24 data from the correct offset in the file. I was testing with this file: https://www.musical-artifacts.com/artifacts/5536 and according to my calculations, the sm24 raw data should start at offset 72577618. Polyphone seems to be off by a couple hundred bytes? I may be wrong but I think this calculation fails to take into account previous headers and stuff.

    value.dwValue = SHDR._start.value + sdtaPart._startSm24Offset;

  3. Certain envelope calculations are done twice. With large buffers this is not a big deal, but if you run the envelopes 1-sample at a time (which never happens in reality) you will see that the decay and release of the modulation envelope applies the slope twice. Meaning a 2sec decay will take 1sec. Again, this doesnt really matter with 512-bytes audio buffers, the error will be tiny, but it is still a small error.

    lastValue = _precValue + coef;

Thanks so much for developing this tool. It is the benchmark every other soundfont tool should be compared against.

-Mat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant