Compare commits

..

No commits in common. "6b508ab86efcbb9b61cba13ff1accd153bacac35" and "8254bb042cc38f1e7fdf0a5ae65f341c6840083f" have entirely different histories.

3 changed files with 3 additions and 9 deletions

View file

@ -1 +1 @@
0.0.64
0.0.63

View file

@ -357,16 +357,10 @@ class App:
self.bpm, self.lanes = parse_program(prog)
self.master = self.lanes[0]
self._reset_clock(); self.draw_bpm(); self.draw_status(); self.build_grid()
def _lane_dur(self, L):
beat = 60_000_000_000 / self.bpm
if L['poly']: # ~ polymeter: fit this lane's whole cycle into lane 1's bar
m = self.lanes[0]; master_bar = beat * (m['steps'] // m['sub'])
return int(master_bar / L['steps'])
return int(beat / L['sub']) # straight: a step = one beat / subdivision
def _reset_clock(self):
now = time.monotonic_ns()
for L in self.lanes:
L['next'] = now; L['step'] = -1; L['dur'] = self._lane_dur(L)
L['next'] = now; L['step'] = -1; L['dur'] = int(60_000_000_000 / self.bpm / L['sub'])
# ---------- audio + light ----------
def click(self, level):
@ -394,7 +388,7 @@ class App:
v = max(30, min(300, v))
if v != self.bpm:
self.bpm = v
for L in self.lanes: L['dur'] = self._lane_dur(L)
for L in self.lanes: L['dur'] = int(60_000_000_000 / self.bpm / L['sub'])
self.draw_bpm()
def goto(self, i):
was = self.running; self.load(i); self._label("play")