request

#1
by Nex432 - opened

hey there, can you add feature customize soundfont by upload sf2 file?

@Nex432 Thank you for your request but unfortunately I do not think such option will be practical or even possible due to Gradio components limitations.

But I will definitely think about it and I will try to add it in the future :)

Alex

thanks you :)

@Nex432 Since you've asked and if you have any particular good SF2 in mind, I can add it manually so that there are more SF2 choices.

Let me know...

good job

and maybe for the output you can add midi visualizer like this

example.png

@Nex432 Unfortunately, that is too complex for me. But I am open to collaboration so if you can help me do it, feel free to do so :)

@Nex432 I do not know if you have seen it but SkyTNT made one that used to work very well. Unfortunately, it is not compatible with Gradio anymore...

https://huggingface.co/spaces/skytnt/midi-composer/blob/main/javascript/app.js

hmm, i found this code in main code

def load_javascript(dir="javascript"):
scripts_list = glob.glob(f"{dir}/*.js")
javascript = ""
for path in scripts_list:
with open(path, "r", encoding="utf8") as jsfile:
javascript += f"\n"
template_response_ori = gr.routes.templates.TemplateResponse

def template_response(*args, **kwargs):
    res = template_response_ori(*args, **kwargs)
    res.body = res.body.replace(
        b'</head>', f'{javascript}</head>'.encode("utf8"))
    res.init_headers()
    return res

gr.routes.templates.TemplateResponse = template_response

maybe you can also use ZeroGPU for this Spaces

Sign up or log in to comment