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   Go Down

Author Topic: Need help formatting an abc file into PDF  (Read 5822 times)

0 Members and 1 Guest are viewing this topic.

smiley

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 973
  • Folk music: it's not as bad as it sounds
    • a few sound clips
Need help formatting an abc file into PDF
« on: May 29, 2015, 12:29:20 AM »

Firstly, is there an active internet forum where users of abc notation can get educated answers to abc-related queries? The one at http://abcnotation.com/discuss appears to have been discontinued, and I don't want to bother abc software developers on their mailing list with my basic newbie user issues.

My current problem is: I want to insert linebreaks into my PDF output to improve the layout of the heading text above the printed music (the format varies for each page). The abc below is an example of how I've bodged up some lines by using an extra T: field, but it looks crappy. I've gone through the abc standard 2.1 manual and still can't find a solution to such a simple issue.

[I've tried creating a title page in MS Word and saving it as a PDF, but then I don't know how to combine this page with the main music PDF file for distribution.]

-------------------------------

X:1
T: ENGLISH CEILIDH WORKSHOP
T:-
T:Called by
T:-
T: DANCE: Hamburger Special
T: -
T:My Lad's Ower Bonny for the Coal Trade
M:2/4
L:1/8
K:G
|:"Am"A/B/c/d/ eg|"D"fd "Am"ec|"G"BG GB| gB B2|"Am"A/B/c/d/ eg|"D" fd "Am"ec|"G"BG GB|"Am"cA A2:|
|:"Am"ae cA|ae cA|"G"BG GB| gB Bg|"Am"ae cA| ae cA|"G"BG GB |"Am"cAA2:|]
Logged

Jack Campin

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 764
    • Jack Campin's Home Page
Re: Need help formatting an abc file into PDF
« Reply #1 on: May 29, 2015, 12:57:25 AM »

Use the special typesetting commands in abcm2ps.  Copy this and paste it into the input box at http://mandolintab.net/abcconverter.php :

Code: [Select]
%%textfont Times-Roman 24
%%vskip 0.5cm
%%center ENGLISH CEILIDH WORKSHOP 
%%textfont Times-Roman 18
%%center DANCE: Hamburger Special

X:1
T:My Lad's Ower Bonny for the Coal Trade
M:2/4
L:1/8
K:G
"Am"A/B/c/d/ eg|"D"fd "Am"ec|"G"BG GB|    gB B2 |
"Am"A/B/c/d/ eg|"D"fd "Am"ec|"G"BG GB|"Am"cA A2:|
"Am"ae       cA|   ae     cA|"G"BG GB|    gB Bg |
"Am"ae       cA|   ae     cA|"G"BG GB|"Am"cA A2:|

I have attached the resulting PDF.  Does it do the trick?

Note, :|] is not legal ABC.  The right hand line of a right repeat is drawn thick anyway.
Logged
http://www.campin.me.uk/

I can't figure out how to quit but I will no longer check this group and have deleted all shortcuts to it.

Matthew B

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 873
Re: Need help formatting an abc file into PDF
« Reply #2 on: May 29, 2015, 01:01:39 AM »

I just deleted your T fields, and left a space with a carriage return.  It seemed to work OK in the Mac package Easy ABC.  I'm not sure that's what you're looking for, but it seems to fit your description. 
Logged
Charter Member Presumpscot and Fore River Accordion Club

TomBom

  • Respected Sage
  • ****
  • Offline Offline
  • Posts: 471
Re: Need help formatting an abc file into PDF
« Reply #3 on: May 29, 2015, 01:29:33 AM »

You can adjust the space that appears above subtitle lines (subtitle lines are any lines starting with 'T:' after the initial one):

%% subtitlespace ##

Your example:

X:1
%% subtitlespace 20
T: ENGLISH CEILIDH WORKSHOP
T:Called by
T: DANCE: Hamburger Special
T:My Lad's Ower Bonny for the Coal Trade
M:2/4
L:1/8
K:G
|:"Am"A/B/c/d/ eg|"D"fd "Am"ec|"G"BG GB| gB B2|"Am"A/B/c/d/ eg|"D" fd "Am"ec|"G"BG GB|"Am"cA A2:|
|:"Am"ae cA|ae cA|"G"BG GB| gB Bg|"Am"ae cA| ae cA|"G"BG GB |"Am"cAA2:|]
Logged

smiley

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 973
  • Folk music: it's not as bad as it sounds
    • a few sound clips
Re: Need help formatting an abc file into PDF
« Reply #4 on: May 29, 2015, 05:02:35 AM »

Thanks, my first question was quickly solved. Melodeon.net is an excellent forum for getting good answers to my abc problems. I just wish I'd asked earlier and saved myself so much wasted effort.

Both Jack & Tom's solutions will fix my formatting issues and I appreciate those examples of how to apply typesetting commands. Jack's rewrite of my abcs is an invaluable lesson to improve my abc coding habits. A practical demonstration is worth a thousand words to me ;)

And thanks Matthew - I should've explained that I'm mainly using ABCexplorer on a windows PC (so Jack's typesetting commands needed to be copied into the file header).  But I'm actually planning to buy a Mac very soon and will give EasyABC a go.

cheers, Ian
Logged

malcolmbebb

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 2609
  • In dampest Dorset, on the soggy south coast.
Re: Need help formatting an abc file into PDF
« Reply #5 on: May 29, 2015, 07:25:00 AM »

As a more general question, where might one find the documentation for the typesetting markup? I have often seen it but not yet felt the urge to enquire further. 
Logged
Dino BPII.
"Tradition is not the worship of ashes, but the preservation of fire."

Lester

  • MADman
  • Mods and volunteers
  • Hero Member
  • ***
  • Offline Offline
  • Posts: 9124
  • Hohners'R'me
    • Lester's Melodeon Emporium and Tune-a-Rama
Re: Need help formatting an abc file into PDF
« Reply #6 on: May 29, 2015, 07:38:44 AM »

As a more general question, where might one find the documentation for the typesetting markup? I have often seen it but not yet felt the urge to enquire further.

http://www.stephenmerrony.co.uk/uploads/ABCquickRefv0_6.pdf

Chris Ryall

  • "doc 3-row"
  • French Interpreter
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 10200
  • Wirral UK
    • Chris Ryall
Re: Need help formatting an abc file into PDF
« Reply #7 on: May 29, 2015, 07:44:18 AM »

On the rare occasions I've needed to do this I just used the stave graphical output available on several web ABC facilities. Then tweaked that on an image editor - MSpaint actually. Easy peasy

You have more precision in placing the chords, and can also easily adjust the bars to bring out the music's structure. I've always found dots for a melody in say 16 bars … but laid out as say 5 per line particularly hard to follow. But I guess that's to say I'm no real musician?  :|glug
Logged
  _       _    _      _ 

Anahata

  • This mind intentionally left blank
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 6373
  • Oakwood D/G, C/F Club, 1-rows in C,D,G
    • Treewind Music
Re: Need help formatting an abc file into PDF
« Reply #8 on: May 29, 2015, 09:17:46 AM »

http://www.stephenmerrony.co.uk/uploads/ABCquickRefv0_6.pdf

Ooh, that's handy!
For a more detailed description of what those codes do, try Guido Gonzato's documentation for ABC plus. (As far as I know, most of the ABC plus extensions are incorporated in current ABC standards, and it's certainly implemented by abcm2ps, which is the backend for several ABC editors)

On the rare occasions I've needed to do this I just used the stave graphical output available on several web ABC facilities. Then tweaked that on an image editor

If you are really pernickety about layout, you could use Lilypond. Like ABC, that uses a text-based format for describing music, but goes into far more typographical detail. I've never found it necessary, myself, and there's a lot to learn.

Quote
I've always found dots for a melody in say 16 bars … but laid out as say 5 per line particularly hard to follow. But I guess that's to say I'm no real musician?  :|glug
That's two of us, then...

However, it's trivial in ABC to put the stave line breaks where you want them.
Line break in text = line break in stave. '\' at end of line to override (i.e. two lines of text -> 1 line of ,music)
Logged
I'm a melodeon player. What's your excuse?
Music recording and web hosting: www.treewind.co.uk
Mary Humphreys and Anahata: www.maryanahata.co.uk
Ceilidh band: www.barleycoteband.co.uk

TomBom

  • Respected Sage
  • ****
  • Offline Offline
  • Posts: 471
Re: Need help formatting an abc file into PDF
« Reply #9 on: May 29, 2015, 11:00:07 AM »

I've always found dots for a melody in say 16 bars … but laid out as say 5 per line particularly hard to follow. But I guess that's to say I'm no real musician?  :|glug
That's two of us, then...

However, it's trivial in ABC to put the stave line breaks where you want them.
Line break in text = line break in stave. '\' at end of line to override (i.e. two lines of text -> 1 line of ,music)
Three!

And ! to force a line break anywhere in ABC-code.
Logged

Tone Dumb Greg

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 4933
    • Dartmoor Border Morris
Re: Need help formatting an abc file into PDF
« Reply #10 on: May 29, 2015, 12:18:33 PM »

Get easyABC for windows here:

http://www.nilsliberg.se/ksp/easyabc/
Logged
Greg Smith
DG/GC Pokerwork, DG 2.4 Saltarelle, pre-war CF Hohner, Hohner 1040 Vienna style, old  BbEb Hohner that needs a lot of work.

ACCORDION, n. An instrument in harmony with the sentiments of an assassin. Ambrose Bierce

Jack Campin

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 764
    • Jack Campin's Home Page
Re: Need help formatting an abc file into PDF
« Reply #11 on: May 29, 2015, 01:02:50 PM »

Quote
And ! to force a line break anywhere in ABC-code.

That doesn't always work.  Ideally I'd want both ! and \ to be usable in the same tune, but I can't do that in BarFly.  And abcm2ps fucked it up by using ! for something else entirely.

You can make staff line lengths and ABC line lengths different this way, which preserves readability pretty well:

Code: [Select]
X:1
T:Geamparalele de la Murfatlar
M:7/8
L:1/8
Q:1/4=172
K:APhr ^c
|: "A" cAcA cde|"Dm"d2dc BAG|   "A" cAcA cde|"Dm"d2dc BAG |
[1 "A" cAcA cde|"Dm"d2dc def|   "Bb"gffe dcd|"A" e2eA eAA:|
[2 "Gm"gffe ded|"A" c2cA BAG|   "Bb"ABBA GFG|"A" A2A2 Ace||
|: "A" a2a2 Aca|"A7"g2g2 Acg|   "Dm"f2fe ded|"A" c2cA BAG |\
   "Dm"f2fe ded|
                "A" c2cA BAG|[1 "Bb"f2fe dcd|"A" e2e2 Ace:|\
                             [2 "Bb"ABBA GFG|"A" A2AE AEE||
|: "A" e2dc def|"Gm"gfga gfe|   "Dm"gffe ded|"A" c2cA BAG |\
   "Dm"effe ded|
                "A" c2cA BAG|[1 "Bb"effe dcd|"A" e2eA eAA:|\
                             [2 "Bb"ABBA GFG|"A" A2AE AEE|]

That works in BarFly, despite its screwed up implementation of !.  If Phil and Jean-Francois had done it right, I could have written this:

Code: [Select]
X:2
T:Geamparalele de la Murfatlar
M:7/8
L:1/8
Q:1/4=172
K:APhr ^c
|: "A" cAcA cde| "Dm"d2dc BAG|   "A" cAcA cde|"Dm"d2dc BAG |
[1 "A" cAcA cde| "Dm"d2dc def|   "Bb"gffe dcd|"A" e2eA eAA:|
[2 "Gm"gffe ded| "A" c2cA BAG|   "Bb"ABBA GFG|"A" A2A2 Ace||
|: "A" a2a2 Aca| "A7"g2g2 Acg|   "Dm"f2fe ded|"A" c2cA BAG |\
   "Dm"f2fe ded|!"A" c2cA BAG|[1 "Bb"f2fe dcd|"A" e2e2 Ace:|\
                              [2 "Bb"ABBA GFG|"A" A2AE AEE||
|: "A" e2dc def| "Gm"gfga gfe|   "Dm"gffe ded|"A" c2cA BAG |\
   "Dm"effe ded|!"A" c2cA BAG|[1 "Bb"effe dcd|"A" e2eA eAA:|\
                              [2 "Bb"ABBA GFG|"A" A2AE AEE|]

which keeps the visual flow of the ABC source a bit better.

« Last Edit: May 29, 2015, 01:06:47 PM by Jack Campin »
Logged
http://www.campin.me.uk/

I can't figure out how to quit but I will no longer check this group and have deleted all shortcuts to it.

TomBom

  • Respected Sage
  • ****
  • Offline Offline
  • Posts: 471
Re: Need help formatting an abc file into PDF
« Reply #12 on: May 29, 2015, 04:22:23 PM »

Quote
And ! to force a line break anywhere in ABC-code.

That doesn't always work.  Ideally I'd want both ! and \ to be usable in the same tune, but I can't do that in BarFly.  And abcm2ps fucked it up by using ! for something else entirely.

I use abcm2ps on a command line in Linux and ! and \ work perfectly well in the same tune.

BTW Geamparalele de la Murfatlar is a great tune. Is it from Romania?
Logged

Jack Campin

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 764
    • Jack Campin's Home Page
Re: Need help formatting an abc file into PDF
« Reply #13 on: May 29, 2015, 04:41:06 PM »

Quote
I use abcm2ps on a command line in Linux and ! and \ work perfectly well in the same tune.

How does that work?  In abcm2ps, !ff! means a fortissimo dynamic indication.  If ! meant a line break it ought to generate a two-note line.

Quote
BTW Geamparalele de la Murfatlar is a great tune. Is it from Romania?

Yep, Murfatlar is in Dobrogea, the largely Turkish-influenced part of the country of the southern Black Sea coast (probably the most ethnically heterogeneous region in Europe).
Logged
http://www.campin.me.uk/

I can't figure out how to quit but I will no longer check this group and have deleted all shortcuts to it.

Anahata

  • This mind intentionally left blank
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 6373
  • Oakwood D/G, C/F Club, 1-rows in C,D,G
    • Treewind Music
Re: Need help formatting an abc file into PDF
« Reply #14 on: May 29, 2015, 05:43:25 PM »

How does that work?  In abcm2ps, !ff! means a fortissimo dynamic indication.  If ! meant a line break it ought to generate a two-note line.

It seems that behaviour can be changed by a switch either in the command line or embedded in the ABC code.
From the abcm2ps manual
Code: [Select]
decoration character
                 Define the decoration separator. It may be set  to  either  !
                 (the  default) or +       (for compatibility with the ABC 2.0
                 standard).
Also this may be relevant (second paragraph especially):
Code: [Select]
linebreak separators
                 Define the character(s) for breaking music lines.  separators
                 is a blank-separated list of none, one, or more of: >EOL<
                 (system end-of-line character, the default), $, !, or >none<.

                 For compatibility, when >EOL<          is in the list, the  !
                 character  also  causes a line break if it does not look like
                 it is introducing a decoration.
This is abcm2ps-6.6.17 (June 10, 2012)

My own experience of using '!' in a file with abcm2ps is that once it has occurred anywhere in the file, it stops interpreting text line breaks as as output line breaks, thus messing up my formatting. I found removing all occurrences of '!' fixed it.
Logged
I'm a melodeon player. What's your excuse?
Music recording and web hosting: www.treewind.co.uk
Mary Humphreys and Anahata: www.maryanahata.co.uk
Ceilidh band: www.barleycoteband.co.uk

Pete Dunk

  • Typo Expert
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3690
Re: Need help formatting an abc file into PDF
« Reply #15 on: May 29, 2015, 05:55:51 PM »

How does that work?  In abcm2ps, !ff! means a fortissimo dynamic indication.  If ! meant a line break it ought to generate a two-note line.

Acknowledging Anahata's post which happened while I was writing this, we all seem to have different experiences of usage here caused by cross platform and different software.

Some software still allows ! at the end of a line to be a forced line break, but if used in one line then all subsequent lines must end in ! or carriage returns are ignored and auto line-wrapping takes over. !ff! Will still produce the expected dynamic marking in any event as ! is only a line break if there are no following characters on the line.

All very messy, which is why the in the current official standard the use of ! as a line break has been deprecated. Please don't shoot me I'm only the messenger!  ;D
Logged
Squeezing on the Isle of Oxney, UK
Primo (Serenellini) D/G
Isis D/G
Hohner B/E, G/C, C/F, Bb/Eb G/C/F
Liliputs D/G (G scale), C/F, Bb/Eb, Albrecht Custom D/G (G scale)

Jack Campin

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 764
    • Jack Campin's Home Page
Re: Need help formatting an abc file into PDF
« Reply #16 on: May 29, 2015, 06:24:49 PM »

Quote
! is only a line break if there are no following characters on the line.

I would only ever want to use it in situations like the one in my second tune above, where there ARE following characters in the line.  The point is to control ABC and staff line breaks independently, so you can get optimally readable source which also produces appropriately spaced staff notation.  A (non-escaped) linebreak in the ABC source already produces a staff line break, you don't need anything to reinforce that.

I pointed out exactly why I wanted to do this on the (pre-Yahoo) ABC forum when Moine and Gonzato first suggested that !<something>! syntax.  And was ignored.
Logged
http://www.campin.me.uk/

I can't figure out how to quit but I will no longer check this group and have deleted all shortcuts to it.

Anahata

  • This mind intentionally left blank
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 6373
  • Oakwood D/G, C/F Club, 1-rows in C,D,G
    • Treewind Music
Re: Need help formatting an abc file into PDF
« Reply #17 on: May 29, 2015, 06:47:23 PM »

Quote
The point is to control ABC and staff line breaks independently

I'm sure than was Jim Vint's intention when he wrote ABC2WIN. He was obviously thinking of popular programming languages where line breaks and blanks are all 'white space' and have identical semantics, but it was a flagrant violation of Chris Walshaw's original ABC standard which used line breaks and '\' and didn't use '!' at all. That also allows you to control staff line breaks and keep your formatting sensible, unless your idea of 'sensible' insists on allowing a staff line break in the middle of a source text line; I can't think why you would really need to do that.

I guess it was unwise of the ABC Plus folks to start using '!' for something different, but I'm glad to hear
it's deprecated as a line break, because huge compatibility problems resulted from its introduction in a piece of software which unfortunately became widely used.

Yes, I know, stable doors etc.
Logged
I'm a melodeon player. What's your excuse?
Music recording and web hosting: www.treewind.co.uk
Mary Humphreys and Anahata: www.maryanahata.co.uk
Ceilidh band: www.barleycoteband.co.uk

Anahata

  • This mind intentionally left blank
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 6373
  • Oakwood D/G, C/F Club, 1-rows in C,D,G
    • Treewind Music
Re: Need help formatting an abc file into PDF
« Reply #18 on: May 29, 2015, 06:49:08 PM »

Some software still allows ! at the end of a line to be a forced line break, but if used in one line then all subsequent lines must end in ! or carriage returns are ignored and auto line-wrapping takes over.

Yes, that's a more accurate description of the problem I mentioned earlier.
Logged
I'm a melodeon player. What's your excuse?
Music recording and web hosting: www.treewind.co.uk
Mary Humphreys and Anahata: www.maryanahata.co.uk
Ceilidh band: www.barleycoteband.co.uk

Pete Dunk

  • Typo Expert
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3690
Re: Need help formatting an abc file into PDF
« Reply #19 on: May 29, 2015, 07:35:00 PM »

I pointed out exactly why I wanted to do this on the (pre-Yahoo) ABC forum when Moine and Gonzato first suggested that !<something>! syntax.  And was ignored.

I don't know if you are a member of the current ABC Users Yahoo group Jack but I can assure you that things still can and do become quite heated in debate! Percussion notation is being discussed at the moment from some deeply entrenched positions, as for the matter of how to describe the shape of special note heads to abcm2ps, well, you need an umbrella to fend of the number of dummies (soothers to our U.S. brethren) that are being spat out!

On that basis alone simply being ignored seems quite civilised!
Logged
Squeezing on the Isle of Oxney, UK
Primo (Serenellini) D/G
Isis D/G
Hohner B/E, G/C, C/F, Bb/Eb G/C/F
Liliputs D/G (G scale), C/F, Bb/Eb, Albrecht Custom D/G (G scale)
Pages: [1] 2   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