# mxst515/katana50_presetswitcher architecture

> Architecture diagram of the GitHub repository mxst515/katana50_presetswitcher, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mxst515/katana50_presetswitcher
- Repository: https://github.com/mxst515/katana50_presetswitcher

## Overview

BOSS Katana 50 Preset Switcher is a keyboard-driven desktop tool for selecting presets in TONE STUDIO by moving and clicking the mouse. The user configures hotkeys and preset positions, then uses either two separate keys or Space to switch between two presets; Esc exits a switching mode. The app loads and saves the two-key configuration in settings.json. The source shows the app invoking keyboard and mouse-control libraries; the graph omits their internal implementations and treats TONE STUDIO as the external UI target.

Main entry points: [`App.py`](https://github.com/mxst515/katana50_presetswitcher/blob/main/App.py) (App controller), [`setup.py`](https://github.com/mxst515/katana50_presetswitcher/blob/main/setup.py) (Settings helpers), [`main.py`](https://github.com/mxst515/katana50_presetswitcher/blob/main/main.py) (Application entry), [`settings.json`](https://github.com/mxst515/katana50_presetswitcher/blob/main/settings.json) (Settings file)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["App interaction"]
  node_entry["Application entry<br/>[main.py]"]
  node_app["App controller<br/>[App.py]"]
  node_keyboard["Keyboard input"]
end

subgraph group_switching["Preset switching"]
  node_mouse["Mouse control"]
  node_two_key["Two-key mode<br/>[App.py]"]
  node_space_mode["Space mode<br/>[App.py]"]
  node_button["Button state<br/>[Button.py]"]
end

subgraph group_configuration["Configuration"]
  node_settings_logic["Settings helpers<br/>[setup.py]"]
  node_settings_file["Settings file<br/>[settings.json]"]
end

node_user(("User"))
node_tone_studio["TONE STUDIO"]

node_user -->|"starts app"| node_entry
node_entry -->|"opens menu"| node_app
node_user -->|"chooses mode"| node_app
node_app -->|"reads keys"| node_keyboard
node_app -->|"loads settings"| node_settings_logic
node_settings_logic -->|"reads"| node_settings_file
node_app -->|"saves settings"| node_settings_logic
node_settings_logic -->|"writes"| node_settings_file
node_app -->|"sets key and position"| node_button
node_app -->|"runs"| node_two_key
node_app -->|"runs"| node_space_mode
node_two_key -->|"checks hotkeys"| node_keyboard
node_space_mode -->|"checks Space"| node_keyboard
node_two_key -->|"moves and clicks"| node_mouse
node_space_mode -->|"moves and clicks"| node_mouse
node_mouse -->|"selects preset"| node_tone_studio
node_user -->|"sets positions"| node_app

click node_entry "https://github.com/mxst515/katana50_presetswitcher/blob/main/main.py"
click node_app "https://github.com/mxst515/katana50_presetswitcher/blob/main/App.py"
click node_two_key "https://github.com/mxst515/katana50_presetswitcher/blob/main/App.py"
click node_space_mode "https://github.com/mxst515/katana50_presetswitcher/blob/main/App.py"
click node_button "https://github.com/mxst515/katana50_presetswitcher/blob/main/Button.py"
click node_settings_logic "https://github.com/mxst515/katana50_presetswitcher/blob/main/setup.py"
click node_settings_file "https://github.com/mxst515/katana50_presetswitcher/blob/main/settings.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_app,node_keyboard,node_user toneBlue
class node_mouse,node_two_key,node_space_mode,node_button toneAmber
class node_settings_logic,node_settings_file toneMint
class node_tone_studio toneIndigo
```

## Components

### App interaction

- [Application entry](https://github.com/mxst515/katana50_presetswitcher/blob/main/main.py): `main.py`
- [App controller](https://github.com/mxst515/katana50_presetswitcher/blob/main/App.py): `App.py`
- **Keyboard input**

### Preset switching

- **Mouse control**
- [Two-key mode](https://github.com/mxst515/katana50_presetswitcher/blob/main/App.py): `App.py`
- [Space mode](https://github.com/mxst515/katana50_presetswitcher/blob/main/App.py): `App.py`
- [Button state](https://github.com/mxst515/katana50_presetswitcher/blob/main/Button.py): `Button.py`

### Configuration

- [Settings helpers](https://github.com/mxst515/katana50_presetswitcher/blob/main/setup.py): `setup.py`
- [Settings file](https://github.com/mxst515/katana50_presetswitcher/blob/main/settings.json): `settings.json`

### Other components

- **User**
- **TONE STUDIO**

## Connections

- User → Application entry: starts app
- Application entry → App controller: opens menu
- User → App controller: chooses mode
- App controller → Keyboard input: reads keys
- App controller → Settings helpers: loads settings
- Settings helpers → Settings file: reads
- App controller → Settings helpers: saves settings
- Settings helpers → Settings file: writes
- App controller → Button state: sets key and position
- App controller → Two-key mode: runs
- App controller → Space mode: runs
- Two-key mode → Keyboard input: checks hotkeys
- Space mode → Keyboard input: checks Space
- Two-key mode → Mouse control: moves and clicks
- Space mode → Mouse control: moves and clicks
- Mouse control → TONE STUDIO: selects preset
- User → App controller: sets positions
