The forum about vgm files
It is currently 2023-03-20, 15:13:58

All times are UTC + 1 hour [ DST ]

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: 2023-01-20, 22:30:11 
User avatar

Joined: 2022-04-23, 22:53:04
Posts: 81
Location: On the YM2612 chip
kaijuu is a Windows context menu shell extension. The context menu is the list you see when you right-click on a file or folder. kaijuu allows you to add your own custom actions to this menu.

Think of opening an unknown file type: Windows will ask you to associate a program with the file type. From there forward, double-clicking the file will open the file with that program.

kaijuu is a far more powerful version of this same concept. With kaijuu, you can assign as many rules as you want. You can apply the same rule to multiple file patterns. You can have more complex pattern matching for names. You can apply rules to folders. You can specify rules about how to handle single-file versus multi-file selection. You can send custom command-line parameters to the program. You can have rules on a per-user basis. And you can do all of this from an easy-to-use GUI.

What does this have to do with VGMs? Nothing on its own. But you can use it to replace a great deal of .BAT file and command line usage. No matter how comfortable you are with using those things, Kaijuu should give you considerable quality-of-life improvements in the form of speed alone.

As useful as Kaijuu is, it does have a few downsides:

  • It's Windows-only, of course.
  • For it to work, you have to run the program as an administrator at least once so you can install its DLL onto your system. This should be safe, but your system configuration could prevent you from doing so. If you can't install the extension, you're either SoL or will have to get an administrator to install it for you.
  • Your commands are stored in the Registry, a dealbreaker for some; however, kaijuu-tachi at least lets you export them to a file for transfer or safekeeping. (Registry usage is so each user can have separate command settings.)
  • Although version v06/Kaijuu-Tachi has many good bugfixes, it doesn't keep the +Icons feature, needs to be built from source (but mentions a program that can do this for you?), and doesn't have a quick and easy way to build a Win32 version.

The following bugs appear in Version 05 (+Icons version, at least) and have been fixed in Tachi/06:
  • Having too many commands created seems to make the program lose track of the order of commands, scrambling them every time.
  • Having the Rule Editor window open used a lot of CPU cycles for no reason. (Could it have been due to the implementation of icons?)
  • I'm not aware of any further or dangerous bugs (and doubt dangerous ones exist, based on the programmer), but if you need to use v05 it's possible you'll discover others.

If none of the above is a problem to you, then let's get started!

As copies of the binaries and source of the ancient v05 are gone or hard to find, I've mirrored them in the attachment:

  • kaijuu_v05.7z, 32-bit and 64-bit binaries
  • kaijuu_v05.tar.xz, v05 source
  •, +Icons edition (32-bit and 64-bit binaries; Manual is missing!)
  •, +Icons edition source

Then there is version v06, in the form of Kaijuu-Tachi. The new readme/manual mentions a particular build of mingw to compile it with - but without knowing this I built it with a different one. The linked build has an installer, though; once it's installed, you should only need to run the cc.bat file (and maybe to copy (not move) some of the other source folders into kaijuu/obj, if it says things aren't found).

(If you are already using Kaijuu 05 and wish to upgrade, you don't need to Reset the Rules like the manual recommends. All my Rules carried over to Tachi-06 without any problems.)

The manual handily explains how to use Kaijuu (please do read it!), but I have further examples below which double as useful commands you can start using right away. It also doubles as a cheat sheet.

"Find Start Point"

We start with *.vg? for the Pattern, meaning to match all VGZs and VGMs. (The ? character actually matches any single character; * matches any amount of characters.)

Then, for the command:

vgm2txt {file} 0 0:03 "{basename} start.txt"

As a power user, I have vgm2txt accessible from my path. As (presumably) a non-power user, you (still) have no idea what that means. The beauty of Kaijuu is, you can press "Select..." next to Command and navigate to the EXE of the tool you need to use; Kaijuu will fill out the full path for you. Then, at the end, you can add any arguments you need to finish out the Command you want.

Since vgm2txt can only work with one file, we use {file}, which has been supplied for us. The number arguments make a TXT of only the first three seconds of the file, which should be more than enough for most cases accounting for the silence buffer. Finally, to make an output filename that ends with "start" I used {basename}, to use the filename (without extension) of the VGM as a basis.

(I surrounded my custom filename with quotes because there's a space in it. Without them, the OS can't tell where each argument ends and the next starts.)

You can make any amount or type of rules you want, even if they're very similar. For my own convenience, I also made a vgm2txt rule that's the same as that one, except for the name and for omitting the start and end arguments (which makes vgm2txt prompt me for those arguments). I frequently put in custom ranges, so this makes for a really quick way to use vgm2txt. (On the other hand, you can't use the "output filename" option this way...)


Here's another useful example, which seems more complex but is very simple. We use a Pattern of * - ?? *.bin to match the output of GemsScan and, more importantly, ignore BIN files that don't match the filenames GemsScan produces. Then we create a Command that looks like this.

"C:\my\path\to\gems2rom.exe" -o "{basename} g2r.bin" {files}

(Again, use Select to find the EXE, or fill in the correct path by hand.)

-o is needed to specify the output file of gems2rom. To name it dynamically, I use {basename} again; it will take the name from the first file in the list of {files} Kaijuu receives. (Yes, this'll include the word "Driver" et all.) Then, to keep the output and source filenames from being identical, I added "g2r" before the extension. (I could also have used the "smd" extension instead.)

With this Rule in place, you can now select all five GemsScan output files - Driver, Instruments, Envelopes, Sequences, and Samples - and Kaijuu will use them with gems2rom for you. But, you must note: Since you must give gems2rom the Driver file first, you'll have to menu-click on the Driver file to run the Rule on it.

Now, what did I tell you about quality-of-life, eh?

I have a few others but I'm exhausted..

kaijuu05builds-source.7z [1.06 MiB]
Downloaded 15 times

I'm trying to gradually make information on the forums easier to find on the wiki. If I forget to credit you for any information, please let me know (or edit in your credits to the article if you don't want to wait on me to return).
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour [ DST ]

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
[ Time : 0.041s | 13 Queries | GZIP : On ]