PM_K-1 grid: smaller circles + align beats vertically across lanes

Place step circles by proportional position in the bar (beat = column start) instead
of centring in per-lane slots, so same-meter lanes' beats land at the same x (e.g. the
8-step hat's beats sit directly under the 4-step kick/snare). Cap circle radius at 6
(was up to ~18). Verified by printing per-lane beat x-positions + rendering the grid.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Me Here 2026-05-28 22:16:36 -05:00
parent c34d37d9c6
commit 6edb89e33c
2 changed files with 5 additions and 3 deletions

View file

@ -464,12 +464,14 @@ class App:
L = self.lanes[li]; y = top + li * rowh; cy = y + rowh // 2 L = self.lanes[li]; y = top + li * rowh; cy = y + rowh // 2
tg, w, h = make_text((L.get('sound', '') or '?')[:7], FONT_S, C_MUTE, C_BG) tg, w, h = make_text((L.get('sound', '') or '?')[:7], FONT_S, C_MUTE, C_BG)
tg.x = 8; tg.y = cy - h // 2; self.g_grid.append(tg) tg.x = 8; tg.y = cy - h // 2; self.g_grid.append(tg)
steps = L['steps']; sub = L['sub']; px0 = 60; pw = (WIDTH - 8 - px0) // steps steps = L['steps']; sub = L['sub']; px0 = 60
r_big = max(3, min((rowh - 4) // 2, (pw - 2) // 2)); r_sml = max(2, r_big * 6 // 10) usable = WIDTH - 8 - px0 - 12; stepw = max(1, usable // steps)
r_big = max(2, min(6, stepw // 2, (rowh - 8) // 2)); r_sml = max(2, r_big - 2)
pads = [] pads = []
for s in range(steps): for s in range(steps):
rad = r_big if (s % sub == 0) else r_sml # big = beat (division), small = subdivision rad = r_big if (s % sub == 0) else r_sml # big = beat (division), small = subdivision
c = vectorio.Circle(pixel_shader=self.pad_pal, radius=rad, x=px0 + s*pw + pw//2, y=cy) cxp = px0 + 6 + (s * usable) // steps # proportional → beats line up across lanes
c = vectorio.Circle(pixel_shader=self.pad_pal, radius=rad, x=cxp, y=cy)
c.color_index = self._padbase(L, s); self.g_grid.append(c); pads.append(c) c.color_index = self._padbase(L, s); self.g_grid.append(c); pads.append(c)
self.lane_pads.append(pads); self.lane_lit.append(-1) self.lane_pads.append(pads); self.lane_lit.append(-1)
self.dirty = True self.dirty = True