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

Author Topic: EasyABC for Mac - formatting commands for changing stave spacing, scale etc.  (Read 4464 times)

0 Members and 1 Guest are viewing this topic.

Steve_freereeder

  • Content Manager
  • Hero Member
  • ***
  • Offline Offline
  • Posts: 7511
  • MAD is inevitable. Keep Calm and Carry On
    • Lizzie Dripping

Recently my ancient MacPro finally died and I replaced it with a new iMac, running OS Yosemite. This means that I can no longer run my long-trusted BarFly ABC software and I have been forced to switch to EasyABC instead, which mostly suits my purposes well enough.

For me, one of the most useful features of BarFly was the excellent range of options for controlling the stave distances, scale settings, etc., when converting ABC files to PostScript or PDF format. For teaching purposes, I often need to increase the stave spacing from the default, for example to import a PDF into Powerpoint which I then use to insert additional information (fingering, tablature, etc) between the individual staves of a tune. It was easy to do this in BarFly, but not, at first sight, possible to do it in EasyABC. But with some digging around in the more obscure features of EasyABC, I have discovered a way of forcing different stave spacing and scales. I thought it was worth sharing with you all. Apologies if you know this already and I’m merely re-inventing a well-used wheel.  :|bl

EasyABC has a ‘Help’ dropdown menu which includes ‘Show fields and commands reference’ --> 'Spacing’ and therein lies the key...

ABC commands need to be prefaced by ‘%%’ and can be placed either before the X: field of a tune, or else inserted in the tune header, i.e. after the X: field.

For my formatting needs, the useful commands are:

%%maxstaffsep <num> (suggested value 200)
%%staffsep <num> (default value = 46)
%%scale <num> (default value = 0.75)


Note that the %%staffsep command has to follow a %%maxstaffsep command, otherwise it doesn’t work. (It took me several days to finally work this out!  ::) ). Set the %%maxstaffsep value to something large - I suggest 200. The default staff separation value seems to be 46 (units in pixels?? points??), but increasing this to, say, 100 or 150, gives a very useful extra space between the staves.

The %%scale command enables all the elements of the music notation to be increased or reduced in size. The default value appears to be 0.75 and is very sensitive to minor changes. E.g. a scale value of 0.85 results in significantly larger music.

If you have an ABC file with multiple tunes (X:1, X:2, X,3….) the formatting commands can be placed before the first X: field and all subsequent tunes will be affected equally. If you want to format individual tunes differently, then you need to re-specify the commands after each X: field, i.e. within the tune header. When formatted using these commands, you can see the effect in the music viewing pane of EasyABC, but more crucially, the changes are carried through to a PDF export too.

Here are a couple of examples of the usage:

1. Affects all tunes in the file
 â€”———————————————
%%maxstaffsep 200
%%staffsep 100
%%scale 0.8
X:1
(Lines of ABC code)

X:2
(Lines of ABC code)

X:3
(Lines of ABC code)

etc...


2. Affects individual tunes differently
 â€”———————————————
X:1
%%maxstaffsep 200
%%staffsep 50
%%scale 0.75
(Lines of ABC code)

X:2
%%maxstaffsep 200
%%staffsep 100
%%scale 0.82
(Lines of ABC code)

X:3
%%maxstaffsep 200
%%staffsep 60
%%scale 0.75
(Lines of ABC code)


Hope this is useful to some of you. If you care to experiment and report back, I will perhaps insert this as an article in the forum home page.
Logged
Steve
Sheffield, UK.
www.lizziedripping.org.uk

Lester

  • MADman
  • Mods and volunteers
  • Hero Member
  • ***
  • Offline Offline
  • Posts: 9327
  • Hohners'R'me
    • Lester's Melodeon Emporium and Tune-a-Rama

Ta!

Anahata

  • This mind intentionally left blank
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 6767
  • Oakwood D/G, C/F Club, 1-rows in C,D,G
    • Treewind Music

It almost certainly uses abcm2ps as its conversion engine.
You'll find all the abcm2ps command line switches, which can be embedded in the ABC code after %% as described above, in the abcm2ps manual (there will be lots of copies of this on the web: this is the first one that Google found for me)
Logged
Слава Україні !
Music recording and web hosting: www.treewind.co.uk
Mary Humphreys and Anahata: www.maryanahata.co.uk
Ceilidh band: www.barleycoteband.co.uk

Steve_freereeder

  • Content Manager
  • Hero Member
  • ***
  • Offline Offline
  • Posts: 7511
  • MAD is inevitable. Keep Calm and Carry On
    • Lizzie Dripping

It almost certainly uses abcm2ps as its conversion engine.
You'll find all the abcm2ps command line switches, which can be embedded in the ABC code after %% as described above, in the abcm2ps manual (there will be lots of copies of this on the web: this is the first one that Google found for me)

Thanks for the link to the abcm2ps manual.  (:)
Yes - I'm sure you're right about EasyABC using abcm2ps to convert the files. BarFly has a nifty dialogue box which appears when you export an ABC file to PDF. It makes setting the various parameters such as staff spacing very easy. But EasyABC has no such refinement, sadly.

I would use abcm2ps as described in the manual, except I'm not sure how/where to run the program. Presumably from a Terminal command line on my Mac? I've had a quick try at this but not got anywhere. Do I have to navigate to the same directory as my ABC files and run abcm2ps from there?

Logged
Steve
Sheffield, UK.
www.lizziedripping.org.uk

Anahata

  • This mind intentionally left blank
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 6767
  • Oakwood D/G, C/F Club, 1-rows in C,D,G
    • Treewind Music

Presumably from a Terminal command line on my Mac?
Yes...

Quote
Do I have to navigate to the same directory as my ABC files and run abcm2ps from there?
That's what I do in Linux. Easiest way because you know the output is going to be created in the current directory too.
Logged
Слава Україні !
Music recording and web hosting: www.treewind.co.uk
Mary Humphreys and Anahata: www.maryanahata.co.uk
Ceilidh band: www.barleycoteband.co.uk

Steve_freereeder

  • Content Manager
  • Hero Member
  • ***
  • Offline Offline
  • Posts: 7511
  • MAD is inevitable. Keep Calm and Carry On
    • Lizzie Dripping

Thanks Anahata!
I'll give it a try.
Logged
Steve
Sheffield, UK.
www.lizziedripping.org.uk

Stiamh

  • Old grey C#/D pest
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3611
    • Packie Manus Byrne

I had to get a bit deeper into this subject than I cared to when the web-based ABC converter I had been using (to create and maintain PDF versions of a band tunebook containing 200+ tunes) was replaced with a new version that worked differently, or rather, didn't work.

I tried using the %% formatting commands with ABCExplorer or EasyABC but was not satisfied with the results.

I work on PCs and installed ghostscript and abcm2ps which do the job, in two stages (ABC to PS, PS to PDF) very well indeed. But I am very glad of my command-line experience from pre-GUI days, without which I would have found the process excessively baffling.

I have found Guido Gonzato's ABCPlus manual a huge help - it gives lots of examples of how you can use all these commands. It is available, along with gs and abcm2ps at http://abcplus.sourceforge.net/

Anahata

  • This mind intentionally left blank
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 6767
  • Oakwood D/G, C/F Club, 1-rows in C,D,G
    • Treewind Music

+1 for Guido Gonzato's manual - a fine piece of work and my ABC bible.

Also true the command line is a culture shock if you're not used to it. The great thing about it is you can easily* write short scripts to combine the command line tools. So I have one called vabc which converts to ps (with a bunch of default switch settings which I don't have to remember and type each time) and then runs gv (Ghostview) to show it. A few more tricks enable me to update the display in a few keystrokes from my editor, not quite note by note as you add them like ABC explorer but good enough for quick checks while you are fixing errors.

*OK, for some values of "easily". I'm still not very good at bash...
Logged
Слава Україні !
Music recording and web hosting: www.treewind.co.uk
Mary Humphreys and Anahata: www.maryanahata.co.uk
Ceilidh band: www.barleycoteband.co.uk
Pages: [1]   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