feat: implement McGill Billboard converter (Harte → .chord)
Adds src/external_converters/mcgill_to_chord.py with two public functions:
- convert_song(song_dir, output_dir) — converts one salami_chords.txt to
per-section .chord files (4–16 bars each, style=other)
- convert_dataset(dataset_dir, output_dir) — batch converts all songs
Key decisions:
- Harte qualities mapped to our 18-quality vocabulary; hdim7 → m7b5,
parenthetical alterations (e.g. 7(b9)) handled via regex
- Bar duration estimated from median non-trivial chord duration
- Mode (major/minor) inferred from tonic chord quality distribution
- Sections with <4 or >16 bars are skipped with a logged reason
- Unrecognized Harte chords skip the whole section (no silent corruption)
48 new tests in tests/test_mcgill_converter.py; total suite 223 passed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
# artist: Test Artist
|
||||
# title: Test Song
|
||||
# metre: 4/4
|
||||
# tonic: C
|
||||
|
||||
0.000000 Z
|
||||
4.000000 A,verse C:maj
|
||||
8.000000 . F:maj
|
||||
12.000000 . G:7
|
||||
16.000000 . C:maj
|
||||
20.000000 B,chorus F:maj
|
||||
24.000000 . C:maj
|
||||
28.000000 . G:7
|
||||
32.000000 . C:maj
|
||||
36.000000 Z
|
||||
Reference in New Issue
Block a user