Skip to main content
7 of 9
deleted 106 characters in body
LeFauve
  • 402
  • 2
  • 6

##AWK BASH: 66 86 67 74 bytes##

As requested by Martin Büttner, I added a tempo since after checking the ABC Notation standard, it seems there is no defined default value for this (thanks nutki for pointing this).
I also write into a disk file (a) instead of STDOUT since the question wanted explicitly "a file on disc".

a=C3z;echo "X:1
K:A
Q:99
CzCz$a$a$a3$a$a$a$a${a}3Cz$a$a$a${a}3CzCzCzCzC">a

I put a tempo of 99 which causes the audio file to last 22 seconds; It's slower than my previous version, but at least now it is supposed to be the same length on every ABC player, and it fit under 30 seconds.

It looks ... very much like the previous version as you can see: Last (I hope :o) ) version of 2015's score

Here is the new midi file.

##First BASH version (tempo is missing)## Why didn't I think to this first... :o)

That's 22 less bytes than with AWK, for the same result

a=C3z;echo "X:1
K:A
CzCz$a$a$a3$a$a$a$a${a}3Cz$a$a$a${a}3CzCzCzCzC"

Like the previous version in AWK, it write on stdout a valid "ABC" notation file (thanks Tobia for finding out that the "L" statement was optional)

It looks like this: last version of "2015" partition

And it sounds exactly like the previous version.

Previous version in AWK (86 Bytes)

Here is a new version; a little longer, but with a more accurate timing. I let the first version bellow for comparison/reference:

BEGIN{a="C3z";print"X:1\nK:A\nL:1/8\nCzCz"a a a"3"a a a a a"3Cz"a a a a"3CzCzCzCzCz";}

This is still a valid "abc" file, which looks like this: score of 2015

Here is the new midi file (I accelerated the tempo to stay under the 30 seconds limit).

First version in AWK (66 Bytes):##

This is a lot less interesting than my previous answer, but it is a lot shorter, so:

BEGIN{print"X:1\nK:A\nL:1/4\nCCC2C2C2zC2C2C2C2C2zCC2C2C2C2zCCCCC"}

This outputs a valid "abc" file, which can be read into (among others) EasyABC. It will look like this: Score of "2015" in morse

and it will sound like this (midi file). +

LeFauve
  • 402
  • 2
  • 6