performer=klass() function performer:init(track,channel,instrument,time,roots) assert_range(#roots,1,33,"#roots") self.track=track self.channel=channel self.instrument=instrument self.time=time self.roots=roots self.selected_root=1 self.offset=0 end function performer:root(root) assert_range(root,1,#self.roots,"root") self.selected_root=root end function performer:play(duration,note,verbs) local base=self.roots[self.selected_root] local note=base+note+self.offset local t0=self.time local t1=t0+duration self.time+=duration self.instrument:spackle(self.track,self.channel,t0,t1,note,verbs) end function performer:rest(duration) self.time+=duration end