Cleanup
This commit is contained in:
@@ -1,66 +1,10 @@
|
||||
"""One curated, deterministic composition policy; all times are quarter-note beats."""
|
||||
from __future__ import annotations
|
||||
|
||||
import dataclasses
|
||||
import hashlib
|
||||
import json
|
||||
|
||||
"""Physical/harmonic constants and semantic generation version."""
|
||||
import dataclasses, hashlib
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Policy:
|
||||
acoustic_activity: float = 1.125
|
||||
electric_activity: float = 1.125
|
||||
active_occupancy: float = 0.925
|
||||
arrival_occupancy: float = 0.9
|
||||
weights: tuple[tuple[str, float], ...] = (('activity', 4), ('occupancy', 4), ('landmarks', 3), ('register', 1), ('contour', 1), ('connection', 1), ('repetition', 1), ('movement', 0.5), ('harmonic_exposure', 2), ('draft_preservation', 3), ('development', 2), ('direction', 1), ('join_coherence', 2), ('ending_integration', 2))
|
||||
beam_width: int = 64
|
||||
extensions: int = 32
|
||||
retrieval: int = 32
|
||||
alternatives: int = 4
|
||||
long_note: float = 2.0
|
||||
stopping_note: float = 1.0
|
||||
suspension_preparation: float = 0.5
|
||||
suspension_resolution: float = 1.0
|
||||
replan_attempts: int = 2
|
||||
anchor_lines: int = 8
|
||||
draft_frontier: int = 16
|
||||
phrase_alternatives: int = 8
|
||||
join_alternatives: int = 8
|
||||
revision_sweeps: int = 2
|
||||
revision_joins: int = 2
|
||||
refinement_alternatives: int = 4
|
||||
join_window: float = 2.0
|
||||
activity_deadband: float = 1.0
|
||||
occupancy_deadband: float = 0.1
|
||||
lead_activity_range: tuple[float, float] = (1.0, 1.5)
|
||||
lead_occupancy_range: tuple[float, float] = (0.85, 1.0)
|
||||
source_variations: int = 8
|
||||
chorus_frontier: int = 8
|
||||
theme_copy_threshold: float = 0.8
|
||||
theme_copy_beats: float = 8.0
|
||||
theme_copy_attacks: int = 4
|
||||
theme_seed_limit: int = 8
|
||||
theme_unit_alternatives: int = 8
|
||||
theme_rhythm_alternatives: int = 8
|
||||
theme_destinations: int = 6
|
||||
theme_continuations: int = 8
|
||||
theme_route_jobs: int = 16
|
||||
settling_range: tuple[int, int] = (5, 7)
|
||||
history_bars: int = 16
|
||||
enclosure_targets: int = 4
|
||||
enclosure_routes: int = 4
|
||||
enclosure_frontier: int = 8
|
||||
enclosure_max_per_32_bars: int = 4
|
||||
composition_version: str = 'joint-arrivals-2'
|
||||
|
||||
# Preserve the former default root seeds while decoupling them from policy edits.
|
||||
SEED_NAMESPACE = 'a85abb240d7cfa9d054375b654bcb5c23c746201fd4aed7acf81cb3f4ee720e1'
|
||||
|
||||
DEFAULT = Policy()
|
||||
|
||||
def describe():
|
||||
values = dataclasses.asdict(DEFAULT)
|
||||
identity = hashlib.sha256(json.dumps(values, sort_keys=True).encode()).hexdigest()
|
||||
return {'fingerprint': identity, 'seed_namespace': SEED_NAMESPACE, 'parameters': values}
|
||||
|
||||
long_note: float = 2.
|
||||
stopping_note: float = 1.
|
||||
composition_version: str = 'phrase-composer-1'
|
||||
DEFAULT=Policy()
|
||||
def stable_rank(seed, value):
|
||||
return hashlib.sha256((seed + repr(value)).encode()).hexdigest()
|
||||
|
||||
Reference in New Issue
Block a user