Previous Page | Next Page
- by bnnm at 12:09 PM EDT on September 6, 2017
- It'll take some weeks/months, depending on my motivation.
- by marcusss at 12:53 PM EDT on September 6, 2017
- Sorry bnnm the Game using OPUS is Ken Folletts The Pillars of the Earth (PC) which I ripped a while back.
- by Nisto at 5:21 PM EDT on September 6, 2017
- Hey guys, can I ask a quick (possibly dumb) question, mostly for GENH/PSXADPCM?
When setting a loop point, what exactly is that meant to represent; the last sample to be played, or the end of the loop data? I'm just reading through the SPU2 docs, and they say that the last sample of a block with the loop/end bit set becomes the final processed sample of a loop. So basically I'm wondering if I should set the loop end point to the last sample, or past the last sample..
- by bnnm at 7:46 PM EDT on September 6, 2017
- IIRC (somebody recheck):
loop_end_sample = "after decoding N samples, go back to right before loop_start_sample".
Say you want to loop 1 sec at 44100: loop_start = 0 (no samples decoded), loop_end = 44100 (all samples decoded) = decodes 44100 samples (not 44101)
(IOW loop_end 0 wouldn't mean "loop first sample", but "no samples", obviously not valid).
PS ADPCM flags are similar but in decoded 0x10 frames, ex:
- loop_start flag in the 1st frame: loop_start_sample = 0 (*before* frame 1
- loop_end flag in the 2nd frame: loop_end_sample = 28+28 (*after* frame 2).
So after decoding all 2 frames/56 samples it'll rewind right before frame 1.
Note that rarely the header's meaning of loop_end_sample varies to +-1 (ex some DSP, SGXD).
EDIT: now with proper math, 28+28 != 48, derp.
edited 4:28 AM EDT September 7, 2017
- by Nisto at 8:26 PM EDT on September 6, 2017
- Yeah, that's always how I've interpreted the loop start value. Makes total sense. Just never really knew how the loop end value was handled. Thanks, bnnm!
By the way, you mean "2 frames/56 samples", not 48 samples, right?
- by Ultrafighter at 3:58 AM EDT on September 7, 2017
- Big thanks for quick explanation Bnnm, I could have missed a few tracks if you hadn't helped me out! It's not just Main_Theme_Track but also UI_FX_Victory_Loop and numerous stingers.
Best wishes!
- by Nisto at 2:14 PM EDT on September 7, 2017
- @bnnm / vgmstream devs: Sorry to be a bother again. I ripped the audio now, according to the logic you explained, bnnm. Well, actually, I automated three rips, with sample offsets +0 (before first sample), +27 (before last sample), and +28 (after last sample), all relative to the start of the loop end block.
As you may guess, the +0 rip pops more frequently, so that's probably indeed not how it's supposed to work. But interestingly enough, that rip has some files that do not pop, whereas both the +27 and +28 rips do. I had a look at one particular stream, and I noticed that, at least there, the loop end block is the final block of the entire stream. So I'm wondering if there's a conflict there somehow when looping over?
Case in point: https://www.sendspace.com/file/hrxi59
Or do we just assume the composer wasn't really affected by it, thanks to the use of ADSR envelopes and stuff?
- by bnnm at 5:50 PM EDT on September 7, 2017
- @Nisto - interesting case. I did a quick test with Sony's vagconv tool and as far as I see what I posted is correct.
ie.- I converted 1 sec/44100 samples wav to .vag, loop_start = 0, loop_end = 44100. The resulting file is 0x6270 (+0x10 extra null "reset" frame at the start), and 0x6270 * 28 / 16 = exact 44100. Flag 0x06 in the first frame (loop starts right before it) and 0x03 in the last frame (must be fully decoded).
So a few ideas for your file:
- actually ignores the loop start/end flags and loops by exact sample stored somewhere
- may *not* need to preserve ADPCM history when looping (by default for PS ADPCM it doesn't reset the internal state). Very unlikely, and I did a quick test and I don't think this is the case.
- it actually pops in game too. But I'd think Sony's tools adjust looping by adding padding so loops are aligned to 28 samples (unless they used their own tools)
- by Nisto at 8:52 PM EDT on September 7, 2017
- Yeah, you know what. It seems like that sample actually does click in game too. Silly me. I hadn't noticed since it doesn't actually loop over until a few seconds in, and otherwise just cuts before reaching the loop point.
Also, just out of curiosity, mind telling me where I can find VagConv? Never heard of that tool before. I do have both the PS1 and PS2 SDKs, but I couldn't find it in either. All I could find was a blog post from the guy who supposedly developed the tool. I do see encvag.dll and VAGEdit in the SDKs though..
- by bnnm at 5:21 AM EDT on September 8, 2017
- Good(?) to know devs actually mess up their audio.
vagconv ([95]-VAGconverter-1.0.zip) is actually from the PS3 SDKs. Nicer that the PS1/2 apps since it's command line.
The timestamp is from 2006 and creates .vag pretty much like PS1/PS2 so it shouldn't be matter much it's from PS3.
The SDK has other neat apps/docs for research too.
Previous Page | Next Page
Go to Page 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
Search this thread
Show all threads
Reply to this thread:
HCS Forum Index
Halley's Comet Software
forum source