Language…
8 users online: autisticsceptile1993, CrazyPencilDawg, Dan2point5, DanMario24YT, Gamet2004, iamtheratio, Scags, TheOrangeToad - Guests: 263 - Bots: 320
Users: 64,795 (2,378 active)
Latest user: mathew

wav2brr: Automatically encode, loop, resample, and tune .wav and .brr files for AddMusicK

wav2brr

Download at: amktools.7z

wav2brr is a tool to automatically batch-encode many .wav files to .brr files, loop at given loop points, resample by ratios, and calculate tuning for the final sample.

Tutorial

Just create a folder named “wav” (or anything else), and place each .wav (along with Audacity projects, etc) in its own folder (name doesn’t matter).

For example, in the folder “wav/Organ” with file “organ.wav”, create file “organ.cfg” containing

Code
dict(
    ratio=0.4,
    loop=400,
    truncate=500,
    at=60
)

Decrease ratio to decrease the size of the resulting .brr file (tuning will still be correct).

loop and truncate describe the begin and end of the looped region. Your sample will be automatically resampled to a multiple of 16 samples, which is very convenient.

The generated tuning will be correct if your sample is tuned to an exact note, and at contains the correct MIDI pitch.

wav2brr also supports extracting looping and tuning information from .sf2 files. Pass --sf2 <sf2path> to wav2brr.exe, and remove loop, truncate, and at.

Execution

Assume your samples are located under wav, AddMusicK is located at amk_path, and you want your samples to be written to samples/smp.

Create file convert_brr.cmd containing:

path\to\amktools\wav2brr.exe wav amk_path smp

See https://github.com/jimbo1qaz/amktools/blob/master/docs/wav2brr.md for full documentation.

Importing tuning data

wav2brr prints tuning data to console. To automatically insert tuning data into .txt, see my tutorial at docs/mmkparser.md .

FAQ

  • mmkparser will interpret all lowercase v and y as volume and pan commands (which can be rescaled). If you map "octave=o3" and use octave, mmkparser will report an invalid v command.
    • Potential solution: I could turn off v and p processing entirely.
  • In #instruments, if you include %tune followed by ;comments, the tuning bytes will be written after the comments. This is a bug.
  • In #instruments, if you use %tune, you cannot include more than one “sample.brr” per line.

Credits

wav2brr is based on brr_encoder (https://github.com/Optiroc/BRRtools).

If this does what i think it does, then this is really cool. Finally being able to create short voice samples and SFX without much knowledge of the SPC700, is a really handy thing to have for hacks.
Layout by Erik557
Hi.
Nice! I wanna try it out!! #thp{=D}
The Hacking of PuyoPuyo. Come join the fun, friends. 『いけいけ団長、頑張れ頑張れ団長!』
Help us raise funds for the Armed Forces of Ukraine. #ДопомагаємоРазом / #HelpTogether
“Even if you personally are so dissatisfied with life that you want the world to end, surely the cruel reality is that it will continue on, unchanging. All the better for someone perfectly content, like me.”
Aya Shameimaru, Touhou Suzunaan ~ Forbidden Scrollery