Skip to main content

🎵 Link2ABC

Transform any link into ABC music notation with AI - simple as that!

PyPI version Python Support License: MIT

Link2ABC converts any web content into beautiful ABC music notation using AI. From blog posts to ChatGPT conversations, from simple melodies to professional compositions with ChatMusician AI.

⚡ Quick Start

# Install and create music in 30 seconds
pip install link2abc
link2abc https://app.simplenote.com/p/bBs4zY
# Output: melody.abc, melody.mid

🎯 Features

  • 🎵 Universal: Works with any web content
  • 🤖 AI-Powered: ChatMusician integration for professional composition
  • 🧱 Modular: Progressive enhancement architecture
  • 💰 Cost-Effective: Cloud execution with auto-terminate
  • 🎼 Multi-Format: ABC, MIDI, MP3, SVG output
  • 📝 Langfuse Ready: Custom prompt injection

📦 Installation Tiers

🥇 Core (Basic)

Perfect for getting started - 99% installation success rate.

pip install link2abc
# Size: ~15MB | Success: 99% | Features: Basic rule-based generation

🤖 AI Enhanced (Recommended)

Professional music generation with ChatMusician.

pip install link2abc[ai]
# Size: ~50MB | Success: 95% | Features: + ChatMusician, Claude, ChatGPT

🧠 Neural Processing

Advanced audio synthesis with Orpheus integration.

pip install link2abc[neural] 
# Size: ~2GB | Success: 80% | Features: + Neural synthesis, Voice input

🌍 Everything

All features including cloud execution.

pip install link2abc[full]
# Size: ~3GB | Success: 70% | Features: + Cloud execution, Voice bridge

📱 Mobile/Termux Installation (Android)

Link2ABC works perfectly on Android/Termux! The core package uses mobile-friendly dependencies:

# On Termux (Android)
pkg update && pkg upgrade
pkg install python python-pip
pip install link2abc

# Optional: For faster parsing (if you have build tools)
pip install link2abc[parsing]

# Test installation
link2abc --test

Why mobile-friendly? Link2ABC automatically detects your environment:

  • ✅ Termux/Android: Uses built-in html.parser (no compilation needed)
  • ⚡ Desktop/Server: Uses lxml for faster parsing (when available)
  • 🔄 Automatic fallback: Seamless experience across all platforms

🎵 Usage Examples

Basic Usage

# Convert any link to music
link2abc https://app.simplenote.com/p/bBs4zY

# Specify output format
link2abc https://app.simplenote.com/p/bBs4zY --format abc,midi,mp3

# Custom output location
link2abc https://app.simplenote.com/p/bBs4zY --output my_song

AI Enhancement

# Use ChatMusician (recommended)
link2abc https://app.simplenote.com/p/bBs4zY --ai chatmusician

# Compare different AI models
link2abc https://app.simplenote.com/p/bBs4zY --ai chatmusician,claude,chatgpt

# Custom AI prompts
link2abc https://app.simplenote.com/p/bBs4zY --prompt-file custom_prompts.yaml

Advanced Features

# Neural audio synthesis
link2abc https://app.simplenote.com/p/bBs4zY --neural

# Voice input (requires microphone)
link2abc --voice "Create a happy melody about friendship"

# Cloud execution (cost-optimized)
link2abc https://app.simplenote.com/p/bBs4zY --cloud --cost-optimize

🐍 Python API

Simple API

import link2abc

# One-liner conversion
result = link2abc.link_to_music("https://app.simplenote.com/p/bBs4zY")
print(f"Generated: {result['abc_file']}")

# With AI enhancement
result = link2abc.link_to_music(
    "https://app.simplenote.com/p/bBs4zY", 
    ai="chatmusician",
    format=["abc", "midi", "mp3"]
)

Advanced Pipeline

from link2abc import Pipeline
from link2abc.blocks.ai import ChatMusicianBlock

# Custom pipeline
pipeline = Pipeline([
    link2abc.ContentExtractor(),
    link2abc.ContentAnalyzer(),
    ChatMusicianBlock(),
    link2abc.FormatConverter()
])

# Process with custom prompts
pipeline.inject_prompt("musical_style", "Create jazz-influenced composition")
result = pipeline.run("https://app.simplenote.com/p/bBs4zY")

🤖 ChatMusician Integration

Link2ABC features first-class ChatMusician integration for professional music generation.

Setup

# Install with ChatMusician support
pip install link2abc[ai]

# Set API key
export CHATMUSICIAN_API_KEY="your-key-here"

# Generate professional music
link2abc https://app.simplenote.com/p/bBs4zY --ai chatmusician

Features

  • Professional Harmonies: Advanced chord progressions
  • Style Transfer: Jazz, Classical, Celtic, Folk adaptations
  • Ornamental Expressions: Grace notes, trills, articulations
  • Multi-Format Output: ABC, MIDI, MP3, SVG generation

📝 Langfuse Prompt Customization

Inject custom prompts at any pipeline stage:

# prompts.yaml
content_analysis: |
  Analyze this content for musical elements:
  - Identify emotional tone and energy level
  - Extract key themes and narrative arc
  - Suggest appropriate musical genre

chatmusician_composition: |
  Generate ABC notation that:
  - Reflects the emotional journey
  - Uses sophisticated harmonic progressions
  - Includes ornamental expressions
  - Maintains musical coherence
link2abc https://app.simplenote.com/p/bBs4zY --prompt-file prompts.yaml

⚙️ Configuration

Environment Variables

# AI Services
export CHATMUSICIAN_API_KEY="your-key"
export OPENAI_API_KEY="your-key"
export ANTHROPIC_API_KEY="your-key"

# Langfuse
export LANGFUSE_PUBLIC_KEY="your-key"

# Cloud Execution
export AWS_ACCESS_KEY_ID="your-key"
export AWS_SECRET_ACCESS_KEY="your-secret"

Config File

# ~/.link2abc/config.yaml
ai:
  default: "chatmusician"
  chatmusician:
    endpoint: "https://api.chatmusician.com"
    model: "latest"
  
output:
  default_format: ["abc", "midi"]
  directory: "~/Music/Link2ABC"

cloud:
  auto_terminate: true
  cost_optimize: true
  instance_type: "t3.medium"

🧪 Testing Your Installation

# Test basic functionality
link2abc --test

# Test AI features (if installed)
link2abc --test-ai

# Test with real content
link2abc https://app.simplenote.com/p/bBs4zY

# Check available features
python -c "import link2abc; print(link2abc.get_installed_tiers())"

📊 Performance & Cost

Execution Speed

  • Basic: 0.1-0.5 seconds
  • AI Enhanced: 1-5 seconds
  • Neural: 5-15 seconds
  • Cloud: 0.3-2 seconds + startup

Cloud Cost (with auto-terminate)

  • Basic Processing: $0.001-0.01 per conversion
  • AI Generation: $0.01-0.05 per conversion
  • Neural Synthesis: $0.05-0.20 per conversion

🔧 Development

Setup Development Environment

git clone https://github.com/jgwill/link2abc
cd link2abc
pip install -e ".[dev]"
pre-commit install

Run Tests

# Basic tests
pytest tests/unit/

# Integration tests (requires AI keys)
pytest tests/integration/ 

# Full test suite
pytest

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Ensure all tests pass
  5. Submit a pull request

📚 Documentation

🤝 Support

📄 License

MIT License - see LICENSE file for details.

🎵 Examples

Check out the examples directory for:

  • Basic link conversion examples
  • AI-enhanced composition tutorials
  • Custom pipeline implementations
  • Langfuse prompt templates
  • Integration with other tools

Transform any link into ABC music notation with AI - simple as that! 🎵✨

Metadata

Release files for link2abc 0.4.1

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

Source distribution (sdist)

Source distribution for link2abc 0.4.1
File Size Uploaded Provenance
link2abc-0.4.1.tar.gz 105.5 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 167.2 kB

Release files / link2abc-0.4.1.tar.gz

Download URL link2abc-0.4.1.tar.gz
Size 105.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4aa92063e48d4092ca72fc81f77905362241de5e6ecad02aeb536b8800933738
BLAKE2b-256 checksum
How to use checksums
45462606b6aa0fca0b82206e39ec4be6817bc42e752759ae5a8ad0f3366c941b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / link2abc-0.4.1-py3-none-any.whl

Download URL link2abc-0.4.1-py3-none-any.whl
Size 61.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d3e2b99ee32016bdc138945f5ac4f585d5c0ddaf5d703228027bc00b61f2cd71
BLAKE2b-256 checksum
How to use checksums
a63e0a225dd3f31635f2223d166601b672a3cbd9cafb7b7b5c7c0cf6a4948fd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for link2abc 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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