Changeset - a88e082d2507
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 8 years ago 2017-06-11 19:16:11
drewp@bigasterisk.com
a little more sequencer reload speed
Ignore-this: 1a9c21c58bff0b430b20798b1898eec
1 file changed with 7 insertions and 5 deletions:
0 comments (0 inline, 0 general)
light9/effect/sequencer.py
Show inline comments
 
@@ -92,12 +92,14 @@ class Note(object):
 
        originTime = floatVal(uri, L9['originTime'])
 
        self.points = []
 
        for curve in g.objects(uri, L9['curve']):
 
            if g.value(curve, L9['attr']) != L9['strength']:
 
            po = list(g.predicate_objects(curve))
 
            if dict(po).get(L9['attr'], None) != L9['strength']:
 
                continue
 
            for point in g.objects(curve, L9['point']):
 
            for point in [row[1] for row in po if row[0] == L9['point']]:
 
                po2 = dict(g.predicate_objects(point))
 
                self.points.append((
 
                    originTime + floatVal(point, L9['time']),
 
                    floatVal(point, L9['value'])))
 
                    originTime + float(po2[L9['time']]),
 
                    float(po2[L9['value']])))
 
            self.points.sort()
 
        
 
    def activeAt(self, t):
 
@@ -175,8 +177,8 @@ class Sequencer(object):
 
        g = self.graph
 

	
 
        sharedEffectOutputs = {}
 

	
 
        for song in g.subjects(RDF.type, L9['Song']):
 
            # ideally, wrap this (or smaller) in a sub-handler to run less on each patch
 
            self.notes[song] = []
 
            for note in g.objects(song, L9['note']):
 
                self.notes[song].append(Note(g, note, effecteval, sharedEffectOutputs))
0 comments (0 inline, 0 general)