Spaces:
Runtime error
Runtime error
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"] | |