- C++ 74.2%
- C 16.9%
- Makefile 2.9%
- Logos 2.9%
- Linker Script 1.8%
- Other 1.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
This PR adds the required CLI options to interface with the resampling features added in the last PR. I have done some testing on my computer and things work as expected, but please feel free to test further as needed. I'm not sure if I've made the descriptions for these options too verbose in the README, or even if I should've compacted the descriptions in `print_usage()` some more to avoid a second block of information. As an aside, my intent with the oversampling option in particular was that it can be combined with ADPCM compression to get the best results (eg. oversampling 16-bit audio by a factor of 4 and then compressing with ADPCM nets the same file size, but now has plenty of room for resampling without harsh aliasing artifacts). However, there isn't actually an option to *force* ADPCM encoding, only an option to *test* it. Would it be better to add an option to allow the user to force the output format? (eg. signed/unsigned 8-bit/16-bit/ADPCM, which can later be bypassed/masked out when "fixing" samples for GBA/DS as needed) |
||
| data | ||
| gba_demo_rom | ||
| nds_demo_rom | ||
| source | ||
| .gitignore | ||
| COPYING | ||
| Makefile | ||
| readme.md | ||
Maxmod Utility
Introduction
This is a packer of songs and audio effects to be used by Maxmod.
Please, report issues here.
Usage
mmutil [options] input files ...
Input files may be MOD, S3M, XM, IT, and/or WAV.
| Option | Description |
|---|---|
-o [output] |
Set output file (.mas, .bin, .gba, .nds). |
-h [header] |
Set header output file (.h). |
-D |
Add list of sample and module names to soundbank. |
-m |
Output MAS file rather than soundbank. |
-d |
Use for NDS projects. |
-b |
Create test ROM. (use -d for .nds, otherwise .gba) |
-i |
Ignore sample name flags (NDS mode only). |
-v |
Enable verbose output (-v -v for extra verbose). |
-p [0...255] |
Set initial panning separation for MOD/S3M. |
-z |
Convert WAV file to raw ADPCM file (for testing). |
-y |
Assume 'yes' in confirmation prompts. |
-V |
Print version string and exit. |
Sample flags
Sample flags are strings added to a sample name to modify the sample during conversion.
%o: NDS hardware mixer mode only. Used to support theSample Offseteffects when using the DS hardware channels for playback. You can use a sample offset command to start playing beyond the loop start, and then when the sample hits the loop end it'll still correctly loop back to the start.%c: NDS hardware mixer mode only. Compress the sample using IMA-ADPCM.#: Normally, samples of a module file don't get their own definitions in the header file generated bymmutil. If the name of a sample starts with#, a definition is generated, and its name will be added to the samples dictionary.
Resampler flags
These options control resampling behavior. By default, they are set to 'classic' values for backwards compatibility.
-
-fmin [freq]: Set minimum sampling rate (in Hz). This causes samples that are sampled below that rate to be upsampled, which can help reduce 'crunchy' aliasing when waveforms are played back at low playback rates. Note that this can increase the output file size. -
-fmax [freq]: Set maximum sampling rate (in Hz). Downsample anything above the specified rate. This can be useful when waveforms are sampled at 44.1kHz but will be mixed at 16kHz, for example, as this will decrease the file size, as well as remove high-frequency components that would cause audible aliasing distortion on playback. -
-resampler [method]: Set resampling algorithm. Can be any of:nearest: Nearest-neighbor interpolation (1-tap)linear: Linear interpolation (2-tap)cubic: Cubic spline interpolation (4-tap; default)sinc[,4]: Sinc interpolation (4-, 6-, ... 254-tap)
Sinc resampling is the 'mathematically-correct' method, but the other methods may be of use for stylistic purposes.
-
-oversample [ratio]: Set oversampling ratio (default: 1.0). Multiply the sampling rate by the specified ratio, but also preserve the original low-pass cutoff. This option is most useful for simulating band-limited resampling on playback, without actually using interpolation. This will necessarily increase file size, proportional to the ratio.- The oversampling ratio is applied AFTER capping to the minimum/maximum rate
(as specified by
-fminand-fmax), and can also be 'inverted' by using a ratio less than 1.0 (this will scale sampling rates DOWN, with a corresponding DECREASE in file size). - This option only works correctly with sinc resampling, as the other methods cannot apply the necessary low-pass filter.
- The oversampling ratio is applied AFTER capping to the minimum/maximum rate
(as specified by
Examples
-
Create DS soundbank file (soundbank.bin) from input1.xm and input2.it. Also, output header file (soundbank.h)
mmutil -d input1.xm input2.it -o soundbank.bin -h soundbank.h -
Create test GBA ROM from two inputs.
mmutil -b input1.mod input2.s3m -o TEST.gba -
Create test NDS ROM from three inputs.
mmutil -d -b input1.xm input2.s3m testsound.wav -o TEST.nds