Spaces:
Runtime error
Runtime error
File size: 2,239 Bytes
d3a278d 075b025 d3a278d 075b025 d3a278d 075b025 d3a278d 075b025 d3a278d 075b025 d3a278d 075b025 d3a278d 075b025 d3a278d 075b025 d3a278d 075b025 d3a278d 075b025 d3a278d 075b025 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
compose_styles_config = {
"piano": {
"readable": "Piano",
"instruments": ["1"],
},
"chamber": {
"readable": "Chamber Music",
"instruments": ["0", "40", "42"],
},
"rock_and_metal": {
"readable": "Rock and Metal",
"instruments": ["DRUMS", "30", "34"],
},
"synth": {
"readable": "Synthesizer",
"instruments": ["DRUMS", "38", "80"],
},
"church": {
"readable": "Church",
"instruments": ["19", "52"],
},
"timpani_strings_harp": {
"readable": "Timpani, Contrabass, Harp",
"instruments": ["47", "43", "46"],
},
"country": {
"readable": "Country",
"instruments": ["DRUMS", "22", "32", "25"],
},
"reggae": {
"readable": "Reggae-esque",
"instruments": ["114", "28", "1"],
},
}
densities_config = {
"low": {
"readable": "Low",
"density": 4,
},
"medium": {
"readable": "Medium",
"density": 6,
},
"high": {
"readable": "High",
"density": 8,
},
}
temperatures_config = {
"low": {
"readable": "Low",
"temperature": 0.5,
},
"medium": {
"readable": "Medium",
"temperature": 0.75,
},
"high": {
"readable": "High",
"temperature": 1.0,
},
"very_high": {
"readable": "Very High",
"temperature": 1.25,
},
}
def get_compose_styles_for_ui():
compose_styles = [
[key, compose_styles_config[key]["readable"]]
for key, value in compose_styles_config.items()
]
return compose_styles
def get_densities_for_ui():
densities = [
[key, densities_config[key]["readable"]]
for key, value in densities_config.items()
]
return densities
def get_temperatures_for_ui():
temperatures = [
[key, temperatures_config[key]["readable"]]
for key, value in temperatures_config.items()
]
return temperatures
def get_instruments(key):
return compose_styles_config[key]["instruments"]
def get_density(key):
return densities_config[key]["density"]
def get_temperature(key):
return temperatures_config[key]["temperature"]
|