Melodeon.net Forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the new melodeon.net forum

Pages: [1] 2 3 4 5   Go Down

Author Topic: My new client-side abcjs-based ABC converter  (Read 15307 times)

0 Members and 1 Guest are viewing this topic.

Michael Eskin

  • Hero Member
  • *****
  • Online Online
  • Posts: 547
    • AppCordions
My new client-side abcjs-based ABC converter
« on: February 06, 2023, 03:32:45 AM »

With the demise of the mandolintab converter, I forked another abcjs based project and built this completely client-side open-source abc-to-notation converter.

Perhaps others might find it useful:

http://michaeleskin.com/abctools/abctools.html

Works best on Chrome and Firefox.

Full source on my GitHub repo, feel free to fork it and modify it to your requirements!

https://github.com/seisiuneer/abctools

It’s probably not up to the task of complex ABC files, but should be useful for simple traditional single tunes with chord indications.  It is sufficient to meet my humble needs for my whistle and B/C box teaching.







« Last Edit: February 06, 2023, 06:29:53 AM by Michael Eskin »
Logged

Michael Eskin

  • Hero Member
  • *****
  • Online Online
  • Posts: 547
    • AppCordions
Re: My new client-side abcjs-based ABC converter
« Reply #1 on: February 07, 2023, 03:56:34 AM »

 While the converter is limited to single tunes, with a bit of creative ABC editing, you can get it to generate multipage tune sets.

Here’s how I could get it to do a 3-tune polka set in PDF form, two tunes on the first page, one tune on the second:

Starting with:
 

X: 1
T: The Blackwater
R: polka
M: 2/4
L: 1/8
K: Dmaj
|:Fd Bd/B/|AF ED|A,B, DE|FE EF|
Ad Bd/B/|AF EF|DF A/B/A/F/|ED D>E:|
|:FA Bc|d2 Ad|fg/f/ ed|fe e2|
dc/d/ ed|BA FE|DF A/B/A/F/|ED D>E:|


X: 2
T: Kathleen's
R: polka
M: 2/4
L: 1/8
K: Bmin
|:dc/d/ fe|dB Bd|e>f ed|cA Ac|
dc/d/ fe|dB Bd|c/B/A Bc|1 B2 Bc:|2 B2 f>g||
|:af ge|fd de/f/|gf ed|cA A>e|
fd ec|dB cA|BA FA|1 B2 Bf/g/:|2 B2 Bc||


X: 3
T: Mícheál's
R: polka
M: 2/4
L: 1/8
K: A
|:A2 BA/B/ | cA A>B | ce ae |f/a/f/e/ cB|
A2 BA/B/ | cA A>F | EF A/B/c/A/ |1 BA AE :|2 BA A2 ||
ag/a/ ba | fa fe |cA/c/ eA |cB B2 |
ag/a/ ba | fa fe |Ac e/f/e/c/ |BA A2 |
ag/a/ ba | fa fe |cA/c/ eA |cB Bc |
A2 BA/B/ | cA A>F | EF A/B/c/A/ | BA A2 |]

I strip all the headers other than the key from the second and third tunes, use %%center annotation to generate the names and add a %%vskip on the last tune to push it to a second page:

X: 1
T: The Blackwater Polka Set
R: polka
M: 2/4
L: 1/8
K: Dmaj
%%center
%%center The Blackwater
%%center
|:Fd Bd/B/|AF ED|A,B, DE|FE EF|
Ad Bd/B/|AF EF|DF A/B/A/F/|ED D>E:|
|:FA Bc|d2 Ad|fg/f/ ed|fe e2|
dc/d/ ed|BA FE|DF A/B/A/F/|ED D>E:|
%%center
%%center
%%center Kathleen’s
K:Bmin
|:dc/d/ fe|dB Bd|e>f ed|cA Ac|
dc/d/ fe|dB Bd|c/B/A Bc|1 B2 Bc:|2 B2 f>g||
|:af ge|fd de/f/|gf ed|cA A>e|
fd ec|dB cA|BA FA|1 B2 Bf/g/:|2 B2 Bc||
K: A
%%vskip 125
%%center Mícheál’s
|:A2 BA/B/ | cA A>B | ce ae |f/a/f/e/ cB|
A2 BA/B/ | cA A>F | EF A/B/c/A/ |1 BA AE :|2 BA A2 ||
ag/a/ ba | fa fe |cA/c/ eA |cB B2 |
ag/a/ ba | fa fe |Ac e/f/e/c/ |BA A2 |
ag/a/ ba | fa fe |cA/c/ eA |cB Bc |
A2 BA/B/ | cA A>F | EF A/B/c/A/ | BA A2 |]

PDF export results in:

https://www.dropbox.com/s/yln6jlgbgvl7w4c/The_Blackwater%20Polka%20Set.pdf?dl=0
Logged

Michael Eskin

  • Hero Member
  • *****
  • Online Online
  • Posts: 547
    • AppCordions
Re: My new client-side abcjs-based ABC converter
« Reply #2 on: February 07, 2023, 03:57:32 AM »

Demo video showing grabbing some ABC from thesession and generating PDF notation in various formats and tablatures:


https://youtu.be/ixCHWD6PXsM
Logged

Stiamh

  • Old grey C#/D pest
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3611
    • Packie Manus Byrne
Re: My new client-side abcjs-based ABC converter
« Reply #3 on: February 07, 2023, 02:50:49 PM »

Neatly done, Michael.

Given the fuss generated by the recent discussion about web-based ABC tools as opposed to editor apps/programs, I'm surprised this hasn't attracted any comments.

Michael Eskin

  • Hero Member
  • *****
  • Online Online
  • Posts: 547
    • AppCordions
Re: My new client-side abcjs-based ABC converter
« Reply #4 on: February 07, 2023, 10:30:20 PM »

A new experimental feature for the ABC Transcription Tool: Auto-formatting of tune sets.

This option now shows up on the "Advanced Controls" panel if there is more than one tune is detected in the ABC.

Clicking "Auto-Format Tune Set" will reformat the set into one big tune that can then be exported to PDF.

You may have to adjust the %%vskip values to get proper paging of tunes if that is important to you, but this is a big step forward.

The tool is available at:

http://michaeleskin.com/abctools/abctools.html

Demo video:

https://youtu.be/5JbFX6O2aaU
« Last Edit: February 08, 2023, 03:14:29 PM by Michael Eskin »
Logged

Michael Eskin

  • Hero Member
  • *****
  • Online Online
  • Posts: 547
    • AppCordions
Re: My new client-side abcjs-based ABC converter
« Reply #5 on: February 07, 2023, 10:56:11 PM »

Another demo video:

https://youtu.be/kzeChKa091A
Logged

Michael Eskin

  • Hero Member
  • *****
  • Online Online
  • Posts: 547
    • AppCordions
Re: My new client-side abcjs-based ABC converter
« Reply #6 on: February 08, 2023, 12:38:22 AM »

Also added the ability to just print from the browser.

Set the size to "Large" and then select "Print" from your browser's menus.

https://youtu.be/Msn5mjsHPuA
Logged

Roger Hare

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 949
  • Urmston, Lancashire, U.K. éééé
Re: My new client-side abcjs-based ABC converter
« Reply #7 on: February 08, 2023, 04:44:23 AM »

A new experimental feature for the ABC Transcription Tool: Auto-formatting of tune sets.
This option now shows up on the "Advanced Controls" panel if there is more than one tune is detected in the ABC.
Clicking "Auto-Format Tune Set" will reformat the set into one big tune that can then be exported to PDF.
You may have to adjust the %%vskip values to get proper paging of tunes if that is important to you, but this is a big step forward.
Also added the ability to just print from the browser.
Set the size to "Large" and then select "Print" from your browser's menus.
Outstanding! Thank you!

Question: How large is "Large"? This machine isn't connected to a printer, so I can't check,
but is "Large" likely to be large enough to help those who have difficulty reading small print?
« Last Edit: February 08, 2023, 05:34:25 AM by Roger Hare »
Logged
My ABC tune collections can be found here (GoogleDrive) & here (Dropbox).

For more about Manchester Morris, The Beech Band Folk Club or anything else,  please use the private messaging facility.

Michael Eskin

  • Hero Member
  • *****
  • Online Online
  • Posts: 547
    • AppCordions
Re: My new client-side abcjs-based ABC converter
« Reply #8 on: February 08, 2023, 07:26:13 AM »

In my experience “Large” is sufficient to span a standard letter size piece of paper when printed via the browser. The PDF export also creates a similar sized image.
Logged

Roger Hare

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 949
  • Urmston, Lancashire, U.K. éééé
Re: My new client-side abcjs-based ABC converter
« Reply #9 on: February 08, 2023, 07:54:25 AM »

In my experience “Large” is sufficient to span a standard letter size piece of paper when printed via the browser...
Noted. Thanks.
Logged
My ABC tune collections can be found here (GoogleDrive) & here (Dropbox).

For more about Manchester Morris, The Beech Band Folk Club or anything else,  please use the private messaging facility.

Michael Eskin

  • Hero Member
  • *****
  • Online Online
  • Posts: 547
    • AppCordions
Re: My new client-side abcjs-based ABC converter
« Reply #10 on: February 08, 2023, 10:39:05 PM »

My browser-based ABC transcription tool can now natively handle editing multiple tunes in one ABC file and export multi-tune PDF files (one tune per page)!

The tool is available at:

http://michaeleskin.com/abctools/abctools.html

Source code available on GitHub at:

https://github.com/seisiuneer/abctools

Demonstration video showing several examples of multi-tune import and PDF generation:

https://youtu.be/A_arBse7u5Q
Logged

Michael Eskin

  • Hero Member
  • *****
  • Online Online
  • Posts: 547
    • AppCordions
Re: My new client-side abcjs-based ABC converter
« Reply #11 on: February 09, 2023, 05:33:52 PM »

For my client-side web-based ABC-to-notation transcription tool, I changed out the Javascript framework I was using for the PDF rasterization.


It's now 10-100x faster generating PDF files for multiple tunes.


The original Javascript framework, html2canvas, would get slower and slower as the number of tunes being rendered increased.


The replacement Javascript framework, html-to-image, does not have that issue and renders each individual tune in the same time whether there are 3 or 30 tunes.


The tool is available at:


http://michaeleskin.com/abctools/abctools.html


The source is available on my GitHub repo at:


https://github.com/seisiuneer/abctools


Demo video showing the new PDF generation speed at:


https://youtu.be/vWoDCb3-n2M
Logged

Michael Eskin

  • Hero Member
  • *****
  • Online Online
  • Posts: 547
    • AppCordions
Re: My new client-side abcjs-based ABC converter
« Reply #12 on: February 09, 2023, 06:23:32 PM »

I finally feel like I have, at least for my needs, a replacement for the now defunct mandolintab converter.

My converter can generate the PDF for my 52-page tune book for new B/C accordion players in less than 2 minutes. Woo Hoo!

The html2canvas Javascript library I previously used internally was copying the entire page DOM for every SVG staff render even if I was just rasterizing one staff.

As the number of tunes increased, the time it took per-tune to render increased to the point where it was unusable.

The replacement html-to-image Javascript library doesn't do a complete DOM copy on each staff rasterization call, and is the same speed per-staff whether there is one tune or 100.
Logged

Roger Hare

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 949
  • Urmston, Lancashire, U.K. éééé
Re: My new client-side abcjs-based ABC converter
« Reply #13 on: February 09, 2023, 07:40:12 PM »

I finally feel like I have, at least for my needs, a replacement for the now defunct mandolintab converter...
..and is the same speed per-staff whether there is one tune or 100.
I'm not usually a fan of remotely-hosted programs (if that's the correct term), because
I've had some pretty unsatisfactory experiences in this area, but I would just like to say
that this is a super piece of work. I wish I had the smarts to do this sort of programming.

Thank you! Please do not stop now...
« Last Edit: February 09, 2023, 11:13:20 PM by Roger Hare »
Logged
My ABC tune collections can be found here (GoogleDrive) & here (Dropbox).

For more about Manchester Morris, The Beech Band Folk Club or anything else,  please use the private messaging facility.

Michael Eskin

  • Hero Member
  • *****
  • Online Online
  • Posts: 547
    • AppCordions
Re: My new client-side abcjs-based ABC converter
« Reply #14 on: February 10, 2023, 12:32:40 AM »

Thanks Roger!

Sorry for all the posts, been a manic week...

If you're using the new "Multiple tunes per page" feature in my ABC converter and you want to force a tune to another page, here's a demo for how to modify the ABC by adding a series of:

W:
W:
(as many as you need)
W:
W: . (have to have a character on the final line)

to the end of the tune you want to have the extra space after.

In the demo video, first I render a set of tunes to PDF, and in the resulting PDF the second tune is split between two pages.

Then I add some space manually and regenerate the PDF pushing the second tune to the second page.

This info is now also on the Instructions page (click the link at the top of the converter page).

Thank you to Paul Gitlitz for this idea!


Demo video:

https://www.youtube.com/watch?v=jr1EC4l7RgQ
Logged

Roger Hare

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 949
  • Urmston, Lancashire, U.K. éééé
Re: My new client-side abcjs-based ABC converter
« Reply #15 on: February 10, 2023, 06:21:27 AM »

A semi-technical question:

The whistle tab generated by your program looks very similar to that produced by the 'standard'
flute.fmt file which I sometimes use when running abcm2ps in command-line mode, but the
typography is subtly different. Do you use an 'alternative' form of this flute.fmt file to generate
your whistle (and other) tabs, or do you use a completely different mechanism? The flute.fmt
file I use seems to be a bog-standard PostScriot file...

Thanks.

Roger
Logged
My ABC tune collections can be found here (GoogleDrive) & here (Dropbox).

For more about Manchester Morris, The Beech Band Folk Club or anything else,  please use the private messaging facility.

Chris Ryall

  • "doc 3-row"
  • French Interpreter
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 11153
  • Wirral UK
    • Chris Ryall
Re: My new client-side abcjs-based ABC converter
« Reply #16 on: February 10, 2023, 12:00:32 PM »


I’ve got a 5 octave collection of sampled Binci reed melodeon mpg’s if you want them Michael. Half second or so.

Use them for Melodeon Explorer, also client side. It’s a decade old now and needs a re-write, once I’ve got Ryall Armouties2.1 debugged

Can email them over if they’d be useful. PM me?

[edit] the sound on Explorer worked last month, has just stopped! Guess it’s the new protocols on speaker access. Defo needs recoding!
« Last Edit: February 10, 2023, 12:04:34 PM by Chris Ryall »
Logged
  _       _    _      _ 

Michael Eskin

  • Hero Member
  • *****
  • Online Online
  • Posts: 547
    • AppCordions
Re: My new client-side abcjs-based ABC converter
« Reply #17 on: February 10, 2023, 04:33:50 PM »

Rodger, the tin whistle tab font I’m using came from here:

https://github.com/OMerkel/tin_whistle/tree/master/res/font
Logged

Michael Eskin

  • Hero Member
  • *****
  • Online Online
  • Posts: 547
    • AppCordions
Re: My new client-side abcjs-based ABC converter
« Reply #18 on: February 10, 2023, 09:07:17 PM »

You can now easily share tunes with others right from my ABC Transcription tool! 

Clicking on the "Advanced Controls" button and then the "Create URL to Share" will give you a URL you can copy and paste into any browser to bring up the editor with the same tune set.

Thank you to Philip McGarvey for the new feature!

Demo Video:

https://youtu.be/3UUazwWcae0

The tool is at:

http://michaeleskin.com/abctools/abctools.html

GitHub repo is:

https://github.com/seisiuneer/abctools
Logged

Roger Hare

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 949
  • Urmston, Lancashire, U.K. éééé
Re: My new client-side abcjs-based ABC converter
« Reply #19 on: February 11, 2023, 05:03:36 AM »

Rodger, the tin whistle tab font I’m using came from here:
https://github.com/OMerkel/tin_whistle/tree/master/res/font
Thank you!
At first sight, I don't quite see how I could employ this in my own (very pedestrian!) programs,
which simply modify an existing ABC file by adding w: lines, saving the result in a new ABC file,
but I'll certainly be taking a long, hard look!
Thank you very much!
R.
« Last Edit: February 11, 2023, 06:27:04 AM by Roger Hare »
Logged
My ABC tune collections can be found here (GoogleDrive) & here (Dropbox).

For more about Manchester Morris, The Beech Band Folk Club or anything else,  please use the private messaging facility.
Pages: [1] 2 3 4 5   Go Up
 


Melodeon.net - (c) Theo Gibb; Clive Williams 2010. The access and use of this website and forum featuring these terms and conditions constitutes your acceptance of these terms and conditions.
SimplePortal 2.3.5 © 2008-2012, SimplePortal