Melodeon.net Forums
Discussions => Tunes => Topic started by: Andy Next Tune on May 19, 2011, 11:12:59 PM
-
I'm compiling a tunebook of the current Mersey Morris repertoire from various ABC sources, and its almost complete.
A few of the musicians prefer printed music and I've sorted out how to add a title page to the ABC file which then prints nicely with ABCexplorer.
Then one of them said "Brilliant, it would be even better if you can add an index of the tunes!" ???
So any suggestions on how I can automatically generate a list of all the tunes in that ABC archive from the T tags?
Thanks,
Andy
-
Here's what I would do.
Since I use GNU/Linux and GNU Emacs, I'd use grep mode (http://www.emacswiki.org/emacs/GrepMode) in Emacs and then tidy up the results. The quickest way would be to go to the directory with Dired and then M-x grep and put in your search term. In this case it would simply "T: *.abc" (without the quotes of course).
Of course you don't need to use Emacs ( :o ) to do a grep. You can do it from a shell and have the results saved to a file (named output-file.txt in the command below) which can be opened by a text editor of your choice. Grep will output each line where the term T: occurs.
grep T: *.abc > output-file.txt
If this extraction has to be done regularly then I'd be inclined to use an Emacs macro to automate it and get it into whatever format you want.
-
Then one of them said "Brilliant, it would be even better if you can add an index of the tunes!" ???
So any suggestions on how I can automatically generate a list of all the tunes in that ABC archive from the T tags?
Barfly (the ABC shareware software for Mac) has a menu option to do this easily, and very useful it is too. It lists all the tunes in a file by their T: field and generates the first two bars of music next to each title.
If this is what you want, then perhaps you should try to find someone with a Mac and Barfly ;)
-
Lester's method - with no added Mac or Linux ;D
Make a copy of the .abc file with a .txt extension
Open it in Word, Libre Writer or you txt editor of choice
Sort the file alphabetically
Delete all irrelevant stuff
-
Like Andrew I use GNU/Linux, and I have a script that will take a list of tunes (file references) and create an ABC book. I hadn't thought of trying to make an automatic index, but if your ABC files are all in one directory it's as simple as
grep -h ^T: *.abc >titles.txt
...and then a bit of editing.
In a similar vein, I'm working on a session tunes web site for a local session. My aim is to store ABC text only on the site, one tune per file, and enable tunes to be selected from a list of titles. Graphical representation of the tune and high quality downloadable PDF files are generated on the fly - the idea is that I can simply add new ABC files and everything else happens automatically. Very early and incomplete prototype here: http://bizet.treewind.co.uk/session/
(tech note: bizet.treewind.co.uk is a virtual machine provided by Bytemark (http://www.bytemark.co.uk))
-
I'd forgotten the 'joys' of command line operating systems, having left the world of Unix when it was still a battlefield between commercial releases, Open Source was viewed as heresy and Linux was the cute new kid trying to break the mould!
But the suggestions have shown me a few ways forward, and confirmed my suspicions about the lack of the required functionality in the main Windows ABC software.
In a few weeks time, daughter will return from Uni with her MacBook (:)
Thanks, Andy
PS Anahata - please keep us informed about your web project. I think a few people could be interested in something similar.