wav2dmp (c) Anaël Seghezzi - 2026

This tool is used to convert a sample wav file into a ym2612 FM instrument for a tracker like DefleMask.
It will search and select the best FM variables to match the spectrogram of the input sample.

This is a command-line tool, the first argument is the input file, the second (optional) is the iteration_count.
Ex: wav2dmp "my_sample.wav" 3000

Every 100th iteration, "my_sample.dmp" and "my_sample.dmp.wav" (a preview in wav) are saved in the same folder as the input. The console also print the current spectrogram distance and the detected note.
Ex: 1100/3000 .......... 0,000431 (F#2)

Input samples are converted to mono 53267 Hz.
For a reasonable computation time, keep the sample duration under 1 second.

By default the iteration count is 5000 (15 minutes or more).
Use higher for better quality, lower for faster computation time.