Compare commits
No commits in common. "6b508ab86efcbb9b61cba13ff1accd153bacac35" and "8254bb042cc38f1e7fdf0a5ae65f341c6840083f" have entirely different histories.
6b508ab86e
...
8254bb042c
3 changed files with 3 additions and 9 deletions
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
||||||
0.0.64
|
0.0.63
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -357,16 +357,10 @@ class App:
|
||||||
self.bpm, self.lanes = parse_program(prog)
|
self.bpm, self.lanes = parse_program(prog)
|
||||||
self.master = self.lanes[0]
|
self.master = self.lanes[0]
|
||||||
self._reset_clock(); self.draw_bpm(); self.draw_status(); self.build_grid()
|
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):
|
def _reset_clock(self):
|
||||||
now = time.monotonic_ns()
|
now = time.monotonic_ns()
|
||||||
for L in self.lanes:
|
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 ----------
|
# ---------- audio + light ----------
|
||||||
def click(self, level):
|
def click(self, level):
|
||||||
|
|
@ -394,7 +388,7 @@ class App:
|
||||||
v = max(30, min(300, v))
|
v = max(30, min(300, v))
|
||||||
if v != self.bpm:
|
if v != self.bpm:
|
||||||
self.bpm = v
|
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()
|
self.draw_bpm()
|
||||||
def goto(self, i):
|
def goto(self, i):
|
||||||
was = self.running; self.load(i); self._label("play")
|
was = self.running; self.load(i); self._label("play")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue