MUSIC21_FILE_EXTENSIONS = [".xml", ".mxl", ".musicxml"]
"""Extensions used by music21. Defaults to `[".xml", ".mxl", ".musicxml"]`"""


SOUND_TO_ABBREVIATION = {
    "accordion": "acc",
    "alto flute": "afl",
    "alto": "alt",
    "voice": "v",
    "contralto": "alt",
    "arpeggione": "arp",
    "bagpipe": "bag",
    "baritone": "bar",
    "bass": "bass",
    "bass baritone": "bbar",
    "continuo": "bs",
    "basso continuo": "bs",
    "continuous bass": "bs",
    "bass clarinet": "bcl",
    "bell": "bell",
    "chimes": "bell",
    "bells": "bell",
    "bass flute": "bfl",
    "bass guitar": "bgtr",
    "electric bass": "bgtr",
    "banjo": "bjo",
    "bassoon": "bn",
    "fagoto": "bn",
    "bass oboe": "bob",
    "baritone oboe": "bob",
    "oboe baritono": "bob",
    "brass instruments": "br",
    "strumento a fiato di ottone": "br",
    "baryton": "bryt",
    "baritono": "bryt",
    "basset clarinet": "bstcl",
    "clarinetto di bassetto": "bstcl",
    "basset horn": "bsthn",
    "corno di bassetto": "bsthn",
    "bugle": "bug",
    "corna de segnale": "bug",
    "contrabass clarinet": "cbcl",
    "clarinetto contrabbasso": "cbcl",
    "contrabassoon": "cbn",
    "contrafagotto": "cbn",
    "children's chorus": "cch",
    "coro di fanciulli": "cch",
    "celesta": "cel",
    "mixed chorus": "ch",
    "coro miste": "ch",
    "cimbalom": "cimb",
    "cittern": "cit",
    "cetra": "cit",
    "cetara": "cit",
    "clarinet": "cl",
    "clarinetto": "cl",
    "clarinetti": "cl",
    "clavichord": "clvd",
    "clavicordo": "clvd",
    "chalumeau": "cm",
    "salmoè": "cm",
    "concertina": "conc",
    "crumhorn": "crh",
    "cromorno": "crh",
    "cornet": "crt",
    "cornetta": "crt",
    "a pistoni": "crt",
    "cornett": "crtt",
    "zink": "crtt",
    "cornetto": "crtt",
    "child's voice": "cv",
    "voce di fanciullo": "cv",
    "double bass": "db",
    "contrabasso": "db",
    "dulcian": "dlcn",
    "dulciana": "dlcn",
    "domra": "dom",
    "dulcimer": "dulc",
    "salterio": "dulc",
    "electric guitar": "egtr",
    "chitarra elettrica": "egtr",
    "english horn": "eh",
    "cor anglais": "eh",
    "corno inglese": "eh",
    "electronic instruments": "elec",
    "strumento elettrica": "elec",
    "electric piano": "epf",
    "pianoforte elettrico": "epf",
    "equal voices": "eq",
    "voci pari": "eq",
    "erhu": "erhu",
    "euphonium": "euph",
    "eufonio": "euph",
    "female chorus": "fch",
    "coro femminile": "fch",
    "flute d'amore": "fda",
    "tenor flute": "fda",
    "flauto tenor": "fda",
    "flugelhorn": "fgh",
    "flicorno soprano": "fgh",
    "fife": "fife",
    "fiffaro": "fife",
    "flute": "fl",
    "flauto": "fl",
    "flageolet": "flag",
    "flagioletto": "flag",
    "glass harmonica": "ghca",
    "bowl organ": "ghca",
    "glassarmonica": "ghca",
    "bicchieri de vetro": "ghca",
    "glockenspiel": "gl",
    "campanelli": "gl",
    "metallofono": "gl",
    "guitar": "gtr",
    "chitarra": "gtr",
    "harmonium": "harm",
    "armonium": "harm",
    "harmonica": "hca",
    "mouth organ": "hca",
    "armonica a bocco": "hca",
    "heckelphone": "heck",
    "heckelfono": "heck",
    "horn": "hn",
    "corno": "hn",
    "harp": "hp",
    "arpa": "hp",
    "harpsichord": "hpd",
    "cembalo": "hpd",
    "clavicembalo": "hpd",
    "keyboard instrument": "kbd",
    "strumento a tastiera": "kbd",
    "lute": "lute",
    "liuto": "lute",
    "lyre": "lyre",
    "lira": "lyre",
    "mandolin": "mand",
    "mandolino": "mand",
    "marimba": "mar",
    "male chorus": "mch",
    "coro maschile": "mch",
    "mezzo-soprano": "mez",
    "mezzosoprano": "mez",
    "musette": "mus",
    "musette de cour": "mus",
    "narrator": "nar",
    "reciter": "nar",
    "narratore": "nar",
    "oboe": "ob",
    "ocarina": "oca",
    "oboe d'amore": "oda",
    "ondes martenot": "om",
    "onde martenot": "om",
    "ophicleide": "oph",
    "orchestra": "orch",
    "organ": "org",
    "organo": "org",
    "oud": "oud",
    "pan flute": "pan",
    "pan-pipes": "pan",
    "flauto di pan": "pan",
    "siringa": "pan",
    "percussion": "perc",
    "strumento a percussione": "perc",
    "piano": "pf",
    "pianoforte": "pf",
    "piano 3 hands": "pf3h",
    "pianoforte 3 mani": "pf3h",
    "piano 4 hands": "pf4h",
    "pianoforte 4 mani": "pf4h",
    "piano 5 hands": "pf5h",
    "pianoforte 5 mani": "pf5h",
    "piano 6 hands": "pf6h",
    "pianoforte 6 mani": "pf6h",
    "piano left hand": "pflh",
    "piano di sinistra": "pflh",
    "pedal piano": "pfped",
    "pianoforte organistico": "pfped",
    "piano right hand": "pfrh",
    "piano di destra": "pfrh",
    "piccolo": "picc",
    "flauto piccolo": "picc",
    "ottavino": "picc",
    "pipa": "pipa",
    "timpani": "timp",
    "piccolo trumpet": "ptpt",
    "trombino": "ptpt",
    "rebec": "reb",
    "rebeca": "reb",
    "ribeca": "reb",
    "recorder": "rec",
    "flauto dolce": "rec",
    "flauto a becco": "rec",
    "sarrusophone": "sar",
    "sarrusofono": "sar",
    "saxophone": "sax",
    "sassofono": "sax",
    "saxofono": "sax",
    "sheng": "sheng",
    "shawm": "shw",
    "ciaramella": "shw",
    "piffaro": "shw",
    "sitar": "sit",
    "sackbut": "skbt",
    "soprano": "sop",
    "serpent": "srp",
    "serpentone": "srp",
    "slide trumpet": "stpt",
    "tromba a tirarsi": "stpt",
    "string instruments": "str",
    "archi": "str",
    "saxhorn": "sxh",
    "flicorni": "sxh",
    "synthesizer": "syn",
    "sintetizzatore": "syn",
    "tuba": "tba",
    "trombone": "tbn",
    "tenor": "ten",
    "tenore": "ten",
    "theremin": "thrm",
    "trumpet": "tpt",
    "tromba": "tpt",
    "clarino": "tpt",
    "unison chorus": "uch",
    "coro unisono": "uch",
    "ukelele": "uke",
    "ukulele": "uke",
    "solo": "v",
    "voce": "v",
    "viola": "va",
    "viola pomposa": "vap",
    "cello": "vc",
    "violoncello": "vc",
    "viola d'amore": "vda",
    "vibraphone": "vib",
    "vibrafono": "vib",
    "vielle": "vie",
    "hurdy-gurdy": "vie",
    "lyra tedesca": "vie",
    "ghironda": "vie",
    "viol": "viol",
    "viola da gamba": "viol",
    "gamba": "viol",
    "violone": "vlne",
    "violin": "vn",
    "violino": "vn",
    "vuvuzela": "vuv",
    "voices": "vv",
    "multiple soloists": "vv",
    "voci": "vv",
    "wagner tuba": "wag",
    "tuba di wagner": "wag",
    "woodwind instruments": "ww",
    "strumento a fiato di legno": "ww",
    "xiao": "xiao",
    "xylophone": "xyl",
    "xilofono": "xyl",
    "silofono": "xyl",
    "zither": "zith",
    "cetra da tavola": "zith",
}
"""Dictionary connecting each instrument name in a musicxml to an abbreviation"""

FAMILY_TO_ABBREVIATION = {
    "strings": "str",
    "woodwinds": "ww",
    "wind": "ww",
    "brass": "br",
    "percussion": "perc",
    "voice": "voice",
    "general": "gen",
}
"""Dictionary containing abbreviation of each family"""

SOUND_TO_FAMILY = {
    "soprano": "voice",
    "cantus": "voice",
    "discant": "voice",
    "discantus": "voice",
    "tiple": "voice",
    "mezzo soprano": "voice",
    "alto": "voice",
    "contralto": "voice",
    "tenor": "voice",
    "baritone": "voice",
    "bass": "voice",
    "voice": "voice",
    "solo vocal part": "voice",
    "dessus": "voice",
    "spoken voice": "voice",
    "highest voice": "voice",
    "quinta vox": "voice",
    "5th voice": "voice",
    "sexta vox": "voice",
    "6th voice": "voice",
    "vagans": "voice",
    "choir": "voice",
    "chorus": "voice",
    "the soprano part in a chorus": "voice",
    "the alto part in a chorus": "voice",
    "the tenor part in a chorus": "voice",
    "the bass part in a chorus": "voice",
    "an unspecified or unknown chorus part": "voice",
    "children's choir": "voice",
    "boys' choir": "voice",
    "girls' choir": "voice",
    "womens' choir": "voice",
    "mens' choir": "voice",
    "violin": "strings",
    "violin concertino": "strings",
    "violin principale": "strings",
    "violin ripieno": "strings",
    "solo violin part": "strings",
    "viola": "strings",
    "alto viola": "strings",
    "violoncello": "strings",
    "cello": "strings",
    "contrabass": "strings",
    "double bass": "strings",
    "": "keyboard",
    "baryton": "strings",
    "fiddle": "strings",
    "violetta": "strings",
    "violetta marina": "strings",
    "viola basso": "strings",
    "viola bastarda": "strings",
    "viola d'amore": "strings",
    "viola da braccio": "strings",
    "viola da gamba": "strings",
    "treble viola da gamba": "strings",
    "tenor viola da gamba": "strings",
    "bass viola da gamba": "strings",
    "viola pomposa": "strings",
    "violone": "strings",
    "strings": "general",
    "flute": "woodwinds",
    "transverse flute": "woodwinds",
    "piccolo": "woodwinds",
    "ottavino": "woodwinds",
    "flûte d'amour": "woodwinds",
    "flauto dolce": "woodwinds",
    "flauto quarto": "woodwinds",
    "flute in e|b": "woodwinds",
    "flautino": "woodwinds",
    "oboe": "woodwinds",
    "piccolo oboe": "woodwinds",
    "oboe grande": "woodwinds",
    "oboe d'amore": "woodwinds",
    "a ob": "woodwinds",
    "cor anglais": "woodwinds",
    "english horn": "woodwinds",
    "oboe da caccia": "woodwinds",
    "oboe di silva": "woodwinds",
    "taille de hautbois": "woodwinds",
    "vox humana": "woodwinds",
    "tenor oboe": "woodwinds",
    "heckelphone": "woodwinds",
    "b ob": "woodwinds",
    "clarinet": "woodwinds",
    "bass clarinet": "woodwinds",
    "clarinet in a": "woodwinds",
    "clarinet in c": "woodwinds",
    "e|b clarinet": "woodwinds",
    "basset horn": "woodwinds",
    "chalumeau": "woodwinds",
    "saxophone": "woodwinds",
    "soprano saxophone": "woodwinds",
    "alto saxophone": "woodwinds",
    "tenor saxophone": "woodwinds",
    "baritone saxophone": "woodwinds",
    "bassoon": "woodwinds",
    "contrabassoon": "woodwinds",
    "double bassoon": "woodwinds",
    "tenor bassoon": "woodwinds",
    "tenoron": "woodwinds",
    "bombardon": "brass",
    "bombarde": "woodwinds",
    "pommer": "woodwinds",
    "chirimía": "woodwinds",
    "shawm": "woodwinds",
    "fife": "woodwinds",
    "ocarina": "woodwinds",
    "recorder": "woodwinds",
    "sopranino recorder": "woodwinds",
    "woodwinds": "woodwinds",
    "zufoletto": "woodwinds",
    "wind band": "brass",
    "usually brass": "brass",
    "althorn": "brass",
    "also for unspecified bass instrument": "brass",
    "baritone horn": "brass",
    "flicorno": "brass",
    "bombardino": "brass",
    "bass tuba": "brass",
    "brass instruments": "general",
    "bugle": "brass",
    "cimbasso": "brass",
    "clarino": "brass",
    "clairon": "brass",
    "clarion": "brass",
    "cornetto": "brass",
    "cornett": "brass",
    "zink": "brass",
    "horn": "brass",
    "french horn": "brass",
    "keyed bugle": "brass",
    "bass horn": "brass",
    "valve horn": "brass",
    "corno da caccia": "brass",
    "dugetto": "brass",
    "euphonium": "brass",
    "fanfare trumpet": "brass",
    "flugelhorn": "brass",
    "basse d'harmonie": "brass",
    "helicon": "brass",
    "cornettino": "brass",
    "cornet": "brass",
    "lituus": "brass",
    "ophicleide": "brass",
    "piston": "brass",
    "rotary valve cornet": "brass",
    "post horn": "brass",
    "principale": "brass",
    "saxhorn": "brass",
    "serpent": "brass",
    "mellophone": "brass",
    "tuba": "brass",
    "tenor horn": "brass",
    "e|b horn": "brass",
    "trumpet": "brass",
    "keyed trumpet": "brass",
    "valve trumpet": "brass",
    "trombone": "brass",
    "alto trombone": "brass",
    "baritone trombone": "brass",
    "tenor trombone": "brass",
    "bass trombone": "brass",
    "valve trombone": "brass",
    "a small trumpet or tenor trombone": "brass",
    "a high trumpet": "brass",
    "archlute": "plucked",
    "harp": "plucked",
    "guitar": "plucked",
    "electric guitar": "plucked",
    "bass electric guitar": "plucked",
    "lyre": "plucked",
    "lute": "plucked",
    "mandolin": "plucked",
    "plucked instrument": "plucked",
    "requinto": "plucked",
    "psaltery": "plucked",
    "theorbo": "plucked",
    "zither": "plucked",
    "drums": "percussion",
    "birds singing": "percussion",
    "bell": "percussion",
    "handbell": "percussion",
    "chimes": "percussion",
    "small bell": "percussion",
    "glock": "percussion",
    "bells": "percussion",
    "carillon": "percussion",
    "tenor drum": "percussion",
    "parade drum": "percussion",
    "castanets": "percussion",
    "finger cymbals": "percussion",
    "dulcimer": "percussion",
    "cimbalom": "percussion",
    "claves": "percussion",
    "congas": "percussion",
    "conga drums": "percussion",
    "antique cymbals": "percussion",
    "glass harmonica": "percussion",
    "gong": "percussion",
    "bass drum": "percussion",
    "cuckoo": "percussion",
    "bell lyre": "percussion",
    "maracas": "percussion",
    "marimba": "percussion",
    "musical clock": "percussion",
    "musical glasses": "percussion",
    "rattle": "percussion",
    "nightingale": "percussion",
    "cymbal": "percussion",
    "chinese cymbal": "percussion",
    "suspended cymbal": "percussion",
    "ratchet": "percussion",
    "sleigh bells": "percussion",
    "spoons": "percussion",
    "percussion": "percussion",
    "tam tam": "percussion",
    "drum": "percussion",
    "string drum": "percussion",
    "tabor": "percussion",
    "drum with snares off": "percussion",
    "turkish drum": "percussion",
    "tambourine": "percussion",
    "snare drum": "percussion",
    "timbales": "percussion",
    "timpani": "percussion",
    "tom tom": "percussion",
    "triangle": "percussion",
    "vibraphone": "percussion",
    "xylophone": "percussion",
    "celesta": "keyboard",
    "cembalo": "keyboard",
    "clavicembalo": "keyboard",
    "spinet": "keyboard",
    "virginal": "keyboard",
    "etc. four hands": "keyboard",
    "clavecin": "keyboard",
    "clavichord": "keyboard",
    "harmonium": "keyboard",
    "harpsichord": "keyboard",
    "organ": "keyboard",
    "organ four hands": "keyboard",
    "barrel organ": "keyboard",
    "organo a rullo": "keyboard",
    "piano": "keyboard",
    "piano four hands": "keyboard",
    "physharmonica": "keyboard",
    "thoroughbass": "strings",
    "basso continuo": "strings",
    "english": "general",
    "continuous solo instrument in a work": "general",
    "winds": "general",
    "orchestra": "general",
    "additions to any wind instrument to indicate a tuning other than standard tuning": "general",
    "examples": "general",
    "electric": "electric",
    "cl in a \t\t\tcor in e|b": "general",
}
"""Dictionary containing the family of each instrument (sound)"""

SCORING_ORDER = [
    "fl",
    "ob",
    "eh",
    "cl",
    "bn",
    "hn",
    "tpt",
    "tb",
    "clno",
    "timp",
    "tamb",
    "triang",
    "mand",
    "salt",
    "vv",
    "cv",
    "eq",
    "fch",
    "sop",
    "alt",
    "ten",
    "bar",
    "bbar",
    "bas",
    "vn",
    "va",
    "viol",
    "vc",
    "bs",
]
"""List of sounds/instruments in the order we want them TODO: better documentation here!"""

SCORING_FAMILY_ORDER = ["ww", "br", "perc", "pluc", "voice", "str"]
"""List of families in the order we want them TODO: better documentation here!"""
