Jump to content

Convert dots to ABC? PDF to ABC?


Recommended Posts

RAc, yes you absolutely can output tunebooks with multiple tunes per page, just select "Multiple - Letter" or "Multiple - A4" per page from the PDF Tunes/Page dropdown:



image.png.5bdf15bcd1f432bf5d97515c1c067c03.png
 

This only works if you use my own PDF exporter,  same thing applies for features like table of contents, index generation, etc. All that only works using my PDF exporter.

If you just print the page using the browser's built-in print-to-PDF generator, you will get one tune per page. 

The one advantage is that the browser print-to-PDF can generate vector PDFs, while mine generated using jsPDF, are high-resolution rasterized and compressed bitmaps. 

Unfortunately, there isn't a Javascript library available that can do direct SVG-to-PDF vector translation, so the file sizes of my PDF files are substantially larger than vector equivalents.  That's the tradeoff for the additional functionality and my value-add PDF tunebook features.

The browser can do it because it can run native code, where such libraries are available as native compiled binaries, and my tool is 100% client-side Javascript where they are not.

 

Edited by eskin
  • Thanks 1
Link to comment
Share on other sites

3 hours ago, Don Taylor said:

A quick test.

 

I used Sheet Music Scanner on Android to convert the attached pdf of Glorishears that I recently downloaded from David Hansen.  I saved the output as XML and then imported that into Michael's app.  This is the abc that resulted:

 

X:1
T:Glorishears
L:1/8
Q:1/4=193
M:6/8
I:linebreak $
K:F
V:1 treble nm="Violin"
V:1
 c/B/ |: A>GF FEF | G>AG C2 E | G>AG GcB | %4
 A>GA FGA | B>cd cAB | c>de f2 e | d>cB ABG | %8
 F3- F2 c/B/ :| F3- F2 B/c/ |: d2 c cGA | B>cB B2 A | %12
 B>cd dcB | G>AG E>DC | F2 f f>ef | F2 f f2 e | %16
 d>cB ABG | F3- F2 B/c/ :| F3- F2 z |] %19

Observations:

 

Michael's converter produced exactly same result as was shown in Sheet Music Scanner and it plays the same.  So that is all good.  (The %4, %8, etc at the end of each line are just comments that number the previous measure).

 

This example does demonstrate a couple of shortcomings in Sheet Music Scanner:

  1. It does not recognise alternate endings for sections - annoying but easy to fix in Michael's app.
  2. It does not recognise chord notation at all so you would have to add this in by hand which would be fixable in Michael's app, but rather tedious.

On the other hand, it did a decent job on recognising the notes.

 

 

Glorishears.pdf 31.18 kB · 2 downloads


Cool! Thanks for the report.  I'm just including it the tool as a experimental feature since someone requested it and it was pretty straightforward to add. Glad it might actually be useful.

Link to comment
Share on other sites

4 hours ago, DaveRo said:

Sheet Music Scanner (Android) is capable of recognising alternate endings.

Yes, it does work with that pdf file and here is the abc resulting from putting it through Michael's app:

 

X:1
T:A Bruxa (Bm) (a)
%%score 1 2
L:1/8
Q:1/4=193
M:3/4
I:linebreak $
K:D
V:1 treble nm="Violin"
V:2 treble nm="Violin"
V:1
|: fd cB cd | f2 d2 Be | dc G2 d2 | c6 | %4
 fd cB cd | f2 d2 Be | dc G2 c2 |1 B6 :|2 %8
 B6 |: Bc d2 e2 | f6 | gf e2 b2 |1 %12
 f6 :|2 f6 |: ag fe fg | f2 d2 B2 | %16
 fe dc de | d2 B2 G2 | ed cB cd | c2 G2 F2 | %20
 GF G2 ^A2 |1 B2 d2 f2 :|2 B6 |] %23
V:2
|: B2 FG AB | dc B2 F2 | B,2 E4 | F2 ^A3 e | %4
 dB F2 EF/E/ | D>C B,4 | E3 A3 |1 EF B,2 DF :|2 %8
 GF ED B,C |: DE FA cA | d3 A F2 | E2 GF GA |1 %12
 B2 D2 B,2 :|2 ^A2 c2 ed |: cB AG AB- | Bc BA GF | %16
 AG FE FG- | GF ED B,A, | B,2 EG AB | A3 E DB, | %20
 C2- CD EC |1 DB, DF Bd :|2 D2 B,4 |] %23
 

The choice of tempo (193) and instrument (violin) came from my settings in Music Score Scanner and they can be changed before exporting the XML.

 

I don't understand why alternate endings were not recognized in Glorishears but that they were in this scan.  Still no chord recognition.

Edited by Don Taylor
Link to comment
Share on other sites

4 hours ago, RAc said:

For example this here one:

 

ABC import stopped working | MuseScore

 

Already in MS 3.x.

That plug-in relied on an Internet connection in 3.x (and before) and stopped working some time ago.  I think that the originator's web server shut down.

 

I have been using this replacement that works locally: https://musescore.org/en/project/abc-importexport  This does not need an Internet connection for Musescore 3.x  and has worked relaibly for me.

 

I do not know if it still works in Musescore 4.x.

Link to comment
Share on other sites


My tool can now open a MusicXML file with the following extensions:

.xml
.musicxml
.mxl (!!!)

.mxl files should work for most cases. In testing I found the rare UTF-16 encoded .mxl that will fail to open.

This is so freaking cool!

Here's one of the J.S. Bach Two-part Inventions, imported from MusicXML .mxl format, converted to ABC format, displayed and played in the tool using a harpsichord sound.

Sound recorded just using the microphones in my monitor, no post processing of the audio.
 

 

Edited by eskin
Link to comment
Share on other sites

4 hours ago, eskin said:

Here's one of the J.S. Bach Two-part Inventions, imported from MusicXML .mxl format, converted to ABC format, displayed and played in the tool using a harpsichord sound.

 

Some of this comes out in the wrong octave (eg., the left hand part from the 2nd note of measure 3 through the 1st half of measure 5. I’m assuming that was in the input .mxl file. Also, the F natural in measure 7 instead of E# is unfortunate, but I guess couldn’t be avoided.

Link to comment
Share on other sites

3 hours ago, David Barnert said:

 

Some of this comes out in the wrong octave (eg., the left hand part from the 2nd note of measure 3 through the 1st half of measure 5. I’m assuming that was in the input .mxl file. Also, the F natural in measure 7 instead of E# is unfortunate, but I guess couldn’t be avoided.


Man, you're a glass half-empty kind of guy... 🙂
 

This specific example was from here:

 

http://www.mscorelib.com/actree/Bach/Bwv772-786 Two Part Inventions/
 

Apparently these are just random arrangements someone did in MIDI that were then translated to MusicXML:

 

http://www.mscorelib.com/index.htm

 

Their whole collection of classical .mxl files is amazing:

 

http://www.mscorelib.com/actree/index.htm

 

Doesn't surprise me that there would be transcription errors considering the "here's a bunch of random files" nature of the collection.
 

That using the MusicXML-to-ABC Javascript library and ABCjs I can now import, display, and play them at all with one long day's coding work kind of blows my mind.

 

Sure, ABCjs doesn't always generate the prettiest output from these complex files. Setting the MusicXML import options to two measures per staff seems to tidy things up visually for some files

 

I'm going to give this a few days of field testing before I update the code on the GitHub repo.

 

 

 

 

Edited by eskin
Link to comment
Share on other sites

13 hours ago, Don Taylor said:

I don't understand why alternate endings were not recognized in Glorishears but that they were in this scan. 

It doesn't like the unterminated section ┌─────── at the end of line 2. Either complete the bracket  -  see attachment - or put a double bar line on the end.

 

I've met this feature before!

Glorishears_2.pdf

Link to comment
Share on other sites

4 hours ago, DaveRo said:

It doesn't like the unterminated section ┌─────── at the end of line 2. Either complete the bracket  -  see attachment - or put a double bar line on the end.

 

I've met this feature before!

Glorishears_2.pdf 34.85 kB · 2 downloads

Feature or a bug in Sheet Music Scanner? 

 

We are not usually in a position to edit a score inside a pdf file before scanning it with Sheet Music Scanner.

Link to comment
Share on other sites

2 hours ago, Don Taylor said:

Feature or a bug in Sheet Music Scanner?

I don't know. Is a single-ended repeat bracket (or whatever it's called) valid? If not it's arguably not a bug. But it would preferably assume a ┐at an 'appropriate' point.

 

Anyway, if you're using it to convert to ABC it's easy to fix the ABC. If, like me, you're mainly using it to play the music then you could convert the fixed ABC back to a pdf and rescan it - which I have done a couple of times.

 

In this case I used GIMP to paste a ┐ onto the pdf to check whether that alone would correct it and there was nothing else wrong with the pdf.

Link to comment
Share on other sites

On 8/9/2023 at 7:27 PM, RAc said:

Mozart is about 100€ for a licence which I gladly pay, being a software developer myself. EasyABC would not even start up on my Windows 10 machine, and Musescore requires internet access for vital functions which to me is not an option. The only missing feature in Mozart so far is the ability to combine several tunes into a set on a single page, but Dave (Mozart head developer, I guess) has committed to putting that on the TODO list.

 

You can do the several-tunes-in-one-document thing in recent versions of Mozart, using the music break feature. It was a bit fiddly last time I tried it (with v14), but v16 may be better. Here's a shot of a pdf I produced that way (the grey margins are from the pdf viewer).

 

Capture.png

Edited by Moll Peatly
Link to comment
Share on other sites

10 hours ago, Moll Peatly said:

You can do the several-tunes-in-one-document thing in recent versions of Mozart, using the music break feature. It was a bit fiddly last time I tried it (with v14), but v16 may be better. Here's a shot of a pdf I produced that way (the grey margins are from the pdf viewer).

 

Capture.png

Thanks for the insight, Moll, good to know that there are other Mozart users around!

 

I do not think that this addresses my use case, though, because I do not use the internal file format of Mozart (*.mz) but use it mostly as a front end to my abc database. The idea is to be able to combine, say, any pair of 32 bar jigs from the abc stock so that in one session tunebook, Moll in the wad is on one page with Billy Pennock's New Rigged ship and with Oyster girl in another. From my understanding and previous discussion with Dave Webber, this is not yet possible even with multiple abcs in the same file as Mozart will generate distinct documents for each tune in the file, and distinct documents apparently can not yet be collated. That is exactly the gap Michael's tool fills nicely. Dave is looking into native solutions.

 

Thanks again!

 

Edited by RAc
Link to comment
Share on other sites

By the way, in my ABC Transcription Tools, if you are using the "Multiple tunes per page" option for a PDF tunebook and you want to force a page break after a specific tune, it's quite easy:

 

From my user guide:

When exporting multiple tunes per page to PDF the tool will do its best to layout the output to not split tunes between pages, unless the tune itself is longer than one page.

 

When exporting multiple tunes per page, if you want to manually force a tune to a new page in the PDF, add:

 

%%newpage

 

on a new line immediately at the end of tunes after which you want to force a page break.

 

This will allow you to easily format a tune book where you want to override the automatic tune layout.

Edited by eskin
Link to comment
Share on other sites

  • 2 months later...

Since this thread has somehow evolved into a generic "sound and digital" discussion plaform, I thought I would draw your attention to melodyscanner.com. The promise is AI based Online Sound-to-sheet, ie you upload or record sounds, and the software generates written music/abcs/whatever from it. Sort of like the acoustic counterpart of pdf scanners. I thought the approach is worth looking at as this is certainly a poster case for AI. Traditional analyzing software fails pathetically at "understanding" music.

 

In a nutshell, this AI needs a lot of learning yet. The output quality of even scanning "perfectly prepared" music (single part MIDI output from an abc file) is rather poor, and so are the post processing edit options. Maybe the quality improves with more people uploading tracks to train it, so give it a try; thr basic version (up to one minute of recorded input; in my case, I simply recorded a track I played on the same machine's media player) only costs a one time signup.

Link to comment
Share on other sites

Here's one of the best example of a PDF to ABC conversion example I have:

"Ragtime Nightingale" by Joseph Lamb

I believe I found the original notation here (or a very similar version):

https://musescore.com/user/3636436/scores/5244648


First step was to do PDF to MusicXML conversion using the iOS PlayScore2 app.

 

Next step was MusicXML to ABC transcoding using my ABC Transcription Tools.

I did no editing of the tune other than adding the title and Q: tempo tag to the ABC.

Here's the resulting ABC version:

https://tinyurl.com/ymwb7h6c
 

Edited by Michael Eskin
Link to comment
Share on other sites

I took the pdf score of Ragtime Nightingale from here:

https://www.free-scores.com/download-sheet-music.php?pdf=43764

and put it though Music Scanner on my Android tablet for comparison.

It played nicely in Music Scanner itself but the MusicXML was not so good.

 

EasyABC failed to import it, stopping after 28 bars of the 91. (But my version of EasyABC is suspect!)

 

Michael's web tool imported it all but the playing was faulty which I assume is the MusicXML .

 

I notice that there are 4 voices in the ABC against 5 in the one Michael posted:

%%score { 1 | ( 2 3 4 ) }
...
V:1 treble nm="Accordion"
V:2 bass 
V:3 bass 
V:4 bass 

Why not just two. Or six?

 

I attach the PDF and MusicXML for others to play with.

lamb-joseph-ragtime-nightingale_freescores.pdf lamb-joseph-ragtime-nightingale_freescores.xml

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...