Files
product-vamp/generator/engraving/scales.py
T
khodowany f5f0ab5eec
ci / checks (push) Successful in 48m15s
Scale Patterns
2026-09-30 03:17:06 -05:00

15 lines
451 B
Python

from __future__ import annotations
import bisect
import generator.model
def column(index, time, system_start, fonts):
position = bisect.bisect_right(index.scale_starts, time) - 1
if position < 0:
return []
span = index.scale_spans[position]
if time >= generator.model.fraction(span['end']) or time not in (system_start, index.scale_starts[position]):
return []
return [fonts.text(span['label'], 0, 0, 16, 'scale', (span['id'],))]