$ show ChordPro/chordpro
ChordPro is a reference implementation for the ChordPro file format, a plain-text notation for lyrics with chords. This Perl application parses `.cho`/`.chordpro` files and produces professional-quality sheet music in PDF, HTML, LaTeX, Markdown, and plain-text outputs. It includes a command-line interface (CLI) and a cross-platform graphical application built with WxPerl. The architecture features a modular output backend system, a pluggable delegate framework for embedded music notation (ABC, LilyPond, SVG), a comprehensive configuration system using Relaxed JSON, and a custom SVG-to-PDF engine. It also provides chord parsing, transposition, diagram generation, and support for multiple note naming systems (common, Nashville, Roman, solfรจge). The repository bundles extensive test suites, documentation, and packaging scripts for Windows, macOS, and Linux. While the codebase demonstrates strong engineering with several reusable components, it carries some legacy dependencies and hardcoded paths from its wxGlade-generated GUI.
The LLM identified 4 files worth highlighting for reuse:
A standalone parser for Relaxed JSON (RRJSON), an extension of JSON supporting comments, unquoted keys, trailing commas, and combined keys. This module can be extracted and reused in any Perl project that needs a human-friendly configuration format, demonstrating clean tokenization and parse-tree construction.
A collection of Perl modules (SVGPDF.pm, SVGPDF/CSS.pm, SVGPDF/FontManager.pm, etc.) that parse and render SVG graphics to PDF via PDF::API2. The library handles `<defs>`, `<use>`, CSS styling, embedded fonts, and complex path data. It is a self-contained rendering pipeline that could power SVG-to-PDF conversion in any Perl project needing vector graphics output.
A chord parsing framework that supports multiple notation systems (common, Nashville, Roman) through a factory pattern. It decomposes chord strings into root, quality, extension, and bass, and provides canonical representation, transposition, and transcoding. The module isolates complex music theory rules and is reusable in any music-related Perl application.
Implements a layered configuration system with deep merging, augmentation, and reduction of nested hash structures. It integrates JSON Schema validation and loads presets from multiple directories. The merge/augment/reduce pattern is a clean, reusable approach for combining hierarchical configuration sources in any Perl application.