Metadata-Version: 2.3
Name: distortion-tui
Version: 0.4.1
Summary: Add your description here
Author: Erdem Baha Topbas
Author-email: Erdem Baha Topbas <erdembaha.topbas@uzh.ch>
Requires-Dist: librosa>=0.11.0
Requires-Dist: matplotlib>=3.10.8
Requires-Dist: scipy>=1.17.1
Requires-Dist: soundfile>=0.13.1
Requires-Dist: textual>=8.0.2
Requires-Python: >=3.13
Description-Content-Type: text/markdown

# distortion-tui

A terminal-based TUI for applying audio distortion functions to WAV files.

## Installation

```bash
uvx distortion-tui
```

## Usage

Launch the TUI:

```bash
uvx distortion-tui
```

1. Select a distortion function from the dropdown.
2. Enter the path to your input audio file.
3. The output path is auto-filled — edit it if needed.
4. Optionally enable **Save waveform plot** to export a before/after PNG.
5. Press **Process**.

## Available distortion functions

| Function | Description |
|---|---|
| Isochronous Time Warping | Resamples each cycle of the waveform to the average cycle length, making the waveform isochronous |
| Infinite Peak Clipping | Replaces every sample with +1 or −1 based on its sign |

## Using the library directly

The distortion functions can also be used programmatically:

```python
import librosa
import soundfile
import distortion_tui

waveform, sr = librosa.load("input.wav", sr=None)
processed = distortion_tui.isochronous_time_warping(waveform)
soundfile.write("output.wav", processed, sr)
```

## Changelog

See [CHANGELOG.md](CHANGELOG.md).
