Melodeon.net Forums

Discussions => Tunes => ABC => Topic started by: Richard Shaul on January 11, 2020, 04:08:08 PM

Title: Spaces in ABC
Post by: Richard Shaul on January 11, 2020, 04:08:08 PM
Easy ABC seems to be fairly forgiving as to where you use spaces, but is there any best practice e.g. before or after bar likes or chords?
Title: Re: Spaces in ABC
Post by: Steve_freereeder on January 11, 2020, 04:46:16 PM
Some people like to put spaces in, others don't. The ABC works whichever you choose.
ABC is just another form of music notation, so whichever method makes the notation clearer for you and your users is the one to go for.
Title: Re: Spaces in ABC
Post by: Pete Dunk on January 11, 2020, 07:50:19 PM
The functional spaces are those that group quavers and smaller notes together with beams, these are the only important ones because they affect the way music is displayed on the page. The rest are optional and a matter of personal taste as Steve has already said.
Title: Re: Spaces in ABC
Post by: Roger Hare on January 12, 2020, 07:47:36 AM
Easy ABC seems to be fairly forgiving as to where you use spaces, but is there any best practice
e.g. before or after bar likes or chords?
I too am an EasyABC user.

I'm a firm believer in using spaces wherever 'necessary'. 'Best practice' IMO is using spaces to
improve the readability, comprehensibilty and maintainability of the ABC files. This can mean
including as many spaces as the market will bear - but not always...

'Maintainability' can be important when looking at old, 'legacy' ABC files - the spaces make it easier
to spot and fix errors (which may be due to coding errors, or corruption/fragmentation of the file).
A program to spot the grosser errors is a good thing, but 'A1 eyeball' is best -  the spaces help
to spot those errors.

All of this is very much a computer programmer's view.

I've seen it said that too many spaces increases file size unacceptably. I just did a 'quick and dirty'
conversion of a file from 'nospaces' to 'spaces' and the increase in size was marginally greater than
10%. Personally, I think that the advantage in increased readability outweighs the disadvantage of
increased file size.

Chacun à son goût... 8)
Title: Re: Spaces in ABC
Post by: Anahata on January 12, 2020, 08:59:33 AM
The file size argument is ridiculous. ABC is by far the most compact way of representing music in a computer file and a few extra spaces don't change that.

I like to put spaces around bar lines and sometimes in the middle of a bar (e.g. between beats 2 and 3 of  a 4/4). I also try to keep lines below 80 characters wide by  breaking lines with '\' where necessary, but I'm definitely an "old school" programmer.
Title: Re: Spaces in ABC
Post by: Roger Hare on January 12, 2020, 10:54:53 AM
(1) The file size argument is ridiculous...
(2) ABC is by far the most compact way of representing music in a computer file...
(3) I like to put spaces around bar lines and sometimes in the middle of a bar
(e.g. between beats 2 and 3 of  a 4/4)...
(1) I completely agree...
(2) Yup! About 2 years ago, I did a 'rough and ready' comparison of file sizes for ABC and
and lilypond representations of the same tune. For simple tunes, lilypond files were ~5 times
larger than the equivalent ABC files. (At the time, you said: "...It is much more verbose than ABC...")
(3) I didn't phrase it quite as compactly as you have(!), but that's what the approach I'm using
effectively boils down to...
SimplePortal 2.3.5 © 2008-2012, SimplePortal