I'm using Anomie's apudsp.txt doc -- he only briefly touches on it:
Seems simple enough at first glance. However I'm running into several sound effects and even some samples used in music where the first block of a sample consists of 9 00s. So what ends up happening:
- voice is keyed on (enter Attack)
- instrument/sample is restarted
- first header byte is 00 ('l' bit clear) -- enter Release (and hold Envelope at 0)
- From what I can tell... the only way to get out of Release state is to key on again (enter attack) -- which of course just repeats this process.
The end result is that any sound effect/music channel that uses these instruments is totally silent.
This apparently has the biggest impact on Castlevania - Dracula X. When I ignore the loop bit entirely, music and sound effects play normally. When I impliment the loop bit as described, I hear absolutely nothing.
Other noted areas where this happens:
- most/all music channels on the "second" overworld music in SMW (first heard in the "Yoshi's Island 3" stage)
- The "yoshi sound" in SMW
- The whip sound effects in Super Castlevania 4
--
Now I'm not entirely convinced this is the whole story. That problem aside, I have a few other problems in my SPC emulation either in the CPU (still!), in my volume and/or envelope handling, or in my sample decoding -- because even in games that DO play sound... the sound doesn't sound quite right (some samples are crackley, and some voices are much quieter than they should be, while others are crazy loud)
SO! My questions are:
1) Do the samples in question really start with a zero'd out block? Or is there some bug in my CPU/wherever that's causing the wrong sample or sample address to be loaded?
2) Does the loop flag really work as I'm implimenting? Or is there some other condition to it? (like... only look at it if 'e' is set?)
Quote:
If 'l' is clear, the voice goes into the Release state and the envelope goes to 0 immediately.
Seems simple enough at first glance. However I'm running into several sound effects and even some samples used in music where the first block of a sample consists of 9 00s. So what ends up happening:
- voice is keyed on (enter Attack)
- instrument/sample is restarted
- first header byte is 00 ('l' bit clear) -- enter Release (and hold Envelope at 0)
- From what I can tell... the only way to get out of Release state is to key on again (enter attack) -- which of course just repeats this process.
The end result is that any sound effect/music channel that uses these instruments is totally silent.
This apparently has the biggest impact on Castlevania - Dracula X. When I ignore the loop bit entirely, music and sound effects play normally. When I impliment the loop bit as described, I hear absolutely nothing.
Other noted areas where this happens:
- most/all music channels on the "second" overworld music in SMW (first heard in the "Yoshi's Island 3" stage)
- The "yoshi sound" in SMW
- The whip sound effects in Super Castlevania 4
--
Now I'm not entirely convinced this is the whole story. That problem aside, I have a few other problems in my SPC emulation either in the CPU (still!), in my volume and/or envelope handling, or in my sample decoding -- because even in games that DO play sound... the sound doesn't sound quite right (some samples are crackley, and some voices are much quieter than they should be, while others are crazy loud)
SO! My questions are:
1) Do the samples in question really start with a zero'd out block? Or is there some bug in my CPU/wherever that's causing the wrong sample or sample address to be loaded?
2) Does the loop flag really work as I'm implimenting? Or is there some other condition to it? (like... only look at it if 'e' is set?)