#AtomicAudio: Tools for CRI audio formats (ACB, AWB, ADX, HCA, etc.)

1 messages · Page 1 of 1 (latest)

hollow cliff
#

Hi, hello! I've been alluding to some kind of audio-related thread for a while, but couldn't figure out where to start with it.

In short: The audio-editing process (extracting, encrypting, replacement, etc.) has some holes in it. It seems like it would be useful to have a place to discuss general maintenance of existing tools + possible new tools.

I have... lots more to say, but walls of text scare people off. So instead I'll give a ping to a few folks who've been part of the discussion around audio tooling in the past, and see if anyone wants to chime in first.

Let's see... @flint vortex, @foggy river, @static wasp ...you all have expressed interest in this topic before. Anyone's welcome, of course ✌️

flint vortex
#

i was one day away from posting the waiting seal meme in reference to this naocry

foggy river
#

hewwo

flint vortex
#

you should post that wall of text, or at least list out what are the holes you noticed mikustare

hollow cliff
#

Well, I'll at least try to keep it to-the-point....

  • Most of the popular audio editing tools are buggy, incomplete, no longer maintained, and/or were only maintained for non-Persona games. SonicAudioTools and VGAudio (and to a lesser extent ACE/XV2-Tools) are the main examples.
  • Since I have the basic code for handling ACB/AWB/ADX files (as seen in the current EVTUI PR), I'd like to build on that to make a unified + community-maintained alternative for said tools. Ideally without breaking everyone's existing workflows.
  • On a related but slightly different note, AWB Emulator has some long-term bugs re: being able to handle certain files. P5R's VOICE_SINGLEWORD is the most notable, but not the only one. I have some ideas and I'd like to help debug, but my knowledge of the actual modding codebases is limited, and Sewer is a busy bee.
  • ...Also, I wouldn't mind brainstorming ways to make AWB emulation more friendly to ACB structure/replacement. Or at least ways to make it easier to map from cues to sound files and vice versa. Right now that's difficult to do, since we're only using the ordering of sound files inside of AWBs for indexing.
flint vortex
#

gotta love vgaudio having hca encryption support but with no release binaries for it lol

#

not a ton i have much experience with from what you've listed. i've only ever cared playing new audio; do you think it'd be possible to do so (through dynamically adding cues) with a theoretical modified awb/acb emu?

#

vgaudio i've only used as a library, essentially making a glorified vgaudio gui 😔

foggy river
#

ive worked with file emulation framework to make bmd emulator although most of that was just copying code made by swine for bf emu lol, i didnt really have to touch awb emu specifically

#

i have historically added two different tools to aem specifically for handling awbs which i wouldnt mind reducing that to one that works better than either

hollow cliff
#

...ACBs are entire audio sequencing projects. Fully making them editable in an accessible way would basically mean creating an audio sequencing UI 😅

hollow cliff
#

For the basic emulator fix, my suspicion is that it doesn't handle the two different AWBs a given ACB can have: one embedded inside the ACB (in memory), and one that's the external (streamed) AWB file. So if a given ACB uses files in both, that's when the emulator fails. I need to delve into the code to confirm this, but any prior knowledge of the framework is helpful.

foggy river
# hollow cliff Ooh, I'm curious about that. Have you hit issues with the ones you've used?

well one of them is just sonicaudiotools and another is awbtools for awbs without an acb (p4g vita has some)
though tbh i havent personally done anything fancy with the awb merging functionality, just replaced a couple q2 voiceclips

the basic workflow is unpack vanilla acb/awb ==> copy modded audio into output folder ==> repack (with some file moving to deal with awbtools's quirks), similar to how aem handles paks

hollow cliff
hollow cliff
foggy river
#

mostly just what the output looks like
unpacking gives a folder named nameoftheawb_extracted_files with audio files named idinhex.bin, repacking gives an archive named OUT.AWB at aem root. for both of these i just move the file and change the names during the move operation (making the unpack output look like sat's plays better with the process of copying modded audio)

hollow cliff
#

So what I'm thinking for how to proceed... maybe it's just like. You all tell me your wishlists for an audio tool that would work in + improve on current setups, I make some demos, and we see where we want to go from there?

#

(You've already given some starting pointers, ofc.)

foggy river
#

i would like to be able to add new cues for aem awb merging so a move away from sat would be nice

hollow cliff
#

Okay, yeah! A good demo might just be... the simplest possible way of adding a new AWB entry + a new ACB cue that points to it.

#

...And then we can make sure it plays nice with AWB merging + emulation.

static wasp
#

Doesn’t help that most of my coding is on my remote pc atm, which is laggy as shit 🥲

static wasp
#

also I just activated AtomCraft I believe it has a 3 month Eval period but I downloaded the sdk off archive so who knows naotoshrug
Maybe be useful for fully reverse engineering the project files if we wanna go that route :3

#

CriAtomViewer (Cri's ACB, AWB, ADX player ) Shits itself when trying to open anything tho so theres that 🥲

#

Also another idea with the SDK is to take a peek inside the dlls AtomCraft uses, May give some insight on how AC builds the Cue Binaries (ACB), if they arent obfuscated that is

static wasp
plucky elm
#

I’m just starting out with audio modding stuff (like literally last week so I’m still unfamiliar with all the tools right now) but I have a request!

#

Could it be possible to just right click on an audio file (in a set) and be given the option to directly replace it?

#

Apologies if this is something that’s already a thing

hollow cliff
# static wasp Here's [the SDK I'm yapping ab](https://archive.org/details/cri-sdk) if anyone w...

Ooh, I hadn't seen these, but I can probably use some of the default values for sampling rate etc., at the very least 👀

But lol, yeah, don't worry too much about adapting my code as-is. I'm currently adjusting it so that adding cues won't require a ton of manual recalculations (as it currently would). Also making it compatible with older ACB versions, etc. Feel free to play around with it, ofc, but I'm on it ✌️

static wasp
#

BTW id recommend you do the installer thats on that page rather than the zip if your gonna check it out

#

Atom Player actually does shit now femc

#

kinda wanna see how fast it loads singleword lol

hollow cliff
hollow cliff
static wasp
#

About 4~ minutes

#

not great, but not unexpected lol

hollow cliff
#

Damn, it feels good to win... 😆

static wasp
#

On one hand it may be just because its loading a lot ish more data I think? Other hand your may be more optimized :3

#

prolly combo of both lol

hollow cliff
#

I mean, my code does read the whole thing, but theirs probably also takes time setting up the UI and such. Still, four minutes... anybody ever hear of lazy loading over there 💀

static wasp
#

It may ACB do not play correctly

#

I thought i had a stroke

static wasp
#

@hollow cliff
IMHO, it would probably be rather easy to write a py script to rebuild all the ACB files to Atom’s cue sheets.

from the looks of it, the project layout doesn’t really matter a whole lot when trying to compile the Binaries. The project layout is basically the ACF file that can be located in BASE/SOUND and it holds things like Audio Bussing, Telling the game what categories there are and what ACBs are attached to AWBs.

BUT while i think it would be cool to have things in the original software, it has problems. Its buggy, i have had it crash when renaming shit and freeze when loading shit (Atom player but im assuming AtomCraft does this too cuz it uses the same framework)

Honestly it would be faster speed-wise for the code you have to be modified to completely have everything configurable using AtomPlayer as a base for how the ACB is structured. AP, Im pretty sure, has all the info displayed in the gui so shouldnt be difficult to figure out what things are.

hollow cliff
#

Makes sense! That's how I'd prefer to use it, anyway -- for reference rather than as a dependency. The only downside is probably needing to make a custom audio track editing UI from scratch somewhere down the line 🥹

static wasp
#

I figured lol. Its more fun doing it this way anyways (aside from the ui 💀)

static wasp
foggy river
#

yknow i just remembered something weird about one of q2's acbs. imma check something when i get home

static wasp
hollow cliff
# static wasp Do you have notes and/or something like a 010 template for the ACB/AWB files?

Uhhh, not really 😅 The current code was largely based on XV2-Tools (for ACB/AWB) and VGAudio + vgmstream (for ADX). I cross-referenced those to hash it out in Python and then translated back to C# 🤷 I wouldn't necessarily recommend using XV2-Tools as a reference because it has a LOT going on, but it could be enlightening.

Basically, though, ACB files are just Criware UTF tables, and AWB files are AFS2 archives. UTF.cs, AFS2.cs, and ADX.cs should read pretty similarly to 010 templates.

static wasp
hollow cliff
#

It's all effed up at the moment because I'm using it to draft the cue-editing-friendly rearrangement 😅 But I'll share it as soon as it's back in order.

#

So it's actually MORE updated, lol.

static wasp
#

sweet naocool

#

tyy

hollow cliff
#

Hmmmmm. I wonder. It seems perfectly possible to specify in the ACB that a given audio file is a WAV... if we do that and then actually put a WAV at that index, would the game play it properly? Or is there extra code in the exe that makes things go boom if it gets anything but an ADX?

I guess, more generally, what have people tried re: using non-ADXs (without any exe patching), and how has it gone? Is there reason to believe that wouldn't work?

foggy river
#

btl_voice.awb in q2 uses bcwav

hollow cliff
foggy river
#

(this is what i wanted to bring up btw)

hollow cliff
#

😦

#

Weird....

#

Very weird.

foggy river
#

i have the acb and awb themselves open in 010 rn but i dont really understand the file format enough to spot any weirdness lmao

hollow cliff
#

I could take a look / see if they break anything, but I imagine they're a bit large to send, based on how many cues there are in that .h file 😅

#

Actually, you could just send the ACB, which is probably smaller than the AWB.

foggy river
hollow cliff
#

...yeah, the ACB seems normal, and all of the files are labeled as streaming + BCWAV-formatted, as expected....

#

My current theory is that the format index currently labeled in XV2-Tools as BCWAV (and indeed, assigned in this ACB -- it's 9) is actually a generic AudioBuffer, for sound files that CriAtom doesn't handle natively. And so the additional header is for whatever actually knows how to play BCWAV to use to get at the relevant files.

Basis from the CriAtom files linked earlier is this enum:

#define CRIATOM_FORMAT_NONE         (0x00000000)
#define CRIATOM_FORMAT_ADX          (0x00000001)
#define CRIATOM_FORMAT_HCA          (0x00000003)
#define CRIATOM_FORMAT_HCA_MX       (0x00000004)
#define CRIATOM_FORMAT_WAVE         (0x00000005)
#define CRIATOM_FORMAT_RAW_PCM      (0x00000006)
#define CRIATOM_FORMAT_AIFF         (0x00000007)
#define CRIATOM_FORMAT_VIBRATION    (0x00000008)
#define CRIATOM_FORMAT_AUDIO_BUFFER (0x00000009)
#define CRIATOM_FORMAT_INSTRUMENT   (0x0000000C)
#define CRIATOM_FORMAT_HW1          (0x00010001)
#define CRIATOM_FORMAT_HW2          (0x00010002)
static wasp
static wasp
#

Criware has different build for there atomCraft for different platforms

hollow cliff
static wasp
#

wdym? the key are usually stored in the acb files? o.O From the docs it says you can set an encryption key in project settings or on the Cue sheet

#

and somewhere else idr hol on

hollow cliff
#

I just mean, in terms of what we can change in existing ACBs, I don't think that's where the encryption key set in an AtomCraft project is stored.

#

Like, we couldn't get rid of the need for an encryption key or anything. ...Probably??

#

All of this comes down to a main question of mine: Could we just put regular old WAVE files in an AWB, as long as the ACB labels the cues as such, and expect them to play in-game?

#

Or does something prevent this / encryption make it complicated?

static wasp
#

I think,, we'd need to rebuild the ACF file for that. Since A/C stores project settings which would hold the encryption key, as well as what format the audio files are in... Ill show u in a sec once i find the tut project

hollow cliff
#

Okay, so the ACF is what probably lives in the exe somewhere.

static wasp
#

Nope

#

it lives in base.cpk/sound

hollow cliff
#

Huh....

static wasp
#

:3

hollow cliff
#

Whoa....

#

Oh, fuck, it's also just a UTF table... demistare

static wasp
#

You can see that when you open it in *atomviewer that it resembles the general project struct in A/C

#

wow thts r00d of discord for not sending my pic

static wasp
#

All the project files are xml

hollow cliff
#

It's not obvious to me where in here the encryption key would be, though....

static wasp
#

possiblly obfuscated?

hollow cliff
#

...Or where file formats are defined. Because there IS a place for that in ACBs already.

static wasp
#

Maybe Cri does store it in the individual acbs naopain

#

Looks at the project settings and applies it to all of them?

foggy river
#

what game is this from

static wasp
#

P5R

foggy river
#

aight i wasnt sure from the filepath

static wasp
static wasp
hollow cliff
#

Looks like this is where variables get defined, e.g., those that define what type of footsteps play.

static wasp
#

side note archive.orgs dl speeds are ~garbage~

#

yea a catagorizer basically acf just tells the game where to look for the files.

#

and volume control

hollow cliff
#

Gotcha.

static wasp
hollow cliff
#

So then... WAV files in an AWB? Maybe a thing that could work?? I feel like encryption is the only problem there, because I have no idea what the game would expect.

static wasp
#

possibly? naotoshrug

#

I'm gonna try build the sample project into two acbs one with encryption one without then compare them

#

if stop dowwnloading the wrong files that is 🥴

#

@hollow cliff the key is the same whether you encrypt or decrypt right?

#

im tired idr lol

hollow cliff
#

Yeah, it's the exact same key and algorithm both ways.

static wasp
#

coolio

#

Ahh So if the parent's key is set the child's default is the set key :v

#

so that means, yea the key is set per acb

static wasp
#

D: my highlight isnt highlighting

#

"with c#"

static wasp
#

Also btw @hollow cliff the answer is no, you cant just plop in a wav. It need to be ADX, HCA, or "HCA-MX" (??). There is no option for WAV. Im pretty sure this is intentional, Cri want you to use their audio format with their cue binaries . Especially for performance reasons. (SingleWord to wav every time its used? terrifying...)

You can try brute forcing it but i have a strong feeling the game expects one of the cri filetypes. Im not entirely sure how, or whether its the game itself or Cri's decoding/unpacking/streaming library the game uses.

#

But!

#

havent finished testing but i think that, at the very least, you should be able to remove the keys entirely since they are tied to the ACBs?

hollow cliff
#

Hmmmm, in the headers it does account for WAV, though... as in, other formats (that included) are explicitly enumerated. And BCWAV is not a Cri format, afaik, but it works in its game....

#

I think the actual media player CAN play a WAV/RIFF formatted file. It's more a question of whether we'd be stopped before reaching that point.

#

As for removing keys, it looks like keys are set when exporting the binary, but they're not necessarily in the binary...?

static wasp
#

Okay I dont think i exported it right the audio files are in instead of seperate
*Edit had it set to Memory instead of Stream Naofacepalm *

static wasp
#

I found something~

#

that was the only difference between those files

#

@hollow cliff

#

Idk How to interpret that tho, it doesnt convert to easily into the key tho

#

The difference is 16 bytes long which also happens to be the size of the key in Hex

#

So I was right it was obfuscated :S

hollow cliff
#

Yeah, I've been looking at the hashes inside the ACBs, but I don't know how they map to the key.

hollow cliff
#

I mean, it COULD be an Md5 hash of the key, but tbh it seems more just like a way of checking that the ACF and AWB are consistent with expectation. I guess the key could be embedded in that info, indirectly, since the AWB is indeed different between your two files (by virtue of being encrypted or not).

#

Like, they're just checksums. But the AWB checksum does account for encryption in some sense. I just don't think the key would actually be retrievable from that 🤔

static wasp
#

u rite

#

its md5 of the awb 🥲

hollow cliff
#

It could be obfuscated inside the AWB somehow, I guess? But I don't know where.... They're not complicated archives....

#

If you change the default key, does the ACF change at all vs. no default key?

static wasp
#

Has anyone tried just putting them in no encryption?

hollow cliff
#

Welp. "Somewhere mysterious inside the exe" continues to be my theory.

#

I mean, putting in non-encrypted ADXs gets you garbage 🤷

static wasp
#

Makes me wonder how the key was found in the first place naothink

#

@ ShrineFox

hollow cliff
#

The keys are pretty easy to brute-force. There are a number of tools for that, which I assume is how the existing ones were found.

#

It would just be weird if that's how the game itself also did it, lmao.

static wasp
#

Cri makes me cri

hollow cliff
#

Well, bringing attention to those hashes is a nice thing, so I can update them after changing the AWB. That's a plus 👍

foggy river
#

it came up in the reshoot server while we were talking about the idea of adding new battle bgm to that game

hollow cliff
#

Huh. Well, it'd be worth experimenting with adding new cues without changing that file, to see whether it actually gets used.

foggy river
#

is this an ask to run an experiment with ace?

hollow cliff
#

Oh, lol, sorry, it was just speculative. I meant once I get things working with other games. But you could try ACE if you wanted to 🤷

foggy river
#

oh lol

#

i wasnt actually sure about the idea anyway tbh, theres seemingly a bf involved in picking battle bgm too that is hard to make sense of because q2 flowscript has next to no documentation

static wasp
#

yeah when the cue sheets are compiled into ACB, header files are automatically generated and the the ACBs are not dependent on them either. idk, i think its more for reference/debugging purposes. I think kinda like how header files are left for libraries and dlls sometimes so you can have intellisense while using them :3

static wasp
#

@foggy river

hollow cliff
#

Live feed of me fighting UTF table offets:

#

Progress is being made, but good lord.

foggy river
#

so are we looking at like a library with a gui program you can download, like with crifsv2, or some other implementation

hollow cliff
#

I'm prototyping on the commandline so I don't have to also wrestle with a GUI at the same time, but ultimately the CriFs comparison is a good one -- since it has a GUI frontend and a C# library version for easy use in other projects.

#

That'd be the ideal, I think.

static wasp
# hollow cliff Live feed of me fighting UTF table offets:

Fr, trying to keep my sanity while trying to understand the overall structure of the UTFs. Im still entertaining the idea of possibility of converting from Acb to the Atom CueSheets format. But altleast understand how its sorta structured now thanks to ur code 🙏

flint vortex
static wasp
hollow cliff
#

It's still python code, lol. The offsets have been tamed for now, so I'll probably be able to share something basic for it today.

So far it can just replace audio tracks (and update the ACB's hash accordingly!), but I want to expand it a bit more for removing tracks and adding/removing cues.

foggy river
#

did a very lazy audio replacement in q2 and rediscovered something id forgotten about
vanilla bgm.awb (and i think also btl_voice) will throw an error if you try to open it in foobar, but a modded one repacked with sat will load just fine

static wasp
#

the bmg acb/awb i mean

foggy river
#

(the replacement was changing mass destruction (wave id 16) to mass destruction -reload-)

hollow cliff
static wasp
hollow cliff
#

As soon as I share it in this thread, lmao.

static wasp
hollow cliff
#

It does seem like it'd be straightforward enough to translate from ACB/UTF binary structure to that cue sheet XML. I don't know if the exporting to binary is lossy, though, i.e., if it inherently lacks some information that the cue sheet needs (and so it'd need to be added back in manually).

static wasp
#

Im thinking it is missing information, which is fine. I kinda expected that. The missing information is most likely just project info thats not entirely important to compiling to acb. (since it gets stripped away anyways

static wasp
#

Huh, Strange, the ACF Md5 Hash soesn't match the MD5 hash of the game's actual ACF femcsigh

#

And that is bc it is apparently the GUID of the ACF?? Even though the header says its md5?? painfrost

hollow cliff
#

Eyyy, this took a bit longer than I wanted because I tried to get fancy with it, but behold -- Python prototype! It's thoroughly helpstring'd for convenience, but basically, if you run main.py:

               {print_info,extract_audio,replace_waveform,add_simple_cue} ...

Basic editing utility for Cri ACB project files.

positional arguments:
  {print_info,extract_audio,replace_waveform,add_simple_cue}
                        Specify whether you want to do print_info,
                        extract_audio, replace_waveform, or add_simple_cue.
    print_info          Print detailed information about the cues inside the
                        ACB.
    extract_audio       Extract (and possibly decrypt) the audio files inside
                        the ACB and AWB(s) into a directory.
    replace_waveform    Use the provided audio file to replace the waveform at
                        the given AWB ID. Currently only supports ADX.
    add_simple_cue      Use the provided audio file to create a new AWB entry
                        and a simple cue that points to it.```
#

...and if you try one of the subcommands, like add_simple_cue,

                              --new-audio-path NEW_AUDIO_PATH
                              [--adx-key ADX_KEY] --input-acb-path
                              INPUT_ACB_PATH [--input-awb-path INPUT_AWB_PATH]
                              [--output-acb-path OUTPUT_ACB_PATH]
                              [--output-awb-path OUTPUT_AWB_PATH]

options:
  -h, --help            show this help message and exit
  --cue-name CUE_NAME   Name of cue to be added. If omitted, will default to
                        "Cue{cue_id}".
  --cue-id CUE_ID       Cue ID of new cue. If omitted, will pick next
                        available ID.
  --new-audio-path NEW_AUDIO_PATH
                        Path to audio file that will replace existing one.
  --adx-key ADX_KEY     If provided, will encrypt input ADX file (whether ADX
                        at source or converted via --convert-input).
  --input-acb-path INPUT_ACB_PATH
                        Path to ACB file to modify.
  --input-awb-path INPUT_AWB_PATH
                        Path to streaming AWB file to modify. If provided,
                        will try to add audio to the external (streaming) AWB.
                        Otherwise, will try to add to the in-memory AWB inside
                        the ACB.
  --output-acb-path OUTPUT_ACB_PATH
                        Optional path to modified ACB file. If omitted, will
                        modify input ACB in place.
  --output-awb-path OUTPUT_AWB_PATH
                        Optional path to modified streaming AWB file. If
                        omitted, will modify input AWB in place.```
#

I've managed to get it to work pretty nicely for just moving ADXs around, but my dreams of being clever with ffmpeg for conversion were crushed by its ancient ADX codec 😔 So for now it's only really tested for ADXs.

#

(So ignore the helpstrings mentioning conversion for now....)

static wasp
#

In other news I wrote some py code using the code in the EVTUI to (somewhat) neatly output the the contents of the acb to json/yaml femc

#

Here the result if anyone's curious

#

It looks like it might have some work that needs to be done bc i just noticed that AwbFile is null naotoderp

weary yachtBOT
hollow cliff
#

I'll be curious if you can get the print_info command of my script working! It's not actually yaml, but it's similar in spirit.

static wasp
hollow cliff
#

It's a screenshot from the yaml 😆

hollow cliff
#

(The context.)

static wasp
static wasp
#

Not 100%, I'm guessing that StreamAwbTocWork is were the acb stores the awb if the CueSheet is compiled with the soundbank embedded. Since the awb is separate in this case, it gets filled with nullbytes?

#

2kb of bloatdata is wild tho

hollow cliff
#

ACBs are pretty bloaty in general given that P5R at least utilizes very few of its features, but a whole block like that really is wild.

#

Most of the unused tables are just... null.... which makes much more sense....

static wasp
#
PS C:\Users\Admin\Desktop\Code\acbtool> python .\main.py print_info --input-acb-path "D:\Modding\Persona5\My Mods\testing\E156_101.ACB"
Cue #0: e000000_000_0000
 Polyphonic Sequence
 Track #1
  Synth #1
Traceback (most recent call last):
  File "C:\Users\Admin\Desktop\Code\acbtool\main.py", line 97, in <module>
    main()
  File "C:\Users\Admin\Desktop\Code\acbtool\main.py", line 53, in main
    acb.PrettyPrint()
  File "C:\Users\Admin\Desktop\Code\acbtool\ACB.py", line 78, in PrettyPrint
    self.RecursivelyGetReferences(refType, refIndex, depth=1, ind=0, printing=True, extracting=False)
  File "C:\Users\Admin\Desktop\Code\acbtool\ACB.py", line 169, in RecursivelyGetReferences
    self.RecursivelyGetReferences(refType2, refIndex2, depth=depth+1, ind=ind2, printing=printing, adxKey=adxKey, outputFormat=outputFormat, path=f"{path}.{i}.{ind2}", extracting=extracting)
  File "C:\Users\Admin\Desktop\Code\acbtool\ACB.py", line 147, in RecursivelyGetReferences
    self.RecursivelyGetReferences(refType2, refIndex2, depth=depth+1, ind=0, printing=printing, adxKey=adxKey, outputFormat=outputFormat, path=path, extracting=extracting)
  File "C:\Users\Admin\Desktop\Code\acbtool\ACB.py", line 100, in RecursivelyGetReferences
    assert awb is not None
           ^^^^^^^^^^^^^^^
AssertionError``` 😦
hollow cliff
#

The in-memory AWB lives somewhere else, so who knows what it is.

hollow cliff
#

(Should be fixed if you provide the AWB path, though.)

static wasp
#

I figured thats that lolol

hollow cliff
#

It is worth noting that it doesn't implicitly find the AWB if it's not explicitly provided, unlike most tools I've seen.

static wasp
#

Looking between my code and urs is wild, I basically ported your UTF.cs into python so right now its all in one file. I just wasnt expecting that many files lmaoo

static wasp
#

nevermind it still shits itself

Cue #0: e000000_000_0000
 Polyphonic Sequence
 Track #1
  Synth #1
  ...
    raise TypeError(
TypeError: unsupported operand type(s) for 'in': 'int' and 'EnumType'```
hollow cliff
#

Weeeeird. Are those vanilla files or ones you've edited in Atom?

#

That looks like a mistake I just haven't hit with my examples, let me see....

#

Must be this: assert self.EncodingType in EncodingMode, but it works for me in 3.12.

#

Enhanced Flag to support len(), iteration and in/not in on its members.

Yup, new in 3.11. Huh. TIL.

hollow cliff
#

Cool. Yeah, seems like just a Python versioning issue.

static wasp
#

E156_101

#

ah

hollow cliff
#

Above new version should be compatible with older Python versions + you can now print info even without the AWB. (Extraction would just be a no-op, though, obviously.)

static wasp
#

oh my python is 3.12 also

#

i think

hollow cliff
#

Extra weird 🤔

static wasp
#

just kidding 3.11.9

hollow cliff
#

Should still be fixed, regardless 🤷 🤞

static wasp
#

Success femc

static wasp
hollow cliff
#

I mean, just getting it working is a good start, lol. That's mostly what print_info is for.

#

I'd be curious if you can get waveform replacement / cue-adding working, especially if you have an actual modding setup to test the resulting files.

#

Comparing it to a tiny version of ACE, basically.

static wasp
#

from a technical standpoint, adding cues works for me. I cant go in-game rn to truly verify but ACE and AtomViewer had no problems opening and showing the newly added cue :3

hollow cliff
#

Next up: seeing if I can optimize better (this new version is much slower at unpacking due to the various ways I made it easier to modify the data structure), maybe spin up a WAVE reader for conversion, start porting over to C#.

#

If anyone has any ACB+AWBs containing HCAs, BCWAVs, etc., please do send some over (the smaller the better) so I can test with other audio formats.

static wasp
hollow cliff
#

Maybe so! But it's, like, 4x slower for SINGLEWORD, so I at least want to understand which part specifically is slowing it down that much 🥲

#

If nothing else, it might make sense to have two versions of the data structure -- one optimized for extraction, and another optimized for modifying.

#

But hopefully I can find a happy medium.

foggy river
#

cat pls

hollow cliff
#

LOL.

foggy river
#

idk why result_voice itself has stalled out on sending

#

oh there it is

static wasp
hollow cliff
#

LMAO nevermind about the slowness, 99% of it was because I had a tabbing error that created a nested loop instead of two loops... so I was initializing the same dictionary, like, 15K times..........

#

Literally about that many, because it's SINGLEWORD 💀

hollow cliff
foggy river
#

yeah i was mostly disclaimering that awb cus i was too lazy to actually...check if it was lmao
but i thought i remembered it being the case

hollow cliff
#

Also, @static wasp , if you have a chance to open up SYSTEM.ACB in Atom, it contains some type of reference I don't recognize and isn't accounted for in XV2-Tools... namely for cues 510, 511, and 512. If you can find ANY hint of wtf those cues are doing / how they're different from the rest, that would be extremely helpful 😵‍💫

#

I suspect they're sub-sequences, but 🤷

static wasp
#

@hollow cliff What are the cue names? Just to be sure,,,

#

bc the 3 ids you gave me seem normal, but the 3 directly above them are different

hollow cliff
static wasp
#

okay yeah those are the normal once i was talking about.

#

hold on one sec and ill dump the info from atom for you

#

can you show me what the reference you dont recognize is?

#

@hollow cliff

#

lol discord preview does not like that txt file

hollow cliff
#

It's the reference type -- it eventually points to another reference with an enum value of 7, which means absolutely nothing to me, lol. Usually it goes Cue > Sequence > Track > Synth > Waveform/Link, but this time the last step goes Synth > ??? (whatever 7 refers to).

hollow cliff
# static wasp

Yeah, nothing in here that's super telling.... Except the audio metadata may help match it with something....

#

Welp, I'll use this for digging. From this I can see which waveforms it's ultimately referencing, but the question is how....

#

...okay, yeah, it is a sub-sequence! It just goes Cue > Sequence > Track > Synth > Sequence-again. Fascinating.

#

Thanks for the Atom dump, that helped!

static wasp
#

also

#

through my py dumper it says the reference type for cues 510 511 and 512 is 3

hollow cliff
#

A reference pointing to another reference pointing to another....

#

That's how the content of the audio sequencer for each cue is structured.

static wasp
#

Huh interesting

hollow cliff
# static wasp Huh interesting

(You can get some idea of how it works from ACB.cs/ACB.py. Both contain a recursive method for traversing reference chains.)

foggy river
hollow cliff
foggy river
#

oh yeah lol

#

yeah hold on its a uasset

hollow cliff
#

Hopefully I can figure it out 😆 Thanks!

foggy river
#

i think monke2 can do it?? maybe i shoulda checked that first lol

#

i have one(1) p3r mod in progress and its completely unrelated to audio (unless i decide to add costume bgm)

hollow cliff
hollow cliff
#

Damn, these newer ACBs have a ton of new features. LipsMorphTable stored directly in the audio project?? Wild.

hollow cliff
# foggy river idk if you still want these but i just grabbed a random awb from p3r that discor...

Hm, I can read the ACB fine, but the AWB seems funky, and small relative to the number of cues. All readers I try fail with it + I only see one HCA string in here. Is the file incomplete, or encrypted somehow...? I haven't worked with HCAs or UE assets before so I don't know if I'm just missing a step.

(I guess I'm not really directing this question at you, unless there's something obvious re: the file being incompletely uploaded, since you said you haven't done much with P3R audio... but I figure rena could have an idea.)

static wasp
#

Heres the acb awb and extracted HCAs

#

I haven't listened to them because im at work doing this and need my ears lol but yea

static wasp
#

Lemme check the versioning of the acb rq

#

not that much newer lol 1.37 vs 1.30

hollow cliff
#

Mm, I see, okay I'm not actually THAT far off -- I was just expecting to see the HCA signature in each.

static wasp
#

and the version I have is 1.32 wch i think is 3-5 years old

hollow cliff
#

Some padding struggles that I need to fix, but most of it is just not knowing what HCAs need to look like lol.

hollow cliff
static wasp
#

maybe taking a look at Monke's src code and what it does when decompiling the uasset may be helpful

#

also

#

strange thing i should probably note, i had to rename the uasset to uexp for monke to recognize it

#

idk if thats bc of the way @foggy river extracted it, bc monke was orginally for SMT and its a little different, or what but yea.

#

but idk bc i dont have P3R yet

#

imma get it soon though :3

hollow cliff
#

Okay, the issue with the AWB is that its alignment value is fucking wack. So clearly Atom is NOT using that to help with reading, lmfao.

foggy river
#

all i did was grab them with fmodel, although the awb was in a pak while the acb was in a utoc

static wasp
foggy river
#

both of those are unreal archives lmao

#

thatd be like trying to use it on a cpk

static wasp
hollow cliff
#

In the AWBs I've been using, the header contains an "Align" value that is used to determine the amount of zero-padding before each entry. So mostly entries will be e.g. multiples of 32 in length, including said padding. But the padding value given in this AWB is (looks at writing on hand)... 2721972256 😐

static wasp
#

:0

#

gross

foggy river
#

i went to screencap the location info for the archives in fmodel and uh...theres another btl_pc_01.awb in a different pak

#

acb info

hollow cliff
foggy river
#

the awb i sent you

static wasp
#

Makes sense

#

wild guess , but might be like alt versions of the music in the orginal

foggy river
#

the one i found
i think this is for engdub, the one i sent had jp voices

hollow cliff
#

Ahhhh, yeah, that tracks.

#

...So I think I've confirmed that the AFS2/AWB alignment value is fixed at 32 no matter what number is in the header 😅 That's good to know........

foggy river
#

...actually, im realizing theres also another acb in a different folder of the same utoc as the sent one

#

probably also for english voices based on the folder name

static wasp
#

for ex. p5r Has E718_100 and E718_100_SE

#

prolly same concept

foggy river
#

it seems like japanese and language-agnostic awbs go in pakchunk0-WindowsNoEditor.pak, jp and en cuesheets in pakchunk0-WindowsNoEditor.utoc in either CriData or CriDataEn, and english audio is in pakchunk4-WindowsNoEditor.pak

hollow cliff
static wasp
#

Rambling incoming

#

heres a wild idea, does the acb/awb need to be *exactly *the same for p5/r? What I mean is what if you were to just remake the cues and the soundbank just keeping the the cueIDs accurate? Would it still play fine?

AtomCraft has the option to import from cueSheet CSV. So theoretically you could just import csv into Atom and compile to acb.
The only thing that must be the same tho is the ACF GUID and name. therefore the only thing that would need to be rebuilt is the project information to make sure the guids are the same...

Comparing the atom built acb and the og acb, they obv have some differences, Atom's acb having a lil more information with the SeqCommandTables and having the Default 3dAudio info, and the obvious with the ACF info...

Just kinda think out my ass here lol

hollow cliff
#

...It would probably play fine? I don't see why it wouldn't, as long as all the referenced cue ids exist, as you said.

static wasp
hollow cliff
#

I am a little confused by the fact that there seem to be upper keys, lower keys, AND a subkey (from the ACB), according to some sources...?

foggy river
flint vortex
hollow cliff
# flint vortex idrk, for my purposes i just found out i needed the main keycode encryption to g...

I guess my confusion comes from the article above vs. this: https://gamebanana.com/tools/16116

...So there's the game's base key, but in addition to that, the article says to use the first part of the alignment field, while this GB page of keys says it uses AwbHash. Those are two different things, so... 🤔

How exactly do you handle keys in Ryo?

GameBanana

A Persona 3 Reload (P3R) Modding Tool in the Other/Misc category, submitted by MandM

#

(I couldn't tell if any of the P3R Ryo GB links had source code for reference.)

flint vortex
#

ryo "replacement" is just actually setting a different source, in this case hca/adx audio loaded into memory

#

which the game only expects it to be encrypted with the base key, bypassing the acb/awb unique key stuff thankfully

hollow cliff
#

So then... it seems like there are two layers of decrypting. One that happens at extraction time and uses the ACB/AWB unique key, and one that happens at playing/decoding time and uses the base key. I guess...?

#

Hence why pointing to a separate file can bypass the unique key step?

#

I will figure out how to implement this, I swear.... 😆

static wasp
#

In more ACB related things CriTools as an exe called "CriAcbMaker.exe". which is supposedly a CLI for creating ACB from a CSV 👀

But the only clues it gives me on how to run it is this

|||||||||||| CRI Atom AcbMaker for Console Ver.2.01.00 ||||||||||||
Copyright (C) 2009-2017 CRI Middleware Co., Ltd.

usage: AcbMaker <Input CSV File> <Output ACB File> <Input AWB File> [Options]

[Options] is a thing but it doesn't give any clear indication on what those Options are femcsigh

So since its relatively small and only has mscoree as a dependency Im sticking it in Ghidra to see if I can find anything useful. rn it looks like it has function names so thats a plus.

static wasp
#

It has some interesting stuff so check it out 👀

hollow cliff
#

Yoink.

static wasp
#

If you want to debug it tho I'd recommend using dnspy, thats whats working with me

#

idk how that uploaded when i dont have nitro

flint vortex
#

the power of a lvl 3 server that non-nitro people totally don't use for their own stuff sometimes

flint vortex
hollow cliff
foggy river
#

ah

static wasp
#
File name: 'C:/Users/Admin/Desktop/Code/Py_Cri/p5Project/PC/E156_101_new.acb'
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileInfo.get_Length()
   at CriMw.CriAtom.AcbMaker.SimpleAcbMaker.MakeAcbHeader(String outputFilePath, String acbFilePath)
   at CriMw.CriAtom.AcbMaker.Program.Main(String[] args)}```

wdym you cant find the file your suppose to make it ![chieangy](https://cdn.discordapp.com/emojis/797678739529138179.webp?size=128 "chieangy")
static wasp
#

Well anyway, I couldn't get it to work but i think its partly skill issue. It def has all the libraries to make an ACB file. So if one wanted to make a program using these libraries to create an ACB file they definitely could. It also converts the variable in the pic to byte arrays. for me, rn, its over my head lol

#

ah its already converted to byte array in the pic

#

Adx2>CodeGenerator>CodeGen.cs and CriGears>Utilities>Cbn.cs are where the magic happens btw :3

hollow cliff
#

Regardless, nice! All the enums alone are good stuff to have.

hollow cliff
#

Well, I'm gonna be away from my computer for a couple weeks, so I won't be able to make any more progress for a bit. (I'll probably still be on Discord from time to time, though.)

Buuut I was able to recreate the AWB-specific key from the game key + the AWB scramble... and then plug that into vgmstream and get clean audio. So I can derive the keys and I know they work -- I should be able to start making an HCA coder when I get back 👍

weary yachtBOT
#

Pssst, rena... the solution you found aside, you should totally share some of these ACBs (and the game's ACF(s), if that/those are around) to see if there are any hints as to wtf the deal is with these specific cues.

(I won't get to actually look at them for another week, but Logically Anime might in the meantime.)

I just blocked 20210 from snd04_comse (final crit SFX) and the music didn't break mikustare

Jump

[Go to message!](#1089998902616395776 message)

hollow cliff
#

The bare AWBs thing DeathChaos mentioned, though... 😦

static wasp
#

seconded

flint vortex
#

i don't think it was the cues causing me issues, but (probably) how often the bgm player was updated by the cues playing. p4g reduces bgm volume when some cues plays. i think with me using SetFile instead of streaming from an awb it might've caused an error somewhere

hollow cliff
#

The fact that only the one cue from that file seemed to cause an issue, though... 🤔 Unless I'm misreading.

flint vortex
#

it seemed like it at first since everything worked after blocking it, but then i just set it to use a different cue id whenever it tried playing that one and it still bugged out

hollow cliff
#

Huhhh. Then you're probably right, although the ACF could still be informative.

static wasp
#

im pretty sure my tool can decompile acf to yaml like i showed with the acb before so ill try that out when i get a chance.see if it provides anything useful :3

hollow cliff
#

I'm mostly thinking about cue limits and whether those are being hit somehow.

#

Mostly those are on the ACB-level, but the ACF may define them more broadly for buses or whatnot.

static wasp
#

i vaguely remember being able to mess with the cue limits in the cue categories and that would be in the acf so yeah there’s global cue limits but individual cues would def be acb

#

idk if there defined per bus tho

#

id hve to check lolol

hollow cliff
#

Global cue limit seems like the right concept, then.

static wasp
#

Weirdly enough found barely any info on the cue limits in those files :S

#

yaml dump incoming

static wasp
#

dont really know how bgme works so idk 😅

flint vortex
# static wasp dont really know how bgme works so idk 😅

It's handled by Ryo now; Ryo hooks whatever method the game uses to set the source audio (typically SetCueName or SetCueId) and uses a different method that allows for new audio (such as SetData or SetFile) as needed. Then there's some code for setting any required categories on the player before playing.

#

I had an issue where categories were being ignored, but it was because the game was resetting them and applying the ones responsible for config volume settings after setting the source.

#

It wasn't cue limits or the like (unfortunately), neither cues shared any categories or even played on the same player which made everything super confusing death

flint vortex
#

completely forgot to ask this, but with being able to output acb info is it also possible to list out what categories are set for each cue?

hollow cliff
#

Probably...? It's not immediately clear from ACB structure what that would correspond to -- there are Category+CategoryName tables in the ACF, and there's a CategoryExtension table in each ACB... but that's all for things called "Category", and I kind of doubt that the latter is where the cue categories would be defined. So it's a matter of figuring out where the category ids defined in the ACF are actually stored in the ACBs 🤔

flint vortex
#

In the code I think the actual categories are accessed by their index in the ACF

#

Idk if the Cues are set categories with the Category ID/Name though in their ACB

hollow cliff
#

Ooh, looks like it might be through the AcfReference table inside each ACB.

#

Yeah, it's definitely in there. It'll take a bit of tinkering to figure out how the references work re: mapping to each cue, but it doesn't look too complicated.

hollow cliff
#

...Oookay, so maybe it's a little complicated, but I'm confident I can figure out how the references work eventually 😅

hollow cliff
#

Good god, okay, this is so weird, but I figured it out. It's defined by a sequence command, rather than as a straightforward property of the cue. That's SO goddamn weird.

hollow cliff
#

Okie doke, the answer is now yes! Some example screenshots from the updated print_info command for P5R's SYSTEM.ACB. Keeping in mind that these are properties of the sequence underlying the cue, not the cue itself, for some incomprehensible reason....

#

This is also a good reminder that I'll probably need to add the related commands to newly created cues in order for them to play properly.

hollow cliff
#

Yeah, it's probably time to turn this into a repo, huh.... Not sure if it would be useful to put up a repo for the Python/CLI version, or whether it would be better just to make a repo for the C# port once that's done....

#

Maybe one for both 🤔

prisma summit
#

just out of curiosity. Are you going to finish this and then go back and work on the event editor? Or something similar to that?

hollow cliff
#

I'm working on both at once! In fact, I spent yesterday on the event editor before rena's question made me so curious that I stayed up late working on the audio tool 😅

I've been working slowly on the event editor waiting for Pherakki to return, but it's been long enough now that I figure it's better to just move on ahead. Look forward to some updates there soon ✌️

prisma summit
#

Ah, thats understandable. Love the work you're doing on both of them. Really do appreciate it. : )

hollow cliff
#

Thank you! I'm mostly going with the flow based on what there seems to be the most interest for, so it's nice to get that kind of feedback ☺️

#

...That reminds me that I was originally considering adding the audio tooling as a sub-project inside the EVTUI repo, since there will be a significant amount of common code. But if audio stuff is going to be its own library/package anyway, maybe it just makes sense to keep it separate and eventually use it as an external library for the event editor....

prisma summit
hollow cliff
#

Hmmm... it will definitely be easier to keep the audio tool independent and keep the event editor capable only of audio previewing, not audio editing... both for the sake of audio editing for those who aren't working on events, and because of the giant common audio files (especially VOICE_SINGLEWORD).

It makes more sense to only view relevant parts of singleword/system/bgm in the event editor, rather than confusing people with the full files. And since I don't really want those files to be editable in the event editor anyway... the slight annoyance of also having to use the separate tool to edit event-specific audio seems worth it.

The audio tooling COULD still live inside the EVTUI repo, though, so I wouldn't have to keep an external dependency. They'd act as a bundled suite of tools.

(Mostly just thinking out loud, here.)

hollow cliff
#

The next question is: what to call the audio tool? I've been calling the prototype ACBTool, but I want to build in video/USM handling eventually, making "ACB" a bit too specific. Could just be ADXLib/ADXUI, to keep with the EVTUI pattern....

#

(Could also be something more fun, I guess, lol.)

hollow cliff
#

Btw, I haven't implemented it yet, but I am optimistic that REACT and/or AISAC shenanigans [like this](#1264067883290460210 message) should be much easier to see and configure once the ACB(/ACF) editing part of this tool is complete.

weary yachtBOT
#

...Link included separately for previewing:

ð

@rare plinth to clarify
But ducking in these tracks is obv manual

btw that system is so obnoxiously configured in P4G

Jump

[Go to message!](#1264067883290460210 message)

static fiber
# hollow cliff Btw, I haven't implemented it yet, but I am optimistic that REACT and/or AISAC s...

what do you mean? the screenie was just a quick intro of term "ducking" for Brawler
I'm currently messing with audio tracks for anime cutscenes
they isn't (and obv shouldn't be) affected by real-time ducking sys at all (and I haven't noticed anything like this ever happening)
I only meant that p4ct005 audio multitracks provided to Atlus West for localization have sound ducked for JPN voice lines and the engineer never adjusted that on mix (only one inst is really noticeable in that track)

flint vortex
#

i think you just reminded them about it and were linking your post about it MakotoThink

static fiber
#

I'm just dumb, sorry

weary yachtBOT
#

btw, can anyone here confirm? I checked the VLs long time ago and my memory's a bit fuzzy
And if I am, has anyone ever looked into fixing this thing?

ð

btw if i'm not mistaken, p5r voice over files are fine, it's the damn sound engine equalization that fucks them up good for dialogs (EN in particular)
anime cutscene audio is unaffected

Jump

[Go to message!](#1182897587838275614 message)

flint vortex
#

@static fiber ping since i replied to a bot lol

static fiber
hollow cliff
#

Lol, yeah, I just meant that the REACT system is something that seems to be built into ACF/ACB files somewhere. If not explicitly, as with AISAC, then certainly it's affected by category, which definitely IS defined inside ACBs naothumbsup

hollow cliff
# weary yacht btw, can anyone here confirm? I checked the VLs long time ago and my memory's a ...

There are a TON of volume commands happening inside of P5R's ACBs, but I'm not sure about equalization more generally. At the very least, this stuff seems to be set by cue category, so changing cue category and comparing the results would be a good initial experiment.

i.e., compare vanilla in-engine voices vs. voice line ADXs played externally vs. modded in-engine voices with category changed to something other than "voice." (When, of course, it would ultimately be better to find where category-level equalization settings are stored, if those do exist. It definitely SEEMS like something that could be in the ACF.)

#

It makes sense to me that audio inside USMs is unaffected, since embedded audio would be independent of any ACF/ACB categorization. ...But actually, I haven't looked at the videos yet -- now that I think about it, the audio supposedly isn't embedded for any of the videos outside of the intro one, right? If that's the case, then I don't actually know where it's stored or played from. An exe thing...?

flint vortex
#

i wonder what would happen if i hooked the function used to get the category index by id to something else, would it then ignore whatever eq stuff they got going on 🤔

hollow cliff
#

That would be a good experiment 👀

prisma summit
#

If you want more stuff to test. In CBT, the extra battle lines have this issue where they're louder than they should be. So it might be worth looking into that.

foggy river
#

i leave my game volume at max anyway so this doesnt affect me lol

prisma summit
flint vortex
#

@drifting seal how do you play the new voice lines MakotoThink ?

drifting seal
#

you call them by cue id?

#

everything in persona is called by cue id

hollow cliff
#

If it's just doing a standard call by cue id, then the issue is probably within the new ACBs/cues in question, I guess...?

flint vortex
#

maybe they're missing their categories since they were unused?

hollow cliff
#

Could be! What are the specific ACBs/cues known to cause issues? I can't check at this moment, but I can look at them later.

drifting seal
#

they are specifically new cues that didnt exist, added by ACE

#

and only god knows how acb works

hollow cliff
#

Ah, added by ACE. So they're possibly missing quite a few commands and category specifications that existing cues have.

#

God knows, but also I know, which is why this thread exists, lol.

#

In any case, fixing these would be a good test case for making sure the new tool's cue-adding can also add the right commands and categories to avoid the volume issues.

hollow cliff
#

Okay, yeah, I diff'd the modded BP01.ACB inside CBT vs. my vanilla copy. You can see here that the vanilla cue #115 contains a few sequence commands that the modded cue #14 does not, including the AcfCategory label -- our suspected culprit for the volume issues.

drifting seal
#

well, the category is included when using Ryo

#

I actually moved these voiceliens over to use Ryo (because it is entirely possible to use Ryo to "replace" cues that dont exist)

#

and then realized there's no point in making a whole update just for that (lol)

hollow cliff
#

Ah, I see. When moving over to Ryo, did that resolve the volume issue, or no?

drifting seal
#

i have no idea!

#

i have all the volume settings to max

#

so its not an issue ive ever ran into

hollow cliff
#

Lol. Well, then it's a solid maybe 🤷

drifting seal
#

i think that might be the issue

#

because we learned from Yakuza

#

some sounds can just not have a category assigned at all

#

so if they have no category then there's nothing to "control" the sound

hollow cliff
#

Makes sense, then!

#

...Wow, I didn't realize categories were this significant. Thanks for motivating me to find where they are in the ACB, rena 😅

#

Next mission: figure out how all the EQ parameters for each category get set inside the ACF 🤔

flint vortex
flint vortex
hollow cliff
#

BTW, @prisma summit, if you want to try replacing the CBT file at OptionalModFiles/JOKERVOICE.CPK/CPK/SOUND/BP01.ACB with this version I've remodded, I'd be curious if that resolves the issue for you. Or, I mean, anyone who's hit the issue can try it out, but I'm directing this at you since you brought it up.

prisma summit
#

Wow it's a good thing I woke up at 1 am for no reason then. I'll check it out.

hollow cliff
#

Lmao. I summoned you.... 🪄

prisma summit
#

I think it broke the original joker voices instead.

hollow cliff
#

🥲

prisma summit
#

smh nitro one sec

hollow cliff
#

Okay, I got a little ambitious with it, lmao. I'd also added some stuff back to the originals. Let me be a little less ambitious....

prisma summit
#

also unless im just not getting lucky it broke the extra lines aswell.

hollow cliff
#

PFFFF. Beautiful, perfect, etc.

foggy river
#

oops encryption problem

prisma summit
#

Yeah unless im getting super unlucky I think the extra lines just don't play anymore? Even without the edited acb.

hollow cliff
#

Shouldn't be...? I didn't touch the AWB.... Although I did change the AWB hash.... If that affects the encryption that'll actually be uhhhh. Very interesting info.

prisma summit
#

um

#

the extra lines are tied to the music volume slider I think.

hollow cliff
#

WHAT....

prisma summit
#

literally turned back on the music and they instantly played

foggy river
#

bruh

hollow cliff
prisma summit
#

of course it only plays a single time. In any case the bug with it not caring about volume still happens

hollow cliff
#

Baffling...........

#

Okay, I'll keep tinkering. You should probably go back to bed, lol, but I'll come up with some alternatives.

prisma summit
#

no it's fine im not tired at all. I accidentally went to bed like hours before I usually do. Then went back to bed again and woke up at 1. And usually when that happens my body refuses to sleep.

prisma summit
#

If thats any consolation

#

Yeah seems like same volume.

#

actually, it's the same volume. But I just realized the other normal lines are similar in volume.

#

let me see if I can record it

#

yeah they definitely feel like the same volume.

hollow cliff
#

So the volume fix works, but something weird happens with the encryption, sounds like.

prisma summit
#

Something like that.

hollow cliff
#

Well, here's a slightly less ambitious version + updated logs for reference. Turns out I actually didn't change the hash, so I did that this time + took out some other changes to the rest of the cues.

prisma summit
#

i shall test

hollow cliff
#

Truly fascinating 😅

#

And this is clearing the cache and whatnot, or whatever you did to fix things last time?

prisma summit
#

totally, just uh. Give me a sec : )

#

lets say hypothetically, you needed to clear it and forgot where it was. Where would it be?

#

nvm totally hypotetical thing figured out

prisma summit
#

im stupid

#

nvm

#

the name was wrong. now it should be good

hollow cliff
#

Still encryption weirdness naosmiley Incredibly confusing....

#

Well, this is mostly indicating to me that I need to get an actual modding setup working so testing doesn't take a million years 🥲

prisma summit
#

I mean im fine with that. I got all day.

hollow cliff
#

Might take it to the DMs if it gets to be too much, so as not to clog the thread, but thank you 🫡

prisma summit
#

np 🙂

#

ok, so my original testing was just extremely unlucky. The extra lines seem to not be tied to the bgm. Although that would've been really funny

hollow cliff
#

I don't even know what you could have done to make that happen, lmao.

prisma summit
#

its so weird because I haven't had it happen in months. And my bgm was almost always off at that time. I guess it was playing a really long bit.

hollow cliff
#

Just to double-check, if you switch back to the original CBT ACB, it doesn't have the encryption fuzziness?

prisma summit
#

Yeah looked like it, i'll check it again though.

#

yeah can confirm. Back to it being fine and having the volume bug.

hollow cliff
#

Sooooo strange. I mean, at least the volume fix works, but I have no idea why the encryption would now be breaking.

prisma summit
#

Atleast one part of it works.

hollow cliff
#

I'm pretty confident that the issue here is with offsets/alignments/padding (oh my), which I've never been super confident on and which would only affect my writer and not my reader.

Sooo most likely it's not so much an encryption issue as it is an issue of incorrect alignment causing the AWB (and therefore the ADXs) to get read juuust slightly wrong. Which means it's back to studying existing UTF/AFS2 writers (mostly ACE's) to make sure I'm actually able to reproduce correctly... ah naotired

prisma summit
#

Knowing is half the battle.

hollow cliff
#

I mean, if that doesn't fix it and it's somehow actually an encryption issue when I didn't even touch the AWB, that would be VERY interesting information, at least....

flint vortex
#

if it was the encryption i'd imagine it'd sound a lot worse no?

#

unencrypted adx suuuuuuuuuuuucks to listen to in p5r lol

hollow cliff
#

True, it doesn't seem quite as bad as unencrypted ADXs 🙉

static wasp
#

lil late, but in the acbs you have volume control iirc, so messing with that should alleviate the volume issue no?

hollow cliff
#

In this case, most of the settings are determined by cue category, which is set up in the ACF and then (usually) referenced for each cue's sequence in an ACB. From how rena puts it, it seems like category settings are high priority, and in any case, getting that right is how you'll get consistent volume rather than just making things quieter per cue. So, if you want to make cues sensitive to the game's tunable volume settings, and that kind of thing.

...Actually, I'd be curious if you're able to see anything re: EQ settings per category in Atom (when viewing ACFs)... since all of that is still a mystery.

static wasp
#

Cat. setting (volume and etc) iir is in the ACF. Thats why in the acb it just references what category it is.

hollow cliff
#

Yeah, exactly! The ACF files just don't make it obvious which settings are which, as far as I can tell, but maybe I just need to look more carefully.

#

We were discussing earlier how the mixing makes voice lines very eSSSSSy when they don't seem to be that way as raw ADXs.

#

If we could figure out which settings are which to be able to tune the default EQ settings for voice or even music cues, that'd be neat.

static wasp
#

eSSSSSy? lol
like you said before the ACF is just a UTF table. So Ill poke around with my py tool and see if im able to come up w anything.

hollow cliff
#

🐍🐍🐍

#

Mostly I'm wondering if anything that isn't obvious from the file structure itself will be obvious alongside opening it up in Atom MakotoThink but yeah basically any insight on this will be cool to have!

static wasp
#

Ill also post my tool I have cuz i dont think i have yet, its basically just a python version of your EVTUI version :3

static wasp
hollow cliff
prisma summit
#

im sorry I didn't wake up at 1 am again. I'll check it out

hollow cliff
#

YEEEEEES. Thanks for helping me test 🙏🙏

prisma summit
flint vortex
#

@hollow cliff oh, i think this might be related but i was gonna ask if you had any insight as to what RAW PCM means/is used?

#

For example, in P3P it uses .vag files for SFX which it plays as a data buffer using SetData and RAW_PCM format. The thing is, that only worked on the specific player...

#

Playing other formats on that player sounded terrible, and playing those files in a custom player sounded like static

hollow cliff
#

Raw PCM just means no header, AFAIK. So it's a file with only the audio data (payload).

#

FFMPEG/Audacity should be able to read it to confirm that, if so.

#

Buuut this also means you have to know the rest of the file info a priori to read the data properly.....

#

So the other files played in-engine are probably getting their headers read as audio data 🥲 and external players are going to have no idea what codec they're working with.

flint vortex
#

This is through Ryo though

#

SetData is blocked and replaced with SetFile, the audio plays but there's something else set on the player

hollow cliff
#

There's something else set on the player...?

flint vortex
#

well like said, the SFX files only player properly on that specific player. playing them on another player doesn't work

#

and playing other audio, like through SetFile, on that player plays strangely

hollow cliff
#

Sure, other players won't have the header knowledge built in implicitly.

#

That player probably specifically hard-codes the info that would otherwise be in the VAG headers.

flint vortex
#

ohhh

hollow cliff
#

I wonder if you converted to VAG and then just chopped off the header, if that would work... but again, you'd need to know what info is in the hard-coded header.

#

Channel count, sampling rate, etc.

#

It probably wouldn't be too bad to guess-and-check likely values, though.

flint vortex
#

some of that info is set on the player

#

Num Channels
Sampling Rate
Format (RAW_PCM in this case)

#

It's required(?) when using SetData and SetFile

hollow cliff
#

That SHOULD be enough info then, I think....

flint vortex
#

i put a question next to required because num channels and sampling rate seems to not matter really if it's wrong naotoshrug

#

maybe it gets it from the data/file

hollow cliff
#

In headered file types, definitely. In the RAW_PCM case, does it also have no effect...?

flint vortex
#

Yeah, I think it did have an affect on RAW_PCM

hollow cliff
#

Okay, that makes sense then.

#

It gets the info directly for codecs that have their own info in a header, but needs the arguments for codecs without a header.

#

So then... convert to VAG, chop off the header, and provide the needed values to the player. I guess.

flint vortex
#

oh, for the sfx i just bypassed that whole function

#

i created a new player and setdata, then let Ryo redirect it to whatever (like an HCA file) if there was one

#

i just had no idea what was going on with that player and was looking for clarification

hollow cliff
#

Goootcha. Well, if you wanted to do it the old-fashioned way, I think this would be it.

#

I guess that counts as clarification, assuming I'm not way off 😄

hollow cliff
#

Aside from HCA coder/crypto and WAV conversion functionalities, I'm pretty happy with where the prototype code is at, so now I'm thinking about UI and API... as in, what specifically the GUI version should do + what the library version should provide.

#

The library should have APIs for all the CRI audio file types -- ACB, AWB, ADX, HCA. But from there, there should probably be some basic methods for, e.g., ACB.GetCueCategories(int cueId)

#

For the GUI, I'd like to be able to fully edit the hierarchical/tabular data of ACFs and ACBs, but also to unpack, replace, repack, encode/decode, encrypt/decrypt.... Quite an array of things, so it's as much about organization as anything else.

#

...Since these are things the CLI version can already do, aside from encoding/conversion.

#

I guess I'm basically just making Atom But Hopefully Nicer, lmao, so using that as a starting point makes some sense.

flint vortex
#

criatomcraft but good

drifting seal
#

only existing tool that can possibly even come close is ACE

flint vortex
#

hey @hollow cliff how developed is ACF parsing/writing?

#

could it be possible to add a new category naotothink

hollow cliff
# drifting seal only existing tool that can possibly even come close is ACE

ACE is the only real ACB tool out there whatsoever 😭 This all started because while its backend code is a pretty good parser, it's suuuper not-library-able.

My current prototype can add cues, but the biggest hurdle for multi-track / generally-more-complicated cues is going to be the GUI. Each cue is a full audio sequencer, so making that look nice/approachable is going to be...... a pain.

drifting seal
#

there actually exists an older tool that at some point could also add new cues

#

eternity ...something

#

but even when just opening an acb file the shown cue ids on that are already wrong

hollow cliff
# flint vortex hey <@572321426456182794> how developed is ACF parsing/writing?

It's only developed in that both ACBs and ACFs are UTF tables (like CPKs also are), and I have a general API for parsing, editing, and adding entries to those.

I see no reason why you couldn't add a category, though. It's more a matter of making sure it has all the necessary entries and properties... which means knowing what all those actually are. Basically, I could probably make a general UTF editor that would do the job, but doing it nicely would mean making a nice ACF wrapper + API.

hollow cliff
drifting seal
#

nah, different people

hollow cliff
#

Huh... 🤯

flint vortex
hollow cliff
hollow cliff
#

It's basically a binarized XML format, structurally.

#

One way of making a general editor without needing a GUI would honestly be just to have a UTF-to-XML converter so folks could edit a relatively-readable XML before converting it back to UTF....

#

(Between my code and @static wasp's stuff, we're not far off from having our own version of such a tool, anyway.)

static wasp
static wasp
weary yachtBOT
#

@hollow cliff btw did you ever check out the decomp of the official ACB tool i sent a while back?

It has basically everything on how the acbs are compiled. It doesnt work but thats just because of the janky csv parser.

[Reply to:](#1255025517497942016 message) Its made with .net 4.0 so it decompiles beautifully into a nice C# project ...

Well anyway, I couldn't get it to work but i think its partly skill issue. It def has all the libraries to make an ACB file. So if one wanted to make a program using these libraries to create an ACB file they definitely could. It also converts the variable in the pic to byte arrays. for me, rn, its over my head lol

Jump

[Go to message!](#1255025517497942016 message)

hollow cliff
hollow cliff
#

Pretty sure I said this before, but these enums are going to get me SO far risepray They're not 100% up-to-date, since this was an older version, but like... 95% of the way there. Hell, yeah.

drifting seal
hollow cliff
drifting seal
#

nice, what do I credit you as

prisma summit
#

Yeah it should work. I guess I technically didn't test if the volume would match if the slider is changed. I'll test it now, but it should be completely working.

#

can confirm it works fully. I expected it but I wanted to make sure.

hollow cliff
#

If you're testing, do you mind trying out one last version? I added some AISAC commands back in (making the sound responsive to relative model position), which ACE seems to have removed from all the cues. (Seems like they fixed that bug in the December 2023 release.)

If this breaks something else, we can just use the above AISAC-less version.

prisma summit
#

sure i'll check it out

drifting seal
#

I've always wondered what causes that lmao

prisma summit
#

Yeah it seems to work fine.

hollow cliff
#

Yeah! AISACs can add different kinds of responsiveness, but 3D positioning seems to be the biggest one it uses.

hollow cliff
#

REACT also does something similar, but I haven't delved too deeply into that system yet. There are a few other ways game variables can affect sounds, defined both in the ACF per category and in an ACB per cue.

hollow cliff
# prisma summit

Woo, thanks again! (Now, hopefully replacing the AWB itself in the help thread will actually help with your issues there... 🤞)

prisma summit
#

np, spec is out currently so she'll try it out once she gets back on.

#

Also thank you for the help again.

hollow cliff
#

No prob!

...I actually don't think AISACs will work on the new cues in the latest version above, since I didn't add a new entry to the GlobalAisacReference table for them, so eh. Maybe still use the previous working version, unless making the original cues responsive is a priority.

drifting seal
#

thats still better than nothing having it

#

lol

hollow cliff
#

Got an initial version of an XML deserializer into the prototype! It's, uh, definitely not the ideal way of editing ACBs, because there are so many cross-references between the tables, but it did help me finally root out the last of the required GlobalAisac references. If you saw me post another "final" version of BP01.ACB earlier before I made this, no you didn't

#

The other main reason a general UTF deserializer doesn't really work here is because of all the "command" entries, which have to be turned from byte arrays into function-paramCount-params before being at all meaningful to look at. An ACB-specific XML-deserializer could help here, but a GUI is probably the only good option in the long run.

#

But I don't waaaaanna make an entire audio sequencer program just to edit some cues 😩 ...ah, well....

hollow cliff
#

Oh, right -- the new command, if you want to try it, @static wasp:

usage: ACBTool to_xml [-h] --input-utf INPUT_UTF [--output-xml OUTPUT_XML]

options:
  -h, --help            show this help message and exit
  --input-utf INPUT_UTF
                        Path to ACB or ACF file to deserialize.
  --output-xml OUTPUT_XML
                        Path to save output XML to. If not provided, will just print the XML to the console.
prisma summit
#

@hollow cliff can confirm. System.awb does not emulate.

#

and yes it played no sound as it should've not done in the bug report

hollow cliff
#

Hmmm, okay, interesting. Could well be a size issue. My other tests would be:

  • Does this happen with a smaller file that also has both internal and external AWBs? (e.g., F003_002.A[CW]B)
  • Does this happen with a large file that only has an external AWB? (e.g., BGM.A[CW]B)
    ...I assume if BGM had this issue it would be more notable. But since most BGM mods use other frameworks, 🤷
prisma summit
#

I'll go about testing those.

prisma summit
#

just want to make sure before I have a bad test.

hollow cliff
#

Ah, sorry -- to be clear, you don't have to do anything different. Just emulate the AWB as you've been doing.

#

To explain: some ACBs have AWBs within them (i.e., internal/in-memory). All ACBs in P5R also come with external/streaming AWBs (i.e., the actual .AWB files). Most only use the external/streaming AWBs for storing ADXs, but a few (like SINGLEWORD) split their ADXs between the two.

prisma summit
#

ohhhh

#

that makes so much sense. Thank you, I shall test now.

#

system if im reading this correctly actually has this split. So maybe it could be because they're split?

hollow cliff
#

Yeah, that's why I wanted to test smaller files that have the split + larger files that don't have the split.

prisma summit
#

yeah makes sense.

foggy river
hollow cliff
#

Makes sense... which points to the split possibly being the issue rather than the AWB size being the issue 🤔

prisma summit
#

From the looks of it it seems to load. Granted it might be the filepath since I'm not sure what it'd be for fields FEmulator\AWB\F001_003.AWB. But if it is correct then it emulates it.

hollow cliff
#

Hmmmmm.

#

Hmmmmm....... well, if BGM also emulates, then I'm stumped for now. Have you been replacing any particular ID numbered ADXs in each test?

prisma summit
#

I actually just did that, and it seemed like it didn't emulate anything at all. So maybe it's just the filepath being wrong?

foggy river
#

for file emulators that dont use dummy files, of which awb is one, your path would actually be FEmulator/AWB/pathtothe/archive.awb/your.adx

prisma summit
#

ah

#

i see

#

so then FEmulator\AWB\FIELD\F001_003.AWB? Or FEmulator\AWB\SOUND\FIELD\F001_003.AWB?

hollow cliff
#

Then I'm surprised the other emulated files worked at all....

#

(BP01, SYSTEM, SINGLEWORD)

prisma summit
#

yeah that is strange

flint vortex
#

@hollow cliff hey ajda, would you happen to know how the encryption for key for audio typically found?

drifting seal
#

you pray

#

for adx you can bruteforce it

#

incredibly easy to do and takes less than a min

#

hca? have fun with ghidra crying

#

for USM you usually dont bother

#

there's usually only a singular key per project

#

so if you find the audio key, then its extremely likely it also works on USM

foggy river
flint vortex
#

i think found the usm/mana one for jjk cc but hca one eludes me to no end 😭

#

even found the function that typically where encryption is set and it's just 0s for everything

drifting seal
#

i dont even know what that looks like lol

hollow cliff
flint vortex
#

scramble key?

flint vortex
hollow cliff
#

The whole New HCA Encryption thing that combines keys, I mean.

drifting seal
#

its this new thing they implemented

#

basically, there's a global key for audio as usual

#

but then every AWB has its own subkey

flint vortex
#

where it eventually leads to criAtomDecrypter_CreateInternal

drifting seal
#

and both are combined

#

which makes a new separate key

flint vortex
#

yeah p3r has that

drifting seal
#

this is why every acb/awb in P3R requires its own unique key

flint vortex
#

thankfully playing audio through SetData only needs the base key encryption

drifting seal
#

you can also literally just

#

make a new acb/awb without that

#

i did that for P5T cus ain't nobody tryna figure that mess out

#

and it also allowed me to use adx instead of hca

#

lol

hollow cliff
#

...Huh. Yeah, that's a good idea 😆

flint vortex
#

why would you use adx instead of hca

drifting seal
#

because I can!

flint vortex
#

also 99% of people don't know how to create an ACB/AWB 😔

drifting seal
#

tfw need criware sdk to do it

flint vortex
#

LOL

#

i had literally the same thought when i first started looking into it lmao

drifting seal
#

they also have like

flint vortex
#

before it turned out base key was fine even with hca

drifting seal
#

every bgm in its own acb/awb

#

so if there's 100 bgm in the game

#

then they have 100 acb/awb pair with a single audio inside

#

now imagine that with the double key setup on top

flint vortex
#

like actually

#

wtf???

drifting seal
#

only atlus knows

prisma summit
drifting seal
#

usually thats the easiest way to find criware functions

hollow cliff
prisma summit
#

anything else you want me to test?

hollow cliff
hollow cliff
prisma summit
#

🫡

prisma summit
hollow cliff
#

In the meantime, "use ryo" is the fix, lol.

prisma summit
hollow cliff
#

Gotta save that image to use myself at this point.

hollow cliff
flint vortex
#

i wouldn't know to find/figure out the scramble key

hollow cliff
#

You can send me an ACB and I'll check.

flint vortex
#

but like mentioned SetData doesn't get scrambled besides just base key encryption, since there's no AWB

hollow cliff
#

Would it for sure work that way in every game?

drifting seal
#

it has so far

#

not that we've tested every game ever

#

but I'd say we've checked a good few at least

hollow cliff
#

Okay, so then it probably isn't that.

flint vortex
#

i have actually tested every game ever, it always works

#

even the ones without criware at all

drifting seal
#

keep in mind, the scramble key is strictly an AWB feature

#

setdata has no awb

hollow cliff
#

Yeah, fair.... It's just odd that the key would be different from the USM one 😵‍💫

hollow cliff
prisma summit
#

Thats actually by spec funnily enough. I forgot to turn off my test mod and decided to leave it on while testing. It does look really nice.

#

heres the full thing. I just realized that it's already been showed off a while back so it no biggie sharing it.

weary yachtBOT
#

@rena.bgm LMK if you think there's anything that could help with link cue stuff, lol.... I was noting that in P5R the BGM link cues have different categories than the cues at the links.... 😵‍💫 Though this could well be some nonsense that ACB knowledge won't help 🤷

freaking link cue aaaaaaaaaaaaaaaa

Jump

[Go to message!](#1089998902616395776 message)

hollow cliff
#

Booo, @ didn't work.

#

@flint vortex

flint vortex
#

Though I've zero clue how to do that from the code side, right now I've set up a callback that transforms a cue name to the actual cue used

hollow cliff
#

I see... well, you can absolutely get that from the ACB, but IDK if that's relevant at runtime.

flint vortex
#

it could maybe be possible with an ACB parser

#

The acb is in memory, and seems to be accessed directly at runtime, so it should still be parseable... probably

hollow cliff
#

👀

hollow cliff
#

For reference, a BGM link cue in P5R is structured like this:

 Polyphonic Sequence (x1.0 speed)
  Sequence Commands:
   CueLimitsAndMode (1, 0, 1)
   AcfCategory = "bgm"
   Pos3dDistanceMin = 2000.0
   Pos3dDistanceMax = 4000.0
  Track #1
   Synth #1
    Link to Cue #60000```
#

vs. the linked cue:

 Polyphonic Sequence (x1.0 speed)
  Sequence Commands:
   CueLimitsAndMode (1, 170, 1)
   AcfCategory = "six_sense_carrier"
   VolumeGain_Res100(62)
   Pos3dDistanceMin = 2000.0
   Pos3dDistanceMax = 4000.0
  Track #1
   Synth #1
    Synth Commands:
     PriorityModeAndValue (0, 255)
    Waveform from Streaming AWB
     ID: 55
     Type: ADX
     Channels: 2
     Loop: 2
      Loop Start: 600117
      Loop End: 4144615
     Sampling Rate: 48000
     Samples: 4144615```
flint vortex
#

so something i've noticed, have you not encountered any cues with multiple categories or does it not handle that, or is that different than AcfCategory naotothink

#

bgm_000 has six_sense_carrier and bgm, and I don't think it's inheriting it from the link cue (though i don't know much about the format)

hollow cliff
#

I've never seen a cue with multiple categories (indeed called AcfCategory above), no. I'm not sure where else it would be getting the bgm category if not from the linking cue.

#

It's structurally possible to have two category commands within a cue's sequence commands, but I don't know how they would be read/used in that case.

foggy river
#

do we have a repo linked somewhere in this thread, out of curiosity

hollow cliff
#

Not exactly, no 😅 There's an early version of the parsing code in the EVTUI repo that Logically Anime has been referencing. I was considering keeping the full audio codebase in there as its own project, even when it's technically a separate library...

...but I still can't decide whether that's actually a reasonable idea or just a lazy one / whether I should just make a new repo and deal with it. Indecision 😖

#

(I've posted a few zips of the Python version, though.)

#

Bleh, it should really probably get its own repo. I've mostly convinced myself, it's just a hassle....

foggy river
#

i feel like if you were to make a standalone acb program then having it in the same repo as evtui would make releases less convenient

hollow cliff
#

Very true, since an ACB tool is more generally applicable and would possibly get non-Persona-modder users.

flint vortex
#

would you happen to know what REACT/ducking or w/e it is called internally or stored and whether can i yeet it from existence easily

hollow cliff
weary yachtBOT
#

For an example, it's in P5R's ACF here, as <ReactTable>.

Oh, it also works on the ACF.

Jump

[Go to message!](#1255025517497942016 message)

XRD744.xml
hollow cliff
#

Could just empty the table 🤷

#

If it's P4G you're looking at, the one ACB you sent me from it is an absolute fucking mess, lmao. There are so many settings done explicitly per cue... insanity.

hollow cliff
hollow cliff
flint vortex
#

incredible name

#

10/10

hollow cliff
#

Reminder for myself: look at P4G's common.acf that rena shared a while back to see if there are any REACT shenanigans in there.

hollow cliff
# flint vortex

Welp, some interesting news I guess... if this is P4G's only ACF, it uh. Already doesn't have any REACT settings 😅

hollow cliff
#

Nearly all of the categories have cue limits on them, though, so it might be worth removing those and seeing what happens.

hollow cliff
#

So, bit of a tangent... rena was asking about finding encryption keys a few weeks back. I have no idea what I'm doing re: reverse engineering and I've just been tinkering with r2/iaito like a monkey at a typewriter, but I did pretty easily find where in the P5R exe the ADX key is defined. Presumably this is how we know it in the first place...? Or was this one that just got bruteforced?

I guess what I'm getting at is... in P5R, the loading of the encryption key happens right around the loading of the ACF. Is this a standard way for things to be set up (i.e., is this how keys are often found?), or does every game with an encryption key have a totally bespoke setup for loading the ACF and key (i.e., there's no generalizing from this)?

hollow cliff
flint vortex
#

In UPlayAdxControl which seems to be an object specific to P3R/Atlus, not criware

hollow cliff
#

So very much game-specific then, although possibly similar across related games.

#

Hence DC's "crying with ghidra" description, I guess 😅

flint vortex
#

Ultimately it'd have to call the decryption function somewhere with key, like P3R and others do

#

In JJK I found the spot where it seemed to do that, but it just passed in nothing. But tbf, I never really let the decomp finish so it's entirely possible it's called somewhere else

#

From what I've googled, in Unity it seems like you can just re-enable the logs and it'll get printed. Maybe it's true for UE games too?

hollow cliff
#

Hmmmm... after my latest tinkering with the EVTUI timeline view, maybe a real audio sequencer UI for ACBs isn't as far off as I thought >:3c

prisma summit
#

I believe in you adja

hollow cliff
#

🔥femc🔥

hollow cliff
#

Got HCA encryption/decryption fully working and integrated! So HCAs can be extracted and decrypted with the proper AWB key, or encrypted and added into a new or existing cue >:)

#

Granted, I only have one ACB/AWB of HCAs to actually test with, so something could well break outside of that. Which somewhat relates to my next question....

#

...Would anybody be willing to actually test some modded ACBs in-game? I'm especially interested in testing HCAs and added cues in general. And even more so for adding cues to the infamous SINGLEWORD....
I don't have an actual modding setup at the moment, which is why I ask naocry

foggy river
#

does game matter

hollow cliff
#

Only for the SINGLEWORD question, but other than that, no, this should work for any game that uses ACB/AWB.

#

("should" = I want it to, but it probably needs to be refined through testing)

prisma summit
#

Im always down to test.

hollow cliff
#

...Especially now that I've recruited you into using Python KechiEvil

#

Once I can confirm that the basics work, though, I want to start porting this over into the C# API/GUI. So any testing will expedite that 🙏

prisma summit
hollow cliff
#

Btw, ryo, do you ever use VGAudio's HCA decoder/encoder? During testing (since I only have decrypting working, no decoding/conversion yet), it creates fuzzy-sounding WAVE files from HCAs. Whereas vgmstream creates correct-sounding WAVE files.

flint vortex
#

nope

#

only the encoder

hollow cliff
#

Hm, it seems weird that one would work and not the other, but maybe that's the case here naotothink Guess I should test that, too....

hollow cliff
#

Huh. Yeah, the encoder seems fine. That's very weird.

hollow cliff
#

Lol, okay, long time no update, but after today's discussion in the P5 modding chat it was bugging me that it wasn't possible to add cues with multiple tracks using the CLI tool. So now it is possible:

  --input-acb-path /PATH/TO/MY/P5RPC/VANILLA.ACB \
  --input-awb-path /PATH/TO/MY/P5RPC/VANILLA.AWB \
  --output-acb-path /PATH/TO/MY/P5RPC/MODDED.ACB \
  --output-awb-path /PATH/TO/MY/P5RPC/MODDED.AWB \
  --key-code 9923540143823782 \
  --cue-id 25 \
  --cue-name MyNewCue \
  --sequence-type RandomNoRepeat \
  --new-audio-type ADX \
  --new-audio-path /PATH/TO/MY/FIRST_NEW.ADX \
  --new-audio-path /PATH/TO/MY/SECOND_NEW.ADX

Although it's still limited to ADX and HCA, because those are the only two that have parsers yet in order to get sampling rate/count info....
Anyway, hopefully there will be more here soonish once the event editor is in a stable state

drifting seal
#

@hollow cliff kind of a loaded question, but do you have the ability to edit audio properties yet?

#

realized a random edge case today, p5r has the player character acb/awb as "distance based" audio, so the voice clips play in a "positional" way, i.e. if Ann is on the left side of the screen you only hear her on the left audio channel

#

this also makes them lower volume the further away they are from the screen

#

however, if you give this to enemies you almost cant hear them, because they're too far from the screen

#

this is something I never quite figured out how to remove from the acb, figured maybe you'd have an idea

#

if I make an entirely new acb using AtomCraft this is a non issue but obv then the voices are not tied to the "voice" sound settings

hollow cliff
# drifting seal this is something I never quite figured out how to remove from the acb, figured ...

Been a while since I revisited this code, so let me see... TL;DR: yes, but I'm not exactly sure which change you'd want to make to get this to work. All of the info relating to distance sensitivity is on the top sequence level for e.g. the battle cues (as in the screenshot of the first cue in BP01). There's the GlobalAisac_Distance reference, and the Pos3dDistance numbers. You might be able to play with the distance numbers to work with enemy positioning (i.e., increase the max distance)... but it's probably more simple just to drop the distance AISAC stuff.

#

I could try editing an ACB to drop the distance AISAC from the relevant cues, and see whether that fixes it.

drifting seal
#

ah so its an AISAC thing

#

check BP01 (Joker) and see what values it has

#

if the value is clearly visible enough I can probably do with editing it in the template

hollow cliff
#

The screenshot is from BP01!

drifting seal
#

(i.e. make min/max values insanely high)

#

ah

hollow cliff
#

If you change the 6000.0 to 999999.0 or something, that could do it.

drifting seal
#

out of curiosity, what do enemies have?

#

check something like BE_BOSS_0745

#

(that one is Yu)

#

its entirely possible enemies still have it but just have a high value

hollow cliff
drifting seal
#

oh, that's very odd

#

i guess changing that should be enough

#

now where to find that in the template

hollow cliff
#

No idea how you'd find this via template, since it's nested under some of the weird reference structure that ACBs have for mapping cues to sequences, tracks, synths, etc.... but GlobalAisacReference is the name to look for.

drifting seal
#

yeah each cue has everything for this info

#

its a mess lol

hollow cliff
#

I'm kind of surprised it doesn't Just Work, though, since AISACs are referenced by index, and BP01 and BE_BOSS_0745 both only have one entry in the GlobalAisacReference table... so unless something is getting in the way, I'd expect the cues in each file to just be referencing the AISAC at index 0 of the table....

drifting seal
#

the template says they both have value 71

hollow cliff
drifting seal
#

i did find something that might be relevant

#

Yu has NumAisacControlMaps set to 0

#

while the Joker one has a mix of 0s and 1s

#

(this is under cuetable)

#

010 says no occurence of 6000 so that's cool

hollow cliff
#

I only see NumAisacControlMaps set to 1 for all cues in both files naohmm naohmm

drifting seal
hollow cliff
#

...oh well, there's one 0 in Joker's. But just on one cue.

#

Or, two. Lmao. I'm scrolling quickly.

drifting seal
#

okay i think i see part of the issue

#

i hex searched the float on yu in reverse endianess

#

found it under the "command" thing but as individual bytes in the template

hollow cliff
#

The template may not know how to parse SeqCommand -- it'll be somewhere in there.

drifting seal
#

it sure doesnt lmao

hollow cliff
#

Yeah, it's an annoying byte sequence thing....

drifting seal
#

oddly, i cant find the 6000 value on the joker one i copied for the enemy

#

wonder what it changed to

#

720 in this case

hollow cliff
#

This kind of nonsense is needed to parse the sequences 🥲

drifting seal
#

oooooooooooooof

hollow cliff
#

Let me look at those ACBs, then....

drifting seal
#

this is going to be annoying to edit manually lmao

#

especially since joker has like a billion cues

hollow cliff
#

Do you know offhand which cues are the ones you added, for quick reference?

drifting seal
#

whatever is at the end lmao

#

lemme check

hollow cliff
#

Ah, at the end makes sense, lol.

drifting seal
#

the other 2 ACB are copypasted but they might be different because I repacked using SonicAudioTools

hollow cliff
#

Oh, I do see these in the 0720 one 😅

Cue #1002: bp01_p_002 (0.834s)
Cue #1003: bp01_p_003 (0.668s)
Cue #1004: bp01_p_004 (0.871s)
Cue #1005: bp01_p_005 (0.825s)
Cue #1006: bp01_p_006 (0.644s)
Cue #1007: bp01_p_007 (0.788s)```
drifting seal
#

those are the persona callouts

#

they're cue 1000 + (id)

hollow cliff
#

I don't see any Pos3d fields in the 0720 one, anyway -- but they are on every cue in the 0721 and 0722 ones.

drifting seal
#

its incredibly quiet too so i know something is happening

hollow cliff
#

It could be all these weird zero VolumeBus commands the Joker cues have?? Because the Yu cues don't have All That....

drifting seal
#

it works fine as player so not too sure whats happening

#

then again this acb is incredibly ancient

#

you can barely hear him

#

very strange stuff

hollow cliff
#

Ah, yep, it does.

#

All of the ACBs you've sent still use GlobalAisac_Distance, though -- I wonder if just changing that name to GlobalAisac_Skill (to match the 0745 ACB) would do anything.

drifting seal
#

probably!

#

no idea where to change that though

#

the template doesnt display that data at the very least

hollow cliff
#

Viewing the binary in vim, the null-delimited string with the name is in there raw... I think you could string edit it directly, lmao, although that's kind of wild.

drifting seal
#

I see

#

unfortunately I will have to test this tomorrow because it is raining with very loud thunders and the power just blinked so I assume its not a good time to use the PC

hollow cliff
#

🫡

drifting seal
#

oh apparently its a thunderstorm, lovely!

hollow cliff
#

You really get the worst weather... RIP....

hollow cliff
drifting seal
hollow cliff
#

Lmao, okay, I'll edit the string the proper way.

drifting seal
#

does the string have a length value somewhere?

#

skill is shorter than distance, so this is probably something i can bullshit on hxd

#

lmao

#

seems like its just a nullterm string?

#

oh there's a second one

#

acf reference table, row 9

#

wonder what the separate "Distance" string is for

#

I think this actually worked lol, I just changed all 3 "Distance" to "Skill" and I can clearly hear him now

#

louder than the sumi one which should also still have the distance value

#

10/10 solution, thanks for the help

#

while im still here wasting your time, do we have the ability to explicitly add cues to a sound category?

#

i.e. if i wanted to add more cues to Joker and have them all still be in the "voice" category to avoid any more issues of the volume setting being ignored

hollow cliff
#

Yeah, I figured it'd be because I missed the other two. Glad that worked!!

hollow cliff
drifting seal
#

would it be possible to modify the python cli so that you can provide a cue id to "copy" all the values from?

#

would definitely solve most of the issues

hollow cliff
#

Good idea... I'll try to cook something up for that.

foggy river
#

at the risk of interrupting, i forgor what needs to be done for the dotnet version (that isnt in the evtui prototype)

hollow cliff
#

The C# version is still just what's in EVTUI -- and that code is old enough that it can only read ACBs and not write them. So all the editing/writing capabilities need to be ported over as the next step for that.

foggy river
#

i c

hollow cliff
#

I've been taking a break from hobby coding for my sanity, but maybe it's time to revisit and move stuff along femchappy

foggy river
#

understandable have a nice day

hollow cliff
#

Vague updates: I've been fixing some edge case issues that pop up with ACBs I hadn't tested (mainly: Switch bgm and general palace field sfx)... but I keep putting off the "provide a cue ID to copy values from" thing because I forgor how annoying cue structure is naodead

I think I looked at it at the beginning of August thinking it would be a simple extension and then was like. Oh 🫠 Aaaaand then didn't touch it for two months. But 😤 I swear I am implementing it now....

hollow cliff
#

AtomicAudio: Tools for CRI audio formats (ACB, AWB, ADX, HCA, etc.)

hollow cliff
#

Okay, I have a basic version of copy-from-existing-cue working... but the hierarchical cue>sequence>track>synth structure makes things complicated re: fully copying the original cue's attributes. So it'll take a bit more thinking yet naohmm

hollow cliff
drifting seal
#

ayy yo???

hollow cliff
#

I'm sure it'll break at the edges, but I tested it with BP01 and it worked 🤞

drifting seal
#

lmao, i'll let you know if i encounter issues

hollow cliff
#

🫡

drifting seal
#

also i just realized you dont have the repo link at the top post or pinned

hollow cliff
#

Aha, whoops. I'm pretty sure it's somewhere in here, just never got pinned. Let's see....

hollow cliff
#

Thank you!

terse solar
#

i forgot discord made it so specific roles can pin, I should let verified modders do that now...

drifting seal
#

im going to pin endless mikus

terse solar
#

could one of you try pinning something rq

#

(in here lmao)

drifting seal
terse solar
#

awesome

#

well ill do other channels later, modders can pin in concept threads at least

hollow cliff
#

Beautiful femc

flint vortex
hollow cliff
#

Only if you wait until I fully recreate CRI Atom Craft in Avalonia 😄

flint vortex
#

im starting to think persona modders might all be masochists if that's the end goal

#

the fact that cbt/bdsm are actual mods just adds more fuel to the fire

drifting seal
#

this is edge case poisoning

#

you should not count me when gathering the data

#

(after all, I am like one of the less than 10 people alive who suffered the KT experience™, you're never sane after that)

hollow cliff
#

At one point I would've been entirely joking about that, but now I have actually managed to make a timeline in the event editor, sooo... I guess I'm only half joking naosmiley

#

🪢 sexomodding

foggy river
hollow cliff
#

@sullen torrent Figured I'd move the discussion in here so as not to clog the feed, but I added some fixes so now the new ACB fields can be handled... and also there's a new command that lets you add new tracks to an existing cue (and optionally copy parameters from one of the existing tracks):

python -u AtomicAudioTool.py add_simple_track \
  --input-acb-path /PATH/TO/MY/P5RPC/VANILLA.ACB \
  --input-awb-path /PATH/TO/MY/P5RPC/VANILLA.AWB \
  --output-acb-path /PATH/TO/MY/P5RPC/MODDED.ACB \
  --output-awb-path /PATH/TO/MY/P5RPC/MODDED.AWB \
  --key-code 9923540143823782 \
  --cue-id 0 \
  --base-track-num 1 \
  --new-audio-type ADX \
  --new-audio-path /PATH/TO/MY/NEW.ADX
#

Hopefully with this the changes can work in-game 🙏 (obvi changing the arguments to be P5X-appropriate)

drifting seal
#

let me cause you a tiny bit of anguish by asking this

#

what type of value are the multiple cues set to?

#

i.e. there's stuff like random, randomnorepeat, and so on

sullen torrent
#

just 1 cue with RandomNoRepeat, iirc

hollow cliff
#

Multiple cues?

drifting seal
#

sorry, multiple audios in a single cue

sullen torrent
#

but im not sure what exactly norepeat means in this context because the tracks do loop

hollow cliff
#

For this new command, it's whatever the cue was already set to. You can set different types (Polyphonic, RandomNoRepeat, etc.) in add_simple_cue, though.

drifting seal
#

worth considering making randomnorepeat the default

#

because thats usually what most people "expect" out of a random option

hollow cliff
drifting seal
#

pretty sure polyphonic plays all audio tracks in the cue at the same time

#

i dont think thats what people would want if they add a new track to the cue

#

lol

hollow cliff
#

True... I guess I'm assuming that if they're adding tracks to a cue, it already has multiple other tracks 🤔

drifting seal
#

but what if it doesnt!

#

as an example, you have the BE_BOSS_ stuff in p5r

hollow cliff
#

Well.......... yeah, I guess 😅

drifting seal
#

those are 1 track per cue

#

but someone might want to add more tracks to any given cue for example

#

see, you seemed sad that you didn't suffer enough adding this, and like the helpful person that I am, I have now given you some

hollow cliff
#

Hm, hm... okay, fair point. Two options: either there's an extra flag to change it (--change-seq-to-type RandomNoRepeat) and I include it in the readme example so people are more likely to use it than not, OR it's set to RandomNoRepeat by default and there's an extra flag to say not to do that (--leave-seq-type).

#

LOL, fortunately changing sequence type is simple enough.

drifting seal
#

fwiw using RandomNoRepeat by default shouldnt cause issues