Maestro and AbcPlayer with upgrades by Aifel, Elamond and Karloman

Aifel

Active member
I have made some fixes and upgrades to Maestro and AbcPlayer from Digero.

You can get them here: Link to Google Drive. Usually I recommend just grabbing the one with the highest version number.

Please note that the latest versions require 64 bit Java, unlike v2.5.0 which require 32 bit.

Also I highly recommend reading the text file Changes since Maestro 2.5.0.txt before using or installing it. It has both install instructions and the changelog contains details on how to use the new features.
 

Galdwen

Egghead
These updates to Maestro have been great, thank you for putting in the time to make them. I always look forward to new updates. 😁
 

Elamond

Member
Aifel has been kind enough to let me help contribute towards his Maestro/AbcPlayer fork.

The newest version of Aifel's fork, v2.5.0.114 (which you can find in the google drive link above) has my first set of changes in it, support for flat Maestro themes (dark mode and light mode), and font scaling! Here's a screenshot of the new dark mode:

z93PDtE.png


Maestro will look unchanged by default, but you can select one of the new flat themes in the misc options menu, and increase or decrease the font size for the flat themes. Changes to the theme and font size will only take effect after restarting Maestro. Please let me know if you discover any problems with this feature.

More to come...
 
Last edited:

Pontin_Finnberry

Your Friendly Neighborhood Hobbit
One slight problem I found, i can't get ABC files to open by clicking them anymore as could before, you have to open Maestro and drag ABC files into it, clicking file gives an error saying Maestro needs Java 7 32bit or later, this wasn't an issue with last version i had, I could go get java 7 32bit, but didn't need it before.

edit: seems i already have 32bit java, must have forgot i did so this an error with maestro
 
Last edited:

Pontin_Finnberry

Your Friendly Neighborhood Hobbit
One other thing, just as suggestion would be possible if you could change each individual track by 1 semitone instead only 12? I know the transpose option does it by 1 semitone, but thats the whole entire thing across all tracks not just 1.
 

Aifel

Active member
One slight problem I found, i can't get ABC files to open by clicking them anymore as could before, you have to open Maestro and drag ABC files into it, clicking file gives an error saying Maestro needs Java 7 32bit or later, this wasn't an issue with last version i had, I could go get java 7 32bit, but didn't need it before.

edit: seems i already have 32bit java, must have forgot i did so this an error with maestro

It needs Java 64 bit, not 32 bit. Can you show me an image of that error? Its a bug if it say 32 bit.
How did you install it? Using MSI or ZIP?
The exe files are not used anymore, if they are still there after installing with MSI, then go into installation folder and delete them I would recommend, so you don't accidently starts using those.
Clicking on an ABC, MID, KAR or MSX file should launch Maestro/Abcplayer just fine. Try uninstall, and delete the install folder and reinstall.
 

Aifel

Active member
One other thing, just as suggestion would be possible if you could change each individual track by 1 semitone instead only 12? I know the transpose option does it by 1 semitone, but thats the whole entire thing across all tracks not just 1.

There is 2 ways of transposing semitones:
  • Using the spinner control on the lower left side in Maestro.
  • Clicking on the 'T' button near the bottom of Maestro, and then select a region you want to transpose.
But note that for both methods it will transpose all tracks where you do it. The reason for that is you get dissonant (false) notes if you could do it per track individually. You would never ever want to do that to music. It would sound horrible.
 

Pontin_Finnberry

Your Friendly Neighborhood Hobbit
It needs Java 64 bit, not 32 bit. Can you show me an image of that error? Its a bug if it say 32 bit.
How did you install it? Using MSI or ZIP?
The exe files are not used anymore, if they are still there after installing with MSI, then go into installation folder and delete them I would recommend, so you don't accidently starts using those.
Clicking on an ABC, MID, KAR or MSX file should launch Maestro/Abcplayer just fine. Try uninstall, and delete the install folder and reinstall.
So this is what I get when go click on any ABC file, I will see if uninstall and reinstall helps though I installed using the zip, (I have Java 64bit as well other versions installed)

WGVb32T.png


Edit: I removed Maestro and tried MSI version and same issue as above and no there are no exe files at all with v2.5.0.114
 
Last edited:

Aifel

Active member
It won't even run for me, saying that it can't find "javaw."
I tried editing it to "java" but it says I don't have permission to edit the file.
javaw is part of the Java distribution. You need to install Java separately.
If it cannot find javaw then java is not installed properly.
 

Aifel

Active member
So this is what I get when go click on any ABC file, I will see if uninstall and reinstall helps though I installed using the zip, (I have Java 64bit as well other versions installed)

WGVb32T.png


Edit: I removed Maestro and tried MSI version and same issue as above and no there are no exe files at all with v2.5.0.114
If you install using ZIP, then it wont launch Maestro or abcplayer if you click on a file.
You can set that up manually with Open As.. option when right clicking files in windows explorer, just choose the bat file.
That Startup error you posted is not from Maestro 2.5.0.114, but from exe files from older Maestro. So you must have an older version installed somewhere.
 

Pontin_Finnberry

Your Friendly Neighborhood Hobbit
I did some searching and yup way down at bottom of downloads folder I deleted the old version completely.

edit: so i decided to remove everything i unstalled Java and Maestro, then reinstall Java 64 its in correct folders, then I install latest version of Maestro, it says it cannot find javaw, Java should be installed just fine, but anyway I think I will just drag and drop ABC files into meastro from now on as I can't figure out just clicking.
 
Last edited:

Elamond

Member
Just to double check, the version of Java you've installed is the 64 bit offline installer from this install page?

One thing you can check is making sure the installer for java added it to your path correctly. If you search for "Edit the system environment variables" in the start menu, and then click the "Environment variables..." button in the System Properties menu that comes up, find the variable called "Path" in the System variables section, and one of the entries should be something like "C:\Program Files (x86)\Common Files\Oracle\Java\javapath".
 

Pontin_Finnberry

Your Friendly Neighborhood Hobbit
Yeah thats the exact version of Java I installed, Anyway I fixed it seems Javapath folder was missing stuff, so I completely deleted oracle folder and reinstalled Java again and now there stuff in Javapath folder and Maestro start works now along with setting ABC and Midi files to it, they work just fine by clicking it now. :)
 

Karloman

New member
I'm having trouble running this on my Linux machine, which runs OpenJDK instead of Oracle's JDK.

The AbcPlayer works if I downgrade to OpenJDK 8. When I run it in a more recent version it gives an error message:
Code:
Exception in thread "main" java.lang.IllegalAccessError: class com.digero.common.midi.SequencerWrapper (in unnamed module @0x6a7c0ffd) cannot access class com.sun.media.sound.MidiUtils$TempoCache (in module java.desktop) because module java.desktop does not export com.sun.media.sound to unnamed module @0x6a7c0ffd
        at com.digero.common.midi.SequencerWrapper.<init>(SequencerWrapper.java:38)
        at com.digero.common.midi.NoteFilterSequencerWrapper.<init>(NoteFilterSequencerWrapper.java:24)
        at com.digero.common.midi.LotroSequencerWrapper.<init>(LotroSequencerWrapper.java:42)
        at com.digero.abcplayer.AbcPlayer.<init>(AbcPlayer.java:329)
        at com.digero.abcplayer.AbcPlayer.main(AbcPlayer.java:152)

Someone on StackOverflow has an explanation:

com.sun and its sub-packages are not part of the public Java API. They implement some standard Java APIs, but you shouldn't refer to them directly. (They're likely to change and/or be renamed or removed between JVM releases, and non-Sun/Oracle JVMs probably won't have them at all.)

In most cases you should access the public API classes (e.g. in javax.sound) instead. (Those may use sun.*/com.sun.*/etc. classes internally as needed, but that's merely an implementation detail.)

In early versions of Java, there was nothing to stop people using those internal implementation classes, and so some developers got into bad habits. But Java 9 added a module system, which restricts access to them. The error message you see is a result of that.

Maestro refuses to run at all in any version of OpenJDK I've tried, with no clear error message.

Could you perhaps send me the source code? Maybe I can find a replacement for the non-public API class, and figure out what's preventing Maestro from running in OpenJDK. Presumably it works fine with Oracle's JDK in Linux.
 

Elamond

Member
I'm having trouble running this on my Linux machine, which runs OpenJDK instead of Oracle's JDK.

The AbcPlayer works if I downgrade to OpenJDK 8. When I run it in a more recent version it gives an error message:
Code:
Exception in thread "main" java.lang.IllegalAccessError: class com.digero.common.midi.SequencerWrapper (in unnamed module @0x6a7c0ffd) cannot access class com.sun.media.sound.MidiUtils$TempoCache (in module java.desktop) because module java.desktop does not export com.sun.media.sound to unnamed module @0x6a7c0ffd
        at com.digero.common.midi.SequencerWrapper.<init>(SequencerWrapper.java:38)
        at com.digero.common.midi.NoteFilterSequencerWrapper.<init>(NoteFilterSequencerWrapper.java:24)
        at com.digero.common.midi.LotroSequencerWrapper.<init>(LotroSequencerWrapper.java:42)
        at com.digero.abcplayer.AbcPlayer.<init>(AbcPlayer.java:329)
        at com.digero.abcplayer.AbcPlayer.main(AbcPlayer.java:152)
It may be tricky to replace the internal java classes used that openjdk doesn't support. Maestro relies on the deprecated MidiUtils class to do timing calculations, and a few of the other deprecated sun midi library classes are also used. This is also why Maestro is still on Java 8 rather than being updated to a newer Java version. It's on my list of improvements to try and upgrade to java 17, but replacing these dependencies is non-trivial. If you do manage to replace those dependencies though, it would be great!

I'll let Aifel decide if he wants to make the link to his github fork public knowledge, but in the meantime you can experiment with Digero's original repo which is public info. It has the same dependency on MidiUtils.
 

Karloman

New member
It may be tricky to replace the internal java classes used that openjdk doesn't support. Maestro relies on the deprecated MidiUtils class to do timing calculations, and a few of the other deprecated sun midi library classes are also used. This is also why Maestro is still on Java 8 rather than being updated to a newer Java version. It's on my list of improvements to try and upgrade to java 17, but replacing these dependencies is non-trivial. If you do manage to replace those dependencies though, it would be great!

I'll let Aifel decide if he wants to make the link to his github fork public knowledge, but in the meantime you can experiment with Digero's original repo which is public info. It has the same dependency on MidiUtils.
Aifel sent me the link to his branch, and I've been able to replace most of the dependencies (though I did have to resort to replicating MidiUtils since Oracle declined to provide actual wrapper classes). It's rather unfortunate to introduce GPL-licensed classes in a MIT-licensed project, so I should maybe externalize that in some fashion. Another restricted usage was "ShellFolder.getShellFolder()", which apparently does seem to have a replacement starting from Java 9.

I currently have it ported to Java 17 locally with no apparent regressions (with some minor refactoring to take advantage of newer Java features + further mavenization of dependencies) (Edit: Ah, I do have regressions in the sound export of ABC Player. That'll be a tough one.), but there's one oddity that's still bugging me and preventing me from running Maestro (and seeing any error messages). It's this bit of code in MaestroMain:
Java:
        if(!openPort()) {
            sendArgsToPort(args);
            return;
        }
If I remove that, I can run Maestro. But it's obviously there for a reason, yet it's not immediately clear to me. My best guess is that it's tied to the WinRun4J things.
 
Last edited:

Elamond

Member
That's awesome! If we can support Java 17, it would also be great for us to eventually change the export and packaging model of Maestro from the current ant script to use jpackage instead, so users can get binaries that work for their systems without any java installation being necessary. That was one goal I had in mind with upgrading to java 17.

The code you posted is there to limit Maestro from launching multiple instances. The first instance opens a socket which listens for input, and if Maestro is launched again (e.g. by double clicking on a different midi file in file explorer), it will be unable to open the server socket on the same port, and will instead open a client against that port, send over the details of the file it attempted to open, and exit. The original running Maestro instance will receive the file info in the socket and open the file.

I'm not sure why this wouldn't work on Linux. It's possible the socket is stuck open somehow, might be worth trying a reboot if you haven't already to see if that fixes the problem. We can also maybe look into how some other open source programs with similar functionality (VLC media player comes to mind) achieve this, maybe there is a better way than using sockets. I've also discussed gating this behavior under program settings with Aifel, but that's a separate issue from it not functioning properly on Linux.

Edit: and FYI Maestro is no longer using winrun4j, it seems to be abandonware (due to the introduction of jpackage probably) and Aifel ran into some issues with it when he upgraded Maestro to 64 bit. The current distribution on Windows includes batch scripts which becomes the "executables" for Maestro and ABCPlayer.
 
Last edited:

Elamond

Member
Yep, audio file exporting was another barrier I also ran into when I attempted to upgrade to java 17, the deprecation of the AudioSynthesizer class. I wasn't able to find an obvious work-around for this. MP3/WAV export is a feature a lot of people in the music community find useful, so it would be best to find a solution before we upgrade the java version. I haven't looked into alternatives deeply yet, but I wasn't able to find anything promising during my quick search.
 
Top