Skip to content

LilioYa/audiotab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

audiotab

Turn an online video or audio link into guitar sheet music or tablature.

audiotab is a command-line tool that takes a URL, listens to the audio, and produces a PDF: either a classic music score or a guitar tab.

How it works

The tool runs a four-stage pipeline:

  1. Download the audio from the URL (via yt-dlp).
  2. Transcribe the audio into MIDI (via Spotify's Basic Pitch model).
  3. Clean the raw MIDI, and optionally reduce it to a single melodic line.
  4. Render the result as a PDF score or tablature (via LilyPond).

Only the final PDF is kept. Intermediate files are written to a temporary directory that is removed automatically when the program exits.

Requirements

  • Python 3.11 (required by Basic Pitch)
  • FFmpeg (audio extraction)
  • LilyPond (PDF rendering)

Installation

First, install FFmpeg and LilyPond with your system's package manager. Then, clone this repository, navigate to the project root directory, and install audiotab locally in editable mode:

pip install -e .

Usage

Once installed, the audiotab command becomes available anywhere in your terminal:

audiotab "<url>"

Options

Option Values Default Description
--mode tabs, notation tabs Output style: guitar tablature or classic score.
--difficulty simple, full full simple reduces the music to a single melodic line; full keeps chords.
--start seconds - Start time, to transcribe only a segment.
--end seconds - End time, to transcribe only a segment.
--output path ./output Directory where the final PDF is saved.

Examples

# Single melodic line, as a guitar tab
audiotab "<url>" --difficulty simple

# Classic music score instead of a tab
audiotab "<url>" --mode notation

# Only the first 35 seconds
audiotab "<url>" --start 0 --end 35

Cleaning

Automatic music transcription is noisy: the raw MIDI often contains overlapping notes, detected harmonics, and sustained notes split into fragments.

The simple mode reduces this to a single playable line by sampling the music over time, folding octaves into one register, smoothing out isolated stray notes, and merging repeated notes. The full mode only applies light filtering and keeps chords.

Limitations

The quality of the output depends heavily on the input audio. It works best on clean, single-instrument recordings; on dense mixes or distorted audio the result is approximate. The output is a starting point, not a note-for-note exact transcription.

Tech stack

License

MIT

About

CLI tool to turn any online video/audio link into guitar tablature or sheet music PDFs using AI (Spotify's Basic Pitch) and LilyPond.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages