@@ -5,17 +5,13 @@ from typing import Literal
|
||||
|
||||
from generator.score import body_start_measure_index
|
||||
|
||||
SectionRole = Literal["rhythm", "accompaniment", "melody", "vocal", "rest", "slash"]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ArrangementSection:
|
||||
label: str
|
||||
source_measure_index: int
|
||||
measure_count: int
|
||||
section_index: int
|
||||
role: SectionRole
|
||||
|
||||
role: Literal["rhythm", "accompaniment", "melody", "vocal", "rest", "slash"]
|
||||
|
||||
def phrase_aware_edge_measure_count(body_measure_count: int) -> int:
|
||||
if body_measure_count >= 8:
|
||||
@@ -24,8 +20,7 @@ def phrase_aware_edge_measure_count(body_measure_count: int) -> int:
|
||||
return 4
|
||||
return body_measure_count
|
||||
|
||||
|
||||
def section_role(part_type: str, section_index: int) -> SectionRole:
|
||||
def section_role(part_type: str, section_index: int) -> Literal["rhythm", "accompaniment", "melody", "vocal", "rest", "slash"]:
|
||||
if part_type == "acoustic":
|
||||
return "slash" if section_index == 3 else "rhythm"
|
||||
if part_type == "electric":
|
||||
@@ -38,7 +33,6 @@ def section_role(part_type: str, section_index: int) -> SectionRole:
|
||||
return "rest"
|
||||
return "vocal" if section_index in {1, 5, 6} else "rest"
|
||||
|
||||
|
||||
def full_arrangement_sections(measures: list[dict], part_type: str) -> list[ArrangementSection]:
|
||||
if not measures:
|
||||
return []
|
||||
@@ -62,4 +56,3 @@ def full_arrangement_sections(measures: list[dict], part_type: str) -> list[Arra
|
||||
for label, start, count, index in specs
|
||||
if count > 0
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user