wav2hex is a specialized utility designed for converting WAV audio samples into hexadecimal format, optimized for chiptune-based music production, particularly for use with hUGETracker. This tool facilitates the integration of custom waveforms into retro-style music compositions.
- Converts 8-bit mono WAV files to 32x16 hexadecimal waveform grids
- Customizable grid size (with considerations for sample bitrate)
- Optimized for short samples (1-4 seconds)
- Outputs hex data formatted for direct use in chiptune trackers
- File Format: 8-bit mono WAV
- Recommended Duration: ≤ 4 seconds (optimal: ≤ 1 second)
- Input Directory: Place WAV files in the included "input" folder
- 32x16 hexadecimal waveform grid
- Formatted hex string with leading zeros omitted (except where necessary)
The program can be modified to support larger waveform grids (up to 32x32), with corresponding adjustments to sample bitrate processing.
- Python 3.x
- NumPy
- Standard Python libraries: wave, os, glob
Install NumPy using pip:
pip install -U numpy
- Place WAV file(s) in the "input" folder
- Run the script
- Hexadecimal output will be displayed, formatted for chiptune tracker use
- Press any key to close the program after reviewing the output
To obtain the full hexadecimal representation, including leading zeros, modify the following line in the script:
From:
hex_representation = ''.join(f'{value:02X}'[1] for value in processed_waveform)
To:
hex_representation = ''.join(f'{value:02X}' for value in processed_waveform)
- Processes only 8-bit mono WAV files
- Optimized for short samples (≤ 4 seconds)
- Fixed 32x16 waveform grid in default configuration
- Support for additional input formats
- Dynamic grid size adjustment based on input parameters
- Integration with popular chiptune composition software
For issues, feature requests, or contributions, please open an issue or pull request on the GitHub repository.