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

Akao Instr Sets exported to SF2 do not write dynamic ADSR information #434

Open
jdperos opened this issue Feb 5, 2024 · 2 comments
Open
Labels

Comments

@jdperos
Copy link

jdperos commented Feb 5, 2024

Environment details

  • Operating System+version: Win10
  • VGMTrans version: f638d0f, master
  • Game ROM/music dump name and sha256: Tested Chrono Cross and Final Fantasy IX

Describe the bug

Any SF2 file which has been created from an Akai Instr Set (ps1 square format) contains identical ADSR information, regardless of differences in the bytes shown in VGMTrans.

The SF2 instument ADSRs are always
A: 0
D: 4.039
S: 0
R: 0.029

Please see this image, in which an instrument has differing ADSR Sustain Rate values for its regions, but the exported SF2 file's Decay does not reflect this and have consistent 4.039 values. Of note is that in this same file, ADSR Release Rate also varies between instruments, but all instruments in the SF2 have the same Release value of 0.029 as well.
image

Steps to reproduce

  1. Open an Akao-based PSF in VGMTrans (Chrono Cross - 03 Arni Village is a good example)
  2. Right-click the Akao Instr Set
  3. Save as SF2
  4. Open the resulting SF2 file in your soundfont editor of choice (Polyphone over here)
  5. Select the instruments in the SF2
  6. Observe non-dynamic ADSR values

Expected behaviour

Instruments in SF2 files exported from Akao Instrument Sets that display varying bytes corresponding to ADSR information to have varying ADSRs

Additional context

No response

Logs

Click to expand log
[VGMTransQt] Running (f638d0f, master), BASS 2041100, Qt 6.6.1
[VGMFile] Loaded "Akao Seq" successfully.
[VGMFile] Loaded "Akao Instr Set" successfully.
[VGMFile] Loaded "Akao Sample Collection" successfully.
[VGMFile] Loaded "VGMSampColl" successfully.
[VGMFile] Loaded "VGMSampColl" successfully.
@jdperos jdperos added the bug label Feb 5, 2024
@mikelow
Copy link
Member

mikelow commented Feb 6, 2024

Thanks for the detailed report. I'll take a look when I have the chance. I think you might already understand this, but Sustain Rate isn't a concept in SF2 and DLS. As a workaround, the PSX ADSR conversion code (which is over 15 years old and not the greatest), checks if the decay stage is effectively unused, and if so, attempts to implement the sustain rate using decay (but only if the sustain rate is a negative value - yes it can increase amplitude as well). At any rate, this is very possibly what you're seeing here, and yeah it's probably buggy even for what it's attempting to do. But bear in mind that SF2 and DLS can't represent the PSX SPU envelope entirely accurately.

@jdperos
Copy link
Author

jdperos commented Feb 6, 2024

@mikelow thanks for the response and the informative explanations! Yes, I'm vaguely aware of the envelope parameters that the PSX SPU has to offer, and that it definitely has more than the basic ADSR parameters that SF2 has to offer. So what I would hope would occur on SF2 export would be an approximation of what the instruments are doing on the SPU, rather than something exact. Unfortunately, I can't find much documentation on the Akao instrument format to get more information about what the above bytes corresponding with ADSR parameters correspond to in terms of seconds - however in its current implementation, every ADSR acts essentially as a gate, so instruments that have looping samples and rely on decays (like guitars and harps) are rough.

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

No branches or pull requests

2 participants