# BeRoTracker

A tracker: music written as patterns of notes over sampled instruments, edited from the keyboard,
in the tradition of Impulse Tracker and the like. It runs on Linux and on Windows out of the same
sources, draws its whole screen itself through OpenGL, and keeps everything it needs next to its own
executable.

## Running it

The program is portable in the plain sense of the word: unpack it somewhere and start it. It writes
what it wants to remember beside itself and touches nothing else on the machine.

    BeRoTracker/BeRoTracker        Linux
    BeRoTracker/BeRoTracker.exe    Windows

What it makes for itself on the first start, all next to the executable:

| file | what it holds |
| --- | --- |
| `config.ini` | the settings, screen size, audio device, keyboard layout |
| `dircache.dat` | what the file browser found, so it opens without waiting |
| `plugincache.dat`, `pluginscan.dat` | the plugins which were found and what they can do |
| `log.txt` | what went wrong, when something did |

`EQPresets/` is read and not written; the presets in it show up in the equalizer dialog.

### What the machine has to bring

* **Graphics:** OpenGL 4.3, compatibility profile. The tracker says so and stops where it cannot get
  one, rather than drawing half a screen. OpenGL 1.x support is dropped, because such GPUs are too
  old to be used for modern usage. OpenGL 4.3 capable GPUs are available since 2009/2010: AMD's
  TeraScale 2 (Radeon HD 5000) and NVIDIA's Fermi (GeForce 400) generations both received OpenGL
  4.3+ support through later driver updates. Intel joined in 2013 with Haswell. Older GPUs are not
  supported anymore, and the tracker will not run on them.

  Under Linux it is the profile which decides, not the version number. Mesa hands out a
  compatibility profile beyond 3.x only on radeonsi, iris and zink, and that leaves out exactly
  those three oldest cards: TeraScale 2 is driven by r600, Fermi by nouveau's nvc0, and Haswell by
  i965, which left Mesa with version 22 and lives on in the Amber branch. With AMD's old Catalyst
  or NVIDIA's 390 legacy driver they do give a 4.3 compatibility context. Anything younger, on
  radeonsi or iris, has none of this trouble.
* **Audio:** whichever of these is there
  * ALSA, PipeWire, PulseAudio or JACK under Linux
  * WinMM, WASAPI, DirectSound or ASIO under Windows
* **Linux:** 64 bit x86, an X server or a Wayland compositor. Under Wayland `libxkbcommon` and EGL
  are wanted; without the first there is a window but no keyboard.
* **Windows:** 64 bit x86. Nothing has to be installed beside it, the executable asks only for DLLs
  which belong to Windows itself.

In future, ARM64 Linux and Windows on ARM binaries could be added, but for now only x86_64 is built.
For ARM64 it would just be a matter of compiling for that architecture, the sources are portable
enough, but there is no such machine here to try it on. The same applies to 64 bit RISC-V Linux
(RV64GC/RVA23).

### Into the desktop, under Linux

An ELF executable carries no icon inside it, unlike a Windows one, so the icon and the menu entry
are put where the desktop looks for them:

    ./install-desktop.sh              for this user
    ./install-desktop.sh --system     for everyone, needs root
    ./install-desktop.sh --uninstall  takes it out again

That gives the entry in the application menu, the icon on it, and modules offered to be opened with
BeRoTracker. The path of the executable is written into the entry as it stands at that moment, so
nothing has to lie in the `PATH`. The window itself has its icon either way, that one comes out of
the program.

## Formats

- Load: **BRT**, **MOD**, **S3M**, **XM**, **IT**, **MT2**, **MTM**, **DMF**, **IMF**, **OKT**, **STM**, **669** and **MIDI**.
- Save: **BRT**, **MOD**, **S3M**, **XM**, **IT**.
- Import: **SF2**, **DLS**, **WAV**, **FLAC**, **OGG**, **MIDI**.
- Export: **WAV**, **MIDI**.
- Plugins: **BTP**, **VST2**, **VST3**, **CLAP**.

**BRT** is the only format wide enough for everything the tracker can do; the others reach as far as
they reach. Everything in the load list is also taken out of a **ZIP**, an archive inside an archive
included, and a module goes back into one when the name it is saved under ends in `.zip` or in a `z`
— `.mdz`, `.s3z`, `.xmz`, `.itz`.

## The keyboard

The note keys follow the layout, which is set under Settings as QWERTY, QWERTZ or AZERTY. **Alt Gr
counts as an alt key**, on every system: a keyboard which carries it has no right alt key at all,
and without that the shortcuts would be left with the single alt key left of the space bar. Whatever
Alt Gr writes still arrives in the text fields.
