Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pikmin 1: no sound output/missing JaiInit #4

Closed
AeroRime opened this issue Oct 27, 2024 · 4 comments
Closed

Pikmin 1: no sound output/missing JaiInit #4

AeroRime opened this issue Oct 27, 2024 · 4 comments

Comments

@AeroRime
Copy link

Hello! I was looking to be able to use JaiSeqX to playback some music from Pikmin 1, but I wasn't able to figure it out how to get it to work with JaiSeqX on my own.

Normally there would be an initializer like JaiInit.aaf at the top of the AudioRes directory (called SndData in this game), but there's no '.aaf' initializer in there. I was trying to create myself a generic JaiInit.aaf file by using pikibank.bx and the BARC header I extracted from the game's executable file (main.dol). However the program wasn't playing back any sound and had some problems that have to do with the JaiInit I was using. Here's an example of what was outputted:

$ ./JAISeqX JaiInit.aaf play play3.jam 0
Initializing DSP.
none
0 = No sound
1 = Speakers / Headphones (Realtek Audio)
Timebase updated 120bpm 100ppqn cycle-length 5 @ 0
Timebase updated 120bpm 100ppqn cycle-length 5 @ 7
Timebase updated 120bpm 112ppqn cycle-length 4.464286 @ 8
PARAM 33 0
[Track 0@0x0003A] iprm 33 to 0x000
E: Trk0 unknown opcode 0xDD(BUSCONNECT) @ 44
E: Trk0 unimplemented opcode 0xEF(PANSWEEPSET) @ 48
64
E: Trk0 unimplemented opcode 0xF1(IRCCUTOFF) @ 4A
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
PARAM 33 1
[Track 1@0x0065F] iprm 33 to 0x001
E: Trk1 unknown opcode 0xDD(BUSCONNECT) @ 669
E: Trk1 unimplemented opcode 0xEF(PANSWEEPSET) @ 66D
64
E: Trk1 unimplemented opcode 0xF1(IRCCUTOFF) @ 66F
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
PARAM 33 2
[Track 2@0x00A95] iprm 33 to 0x002
E: Trk2 unknown opcode 0xDD(BUSCONNECT) @ A9F
E: Trk2 unimplemented opcode 0xEF(PANSWEEPSET) @ AA3
64
E: Trk2 unimplemented opcode 0xF1(IRCCUTOFF) @ AA5
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
PARAM 33 3
[Track 3@0x010BA] iprm 33 to 0x003
E: Trk3 unknown opcode 0xDD(BUSCONNECT) @ 10C4
E: Trk3 unimplemented opcode 0xEF(PANSWEEPSET) @ 10C8
64
E: Trk3 unimplemented opcode 0xF1(IRCCUTOFF) @ 10CA
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
PARAM 33 4
[Track 4@0x014CC] iprm 33 to 0x004
E: Trk4 unknown opcode 0xDD(BUSCONNECT) @ 14D6
E: Trk4 unimplemented opcode 0xEF(PANSWEEPSET) @ 14DA
E: Trk4 unknown opcode 0xDD(BUSCONNECT) @ 14E1
E: Trk4 unimplemented opcode 0xEF(PANSWEEPSET) @ 14E5
64
E: Trk4 unimplemented opcode 0xF1(IRCCUTOFF) @ 14E7
PARAM 33 5
[Track 5@0x024F3] iprm 33 to 0x005
E: Trk5 unknown opcode 0xDD(BUSCONNECT) @ 24FD
E: Trk5 unimplemented opcode 0xEF(PANSWEEPSET) @ 2501
E: Trk5 unknown opcode 0xDD(BUSCONNECT) @ 2508
E: Trk5 unimplemented opcode 0xEF(PANSWEEPSET) @ 250C
64
E: Trk5 unimplemented opcode 0xF1(IRCCUTOFF) @ 250E
PARAM 33 6
[Track 6@0x02C85] iprm 33 to 0x006
E: Trk6 unknown opcode 0xDD(BUSCONNECT) @ 2C8F
E: Trk6 unimplemented opcode 0xEF(PANSWEEPSET) @ 2C93
64
E: Trk6 unimplemented opcode 0xF1(IRCCUTOFF) @ 2C95
PARAM 33 7
[Track 7@0x039B3] iprm 33 to 0x007
E: Trk7 unknown opcode 0xDD(BUSCONNECT) @ 39BD
E: Trk7 unimplemented opcode 0xEF(PANSWEEPSET) @ 39C1
64
E: Trk7 unimplemented opcode 0xF1(IRCCUTOFF) @ 39C3
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
JAISeqTrack::noteOff > Selected IBNK BNK0 is NULL
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
JAISeqTrack::noteOff > Selected IBNK BNK0 is NULL
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
JAISeqTrack::noteOff > Selected IBNK BNK0 is NULL
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
JAISeqTrack::noteOff > Selected IBNK BNK0 is NULL
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
JAISeqTrack::noteOn > Selected IBNK BNK0 is NULL
...

Can you please help me with this issue I'm having? I do not know where to go from here to be able to play any of the Pikmin 1 music.

@XAYRGA
Copy link
Owner

XAYRGA commented Jan 7, 2025

Sorry for the delay on this!

Pikmin 1 has questionable support, but it still exists.

For this there are a few parameters you'll need, as pikmin does not use a standard jaudio system. They're quite undocumented but I threw them in there out of curiosity!

The first is the JAIInitVersion, or sequence engine version as specified in the parameters, for pikmin 1 this should be set to 0
Next is "-libjaudio.force_init_version" , this should be set to "bx"

For the fun part, pikmin manually swaps out the ibnks in memory and maps them to 0 instead of selecting a new one using the IBNK select instruction (I don't think it existed yet because this is a fork of Nas from the N64)

So you'll need to find out which ibnks map to what sequences! (Hint: they're mostly in order based on how they're extracted)

For this you use the parameter "-jdsp.forcemap_ibnk_bx" followed by a number to map the specified IBNK index to 0

Finally, the ".aaf" file for pikmin is actually named "Pikibank.bx", and it is in the sndData folder as well. You should copy the .aw files to the "Banks" folder just like other installations.

This is a lot to absorb I know, but in a pinch, you can play it like this!

jaiseqxlja.exe pikibank.bx visu pikmin1_map_theme.bms 0 -libjaudio.force_init_version bx -jdsp.forcemap_ibnk_bx 12

You'll of course need to replace the '12' and 'pikmin1_map_theme' with the appropriate values.

@XAYRGA XAYRGA closed this as completed Jan 7, 2025
@AeroRime
Copy link
Author

AeroRime commented Jan 8, 2025

I tried the different parameters and I was able to play most of the bms sequences from Pikmin! I had prior experience with one of your sound modding tools specifically for Pikmin 1, so I was able to match the ibnks to the sequences without much problem.

The only bms sequences that I have some issues with when using JaiSeqX (excluding the sequences that only play sfx) are jungle.jam and demobgm.jam (for good reason). d_end2.jam works as I was able to map it to ibnk 13, but most of the instruments are playing at an entire octave too low. Is there a way to adjust each instrument's base key while in visu mode? I did compare it to both the soundtrack and another rip of this exact song, and thought to share this small inconsistency I had with that specific sequence. Everything else about the sequence (tempo, LR panning, looping etc.) works great!

@XAYRGA
Copy link
Owner

XAYRGA commented Jan 8, 2025

Thanks! Happy it worked.

I don't know why but on some songs the song noteon commands are exactly one octave off, I ran into that from the start too. To be honest, I probably missed some value in parsing the ibnk, but it doesn't affect any other games and I didn't want to touch the loader until i do the rewrite in the future.

Check out the releases page, and download the 'Peanut butter' release, I added a -transpose option for you. The value is a numeric value in semitones, to make the songs play properly in pikmin, you'll want a whole octave, or +12 semitones, which would look like this

-transpose 12

@AeroRime
Copy link
Author

AeroRime commented Jan 8, 2025

Thank you so much! The transpose feature fixed all the tuning problems in d_end2.jam, and it plays just like it would in-game!

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

No branches or pull requests

2 participants