Beispiel #1
0
    def getEffect(self, t):
        dt = t - self.startTime
        tNorm = dt / self.duration

        dst = self.dst1 if dt <= 0.5 else self.dst2
        src = self.src if dt <= 0.5 else self.dst1
        tNormAdjusted = (tNorm * 2) if dt <= 0.5 else ((tNorm - 0.5) * 2)

        return ResolvedEffect.createRgbw(
            ColorTransition.linear(tNormAdjusted, src, dst))
Beispiel #2
0
    def getEffect(self, t):
        tNorm = ScaleFunctions.linear(t, self.startTime, self.period)
        ledPositions = []

        for target in self.targets:
            positions = LEDSelector().getAllTargetPositions(target)
            startPos = positions[0]
            ledsPerChild = len(positions) / self.num
            for child in range(0, self.num):
                childPt = startPos + round(child * ledsPerChild + tNorm *
                                           len(positions)) + self.offset
                ledPositions.append(LEDSelector().unalias(target, childPt))

        return ResolvedEffect(None, None, list(set(ledPositions)))
Beispiel #3
0
    def getEffect(self, t):
        pos = []
        for target in self.targets:
            tempPos = []
            tNorm = 1 - ScaleFunctions.linear(t, self.startTime, self.duration)
            targetPos = LEDSelector().getAllTargetPositions(target)
            numLeds = len(targetPos)
            
            scaledDensity = int(self.startingDensity * tNorm)
            for sparkle in range(0, scaledDensity):
                randomLed = LEDSelector().unalias(target, random.randint(-1, numLeds))
                tempPos.append(randomLed)

            pos.extend(tempPos)

        return ResolvedEffect.createTranslation(list(set(tempPos)))
    def getEffect(self, t):
        tNorm = ScaleFunctions.cubicEaseOut(t, self.startTime, self.duration)
        ledPositions = []

        for target in self.targets:
            positions = LEDSelector().getAllTargetPositions(target)
            fullChildLength = math.ceil(len(positions) / self.numChildren)
            childLength = math.ceil((1 - tNorm) * fullChildLength)

            for child in range(0, self.numChildren):
                childRoot = int(child * fullChildLength +
                                tNorm * fullChildLength)
                tailPos = range(childRoot - childLength, childRoot)
                for p in tailPos:
                    ledPositions.append(LEDSelector().unalias(target, p))

        return ResolvedEffect(None, None, list(set(ledPositions)))
    def getEffect(self, t):
        pos = []
        for target in self.targets:
            tempPos = []
            tPos = LEDSelector().getAllTargetPositions(target)
            numLeds = len(tPos)
            for sectionNum in range(0, self.numSym):
                centerPos = int(round(
                    sectionNum * numLeds / self.numSym)) + self.offset
                tempPos.append(centerPos)
                tempPos.extend(
                    range(centerPos,
                          centerPos + int(round(self.sectionLength / 2)), 1))
                tempPos.extend(
                    range(centerPos,
                          centerPos - int(round(self.sectionLength / 2)), -1))

            for p in tempPos:
                pos.append(LEDSelector().unalias(target, p))

        return ResolvedEffect.createTranslation(list(set(pos)))
Beispiel #6
0
    def getEffect(self, t):
        dt = t - self.startTime
        tNorm = dt / self.fadeOutDuration - 1
        scale = 1 - (tNorm * tNorm * tNorm + 1)

        return ResolvedEffect.createAmplitude(scale)
 def getEffect(self, t):
     return ResolvedEffect.createAmplitude(self.amplitude)
Beispiel #8
0
 def getEffect(self):
     return ResolvedEffect(None, None, None)
 def getEffect(self, t):
     dt = t - self.startTime
     tNorm = dt / self.duration
     return ResolvedEffect.createRgbw(
         ColorTransition.linear(tNorm, self.src, self.dst))
 def getEffect(self, t):
     return ResolvedEffect.createRgbw(self.rgbw)
    def getEffect(self, t):
        pos = []
        for target in self.targets:
            pos.extend(LEDSelector().getAllTargetPositions(target))

        return ResolvedEffect.createTranslation(list(set(pos)))
Beispiel #12
0
 def getEffect(self, t):
     dt = t - self.startTime
     scale = self.startAmplitude - dt / self.fadeOutDuration * self.startAmplitude
     return ResolvedEffect.createAmplitude(scale)
Beispiel #13
0
 def combine(self, dt):
     color = self.combineColors(dt)
     amplitude = self.combineAmplitude(dt)
     ledPositions = self.combinePositions(dt)
     return ResolvedEffect(color, amplitude, ledPositions)
Beispiel #14
0
 def clone(self):
     return CompiledEffect(
         self.hitTypes,
         ResolvedEffect(self.rgbw, self.amplitude, self.ledPositions),
         self.dt, self.duration, self.priority, self.isAmbient,
         self.isModifier, self.noteTime, self.t, self.ambientDuration)