<h1 align="center"><img src="docs/images/logo.svg" alt="Stomp DXL" width="560"></h1>

**Unofficial** custom firmware for the **Line 6 HX Stomp XL** (firmware 3.80.0), not affiliated with or endorsed by
Line 6. *DXL* stands for deluxe XL. I am a guitarist and I made it for the stage: all eight footswitches usable as
effect switches, eight snapshots, and a Home screen that shows at a glance what every switch does and which snapshot is
playing.

You build it yourself from your own copy of the official firmware, in your browser on the
**[build page](https://fredbend.github.io/stomp-dxl/)** (nothing to install) or on your computer: this repository
contains no Line 6 code or data, and a built firmware must never be shared.

<p align="center"><a href="https://www.youtube.com/watch?v=-PdGVvX5YVk"><img src="https://img.youtube.com/vi/-PdGVvX5YVk/hqdefault.jpg" alt="Stomp DXL: the video" width="480"></a><br>
<a href="https://www.youtube.com/watch?v=-PdGVvX5YVk">▶ Watch the presentation video</a></p>

> **Version 1.1** (beta), for the HX Stomp XL firmware **3.80.0**. It runs daily on my own HX Stomp XL, on stage. It has
> not been tried on other units yet. See [What's new](#whats-new).

> [!WARNING]
> **Back up before you install.** Before installing Stomp DXL, make a full backup of your unit with HX Edit
> (File > Create Backup: presets, IRs and global settings) and keep the official firmware file
> (HX_Stomp_XL_v3.80.0_0x103966115.hxf), so that you can put your unit back exactly as it was. Read
> [Recovery](#recovery) first.
>
> **Presets saved with Stomp DXL may not behave the same on the official firmware** (see
> [Known limitations](#known-limitations)): keep your HX Edit backup if you may go back to it.
>
> **Bugs.** I have done my best to find and fix them, but I cannot guarantee that every bug or display glitch is gone,
> and I am not responsible for any that remain. Please report the ones you meet (see [Feedback](#feedback)).
>
> **Use at your own risk.** Stomp DXL is unofficial, experimental firmware, provided "as is", without warranty of
> any kind (GNU GPL v3, sections 15 and 16). Installing modified firmware may void your warranty. I accept no liability
> for any damage, loss of data, or other consequence of building, installing or using it.

## What's new

**1.1**
- Switching between a snapshot 1–4 and a snapshot 5–8 no longer flickers, and the blocks' on/off show at once.
- Footswitches with a Command Center **Preset** command: the preset's number is centred in its box and the name fits
  inside it, on two lines.
- A long preset name no longer stays cut off after a preset change.
- The [build page](https://fredbend.github.io/stomp-dxl/) can now try the firmware from RAM without installing it, convert
  NAM captures, and explains how to load them, how to recover, and more.

**1.0**: first public version.

## Why

These choices come from my way of using the Stomp XL, which may well be yours too:

- I play in **Stomp footswitch mode only**, with my **snapshots assigned to footswitches through the Command Center**.
- I **never use the MODE switch**: I even blocked it, so as not to hit it by accident.
- I hit **the bottom row** reliably; the top row is easier to miss with my big feet. On the XL, MODE and TAP sit side by
  side at the end of the bottom row: making them **assignable** gives me two more switches, right where my foot lands
  best.

If you play differently, MODE can get its stock function back (see [Settings](#global-settings--extra-features)).

## Features

### Footswitches

- **MODE becomes FS7**: an effect / Command Center switch like FS1–FS6. **Holding** it opens the next footswitch mode,
  as MODE did. Or, in the settings, MODE keeps its stock function on a press.
- **TAP becomes FS8 as well as Tap Tempo**: a press toggles FS8's blocks at once; a second press within 1.5 s undoes it
  and the presses tap the tempo; holding opens the tuner, as before. Its LED keeps blinking the tempo, in the colour of
  FS8's blocks. **Ideal for a delay**: put your delay on FS8, and the same switch turns it on and off and taps its
  tempo (with the delay synced to the tempo, Sync on a note value).
- **Long press**: holding FS1–FS6 toggles **virtual footswitches FS9–FS14** (MIDI CC 20–25): give a block
  *Bypass Assign > MIDI In* CC 20–25 and it follows that hold. The Bypass Assign menu shows them as FS9–FS14. A switch
  with a looper or momentary blocks keeps its stock behaviour (no hold). *Ported from HXtra's long press* (FS1–FS5 to
  FS6–FS10 on the HX Stomp), extended to the XL's six switches.

### Home screen (Stomp mode)

- **Eight boxes in two rows of four**: FS1 FS2 FS3 FS7 on top, FS4 FS5 FS6 FS8 below.

  On the unit the switches are three on top and five below, MODE and TAP side by side at the end of the bottom row.
  The screen does not copy that: five boxes across would leave about five characters a line, and a wide empty space on
  the top row. Instead FS1–FS6 keep their row and order, and the two switches Stomp DXL adds, MODE (FS7) and
  TAP (FS8), always make the right-hand column: one place to look for them, every time.
- **The signal chain** between the preset name and the boxes, in the style of the HX Stomp's Home screen (blocks, input
  and output, parallel paths).
- **The current snapshot**: a coloured badge with its number at the top right, and a thin bar in its colour along the
  top of the screen (give your snapshots a colour in HX Edit to see them).
- **Tempo** (BPM) at the top left (*HXtra's BPM display*), the preset number, and the preset name (a long name switches to a smaller font rather
  than losing letters). The *edited* marker sits beside the preset number.
- **Command Center Snapshot commands on FS7 / FS8** show the snapshot's own name and colour, or *SNAP ▲ / ▼* for
  Next / Previous.

### Eight snapshots

Built on *HXtra's more snapshots* (a second bank of four snapshots, saved in the preset file). On the XL, the extra
snapshots are reached through Command Center commands rather than by pressing a lit snapshot switch again.

- Command Center **Snapshot** commands go up to **SNAP 8**. Snapshots 5–8 work like 1–4: names, colours, LEDs, the badge.
- **Saved in the preset**: snapshots 5–8 are stored in the preset file, and a preset reopens on the snapshot it was saved
  on, 1–8, at power-on and when you come back to it.
- In **Snapshot footswitch mode** the arrows step through 1–8; **MIDI CC 69** values 0–7 select snapshots 1–8; the preset
  list's snapshot knob goes 1–8.

### Borrowed from other projects

Several features come from two HX Stomp projects, ported here to the XL (their code adapted to the XL's firmware, by
the XL's own addresses):

- From [hx-stomp-nam-lite](https://github.com/nocaseguy/hx-stomp-nam-lite): **NAM A2 Lite** (Amp > NAM).
- From [HXtra](https://github.com/wisemandenny/hxtra):
  - the **DSP usage display**: each block's share in the Edit view, the total, each model's cost in the model browser;
  - the **Metronome** (Looper > Metronome);
  - the **BPM display**;
  - **long press** and its **virtual footswitches through MIDI CC** (above);
  - **more snapshots**: the second bank, saved in the preset, with the snapshot arrows and MIDI CC 69 reaching it (above);
  - the **Global Settings engine** the Extra Features section is built with (below).

As far as I know, the rest was made for this project: MODE and TAP as footswitches, the eight-box Home screen with the
snapshot badge and bar, snapshots 5–8 through the Command Center, a preset reopening on its snapshot, the Extra Features
settings. The signal chain on the Home screen follows the look of the stock HX Stomp's own Home screen. If you spot an
idea I have not credited, please tell me and I will fix it.

## Global Settings > Extra Features

A Global Settings section of its own (the star icon), after Displays, built with *HXtra's Global Settings engine*:

| Setting | Values | |
|---|---|---|
| MODE Switch | **HOLD** / PRESS | HOLD: MODE is FS7, its hold opens the next footswitch mode. PRESS: MODE as stock (FS7's box stays empty). |
| DSP Total | **On** / Off | The DSP total at the top right of the Edit view. |
| DSP Edit Blocks | **On** / Off | Each block's DSP share in the Edit view. |
| DSP Model Browser | **On** / Off | Each model's DSP cost in the model browser. |

Settings are kept through power-off, as the stock ones.

## Known limitations

- **HX Stomp XL, firmware 3.80.0 only.** The build refuses any other file.
- **No external footswitches**: the EXP/FS jack's two footswitches (FS7, FS8) are the ones MODE and TAP now are. An
  expression pedal works as before.
- **HX Edit knows four snapshots**: its preset exports and backups keep snapshots 1–4 only. The unit itself keeps 5–8.
- **Presets and the official firmware.** Presets saved with Stomp DXL load and play on the official firmware, which
  knows four snapshots only, so expect differences there:
  - Command Center commands aimed at snapshots 5–8 show empty: assign them again;
  - a preset saved while a snapshot 5–8 was playing comes up with snapshots 5–8 in the places of 1–4 (Stomp DXL
    stores the bank playing as the preset's main snapshots, so that it reopens on that snapshot at once, with its sound);
  - snapshots of the other bank are not shown, and are lost if the preset is saved there.

  Keep your HX Edit backup (taken before installing) if you may go back to the official firmware.
- **The boxes are narrower** than the stock ones (four columns instead of three): about seven or eight characters per line
  fit; give your snapshots and blocks short names.
- A footswitch that has a long press acts on its **release** (the hold has to be told from a click).
- **Known display glitch**, harmless: when a preset with a long name loads, the end of its name can be hidden for a
  split second before it shows whole.
- A footswitch with a Command Center **Preset** command shows the preset's number and its name on two lines; a long name
  is cut to fit the narrow box.

Tip: a footswitch that needs two presses to change snapshot usually has **leftover assignments**: a Command Center
command whose value differs from one snapshot to another, or blocks assigned to the same switch (hidden behind the
snapshot box). Clear the switch's Command Center commands and assign them again.

## Get it

Open the **[build page](https://fredbend.github.io/stomp-dxl/)**, choose your copy of the official
**HX_Stomp_XL_v3.80.0_0x103966115.hxf** (the file Line 6 Updater installs, available from Line 6) and click
**Build Stomp DXL**. It takes a minute or two, right in your browser: nothing to install, and your file is not uploaded
anywhere. The page checks the result before offering it for download.

The same page converts your NAM captures for NAM A2 Lite, shows how to load them, and how to recover.

## Install
1. **Back up** with HX Edit (File > Create Backup).
2. Open **Line 6 Updater**, choose your HX Stomp XL, then **Choose File** and select the built `.hxf`.
3. After the restart, check a preset or two. Presets saved with Stomp DXL load on the official firmware too.

To go back to the official firmware, install the official `.hxf` the same way.

## Recovery

If the unit does not start normally: switch it off, **hold Page Right (>) while switching it on**. The screen stays
dark and Line 6 Updater shows an *NXP - DFU* device: choose **HX Stomp XL**, then the **official** `.hxf`. This mode lives
in the unit's boot loader, which this project never touches.

## Feedback

Found a bug, a display glitch, or have an idea to make it better on stage? Please open an
[issue](../../issues) on this repository: what you did, what you expected, what happened (a phone photo of the screen
helps a lot), and your firmware build. Suggestions are welcome too.

This is a one-person project, made in my spare time: I will do my best to answer, but my time and resources are
limited, so replies may take a while, and not every request can be taken on. Thank you for your patience.

## Development

**For developers only.** You do not need any of this to use Stomp DXL: the [build page](https://fredbend.github.io/stomp-dxl/)
does it all. This is for those who want to change the code, or to check that the page gives the same file as the
published sources.

<details>
<summary><b>Building from source, on your computer</b></summary>

You need:
- your copy of the official **HX_Stomp_XL_v3.80.0_0x103966115.hxf** (MD5 `329e3a26d60d3de1988b6785fa833ee1`);
- **Python 3.12** and `pip install -r requirements.txt`;
- **LLVM clang** ([releases](https://github.com/llvm/llvm-project/releases); on Windows the installer's default
  `C:\Program Files\LLVM\bin\clang.exe` is found, elsewhere set `HX_CLANG` to clang's path if needed);
- the two projects it builds on, cloned into `third_party/` (see [third_party/README.md](third_party/README.md)).

Then:

```sh
python build.py path/to/HX_Stomp_XL_v3.80.0_0x103966115.hxf
```

The firmware is written to `build/HX_Stomp_XL_v3.80.0_Stomp-DXL_v1.1.hxf` (`-o` to choose another name). The build is
reproducible: the same inputs give the same file, byte for byte (MD5 `9294c07b56179ad26797fbb006e65a2f` for v1.1),
from the build page as from `build.py`, which the page itself runs in the browser.

</details>

More in [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md): the layout of `src/`, the build page and its cache, running a build
from the unit's RAM without installing it, the tests, and the address maps in `research/`.

## How this was made

I have no background in programming or in interface design. The code of this project was written with
[Claude Code](https://www.anthropic.com/claude-code), Anthropic's AI coding assistant.

What the firmware is, though, comes from the direction I gave it and from testing it, again and again, on my own
HX Stomp XL: what each switch should do on stage, what the screen should show and how it should read, which settings
are worth having, and above all spotting what was wrong, down to a pixel or a split second, until it was right. That
took nearly a hundred test builds and about twenty hours of my own time.

## Support

Stomp DXL is and will stay free, with every feature for everyone. If it helps you on stage and you would like to
thank me for the time it took, you can leave a tip on [Ko-fi](https://ko-fi.com/fredbend). This project stands on
[HXtra](https://github.com/wisemandenny/hxtra) and [hx-stomp-nam-lite](https://github.com/nocaseguy/hx-stomp-nam-lite):
please consider supporting their author too.

## Credits and licence

Stomp DXL is free software under the **GNU GPL v3 or later** ([LICENSE](LICENSE)). It is built on
[HXtra](https://github.com/wisemandenny/hxtra) and [hx-stomp-nam-lite](https://github.com/nocaseguy/hx-stomp-nam-lite),
both GPL-3.0: thank you to their authors, whose tools and research made this possible. It is not affiliated with them:
report its bugs here. Details in [NOTICE](NOTICE).

The [build page](https://fredbend.github.io/stomp-dxl/) follows their own build pages
([HXtra's](https://wisemandenny.github.io/hxtra/web/), [hx-stomp-nam-lite's](https://nocaseguy.github.io/hx-stomp-nam-lite/web/)):
the idea of building in the browser with the projects' own Python tools run by Pyodide, the M4 code prepared in advance
since a browser has no assembler, and the page's steps (convert your captures, load and play them, recovery, questions).
The capture converter is hx-stomp-nam-lite's own, and the capture and recovery instructions are adapted from both pages.

Line 6, HX Stomp, HX Stomp XL and HX Edit are trademarks of Yamaha Guitar Group, Inc. This project is not affiliated with,
endorsed by or supported by Line 6 or Yamaha Guitar Group. **Use at your own risk.**
