bug-gnu-music
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Etf note not in measure


From: Han-Wen Nienhuys
Subject: Etf note not in measure
Date: Thu, 28 Sep 2000 15:23:30 +0200 (CEST)

address@hidden writes:
> I tried to convert etf files saved from Finale 3.8 (Finale97) and Finale
> 3.5, 3 files from each version (these were my own scores) and every file
> failed with the
> same error:


Apply the attached patch. One thing interests me: what would your file
look like when you have multiple layers in one measure? In particular,
the lines saying

    GF(x,y) ...



--- etf2ly.py~  Mon Sep 18 14:56:57 2000
+++ etf2ly.py   Thu Sep 28 15:19:36 2000
@@ -353,19 +353,22 @@
        def valid (self):
                return self.valid
        def calculate (self):
+               fs = []
+
+               
                if len (self.finale) < 2:
-                       sys.stderr.write ("Measure %d in staff %d  has 
incomplete information.\n" % (self.number, self.staff.number))
-                       self.valid = 0
-                       return 
+                       fs = self.finale[0]
+                       fs = map (string.atoi, list (fs))
+                       self.clef = fs[1]
+                       self.frames = [fs[0]]
+               else:
+                       fs = self.finale[0:2]
                        
-               f0 = self.finale[0]
-               f1 = self.finale[1]
-               
-               self.clef = string.atoi (f0[0])
-               self.flags = string.atoi (f0[1])
-               fs = map (string.atoi, list (f0[2:]) + [f1[0]])
+                       fs = map (string.atoi, list (fs))
+                       self.clef = fs[0]
+                       self.flags = fs[1]
+                       self.frames = fs[2:]
 
-               self.frames = fs
 
 class Frame:
        def __init__ (self, finale):
@@ -489,9 +492,13 @@
                        for m in self.measures[1:]:
                                if not m or not m.valid:
                                        continue
+
+                               fr = None
+                               try:
+                                       fr = m.frames[x]
+                               except IndexError:
+                                       pass
                                
-                               
-                               fr = m.frames[x]
                                if fr:
                                        first_frame = fr
                                        if gap <> (0,1):

-- 

Han-Wen Nienhuys   |   address@hidden    | http://www.cs.uu.nl/~hanwen/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]