From ed0f380f53429d26fb4389ef4ab3281fd226af4d Mon Sep 17 00:00:00 2001 From: Bruno de Lima Date: Wed, 12 Aug 2026 22:22:18 -0300 Subject: [PATCH 1/2] Add document about supported wave formats --- docs/wiki/supported_wav_formats.md | 57 ++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 docs/wiki/supported_wav_formats.md diff --git a/docs/wiki/supported_wav_formats.md b/docs/wiki/supported_wav_formats.md new file mode 100644 index 000000000..34b5a149e --- /dev/null +++ b/docs/wiki/supported_wav_formats.md @@ -0,0 +1,57 @@ +# Supported WAV formats + +Little Piggy Tracker loads samples as **16-bit PCM WAV** (`WAVE_FORMAT_PCM`, +compression code `1`). That is the format used by the classic tracker +sample pools and the one you should export to. + +## What works + +| Format | Compression code | Result | +|---------------------------------|------------------|-----------------------------------------| +| PCM 16-bit, mono | `1` | Full support | +| PCM 16-bit, stereo | `1` | Full support | +| PCM 16-bit with a `JUNK` chunk | `1` | Supported (the `JUNK` chunk is skipped) | +| PCM 8-bit, mono | `1` | Loads (expanded to 16-bit on load) | +| PCM 8-bit, stereo | `1` | Loads but the right channel is garbage | + +## What is rejected + +| Format | Compression code | Why | +|-------------------------|------------------|-------------------------------------------------| +| IEEE float (32-bit) | `3` | `Unsupported compression` — not PCM | +| ADPCM | `2` | `Unsupported compression` | +| µ-law / A-law | `6` / `7` | `Unsupported compression` | +| WAVE_FORMAT_EXTENSIBLE | `0xFFFE` | `Unsupported compression` — even if the sub-format is PCM | +| PCM 24-bit / 32-bit int | `1` | `Only 8/16 bit supported` | + +## Common gotchas + +- **WAVE_FORMAT_EXTENSIBLE** is what Windows exports when the "16-bit PCM" + option is picked from a save dialog. It looks like a normal 16-bit WAV + but carries compression code `0xFFFE` in the header, so the tracker + refuses it. Re-encode to plain PCM (`compression code 1`) to fix. +- **32-bit float** is the default export format of several DAWs and of + Audacity when "WAV (Float)" is selected. Export as WAV (PCM) 16-bit + instead. +- **24-bit** is common from audio interfaces. Not supported — convert. +- The `fmt ` chunk must declare exactly 8 or 16 bits per sample. + +## Converting a WAV + +With [sox](http://sox.sourceforge.net): + +```sh +sox in.wav out.wav # re-encodes to the input format +sox in.wav -b 16 out.wav # force 16-bit (default PCM) +``` + +With Audacity: *File → Export Audio → File type: WAV (Microsoft) → Encoding: +Signed 16-bit PCM*. + +## Where the parsing lives + +The checks live in `WavFile::Open()` +(`sources/Application/Instruments/WavFile.cpp`): + +- `comp != 1` → `"Unsupported compression"` +- `bitPerSample` not in `{8, 16}` → `"Only 8/16 bit supported"` From eb67bcf9a20e9ced8a5291d31f36f98fe406c562 Mon Sep 17 00:00:00 2001 From: brunodles Date: Wed, 19 Aug 2026 12:06:09 +0000 Subject: [PATCH 2/2] New map presentation --- sources/Application/Views/BaseClasses/View.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sources/Application/Views/BaseClasses/View.cpp b/sources/Application/Views/BaseClasses/View.cpp index 2b6fdefb6..a390aca02 100644 --- a/sources/Application/Views/BaseClasses/View.cpp +++ b/sources/Application/Views/BaseClasses/View.cpp @@ -81,23 +81,26 @@ void View::drawMap() { GUITextProperties props ; //draw entire map - SetColor(CD_HILITE1) ; - char buffer[5] ; - props.invert_=true ; - //row1 + SetColor(CD_ROW2); + props.invert_ = false ; + char buffer[5] ; + //row1 sprintf(buffer,"P G "); DrawString(pos._x,pos._y,buffer,props) ; pos._y++ ; //row2 - sprintf(buffer,"SCPI"); + SetColor(CD_ROW); + sprintf(buffer,"SCPI"); DrawString(pos._x,pos._y,buffer,props) ; pos._y++ ; //row3 + SetColor(CD_ROW2); sprintf(buffer, " MTT"); DrawString(pos._x,pos._y,buffer,props) ; //draw current screen on map - SetColor(CD_HILITE2) ; + SetColor(CD_CURSOR); + props.invert_ = true ; pos._y = anchor._y; switch(viewType_) {