Event Audio Editing (P3F, P4G)

P3F

P4G

P4G Vita

Table of contents
  1. Tools You’ll Need
  2. Event File Locations
  3. BGME Functionality
  4. Extracting and opening PM2 and PM3 files
  5. Editing BGM calls
  6. Editing BGM timings
  7. Additional music options (I left off here)
  8. Editing cmmEventBGM.dat (P4G PC only)

Add information on editing sound effects and voice lines; this is only written for music so far

Tools You’ll Need

Event File Locations

  • Persona 3 FES and Persona 4 store their .PM1/.PM2/.PM3 files in DATA.CVM/event.
  • Persona 4 Golden stores its .PM1/.PM2/.PM3 files in data.cpk/event.
    • Music calls for many social link and miscellaneous events can also be found in init.bin/event/cmm.bin/cmmEventBGM.dat.

BGME Functionality

The BGME Framework includes some functionality that can assist in event editing for Persona 4 Golden (PC). More information can be found here, or in the BGME documentation.

Extracting and opening PM2 and PM3 files

Find the event that you want to edit. For Persona 4 Golden, many of the events are documented on the Amicitia wiki. For those that aren’t, as well as Persona 3 FES’s events, there are text script dumps with the text from all events so you can find the ID of a specific event. For example, E104_001 in P4G is the scene where Yu first arrives in Inaba.

Open the corresponding folder and find the associated PM2 and PM3 files. Drag these files onto Libellus Event Editing Tool.exe. This will convert the files into a JSON file and place it into a new folder.

When extracted, the PM2 will look something like this:

and the PM3 will look something like this:

Not all events have BGM calls within their PM2 or PM3 files! For P4G, if your PM3 file does not have a BGM section, the music may either be called as ambience in the PM2 (ex: Junes theme) or stored in init.bin/event/cmm.bin/cmmEventBGM.dat. See Editing cmmEventBGM.dat (P4G PC only).

Looking at the format of the BGM call in the .PM3 shows the most important parameters worth noting:

  • "TargetType": "BGM": indicates that the section has to do with BGM.
  • "StartFrame": what frame the music will start playing on. 30 frames corresponds to 1 second, as P3F and P4G (prior to its remaster) both run at 30 FPS.
  • "Id": stores the information on what song to play.
  • "Fade": if music fade out is called, this specifies which fade out to use - a fast one or a short one.

Editing BGM calls

In the BGM call, "Id" is the song ID called. For example, in this event, at frame 769, song ID 50 (Girl of the Hollow Forest) is called.

This is compatible with BGME; new songs are simply called using their corresponding ID. For example, in this event, at frame 285, song ID 775 is called.

Editing BGM timings

StartFrame denotes the frame in which the music or audio will start (or end). A frame in P3F and P4G is 1/30 of a second (or 30 frames = 1 second), as the games originally ran at 30 FPS; this is still true for the P4G remaster despite their higher maximum framerate.

The PM2 file contains data on when different messages will play. It typically looks like this:

StartFrame here similarly indicates when the message is shown. MessageId indicates which message is to be shown. By using the text script dumps or extracting the corresponding PM1 event file, you can find which message corresponds to that ID. For example, for E104_001 in P4G (the scene where Yu first arrives in Inaba), MSG_000 is called at frame 241, and MSG_001 is called at frame 392.

For messages, the start frame is also typically the end frame to account for message auto advance and voiced dialogue! With the above example, if you set a StartFrame of 242, your music will only start after you advance past Dojima’s dialogue.

Additional music options (I left off here)

  • To have BGM and other sound effects like ambience fade out gradually, use

              "Fade": 2
    

    To have BGM and other sound effects like ambience fade out suddenly, use

              "Fade": 3
    

    The Junes theme is treated as ambience, and is called in the .PM2 using

            {
              "TargetType": "ENV",
              "StartFrame": _,
              "Length": 0,
              "NameIndex": -1,
              "Data": "00 00 00 00 00 00 00 00 00 00 00 00 3F 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"
            },
    

    muscle blues is treated as ambience, and is called in the .PM2 using

            {
              "TargetType": "ENV",
              "StartFrame": _,
              "Length": 0,
              "NameIndex": 65535,
              "Data": "00 00 00 00 00 00 00 00 00 00 00 00 1B 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"
            },
    

    It’s SHOW TIME! is treated as ambience, and is called in the .PM2 using

            {
              "TargetType": "ENV",
              "StartFrame": _,
              "Length": 0,
              "NameIndex": 65535,
              "Data": "00 00 00 00 00 00 00 00 00 00 00 00 20 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"
            },
    

    Ambience can be stopped using

            {
              "TargetType": "ENV",
              "StartFrame": _,
              "Length": 0,
              "NameIndex": 65535,
              "Data": "00 00 00 00 00 00 00 00 00 00 00 00 0A 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"
            },
    
  • To have BGM and other sound effects like ambience fade out, use

              "Fade": 6
    

If switching from playing one song to another, P3F and P4G default to using a sudden fade out of the previous track.

Editing cmmEventBGM.dat (P4G PC only)

It is possible to edit event music fully without editing this file by forcing specific music to play in the PM3 file for the event with a new BGM call.

cmmEventBGM.dat is not compatible with BGME!

Many of P4G’s social link events call music at the beginning in init.bin/event/cmm.bin/cmmEventBGM.dat. Editing this file requires the use of 010 Editor and several templates designed for file types supported by the Persona games. Extract these templates to a separate folder.

Extract cmmEventBGM.dat using Amicitia or Persona Editor, then open it in 010 Editor. By running a template on it, we can use a more readable format. Open a template by clicking the Run Template button, then the Open Template button, or press Ctrl + F5.

Open your 010 templates folder and select /templates/p4g_eventBGM.bt. This will run the template on the file you have open and present it in a more readable format as shown below.

Expanding the drop downs shows the following data:

  • MajorID and MinorID: the event ID. For example, in the image above, the event shown is E830_012.
  • BGMIndex: the index for the desired song.

You can change BGMIndex for a given event here to change the music that plays at the beginning. Note that not all events are listed here.