Re: etf2ly off-by-two in minor scales?

2003-10-06 Thread Aaron
hi, I noticed a etf2ly post.
I have a lot of songs to convert from finale etf to ly.
While I realize that this is not top priority and that much of the
problem lies on the etf side, a good convertor would only help the
cause.
So much space is spent on the web page showing how much better lilypond
is, but the way to prove it is to make it easy for the finale folks to
compare for themselves.

Boy I wish I was a programmer

I have many problems with etf2ly and am planning to post them with
examples to the group soon.

I do remember a number of discussions on musicxml2ly and the negitive
response to in on the list.

However if etf is at fault for the conversion problem from finale to
lilypond, maybe it is the way to go.

Someone who has been working on a symphony in finale shouldn't need to
start over from scratch.

I realize that this is an issue of time and resources an that the first
development effort must go into make lilypond the best it can be.

But for me at least it is not quicker reentering 300 songs by hand, and
no I don't need practice touch typing thank you.

Aaron



___
Lilypond-user mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-user


Re: etf2ly off-by-two in minor scales?

2003-10-06 Thread Arvid Grøtting
Arvid Grøtting <[EMAIL PROTECTED]> writes:

> Oh, and I fixed one other thing while I was at it.  ;-)

Everything is not great, however.

Whole measure rests disappear (when a stave is silent for a complete
measure).  This confuses the timing, giving errors in the pitches when
there's a key change.  I may have to dig into this more some day...

-- 

Arvid



___
Lilypond-user mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-user


Re: etf2ly off-by-two in minor scales?

2003-10-06 Thread Arvid Grøtting
Arvid Grøtting <[EMAIL PROTECTED]> writes:

> This seems to be a etf2ly issue.  Is it a known bug?  Is there an easy
> fix?

OK, I know it's rude of me to follow up to myself, but there's a fix
now.  Ugly, but it seems to work for fis minor with at least one
piece; YMMV.

Oh, and I fixed one other thing while I was at it.  ;-)

--

Arvid

Cut here, if you see a great need to cut at all: --->8--
--- scripts/etf2ly-orig.py  Tue Sep  9 12:24:22 2003
+++ scripts/etf2ly.py   Mon Oct  6 17:57:38 2003
@@ -97,17 +97,30 @@
while accidental_bits < 256:
p = transpose (p, (3,0))
accidental_bits = accidental_bits + 1
-   
+
+   if bank_number == 1:
+   # minor scale
+   p = transpose (p, (5, 0))
p  = (p[0] % 7, p[1])
 
-   return p
+   return KeySignature (p, bank_number)
 
 # should cache this.
-def find_scale (transposition):
+def find_scale (keysig):
cscale = map (lambda x: (x,0), range (0,7))
-   trscale = map(lambda x, k=transposition: transpose(x, k), cscale)
-
+   print "cscale: ", cscale
+   ascale = map (lambda x: (x,0), range (-2,5))
+   print "ascale: ", ascale
+   transposition = keysig.pitch
+   if keysig.sig_type == 1:
+   transposition = transpose(transposition, (2, -1))
+   transposition = (transposition[0] % 7, transposition[1])
+   trscale = map(lambda x, k=transposition: transpose(x, k), ascale)
+   else:
+   trscale = map(lambda x, k=transposition: transpose(x, k), cscale)
+   print "trscale: ", trscale
return trscale
+
 def EDU_to_duration (edu):
log = 1
d = 4096
@@ -384,7 +397,25 @@
str = """\nverse%s = \\lyrics {\n %s}\n""" %  (encodeint (self.number 
- 1) ,str)
return str
 
+class KeySignature:
+   def __init__(self, pitch, sig_type = 0):
+   self.pitch = pitch
+   self.sig_type = sig_type

+   def signature_type (self):
+   if self.sig_type == 1:
+   return "\\minor"
+   else:
+   # really only for 0, but we only know about 0 and 1
+   return "\\major"
+   
+   def equal (self, other):
+   if other and other.pitch == self.pitch and other.sig_type == 
self.sig_type:
+   return 1
+   else:
+   return 0
+   
+
 class Measure:
def __init__(self, no):
self.number = no
@@ -502,9 +533,10 @@
e = ''

if g:
-   if last_key <> g.key_signature:
-   pitch= g.key_signature 
 
-   e = e + "\\key %s \\major " % (lily_notename 
(pitch))
+   if g.key_signature and not 
g.key_signature.equal(last_key):
+   pitch= g.key_signature.pitch
+   e = e + "\\key %s %s " % (lily_notename 
(pitch),
+ 
g.key_signature.signature_type())

last_key = g.key_signature
if last_time <> g.timesig :
@@ -1093,7 +1125,7 @@
sys.stderr.write ("\nLyrics found; edit to use \\addlyrics to 
couple to a staff\n")

if staffs:
-   str = str + '\\score { < %s > } ' % string.join (staffs)
+   str = str + '\\score { << %s >> } ' % string.join (staffs)

return str
 



___
Lilypond-user mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-user


etf2ly off-by-two in minor scales?

2003-10-06 Thread Arvid Grøtting
I recently tried etf2ly on a Finale ETF file I got from our conductor,
and while the results are beautiful (and arguably much more so than
the original), they're also definitely wrong.  More precisely, notes
in a minor key appear two positions above the place where they should.

What should have been rendered as (linefeeds and comments removed):

\key fis \minor
fis2. ~ | fis2. | fis4. ~ fis8 gis4 | a4. ~ a8 b4

...becomes:

\key a \major
a2. ~ | a2. | a4. ~ a8 b8 | cis'4. ~ cis'8 d'4

Accidentals follow the position, so transposing is of no help:

\key fis \minor
e4. dis4.

...is instead rendered as

\key a \major
gis4. fisis4.

A part in fis major comes through correctly.

This seems to be a etf2ly issue.  Is it a known bug?  Is there an easy
fix?

-- 

Arvid



___
Lilypond-user mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-user