Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble Using the Musescore Plugin #56

Closed
Nico-Adamo opened this issue Jan 21, 2019 · 5 comments
Closed

Trouble Using the Musescore Plugin #56

Nico-Adamo opened this issue Jan 21, 2019 · 5 comments

Comments

@Nico-Adamo
Copy link

Nico-Adamo commented Jan 21, 2019

I'm on windows 10. After much fiddling, I've gotten DeepBach installed (yay!) and have been able to compose very well by running deepbach.py. However, I'm now trying to use the musescore plugin to get interactive composition.

I've moved the deepBachMuseScore plugin file to my MuseScore plugin directory, and that allows it to load well, but there's no models to choose from, and no matter what I put in for the server adress, none will load. I have models in my DeepBach folder, but that's in a completely separate place from my Musescore plugin files. But just putting a model file into the musescore plugin folder doesn't work either, no matter what I put in for the "server address" (http://localhost:5000/, a direct path to the directory of the model, etc).

How do I load a model into musescore?

EDIT: Alright, I've done some more work and determined I need to set it up with flask to use the musescore plugin. But the flask plugin is only available in the original_keras branch of the git and not in the master version - furthermore, it's not compatible with the current data_utils.py.

Am I missing something, or is the master branch not set up to work as a flask app and therefore to use with musescore?

@Ghadjeres
Copy link
Owner

Hi!
Yes, indeed, I did not include the flask_server for musescore in the pytorch version; and I don't plan to do so.
The reason is that we developed a new interface in order to replace musescore, which allows for more intuitive and responsive controls as can be seen here:
https://twitter.com/gaetan_hadjeres/status/1086175891896569857
(The MuseScore interface is indeed a bit restrictive).
I'm trying to release this interface as soon as possible.

In the meantime, if you really want to use DeepBach with Musescore, I just pushed the Flask server I use with the new interface (flask_server.py). With this file, it should be easy to adapt the old plugin_flask_server.py to use the new implementation. Sorry for that.

@Nico-Adamo
Copy link
Author

Nico-Adamo commented Jan 23, 2019

Thank you so much! I'm looking forward to the new interface.
However, I haven't really worked with flask, and I'm having some trouble. The new flask_server seems to make no reference whatsoever to models, which the musescore plugin depends heavily on. Furthermore, load_models no longer exists. Where, then, should I route a GET for models? Or will I have to re-write the musescore plugin too?

In any case, it isn't a big deal - I'll just look for that interface! Hoping it's going to be open source, or at least free?

@Ghadjeres
Copy link
Owner

Ok, finally I rewrote the musescore_flask_plugin.
Unfortunately, some things have changed since the latest version.

Now, I cannot retrieve in python the score displayed in MuseScore. So what I did is to keep a local copy of the generated scores in the flask server. However, if you do so, you are not able to change some parts of the score by hand and to regenerate the other parts with DeepBach.

So far, you just have to start the Flask server, then start the MuseScore plugin and click on compose.
The first time you click on compose, a totally new score is generated. Then you can select any region and click on compose.

It works fine in this setting, but:

  • you cannot change the metadata (keys, fermata, ...)
  • it does not take into account the displayed score in MuseScore, so it is fixed length (fixed when you start the Flask server).
  • musescore opens a new file when you have a new generated chorale and always asks you if you want to save or not.

Also, I just saw today that MuseScore 3 existed. But this plugin, in its current state, is incompatible with it. So for the moment it's only MuseScore 2.

Check musescore_flask_server.py --help if you want to generate

I really hope you will use that!

@antoniodimartino
Copy link

Hi, Ghadjeres,
I'm trying to install on musescore 2, win10. When I run "python musescore_flask_server.py" the system answers:
C:\Program Files\MuseScore 2\plugins\DeepBach-master>python musescore_flask_server.py
Traceback (most recent call last):
File "musescore_flask_server.py", line 4, in
import click
ModuleNotFoundError: No module named 'click'

can you help me?
thanks

@antoniodimartino
Copy link

Maybe for me It would be helpful reading a step-to-step guide....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants