mirror of
https://github.com/got-feedBack/feedBack.git
synced 2026-07-29 16:11:42 +00:00
fix: name standard tunings properly for all string counts
guitar-6 → E Standard guitar-7 → B Standard guitar-8 → F# Standard bass-4 → E Standard bass-5 → B Standard bass-6 → B Standard Registry validation no longer hardcodes 'E Standard' — just requires at least one tuning per string count.
This commit is contained in:
parent
d4ca98c284
commit
2e0542e114
@ -148,8 +148,8 @@ class InstrumentRegistry:
|
||||
for sc in string_counts:
|
||||
key = str(sc)
|
||||
sc_tunings = raw_tunes.get(key) or {}
|
||||
if "E Standard" not in sc_tunings:
|
||||
raise ValueError(f"instrument.tunings[{key}] must include 'E Standard'")
|
||||
if not sc_tunings:
|
||||
raise ValueError(f"instrument.tunings[{key}] must have at least one tuning")
|
||||
resolved = {}
|
||||
for t_name, t_offsets in sc_tunings.items():
|
||||
resolved[_validate_str(t_name, f"tunings[{key}].name")] = _validate_offset_list(
|
||||
|
||||
@ -144,7 +144,7 @@ TUNING_PRESET_MIDIS: dict[str, dict[str, list[int]]] = {
|
||||
"Open E": [40, 47, 52, 56, 59, 64],
|
||||
},
|
||||
"guitar-7": {
|
||||
"Standard": [35, 40, 45, 50, 55, 59, 64],
|
||||
"B Standard": [35, 40, 45, 50, 55, 59, 64],
|
||||
"Bb Standard": [34, 39, 44, 49, 54, 58, 63],
|
||||
"A Standard": [33, 38, 43, 48, 53, 57, 62],
|
||||
"G Standard": [31, 36, 41, 46, 51, 55, 60],
|
||||
@ -153,7 +153,7 @@ TUNING_PRESET_MIDIS: dict[str, dict[str, list[int]]] = {
|
||||
"Drop F#": [30, 37, 42, 47, 52, 56, 61],
|
||||
},
|
||||
"guitar-8": {
|
||||
"Standard": [30, 35, 40, 45, 50, 55, 59, 64],
|
||||
"F# Standard": [30, 35, 40, 45, 50, 55, 59, 64],
|
||||
"Drop E": [28, 35, 40, 45, 50, 55, 59, 64],
|
||||
"Drop A + Drop E": [28, 33, 40, 45, 50, 55, 59, 64],
|
||||
"E Standard": [28, 33, 38, 43, 48, 53, 57, 62],
|
||||
@ -171,7 +171,7 @@ TUNING_PRESET_MIDIS: dict[str, dict[str, list[int]]] = {
|
||||
"BEAD": [23, 28, 33, 38],
|
||||
},
|
||||
"bass-5": {
|
||||
"Standard": [23, 28, 33, 38, 43],
|
||||
"B Standard": [23, 28, 33, 38, 43],
|
||||
"High C": [28, 33, 38, 43, 48],
|
||||
"Eb Standard": [22, 27, 32, 37, 42],
|
||||
"D Standard": [21, 26, 31, 36, 41],
|
||||
@ -180,7 +180,7 @@ TUNING_PRESET_MIDIS: dict[str, dict[str, list[int]]] = {
|
||||
"Drop A": [21, 28, 33, 38, 43],
|
||||
},
|
||||
"bass-6": {
|
||||
"Standard": [23, 28, 33, 38, 43, 48],
|
||||
"B Standard": [23, 28, 33, 38, 43, 48],
|
||||
"Eb Standard": [22, 27, 32, 37, 42, 47],
|
||||
"D Standard": [21, 26, 31, 36, 41, 46],
|
||||
"C# Standard": [20, 25, 30, 35, 40, 45],
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
"BEAD": [-5, -5, -5, -5]
|
||||
},
|
||||
"5": {
|
||||
"E Standard": [ 0, 0, 0, 0, 0],
|
||||
"B Standard": [ 0, 0, 0, 0, 0],
|
||||
"High C": [ 5, 5, 5, 5, 5],
|
||||
"Eb Standard": [-1, -1, -1, -1, -1],
|
||||
"D Standard": [-2, -2, -2, -2, -2],
|
||||
@ -40,7 +40,7 @@
|
||||
"Drop A": [-2, 0, 0, 0, 0]
|
||||
},
|
||||
"6": {
|
||||
"E Standard": [ 0, 0, 0, 0, 0, 0],
|
||||
"B Standard": [ 0, 0, 0, 0, 0, 0],
|
||||
"Eb Standard": [-1, -1, -1, -1, -1, -1],
|
||||
"D Standard": [-2, -2, -2, -2, -2, -2],
|
||||
"C# Standard": [-3, -3, -3, -3, -3, -3],
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
"Open E": [ 0, 2, 2, 1, 0, 0]
|
||||
},
|
||||
"7": {
|
||||
"E Standard": [ 0, 0, 0, 0, 0, 0, 0],
|
||||
"B Standard": [ 0, 0, 0, 0, 0, 0, 0],
|
||||
"Bb Standard": [-1, -1, -1, -1, -1, -1, -1],
|
||||
"A Standard": [-2, -2, -2, -2, -2, -2, -2],
|
||||
"G Standard": [-4, -4, -4, -4, -4, -4, -4],
|
||||
@ -45,7 +45,7 @@
|
||||
"Drop F#": [-5, -3, -3, -3, -3, -3, -3]
|
||||
},
|
||||
"8": {
|
||||
"Standard": [ 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
"F# Standard": [ 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
"Drop E": [-2, 0, 0, 0, 0, 0, 0, 0],
|
||||
"Drop A + Drop E":[-2, -2, 0, 0, 0, 0, 0, 0],
|
||||
"E Standard": [-2, -2, -2, -2, -2, -2, -2, -2],
|
||||
|
||||
@ -173,7 +173,7 @@ def test_default_tunings_include_extended_host_profiles():
|
||||
|
||||
def test_default_tuning_frequencies_are_derived_from_midis():
|
||||
assert DEFAULT_TUNINGS["guitar-6"]["E Standard"] == open_midis_to_freqs([40, 45, 50, 55, 59, 64])
|
||||
assert DEFAULT_TUNINGS["bass-6"]["Standard"] == open_midis_to_freqs([23, 28, 33, 38, 43, 48])
|
||||
assert DEFAULT_TUNINGS["bass-6"]["B Standard"] == open_midis_to_freqs([23, 28, 33, 38, 43, 48])
|
||||
|
||||
|
||||
def test_tuning_offsets_from_named_presets():
|
||||
@ -267,7 +267,7 @@ def test_freqs_to_midis_round_trips_at_nonstandard_reference():
|
||||
# reference (client-side log2-at-440 reconstruction drifts here).
|
||||
from tunings import freqs_to_midis
|
||||
for ref in (430.0, 432.0, 444.0, 450.0):
|
||||
for midis in (TUNING_PRESET_MIDIS["guitar-8"]["Standard"], TUNING_PRESET_MIDIS["bass-5"]["Standard"]):
|
||||
for midis in (TUNING_PRESET_MIDIS["guitar-8"]["F# Standard"], TUNING_PRESET_MIDIS["bass-5"]["B Standard"]):
|
||||
freqs = open_midis_to_freqs(midis, ref)
|
||||
assert freqs_to_midis(freqs, ref) == midis, f"ref={ref}"
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user