lewdlime / abcm2ps

abcm2ps is a command line program which converts ABC to music sheet in PostScript or SVG format. It is an extension of abc2ps which may handle many voices per staff. abcm2ps is Copyright © 2014-2016 Jean-Francois Moine.
http://moinejf.free.fr/
GNU General Public License v3.0
82 stars 31 forks source link

Add larsen articulation symbols #23

Closed robehickman closed 6 years ago

robehickman commented 6 years ago

It would be useful to me if abcm2ps supported the Larsen articulation symbols, particularly 'cut' and 'strike'. I'd guess they would be noted with !cut! and !strike! in addition to !roll! which already exists.

I know it is common to notate these using grace notes, but in my current project this notation would be ambiguous, as it requires different interpretation from 'classical' grace notes.

moinejf commented 6 years ago

Sorry for I am an organ player and I don't know about the Larsen articulations. Have you some examples?

robehickman commented 6 years ago

Take a look at the following, on a wind instrument you'd play this as a contentious slur, articulating the second note using a 'cut' (notated with a comma) and the third with a strike (notated with the down arrow).

https://pureocarinas.com/res/lilypond/twonoteroll_5f8bfd7a6d1d3975e8e073ad9bb0af6500b3e461.png

The following page shows how they are performed on the ocarina (admittedly an odd ball case), the same technique is used to perform them on tin whistle and simple system flute.

https://pureocarinas.com/playing-techniques/learning-to-play/a-bottom-up-approach/articulating-notes-on-ocarina#finger-articulations

moinejf commented 6 years ago

To add the decorations !cut! and !strike!, add these lines in the ABC files (or in a file included by %%abc-include):

%%beginsvg
<defs>
 <path id="cut" class="fill" d="m2 -10
    l-4 10 5.6 -9.2z"/>
 <path id="strike" class="fill" d="m-2.5 -8.5
    l2.5 9 2.5 -9 -1.2 0 -1.1 4.5 -1.1 -4.5z"/>
</defs>
%%endsvg

%%deco cut 3 cut 10 5 5
%%deco strike 3 strike 10 5 5
robehickman commented 6 years ago

Thanks I wasn't aware of this feature, is it documented anywhere?

moinejf commented 6 years ago

Such decorations may be added by people who know a bit about the internals of abcm2ps/abc2svg. The only (poor) documentation about this feature is http://moinejf.free.fr/abcm2ps-doc/deco.xhtml.

robehickman commented 6 years ago
%%beginsvg
<defs>
 <path id="cut" class="fill" d="m2 -10
    l-4 10 5.6 -9.2z"/>
 <path id="strike" class="fill" d="m-2.5 -8.5
    l2.5 9 2.5 -9 -1.2 0 -1.1 4.5 -1.1 -4.5z"/>
</defs>
%%endsvg

%%deco cut 3 cut 10 5 5
%%deco strike 3 strike 10 5 5
X: 1
R: jig
M: 6/8
L: 1/8
K: Gmaj
|: (G!cut!G!strike!G !cut!GAB) | (!cut!AGE !cut!GED) |

Where should I put this within the file? I've tried compiling the above but the resulting postscript file is totally blank.

robehickman commented 6 years ago

Or was the feature added more recently? I am using abcm2ps-7.8.9, what is in the ubuntu16.4 repo.

moinejf commented 6 years ago

Your version is rather old (october 2014). This feature has been added in the version 8.7.5 (april 2015). The current version is 8.13.20 (february 2018) and it is in VoidLinux (rolling distro).

robehickman commented 6 years ago

How difficult is this to compile? I have no intention of changing distro, especially not to a rolling one as they take too much maintenance time.

moinejf commented 6 years ago

I have VoidLinux installed on all my machines (desktops, portable, ARM boards) and I never had to change anything after an update. Otherwise, building the abcm2ps binary is explained in the file INSTALL. The generation takes less than 1mn in my ARM board (clock 1GHz, 1Gb RAM - gcc-7.3.0).

olets commented 6 years ago

You can get Larsen's symbols directly with the authorized Larsen font. Install the font, and then use annotations.

Annotations are written in "double quotes", with a positioning prefix:

For example, "^annotation"A prints "annotation" above the note A.

The font used by abcm2ps for annotations is set with annotationfont, which can be set either in an fmt file or an abc file:

% your-fmt.fmt
annotationfont <font-name> <font-size>

% or your-abc.abc
%% annotationfont <font-name> <font-size>

(If you set annotationfont in an fmt, you'll have to tell abcm2ps to use it. You can do this in your abc file with %%abc-include your-fmt.fmt or %% format your-fmt.fmt or in on the command line with abcm2ps -F your-fmt.fmt your-abc.abc)

With the "Larsen" font installed, you can print above-the-staff Larsen symbols with something like

% larsen-demo.abc

%% annotationfont Larsen 20

X: 1
T: Larsen crann
L: 1/1
M: C
K: C
"^c"z | % in the Larsen font, `c` is a long crann

Output of abcmp2s larsen-demo:

screen shot 2018-05-05 at 10 43 56

Larsen font symbol reference

The Larsen font includes lots of glyph not relevant to the abc use case (e.g. notes, staff lines, etc). Grey Larsen's new symbols are mapped to

symbol character
cut
roll j
strike v
short roll J
long crann c
short crann C
slide down s
slide up S
shake ~

Note that cut is not '

My bet is most people who know about Larsen's symbols play wind instruments, so you might also need to know that breath is ,.

Here's what they all look like

X: 1
T: Larsen symbol reference
M: C
L: 1/1
K: C
"^\’ v j J c C s S ~ ,"z |

(ps hi Jef! 👋)

olets commented 6 years ago

Made some edits related to the cut symbol. If you're reading this on email, go to GitHub for the latest

olets commented 6 years ago

How difficult is this to compile?

As Jef said this is in INSTALL but that doc can be intimidating if you're unfamiliar with such things. A basic build is simply

./configure
make
olets commented 6 years ago

Okay, the problem with the cut symbol in the Larsen font was that the single curly quotes ( and ) are in a non-Latin font table. I assume they would work if you installed with pango, but I haven't done that.

So I regenerated the font, adding the cut symbol to the previously unused plus-minus sign (±)! You can download the new version from https://github.com/olets/larsen-font

Note:

%% annotationfont Larsen-Regular 20

X: 1
T: Latin character for Larsen's cut symbol
M:C
L:1/8
K:C
"^   ±"A |

screen shot 2018-05-05 at 13 48 30

robehickman commented 6 years ago

The problem with using annotations for these symbols is (as far as I know) you can't use the symbols and regular text annotations or chord symbols at the same time. I've already had problems with descriptive text annotations such as 'b' being treated as a flat sign. Adding the alignment symbols like '^' or '_' fixed that but caused inconsistent formatting with notes of different pitches and looked bad. I ended up using lilypond for most of it for these reasons.

olets commented 6 years ago

Cool. Fwiw you can use annotations and guitar chords at the same time, but yeah for complex formatting something like lilypond can be great

%% annotationfont Larsen-Regular 20

X: 1
T: Annotation and gchord
M:C
L:1/8
K:C
"C""^   ±"z |

screen shot 2018-05-05 at 14 09 55

robehickman commented 6 years ago

I meant seeing as the font uses 'c' for instance for a short crann, if you wrote something like "^cut""^ ±"z | annotating to describe what the cut symbol looks like, woulden't the 'c' in the word be converted into a crann symbol?

I wasn't aware that ABCn supported multiple annotations like that.

robehickman commented 6 years ago

@olets "My bet is most people who know about Larsen's symbols play wind instruments, so you might also need to know that breath is"

I feel that a similar notation would be valuable for other instruments in ITM as it has a clear intent. I've been learning the basics of playing the fiddle, the instrument can perform cuts by dragging a finger across a string barely touching it. This causes the string to stop sounding or sound a harmonic depending where it is touched -- for an extremely brief period.

I have read 'the complete Irish fiddle player', which uses grace notes to notate cuts, as well as something which from the description resembles classical acciaccatura - a fully noded fingering. I think that distinguishing between these in notation would convey a clearer intent.

I've also spent a bit of time studying highland bagpipe notation which, from what I've seen, is even more vague. Embellishments are notated as a block of grace notes, some of which are played as cuts/strikes while others use proper fingering and have longer duration. Some precede the beat and others follow it. The notation depends on the player already knowing what to do.

I've read several books about playing the highland pipes and the term 'grace note' is used to refer to all of these different meanings. It makes the explanations verbose as it always has to clarify meaning. Differentiating between fingered articulations and grace notes would be clearer. Having words for above (cut) and below (strike) also makes the language and intent more obvious.

olets commented 6 years ago

👍 I don't mean to imply that only a wind player would be interested in Larsen's system, only that people already familiar with it are likely to be wind players. I certainly agree that articulation/ornamentation symbols are useful across instruments, and that common ways of notating often come up short.

//

That's right, "cut" in the Larsen font would not be legible as a word. If it was okay for the explanation text to have the same styles as any actual chords, you could write "cut" as a guitar chord. Or if it was okay for it to have the same styles as any actual vocals, you could write the explanation as a vocal. If neither of those met your needs an abcm2ps deco would be the way to go. Some examples:

% fmt

beginps
/crann {
    M -5 20 RM       % for example. bumping this upwards to accomodate the explanation
    gsave
    /Larsen-Regular 20 selectfont
    (c) show
    grestore
}!
/crannexplained {
    crann
    -10 -10 RM       % for example. could also position this above the symbol
    /Times-Italic 10 selectfont
    ((crann)) show
}!
endps

deco crann 3 crann 10 5 5
deco crannexplained 3 crannexplained 10 5 5

annotationfont Larsen-Regular 18
gchordfont Times-Italic 10
vocalfont Times-Italic 10
% abc

X:1
T:Three different ways of printing a symbol's explanation
N:First measure: chord; second measure: vocal; third measure: deco
M:C
L:1/8
K:C
"(crann)""^c"G,2 A, "^c"B,2 C | "^c"D2 E "^c"F2 G | !crannexplained!A2 B !crann!c2 d |
w:| (crann)

screen shot 2018-05-06 at 16 07 17

robehickman commented 6 years ago

I was more expressing my surprise that these articulation symbols haven't been added to the ABC standard, I've had a dialogue with Grey and he dosn't seem to have any objection to others using them. I do see a few issues with the choice of symbols when applied to general notation, as the strike symbol is very similar to an up bow mark and the crann 'C' could be misinterpreted as a C major chord. The word 'strike' also dosn't work when applied to the fiddle as they are performed as you would play a cut on a wind instrument. 'Cut' is generic enough and already used by fiddlers.

Thanks, it's interesting to learn about these more advanced featured that I wasn't aware of. The issue I've experienced with treating annotations as guitar chords is that the letter 'b' is converted into a flat sign, which isn't desirable in an annotation.

Is it possible to have the larsen font separate and tell abcm2ps where to find it? I'm using this integrated into a website and would rather bundle it with the website's source than have it separate, and forget about when I update my server, causing the site to break silently.

olets commented 6 years ago

Gotcha. To propose adding it to abc proper, check out http://abcnotation.com/discuss. I think you'll have an uphill campaign — abc is pretty bare-bones, Larsen's symbols aren't well known even within ITM, ITM folks are only a subset of the abc community, and even within ITM the names for the ornaments/articulations he's interested in aren't standardized across instrument and region. But maybe it'll turn out lots of people are into it!

Good point, the guitar chord solution might be too limited.

Yep! In all of these, the Larsen font has to be a separate file, installed like any other font. For use on a website you might try the abcjs plugin

robehickman commented 6 years ago

The only symbols that I personally use are the 'cut', 'strike', long roll and I may use the slide in the future. I'm describing the technical abilities of the Italian ocarina which is able to use fingered articulations. However this instrument has almost no tradition of it's own and is played by people from many backgrounds including classically trained musicians, so using the folk grace note notation would be ambiguous with classical grace notes.

As I am describing the abilities of the instrument it isn't my place to be telling the reader what they should be using them for, so I'm making a generalisation of fingered articulations as well as rolls. In this context the symbols for different kinds of rolls mostly don't make sense as they are tied to the structure of irish music.

https://pureocarinas.com/playing-techniques/learning-to-play/a-bottom-up-approach/rolls-cranns-strike-cranns-on-ocarina

A discussion of notation:

https://pureocarinas.com/playing-techniques/learning-to-play/a-bottom-up-approach/notating-fingered-articulations-cuts-strikes

"Yep! In all of these, the Larsen font has to be a separate file, installed like any other font"

I'll stick with lilypond then as there is already an implementation of the symbols for it, which can be placed anywhere and included. I've already checked it in to git.

"For use on a website you might try the abcjs plugin"

I want all rendering of music to be done on the server for performance, plus I intend to make it available as a PDF and a book at some point, though that won't be soon.

moinejf commented 6 years ago

Hi,
Using a separate font asks for the users to install this font in their computers. On the other side, having the associated glyphs in the PS/SVG resulting files permits these last ones to be moved anywhere.

So, I got the Larsen fonts from @olets's new version (Hi Henry) and I extracted the interesting glyphs as SVG definitions.
Then, I defined the associated decorations in this ABC file.

But, due to many bugs in abcm2ps, the SVG definitions were not usable with a PostScript output (the bugs will be fixed in the next release). So, after fixing the bugs, I could generate a PostScript ABC file.

Here is an example about its usage:

%%abc-include larsen-ps.abc
%% annotationfont Larsen-Regular 20

X: 1
T: Larsen symbol reference
M: C
L: 1/1
%%pagescale 3
K: C
"^\’ v j J c C s S ~"z|
;AvAjAJAlALAsASA~A |
w:; v j J l L s S \~

(if Larsen-Regular is installed, the first line will show the original glyphs)