Cleanup
This commit is contained in:
@@ -57,6 +57,7 @@ class Harmony:
|
||||
self._at = {}
|
||||
self._segments = {}
|
||||
self._members = {}
|
||||
self._permitted = {}
|
||||
self.evaluations = {}
|
||||
self.color_eligibility = {}
|
||||
def at(self, time):
|
||||
@@ -74,6 +75,11 @@ class Harmony:
|
||||
spans = [s for s in self.spans if s.start < end and s.end > start]
|
||||
self._members[key] = frozenset.intersection(*(s.roles.basic for s in spans)) if spans else frozenset()
|
||||
return self._members[key]
|
||||
def permitted(self,start,end):
|
||||
key=(start,end)
|
||||
if key not in self._permitted:
|
||||
self._permitted[key]=generator.solo.types.permitted(self.choices,start,end)
|
||||
return self._permitted[key]
|
||||
def function(self, number, span):
|
||||
pitch = number % 12
|
||||
return 'basic' if pitch in span.roles.basic else 'specified_extension' if pitch in span.roles.specified else 'mapped_motion' if span.scale and pitch in span.scale.pitches else 'outside_collection'
|
||||
|
||||
Reference in New Issue
Block a user