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
Codedict( 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
andy
as volume and pan commands (which can be rescaled). If you map"octave=o3"
and useoctave
, mmkparser will report an invalidv
command.- Potential solution: I could turn off
v
andp
processing entirely.
- Potential solution: I could turn off
- 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).