I added a function to PFOMO.com to play single voice ABC notation and files. If you are not familiar with ABC notation I'd start here...
Wikipedia: https://en.wikipedia.org/wiki/ABC_notation
Official ABC source: https://abcnotatin.com
I had to tweak some of the input code to:
- Commands can span lines
- Recall history with lines spanning multiple lines
- You can paste in to the command prompt. Mobile has a button you can use to paste into the command prompt. It's goofy and I hope to fix it.
I added fetchContents() to go through a public proxy(s) to get to some of the file contents through URLs.
As public proxies are subject to usage limits, I searched for a few and added them in a failover flow. THIS IS VERY LIMITIMG. Be patient and look at my workaround in PROXY FAILURE below.
PlayABC works in two modes
You can pass it a string of ABC Notation
You can pass it a URL to an .ABC file
String of ABC notation
Caution: the T: header can only support one word. It is an optional header element and not needed. I drop it all the time.
You can pass a string of ABC notation and do something as simeple as play middle C
playabc C
You can pass as much of a string as you want with modification to your needed ABC Header as you want. I tested with the following:
playabc A B c d
playabc A B c/2 c/2 d
playabc L:1/8 A2 B2 c c d2
playabc M:3/4 A B c/2 c/2 d
playabc K:G A2 B2 c c d2
playabc X:2 A2 B2 c c d2
-----
playabc K:D [| "^1"D2 D2 | D> E F2 | "^2"F> E F> G | A4 | (3"^3"d d d (3A A A | (3F F F (3D D D | "^4"A> G F> E | D4 |]
-----
playabc
X:1
M:4/4
C:Trad.
K:G
|:GABc dedB|dedB dedB|c2ec B2dB|c2A2 A2BA|
GABc dedB|dedB dedB|c2ec B2dB|A2F2 G4:|
|:g2gf gdBd|g2f2 e2d2|c2ec B2dB|c2A2 A2df|
g2gf g2Bd|g2f2 e2d2|c2ec B2dB|A2F2 G4:|
Play around and see if there is more needed.
The only headers I currently default at the prompt are X:1 and K:C, as they are the minimum required to function. You can replace them as needed.
URL
Find a song and try it out.
I found Row, Row, Row Your Boat at https://trillian.mit.edu/~jc/music/book/EverydaySongBook/
I found that by testing the source URL to make sure of the returned file contents were the actual .ABC contents helped.
From the prompt you can paste in:
playabc https://trillian.mit.edu/~jc/music/book/EverydaySongBook/075_Round_Row_Row_Row_Your_Boat.abc
PROXY FAILURE
I did find issues with using the public proxies after a bit, but I was able to get to the file in another browser tab and open the file to pull the needed values like this....
playabc K:D L:1/8 M:2/4 X:75 [| "^1"D2 D2 | D> E F2 | "^2"F> E F> G | A4 | (3"^3"d d d (3A A A | (3F F F (3D D D | "^4"A> G F> E | D4 |]
A Collection of Collections