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: On the Naming of Parts and Other Tips and Hints  (Read 13720 times)

0 Members and 1 Guest are viewing this topic.

Pete Dunk

  • Typo Expert
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3706
On the Naming of Parts and Other Tips and Hints
« on: June 18, 2016, 11:34:47 AM »

I've always been irritated that the use of P:A in the body text of an ABC file produces a weedy capital A above the music that is almost indistinguishable from a chord of A. 'Proper' printed music has the parts marked with a large letter in a box which is what I was after. After making enquiries to a number of fellow transcribers (who are slightly less geeky than the Yahoo! group) I was given the answer so I thought I would share it here.

Two %% commands in the header set the rules for the whole piece, the font name and size are of course variable to suit your taste. If you've not seen the command %%barnumbers before, the number defines how often a numbered bar appears. 0 (zero) numbers the first bar in each line, 1 numbers every bar, 3 numbers every third bar and so on. These commands work with popular ABC software packages (probably not with Barfly) but may not work with online converters.

X:1
T:Sous les toits de la rue Tiquetonne
C:D. Denécheau
M:3/4
L:1/8
%%barnumbers 0
%%partsfont Arial, 20
%%partsbox 1
Q:1/4=160
K:Dmaj
P:A
G|:F3 E DC|B,3D Fd|c3B GB|F6|\
G2B2c2|B2G2D2|CD EF ED|C4-CG|
F3 E DC|B,3D Fd|c3B GB|F6|\
G2B2c2|d2c2B2|F2d2c2|B4-BG:|
P:B
|:ec Ge cG|dB Fd BF|cd ef ed|f2 ed cB|\
ec Ge cG|dB Fd BF|cd e2 dc|B6:|
P:C
"VARIATION"
G|:F3 E DC|B,C DE Fd|cd cB GB|F6|\
G2BG cG|BF ED CB,|CD EF ED|C2 D2 E2|
F3 E DC|B,C DE Fd|cd cB GB|F6|\
G2BG cG|dF cF BF|F2 dF cF|B4 G2:|
P:D
|:Gc eG ce|FB dF Bd|cd ef ed|f2 ed cB|\
Gc eG ce|FB dF Bd|cd e2 dc|B6:|
« Last Edit: August 23, 2016, 12:31:45 PM by Pete Dunk »
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)

Steve_freereeder

  • Content Manager
  • Hero Member
  • ***
  • Offline Offline
  • Posts: 7511
  • MAD is inevitable. Keep Calm and Carry On
    • Lizzie Dripping
Re: On the Naming of Parts
« Reply #1 on: June 18, 2016, 02:05:40 PM »

Brilliant sleuthing, thanks!  (:)
Well done Pete! This works brilliantly for me using EasyABC.  :|glug  :|glug  :|glug
Logged
Steve
Sheffield, UK.
www.lizziedripping.org.uk

Pete Dunk

  • Typo Expert
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3706
Re: On the Naming of Parts
« Reply #2 on: June 18, 2016, 11:07:10 PM »

Brilliant sleuthing, thanks!  (:)
This works brilliantly for me using EasyABC.  :|glug :|glug :|glug

From one nerd to another I'm pleased that you like it, enjoy! :D  >:E 8) 8)
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)

Ebor_fiddler

  • Chris
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 2340
  • Hohner 1040 C One-Row, Sandpiper D/G, Liliput C/F
    • Ebor Morris
Re: On the Naming of Parts
« Reply #3 on: June 18, 2016, 11:38:46 PM »

I have recently come across a number of tune abc's where instead of "T", "P" is used as the Title part. Is this common? And why would anyone do this?

Chris B.



Logged
I'm a Yorkie!
My other melodeon's a fiddle, but one of my Hohners has six strings! I also play a very red Hawkins Bazaar in C and a generic Klingenthaler spoon bass in F.!! My other pets (played) are gobirons - Hohner Marine Band in C, Hohner Tremolo in D and a Chinese Thingy Tremolo in G.

Steve_freereeder

  • Content Manager
  • Hero Member
  • ***
  • Offline Offline
  • Posts: 7511
  • MAD is inevitable. Keep Calm and Carry On
    • Lizzie Dripping
Re: On the Naming of Parts
« Reply #4 on: June 19, 2016, 12:48:55 AM »

I have recently come across a number of tune abc's where instead of "T", "P" is used as the Title part. Is this common? And why would anyone do this?

I don't know why people would do this - it's not something I've come across, but I would suggest it is bad practice to use P: as a substitute for the tune title.
Both the T: and the P: fields can contain a text string but they are treated differently by ABC translators.

The T: field is used in conjunction with the preceding X:(n) field to create an index for the tune. In a file containing a collection of several tunes, these fields together can be used to form an ordered list, which can be sorted, for example, in number order, or alphabetic order.

Additionally the T: field generates a proper looking title in a larger font and and centred on the page. Successive T: fields in the same tune will generate a set of centred sub-titles, while additional T: fields within the main body of the tune code can be used to generate a new centred title without the need for a new file. This is useful for naming parts of a medley, for example.

The P: field has two functions.
Firstly, it can generate a text string which is left-justified and situated just above the relevant stave. This can be useful to identify the various sections of a tune: 'A', 'B', 'C', etc... As Pete Dunk has discovered, it is possible to modify the P: field further to change the font and size, and to draw a box around the text.

Secondly, the P: field can have a special function when defined in the tune header lines (i.e. before the K: field). The P: field can be used to specify the order and number of times the various tune sections are to be played when using ABC software with playback facility.
For example: the header line P: 3(AABB)C will play a tune in the order AABB AABB AABB C, providing the individual parts are also appropriately coded P:A, P:B, P:C, in the main body of the tune.

So in summary, use the T: field to generate tune titles and sub-titles and keep the P: fields for identification and correct playback of the various sections within a tune.
Logged
Steve
Sheffield, UK.
www.lizziedripping.org.uk

Jack Campin

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 764
    • Jack Campin's Home Page
Re: On the Naming of Parts
« Reply #5 on: June 19, 2016, 01:45:18 AM »

Quote
Quote
I have recently come across a number of tune abc's where instead of "T", "P" is used as the Title part. Is this common? And why would anyone do this?
I don't know why people would do this - it's not something I've come across, but I would suggest it is bad practice to use P: as a substitute for the tune title

I've done it quite often, by accident.  It happens when you switch tunes from being part of a medley to being a free-standing item.  I'd guess that explains why other people do it, too.

Not something you really want the rest of the world to see.

Pete's suggestion doesn't improve BarFly's display but it doesn't get in the way either, it's perfectly portable.  There is a glitch: the word VARIATION might appear above or below the staff depending on display settings.  You could use "^VARIATION" to force it to go above the staff, or else you could write P:C(VARIATION) - part labels don't have to be single letters (though I think implementations vary a lot in what they accept beyond that).
« Last Edit: June 19, 2016, 01:57:47 AM 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.

Pete Dunk

  • Typo Expert
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3706
Re: On the Naming of Parts
« Reply #6 on: June 19, 2016, 12:53:03 PM »

There is a glitch: the word VARIATION might appear above or below the staff depending on display settings.  You could use "^VARIATION" to force it to go above the staff, or else you could write P:C(VARIATION) - part labels don't have to be single letters (though I think implementations vary a lot in what they accept beyond that).

My software automatically prints anything in quotes (" ") above the staff but I do see the point that including the caret symbol "^" ensures that this is the case across all platforms. The %% commands whilst not causing Barfly any problems obviously don't have the desired effect either, if they did P:C(VARIATION) would produce:

C(VARIATION) in a big box! See attached PDF  ;D ;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)

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
Re: On the Naming of Parts
« Reply #7 on: June 19, 2016, 10:53:49 PM »

My software automatically prints anything in quotes (" ") above the staff but I do see the point that including the caret symbol "^" ensures that this is the case across all platforms.

More than that, I think the caret also indicates that the text is not guitar chords but just text, thus preventing certain substitutions, like b => â™­, and transposition by abc2abc in transpose mode.
Logged
Слава Україні !
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: 3706
Re: On the Naming of Parts
« Reply #8 on: June 19, 2016, 11:15:57 PM »

More than that, I think the caret also indicates that the text is not guitar chords but just text, thus preventing certain substitutions, like b => â™­, and transposition by abc2abc in transpose mode.

Ah yes! I now remember a transcription I did a couple of months ago that turned a b in a text string into a flat symbol and I re-wrote the text line to avoid the problem because I had no idea how to make the text print as I wanted it. Thank you. We live and learn!  ;)
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)

vof

  • Regular debater
  • ***
  • Offline Offline
  • Posts: 221
Re: On the Naming of Parts
« Reply #9 on: June 19, 2016, 11:16:48 PM »

Additionally the T: field generates a proper looking title in a larger font and and centred on the page. Successive T: fields in the same tune will generate a set of centred sub-titles, while additional T: fields within the main body of the tune code can be used to generate a new centred title without the need for a new file. This is useful for naming parts of a medley, for example.

I produce the sheet music for the (newer) musicians in my morris side and associated band and to minimize the number of sheets in use put multiple T: fields and tune bodies in a file, each of which is used to produce a two A4 page PDF which I print double sided. In this way, I can get six, seven or eight tunes on one sheet of paper.  I could produce larger files with more than two A4 sides but managing the position of a single page break in the file makes life much easier.

I also have generated a standard set of %% commands which I include in all my files between the X: command and the first T: command so that there is a standard appearance of text, chord, part name, etc across all my printed music which certainly helps me as a still very novice instrumental musician understand what the dots are telling me to do. The commands I use I have discovered through experimentation work fine in ABCexplorer. Here is an example:

X:54
%start Wyld Morris tune sheet formatting block
% uncomment the following four lines to maximise usable space on page
% %%pageheight 29.7cm
% %%topspace 0.5cm
% %%topmargin 0.0cm
% %%bottommargin 0.0cm
%
%%titlefont DomCasual 24
% %%titleformat T-1 P1
%%subtitlefont DomCasual 24
%%composerfont DomCasual 12
%%partsfont Helvetica-Bold 14
%%vocalfont Helvetica 12
%%wordsfont Helvetica 12
%%staffsep 24
%%gchordfont Helvetica-Oblique-Bold 14
%%partsbox 1
%end Wyld Morris tune sheet formatting block
T:Polka Saint Michel (G)
C:Chris Shaw
M:4/4
L:1/8
K:Gmaj
Q:1/4=180
P:A
|:"Bm"B2>c2d2B2|"C"G4E4|"D"F2>G2A2F2|"Em"GFGAB4|
|"Bm"B2>c2d2B2|"C"G4E4|"D"F2>G2A2F2|"Em"E8:|
P:B
|:"C"E2>F2G2E2|"D"F2>G2A2F2|"C"G2E2A2G2|"Bm"FGAFD4|
|"C"E2>F2G2E2|"D"F2>G2A2F2|"C"G2E2"D"A2G2|"Em"E8:|
P:C
|:"G"d2G4d2|"C"e2G4e2|"G"d2g2gab2|"D"a6c2|
|"G"B2d2d2ef|g2>a2b2g2|"D"a2g2fgaf|1"G"g6e2:|2"G"g8|]

(Resulting PDF attached)

I have noticed that other software which uses/understands ABC can react/respond differently to ABCexplorer - the best of this software implements what it can and does its best with the rest (which is usually to silently ignore it).

My most recently acquired ABC software, which I am very impressed with, is TradMusician for my Nexus 7 Android tablet. It is free and highly recommended. It accepts (but does not necessarily implement) virtually all the %% commands I use without a problem. The only one that seems to throw it is %%pageheight:
http://nicolasjouve.fr/tradmusician/
There was also a thread on thesession about it 18 months ago:
https://thesession.org/discussions/35217

Vince
Logged
Vince O'Farrell
Dino BPII; Hohners: red Erica G/C; couple of 1040s in C and G project boxes.

Pete Dunk

  • Typo Expert
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3706
Re: On the Naming of Parts
« Reply #10 on: June 19, 2016, 11:23:51 PM »

Several lines of your code start with % %%. Surely the first % followed by a space forces an 'ignore this line' command?
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)

vof

  • Regular debater
  • ***
  • Offline Offline
  • Posts: 221
Re: On the Naming of Parts
« Reply #11 on: June 19, 2016, 11:45:09 PM »

Several lines of your code start with % %%. Surely the first % followed by a space forces an 'ignore this line' command?

Yes Pete, the comment line immediately preceding the first four such lines tries to explain how to use them. The example I posted has such lines commented out and therefore inactive but easily edited back in if necessary by removing the leading % and immediately following space characters. 50 years in software design and coding leads me to do this sort of thing (even though ABC is not a particularly elegant programming language). It would be nice if ABC supported macros...  ;)

Vince
Logged
Vince O'Farrell
Dino BPII; Hohners: red Erica G/C; couple of 1040s in C and G project boxes.

Pete Dunk

  • Typo Expert
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3706
Re: On the Naming of Parts
« Reply #12 on: June 20, 2016, 12:19:17 AM »

50 years in software design and coding leads me to do this sort of thing (even though ABC is not a particularly elegant programming language). It would be nice if ABC supported macros...  ;)

Vince

Fifty years? That pretty much pre-dates any of my computer knowledge by at least two decades and I started with a Sinclair ZX81! Macros? really? aren't they what makes Office documents so vulnerable to hacking?
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: On the Naming of Parts
« Reply #13 on: June 20, 2016, 12:45:15 AM »

ABC does support macros. Phil Taylor designed a macro system for BarFly which other implementors managed to incorporate with very little effort or dispute. I suspect it may still be available, undocumented, in many more implementations than admit to it.

For a while I used it quite heavily, to abbreviate keyboard chords. Phil didn't see that application coming but it worked fine.
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.

vof

  • Regular debater
  • ***
  • Offline Offline
  • Posts: 221
Re: On the Naming of Parts
« Reply #14 on: June 20, 2016, 01:14:33 AM »

50 years in software design and coding leads me to do this sort of thing (even though ABC is not a particularly elegant programming language). It would be nice if ABC supported macros...  ;)

Vince

Fifty years? That pretty much pre-dates any of my computer knowledge by at least two decades and I started with a Sinclair ZX81! Macros? really? aren't they what makes Office documents so vulnerable to hacking?

I'm old Pete!! I was programming a KDF9 in Algol 60 at university in 1965-68 then started with ICT/ICL as a 1900 PLAN/assembler programmer in 1968. They were the days of large mainframes, paper tape, 80 column punched cards and as you suggest, pre-dated personal type computers by 10-15 years.

You are right about MS Office VB-style macros. The type of macro I was referring to is less mini executable program and more simple text substitution of a short string by a longer expansion.

ABC does support macros. Phil Taylor designed a macro system for BarFly which other implementors managed to incorporate with very little effort or dispute. I suspect it may still be available, undocumented, in many more implementations than admit to it.

For a while I used it quite heavily, to abbreviate keyboard chords. Phil didn't see that application coming but it worked fine.

I'd be very interested Jack in any info or pointers toward documentation you can give me on this macro scheme so I can do some investigation of my own. I'm a Johnny-come-lately to ABC so all of the activity on ABC pre about 2010 I missed.

Vince
Logged
Vince O'Farrell
Dino BPII; Hohners: red Erica G/C; couple of 1040s in C and G project boxes.

Pete Dunk

  • Typo Expert
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3706
Re: On the Naming of Parts and Other Tips and Hints
« Reply #15 on: August 23, 2016, 12:56:06 PM »

I've changed the title of this thread as a number of other very useful tips and comments have been added and rather than start another thread along similar lines I can add my new discovery here.. Following an enquiry to Steve Mansfield's Lesession site about making chord names larger I had a mess about and came up with an answer that is very similar to the parts font and size.

%%gchordfont Arial, 18  Change font name and size to suit. %%gchordfont Arialbold, 18 does what it says too. Arialitalic doesn't work however.

%%gchordbox also works but may muddy the waters a little.
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)

Pete Dunk

  • Typo Expert
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3706
Re: On the Naming of Parts and Other Tips and Hints
« Reply #16 on: August 23, 2016, 01:13:19 PM »

Here's a sample using %%gchordfont Arialbold, 18
« Last Edit: August 23, 2016, 01:15:02 PM by Pete Dunk »
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)

vof

  • Regular debater
  • ***
  • Offline Offline
  • Posts: 221
Re: On the Naming of Parts and Other Tips and Hints
« Reply #17 on: August 23, 2016, 05:46:09 PM »

I've changed the title of this thread as a number of other very useful tips and comments have been added and rather than start another thread along similar lines I can add my new discovery here..
That is a good idea Pete, or even make it sticky...?

Following an enquiry to Steve Mansfield's Lesession site about making chord names larger I had a mess about and came up with an answer that is very similar to the parts font and size.

%%gchordfont Arial, 18  Change font name and size to suit. %%gchordfont Arialbold, 18 does what it says too. Arialitalic doesn't work however.

%%gchordbox also works but may muddy the waters a little.

This is the command I use too for chord fonts - see my Polka St Michel example above.

What is important is to specify the font name exactly as it is known to Ghostscript (assuming you are using e.g. ABCexplorer on Windows). I find the way GS works with fonts confusing but I have managed to tell the version of GS (7.06) that comes with ABCexplorer how to find Dom Casual which I like to use for headings.

1. Note first that ABCexplorer will show you the basic set of font mappings if you look at Options, then the External Tools tab. It looks as if you can add font definitions to that file (in my case c:/gs/gs7.06/lib/Fontmap.GS) - see http://ghostscript.com/FAQ.html for how to do it. I originally did it a different way, for a reason I can't recall, which now seems much more complicated, so no more of that.

2. I have just checked the GS FAQ method and it seems to work. I edited Fontmap.GS (after saving a copy of the original!) to include a definition of Arial Bold which referenced the standard Windows Arial Bold TTF font file (arialbd.ttf). I like to use hyphens to make names in which spaces are disallowed more readable so my GS-defined name was Arial-Bold. This is the line I added:
/Arial-Bold      (arialbd.ttf)
I then put a copy of arialbd.ttf in the top-level GS fonts folder and used my GS-defined font name (Arial-Bold) in ABC. The onscreen dots and the created PDF both used Arial Bold.

You should be able to do a similar thing for Arial-Italic using the standard font file ariali.ttf
(I've just tried it and it works.)

HTH.

Vince
(edited to add comment about Arial Italic.)
« Last Edit: August 23, 2016, 05:56:37 PM by vof »
Logged
Vince O'Farrell
Dino BPII; Hohners: red Erica G/C; couple of 1040s in C and G project boxes.

baz parkes

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1894
    • All Blacked Up
Re: On the Naming of Parts and Other Tips and Hints
« Reply #18 on: August 23, 2016, 10:48:11 PM »

In the words of the immortal Eric..."You hum it, son, I'll play it..."... :|glug :|glug
Logged
On the edge of Cheshire's Golden Triangle, apparently...

Pete Dunk

  • Typo Expert
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3706
Re: On the Naming of Parts and Other Tips and Hints
« Reply #19 on: August 24, 2016, 07:44:06 PM »

That is a good idea Pete, or even make it sticky...?

Thanks for the reply Vince, I've made it sticky for the time being but it may be unpinned if it remains out of use for a while.

Here's a page you may find useful, all of the ABC 2.1 %% commands complete with explanation and syntax.

The font business went straight over my head!
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]   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