@@ -47,6 +47,7 @@ def __init__(self):
4747 self .current_note = None
4848 self .current_lynote = None
4949 self .current_is_rest = False
50+ self .current_time = Fraction (4 , 4 )
5051 self .action_onnext = []
5152 self .divisions = 1
5253 self .dur_token = "4"
@@ -355,6 +356,7 @@ def new_key(self, key_name, mode):
355356 self .current_attr .set_key (get_fifths (key_name , mode ), mode )
356357
357358 def new_time (self , num , den , numeric = False ):
359+ self .current_time = Fraction (num , den .denominator )
358360 if self .bar is None :
359361 self .new_bar ()
360362 self .current_attr .set_time ([num , den .denominator ], numeric )
@@ -491,7 +493,7 @@ def check_duration(self, rest):
491493 if rs == bs [1 ]:
492494 self .current_note .duration = (bs [0 ], 1 )
493495 self .current_note .dot = 0
494- self .scale_rest (rs )
496+ self .scale_rest (bs )
495497 return
496498 self .current_note .dot = dots
497499 self .dots = dots
@@ -582,12 +584,13 @@ def note2rest(self):
582584 self .bar .obj_list .pop ()
583585 self .bar .add (self .current_note )
584586
585- def scale_rest (self , multp ):
587+ def scale_rest (self , bs ):
586588 """ create multiple whole bar rests """
587589 dur = self .current_note .duration
588590 voc = self .current_note .voice
589591 st = self .current_note .show_type
590592 sk = self .current_note .skip
593+ multp = int (bs [1 ] * (bs [0 ]/ self .current_time ))
591594 for i in range (1 , int (multp )):
592595 self .new_bar ()
593596 rest_copy = xml_objs .BarRest (dur , voice = voc , show_type = st , skip = sk )
0 commit comments