Skip to main content

Caramelldansen in Terminal 🍭✨

PyPI version Python Version License: MIT Platform

High-performance, flicker-free, 24-bit TrueColor Caramelldansen terminal player featuring Dansen Loop mode!

Built with a modular Platform Abstraction Layer (PAL) and Audio Master Clock architecture, providing zero-configuration, cross-platform audio and rendering on macOS, Windows, and Linux.


Features

  • 24-bit TrueColor Rendering:
    • halfblock (Default): Uses half-block characters (▀, ▄) with 24-bit TrueColor for near-square pixels and stunning visual fidelity.
    • color-ascii: Classic ASCII character brightness ramp combined with full RGB color.
    • braille: High-resolution Unicode Braille (2x4 dot matrix) rendering.
    • ascii: Nostalgic monochrome ASCII shading.
  • Dansen Loop Mode (Infinite Loop):
    • Starts directly in the iconic Mai & Mii chorus dance sequence and loops seamlessly without stutter or glitches.
    • Toggle between the dance loop and the full music video using the L key or CLI flags.
  • Audio Master Clock Engine:
    • Video rendering is strictly synchronized to hardware audio playback time for flawless rhythm alignment and zero audio-video drift.
  • Zero-CPU Binary Cache Engine (CDBP v1):
    • Streams from a pre-rendered, zlib-compressed RGB binary container (caramell_dansen.bin) for <1% CPU consumption and instantaneous seek times.
  • Automatic Asset Provisioning:
    • Installs in seconds as a featherlight (<40 KB) PyPI wheel! Video and audio assets are automatically downloaded on first launch with live progress bar and MD5 verification.
  • Flicker-Free Terminal Experience:
    • Uses Alternate Screen Buffer (\033[?1049h), cursor hiding, Win32 VT100 processing, and non-blocking I/O.
  • Responsive Sizing & Interactive Scrubber:
    • Automatically respects 16:9 aspect ratio, centers video in any terminal window, and renders an adaptive live HUD status bar.

Controls

Key Action
Space Pause / Resume
M Cycle Render Mode (halfblock → color-ascii → braille → ascii)
C Toggle Color Mode (TrueColor RGB ↔ Monochrome)
L Toggle Dansen Loop mode
Right Arrow ($\rightarrow$) Seek forward 5 seconds
Left Arrow ($\leftarrow$) Seek backward 5 seconds
R Restart playback
Q / Esc Quit cleanly

Installation & Quick Start

pip install caramelldansen

Run directly from any terminal:

caramelldansen

Option 2: Run from Source

# Clone the repository
git clone https://github.com/Ohualtex/caramelldansen.git
cd caramelldansen

# Install dependencies
pip install -r requirements.txt

# Start playback (plays full music video from 00:00)
python main.py

# Start directly in infinite Dansen Loop mode
python main.py --loop

# Select rendering mode
python main.py --mode color-ascii

CLI Options

usage: caramelldansen [-h] [--mode {halfblock,color-ascii,braille,ascii}] [--no-color] [--loop] [--full] [--no-audio] [--build-cache]

options:
  -h, --help            show this help message and exit
  --mode {halfblock,color-ascii,braille,ascii}
                        Rendering mode (default: halfblock)
  --no-color, --mono    Disable TrueColor rendering and run in monochrome
  --loop                Start in infinite Dansen Loop mode
  --full                Play full music video from start to finish (default)
  --no-audio            Mute audio and run on internal clock
  --build-cache         Force rebuild CDBP binary cache

Terminal Display Tips

macOS Terminal.app (Gapless Half-Block Display)

The default macOS Terminal.app adds vertical line leading (font spacing) between character rows. For a gapless, seamless display:

  1. Open Terminal → Settings (Cmd + ,) → Profiles → Text.
  2. Click Change... under Font.
  3. Set the Line Spacing slider to 0.80.
  4. Alternatively, press M in-player to switch to Braille mode (which is naturally immune to line spacing), or use modern GPU-accelerated terminals like Ghostty, iTerm2, or Kitty.

Windows Terminal

Runs out of the box in Windows Terminal, PowerShell, and Command Prompt with 24-bit TrueColor enabled via Win32 Virtual Terminal Processing.


License

MIT License. See LICENSE for details.

Metadata

Release files for caramelldansen 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for caramelldansen 1.0.2
File Size Uploaded
caramelldansen-1.0.2.tar.gz 24.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for caramelldansen 1.0.2
File Interpreter ABI Platform
caramelldansen-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 59.2 kB

Release files / caramelldansen-1.0.2.tar.gz

Download URL caramelldansen-1.0.2.tar.gz
Size 24.4 kB
Tags Source
SHA-256 checksum
How to use checksums
72e80ff7e3ad8d2e8774ba867cf7d478196aeade766b863340678d8b7f8ae703
BLAKE2b-256 checksum
How to use checksums
aef93ce2d06e9ebfde08af9d706d800ba46e735171fcb38b2c46fd3d62cf37de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / caramelldansen-1.0.2-py3-none-any.whl

Download URL caramelldansen-1.0.2-py3-none-any.whl
Size 34.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d8d60d91c1424dbde91acdc88b248d5c10537e841ad5eabeea508d52ec06ed1c
BLAKE2b-256 checksum
How to use checksums
cf051195b48cef2a78b9e27d437d1732d08c84f4e29902a91c949118bf6c2e5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page