A suggestion for new device that interacts with MuseScore

• Sep 18, 2020 - 11:07

Hi all,
I'm Andrea Accordino, the developer of ODLA project.

OLDA is a new input device (a special keyboard) aimed to help users to compose music simply touching a pentagram through a set of silicone buttons (please visit www.odlamusic.com for details about the project). ODLA is also a good support device for blind people who want to compose music.

Currently, we’re using a modified version of MuseScore as default music notation program for ODLA users. In order to connect ODLA device with MuseScore software we edited the MuseScore source code adding a c++ class. Every time I need to change it, I have to compile the whole source code. This operation lasts a fair amount of time due to project complexity.

Our approach is not optimal, so I'd like to improve it. I would like to develop a better way to implement an extension for MuseScore. What do you suggest? To code a separate library (dll) or to create a custom plugin? In your opinion, which way is the easiest one?

Thank in advance.
Best regards,
Andrea Accordino


Comments

I think this is as good a place as any for it. If you want to discuss changes the source code to MuseScore itself, you could join the Telegram chat as described in the developer documentation, but if you want to discuss a way of doing what you need via a plugin, this is the place. Next step would be describe more what you would actually need.

In reply to by Marc Sabatella

Hi Marc, thank you for your reply!

I'm not sure if the complexity of this project is affordable through a plugin (current "odladriver" class is quite big), nor if would be more convenient to transform the current class in a dll.

My questions (at now) can be two as starting point:
1) What are plugin limits? In which cases should be better to NOT use it.
2) If I would to create a .dll what should be steps? I haven't until now worked inside a so big project and I'm a little bit confused to how to begin to give my contribute.

In reply to by Andreoid87

I have never created a DLL or heard of anyone trying to create one that integrates with MuseScore, so I think you’d be in j charted waters.

The plugin framework is pretty broad and can do many things but by no means everything. So best would be if you looked over the documentation, maybe checked out some existing plugins that perhaps touch on similar functionality to what you would need, and then maybe you could ask more specific questions that people more familiar with the framework could then answer.

Submit this for inclusion into MuseScore. You’ll most likely need to change this with every MuseScore version because internals change anyway, and adding a C++-side plugin API would require the functionality to freeze too much. I’m assuming the QML plugin API is nowhere near sufficient, but anything more than what it offers would be too much entangled with the MuseScore internals. Also, make sure it also works on Linux/BSD, not just on proprietary operating systems ;-)

It’s a very interesting project. What does ODLA stand for, anyway? (Acronym, I collect those.)

In reply to by mirabilos

Hi mirabilos, thank you for your reply!

As I told Mark in other comment, I'm a little bit confused about how to start to give a contribute in a so big project, so, I would be glad if you can indicate me where to "start" submitting into MuseScore.

So, don't you think that a QML plugin can permit to execute commands like "add note", "add clef", "move cursor", and so on? Our current "odladriver" class is quite big, but not so complex, it simply get data from a QLocalSocket and execute some commands.

Anyway, assuming I choose dll approach, I should work to a new branch in github?

It looks like your keyboard simulates a 5-lined staff for pitch input and thus likely has to be aware of transposition/keysig?

Hardware interaction from QML is (to my limited knowledge) not trivial. So whilst I don't see any major roadblocks in implementing the tracking and command interface in QML, I don't have a ready answer on how to then further capture your keyboard input and make it interact with such a plugin.
Our plugins are also very much user-action-triggered, which is why I think this won't be the "right" approach for something that should more act as a driver imho.

MuseScore does support remote control over OSC though.. So you might want to have your own background process which handles your keyboard driver and converts those into (a stream of) OSC messages to trigger the corresponding actions in MuseScore. There is possibly some difficulty involved with program focus depending on how your device acts towards the operating system (is it a generic keyboard? a custom CDC device? ...)

In reply to by jeetee

Hi jeetee and thank you for your reply!

As you guessed it is not necessary for plugin to interact to hardware keyboard since we have a background process.

I took a quick look to OSC function and I don't think it can add printable elements (like, for example, key signatures, clefs, and so on) which our device currently does.

So, my question at this point is: can a plugin to execute "add key signature", "add clef", etc calling their c++ methods and instantiate a QLocalSocket to communicate with background process?

In reply to by Andreoid87

I'm not familiar with OSC myself, but according to this older post it should give you access to all "Action" defined in MuseScore (basically everything for which one can assign a shortcut key).
As adding a new key signature indeed doesn't come as an action (although transpose on the still empty measure could be a workaround) this might indeed not suit your needs best.

As for a plugin being able to instantiate a QLocalSocket; I'm not sure. If QML can, then chances are high the required libraries are bundled with MuseScore. A plugin certainly can do some things like adding clef elements and key signatures; but expect to find bugs in the plugin interface along the way (which we'd like to see fixed of course ;-) )

Do you still have an unanswered question? Please log in first to post your question.