Encoding Music

43 views
Skip to first unread message

Benjamin Bradshaw

unread,
May 15, 2023, 6:48:40 PM5/15/23
to starstarhug
Hello,
I had a brief introduction to humdrum in a class in grad school, and have thought about maybe starting a project with it. The problem is that I'm fairly certain that I will have to encode all of the music from scratch. What are the fastest ways to do this? It looks like there was an encode command, but when I just installed the toolkit it didn't seem to have the encode and record commands anymore. Or maybe I messed up the installation somehow.

I'm guessing creating musicxml in finale or something like that and converting that to humdrum might be fastest?

Thanks


Nathaniel Condit-Schultz

unread,
May 15, 2023, 6:56:37 PM5/15/23
to stars...@googlegroups.com
Benjamin,

Are you looking at conventional western scores? If so do you have images of the scores? There are a couple of options for automatic score reading (a.k.a. Optical Score Recognition). Sharpeye and Photoscore are two softwares I know of; I'm sure other people here will have other suggestions as well. None of the OMR software is perfectly accurate yet, so you will have to do a bit of manual error correcting (or a lot, depending on the score).

If this is not score-based music, you will have to provide more information.

Nat


--
--
This is a message is from the **HUG newgroup.
To post to this group, send email to stars...@googlegroups.com
To unsubscribe from this group, send email to
starstarhug...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/starstarhug?hl=en
---
You received this message because you are subscribed to the Google Groups "starstarhug" group.
To unsubscribe from this group and stop receiving emails from it, send an email to starstarhug...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/starstarhug/2ff9d763-7eca-4877-97ba-bc7a836a38c3n%40googlegroups.com.

Craig Sapp

unread,
May 15, 2023, 11:06:48 PM5/15/23
to stars...@googlegroups.com
The encode command was written for MS-DOS and has never been ported to other operating systems, so I have never actually used it.

The most efficient method as you suspect is to create a MusicXML file and then convert to Humdrum.  This file can then be converted in two ways described below.  Note that the MusicXML file should be in uncompressed format in both cases (You can uncompress in the terminal or system file viewer by renaming compressed MusicXML files to end in .zip, and then unzip the file to get the uncompressed data).

(1) You can drag-and-drop the MusicXML file onto the webpage https://verovio.humdrum.org, then go to the File menu and select "Convert to Humdrum":

Screenshot 2023-05-15 at 19.53.41.png

If the file does not convert to Humdrum, then there is a bug in the converter.  You can report errors to the humlib issues page (after you create a free account on github):


Ideally you would isolate the error to the measure in which it occurs (i.e., a short an example as possible that still has the error).

(2) If you have a lot of MusicXML files that you want to convert in one step, you can install humlib (in linux or MacOS):
      cd humlib
      make
      sudo make install

If you are on MacOS, then you should install Homebrew first (https://brew.sh).  For linux you may need to install the compiling tools, which would done something like this (for Fedora linux in this example):
      sudo dnf groupinstall "Development Tools" "Development Libraries"
If you are using Windows, then install Windows Subsystem for Linux (WSL2), then install Ubuntu within that to run linux commands in the Ubuntu terminal (which I can elaborate further on if needed).

Then the musicxml2hum command should be available and can be run in the terminal like this:
       for file in *.musicxml
       do
            echo Processing $file
            musicxml2hum $file > $(basename $file .musicxml).krn
       done

-=+Craig


Benjamin Bradshaw

unread,
May 15, 2023, 11:12:39 PM5/15/23
to starstarhug
It would be standard notation. I could make images fairly easily. Are any of the omr solutions free or open source? Some may not have nicely engraved versions (some obscure classical period bassoon concertos) so I imagine those may not work as well. 

Benjamin Bradshaw

unread,
May 15, 2023, 11:17:54 PM5/15/23
to starstarhug
What is the best way to create the musicxml files? Are the omr programs good enough as a starting point or is it usually faster to export from something like finale or Sibelius? 

Craig Sapp

unread,
May 15, 2023, 11:33:03 PM5/15/23
to stars...@googlegroups.com

What is the best way to create the musicxml files? Are the omr programs good enough as a starting point or is it usually faster to export from something like finale or Sibelius? 

I don't know of a free OMR program (at least that would be easy to work with/learn, or another one that really does not work at all, so I won't mention the ones I am thinking of).

The cheapest and quite impressive is Play Score 2:
This is a smartphone app.  The free version can take photos of music and render to music for playback on the phone (also yout can load PDF files for more accuracy).   In order to export as MusicXML, you need to pay either $5/month or $25/year with a pro account.   Works on both Android and iPhone.

Also there is a new vervio for Microsoft Windows (separate subscription from the smartphone version for the pro version):

One limitation of Play Score 2 is that it does not recognize lyrics.

Another problem is that it has a strange behavior with layers/voices, often moving music into the second layer in piano music leaving the first one empty in the MusicXML file.  musicxml2hum does not like that, so I need to adjust it to get rid of the empty layers when converting.

Otherwise I typically use SharpEye: https://www.visiv.co.uk (version 2.68).   This software is for Windows (but I run it with an emulator in MacOS).  SharpEye has a one-month free evaluation period (easy to reset with a Windows emulator in MacOS :-).

-=+Craig


Nathaniel Condit-Schultz

unread,
May 17, 2023, 1:24:32 PM5/17/23
to stars...@googlegroups.com
Benjamin,

If the scores are well printed/typeset, you will probably find that the OMR software is good enough to do a rough/solid draft which you would then need to correct. If you are using, for example, Photoscore, the OMR output is piped directly in Sibelius to be edited. Generally, pretty much all software can general musicXML, so you can load XML files into Sibelius or Finale or Musescore for editing.

Once you have XML, you can drag your files into (http://verovio.humdrum.org/) to convert them to humdrum (**kern). Once in verovio, you can edit the humdrum directly and see the score rendered. Once you get comfortable with humdrum, you might do a lot of the editing/"fixing" at this stage...but generally editing in a notation software will be faster.

Nat



--
Nathaniel Condit-Schultz
School of Music, the Georgia Institute of Technology
Reply all
Reply to author
Forward
0 new messages