[EMAIL PROTECTED] writes:
> Once I started to get seriously interested in open-source
> music, I realized that Finale/ETF was problematic because
> it's only implemented in commercial closed-source software,
> and although the format isn't a trade secret, the documentation
> is incomplete and only available for download by registered
> users of a Coda product. At this time I knew about Brian
> Victor's Neume project (neume.org), but not about LilyPond,
> so I dove in and started writing an open-source conversion
> program (http://sourceforge.net/project/?group_id=8169)
> to convert from Finale format to the openly-defined
> NIFF format used by Neume. I stopped working on the
> converter because Brian's NIFF-writing routines weren't
> ready yet, and also because I got busy setting up FreeNote.

How far did you get with the ETF reading routines? I'd like to try
writing a convertor to LilyPond some time, if someone can give me
interesting files. (Reverse engineering requires a working Finale with
file-saving options (I don't have one, and don't want to buy one).)

A brief look at an ETF file revealed some ideas (I analyzed the cello
suite prelude). The pitch and duration information is there, so I
think that basic conversion script would be quite easy.

        # Finale some interesting gobs from an .etf file

        program_name = 'abc2ly'
        version = '@TOPLEVEL_VERSION@'
        if version == '@' + 'TOPLEVEL_VERSION' + '@':
                version = '(unknown version)'           # uGUHGUHGHGUGH

        import __main__
        import getopt
        import sys
        import re
        import string
        import os

        def gulp_file(f):
                return open (f).read ()


        f = sys.argv[1]

        str = gulp_file (f)
        str = re.sub ('\r', '\n', str)
        str = re.sub (' +\n +', ' ', str)

        fo = open ('out.itf', 'w')
        fo.write (str)
        fo.close ()
        ls = open ('out.itf').readlines ()


        for l in ls:
                m =  re.match (r"""\^BC\(([0-9]+)\) ([0-9]+) .*$""", l)
                if m:
                        bn = string.atoi (m.group (1))
                        where = string.atoi (m.group (2)) / 1024.0

                        print 'note at: barnumber %d, %f quarters' %  (bn, where)


                m = re.match (r"""\^eE\(([0-9]+)\) [0-9]+ [0-9]+ ([0-9]+) [0-9]+ [^ ]+ 
([0-9]+) [0-9]+ ([0-9-]+) .*""", l)

                if m:
                        nn = string.atoi (m.group (1))
                        iduration = string.atoi (m.group (2))           
                        iflags = string.atoi (m.group (3))

                        duration = iduration / 1024.0
                        flags =[]
                        if (32 & iflags):
                                flags.append ('slur')

                        ipitch = string.atoi (m.group (4))

                        pitch = round(ipitch/ 16) + 3
                        if ipitch % 1 : 
                                flags . append ('alteration')


                        print 'note: no %d flags %s, pitch %d, duration %f' % (nn, 
`flags`, pitch, duration )

> to process music from Mutopia quite efficiently into Finale format,
> for example, but you folks would presumably be more interested in
> the reverse: e.g. I think I'm currently the only site on the web
> that is making the Bach two-part inventions freely available in
> source format, and if LilyPond has MIDI input as well as output, I'd
> think it could be quite

LilyPond has a MIDI-2-ly convertor, but I found a couple of bugs when
I tried it for a two-part invention (also, the fact that ornaments and
tied notes are played fully confuses the convertor).  I think that it
is more worthwhile to pursue a etf2ly conversion tool.

> converting to it is a step backward, not forward. (Not an
> actual quote.) Even if many of you agree with him that
> LilyPond->Finale is pointless, you might presumably be more
> interested in Finale->LilyPond. Even when the legal issues
> are trivial (as with PD editions of PD music), there are
> significant moral and practical issues, which I've discussed
> at the following url:ihttp://freenote.org/mirroring.shtml.

I think that the moral issues aren't very big. The bigger problem is a
version control issue: what happens when someone  updates a finale
file, but not the .ly file.

-- 

Han-Wen Nienhuys   |   [EMAIL PROTECTED]    | http://www.cs.uu.nl/~hanwen/

Reply via email to