commit 101

This commit is contained in:
Moritz Ruth 2025-04-05 01:19:18 +02:00
parent c3a0bea5eb
commit 5ed1b108a3
Signed by: moritzruth
GPG key ID: C9BBAB79405EE56D
5 changed files with 74 additions and 9 deletions

View file

@ -16,6 +16,34 @@ fun ShowBuilderContext.testingAct() = act("Testing") {
} }
} }
lightStep(StepCue.Custom("StairvilleSplb.Effect.CHASE_BACK_AND_FORTH")) {
BlinderBars.all {
it.effect.static(StairvilleSplb.Effect.CHASE_BACK_AND_FORTH)
it.effect.speed.static(20.percent)
}
}
lightStep(StepCue.Custom("StairvilleSplb.Effect.BUMP_INWARDS")) {
BlinderBars.all {
it.effect.static(StairvilleSplb.Effect.BUMP_INWARDS)
it.effect.speed.static(20.percent)
}
}
lightStep(StepCue.Custom("StairvilleSplb.Effect.FLOW_OUTWARDS")) {
BlinderBars.all {
it.effect.static(StairvilleSplb.Effect.FLOW_OUTWARDS)
it.effect.speed.static(50.percent)
}
}
lightStep(StepCue.Custom("StairvilleSplb.Effect.FLOW_OUTWARDS_LONG")) {
BlinderBars.all {
it.effect.static(StairvilleSplb.Effect.FLOW_OUTWARDS_LONG)
it.effect.speed.static(50.percent)
}
}
lightStep(StepCue.Custom("StairvilleSplb.Effect.FLOW_INWARDS")) { lightStep(StepCue.Custom("StairvilleSplb.Effect.FLOW_INWARDS")) {
BlinderBars.all { BlinderBars.all {
it.effect.static(StairvilleSplb.Effect.FLOW_INWARDS) it.effect.static(StairvilleSplb.Effect.FLOW_INWARDS)

View file

@ -26,7 +26,6 @@ class StairvilleSplb(override val firstChannel: DmxAddress) : Device {
HECTIC_SWITCHING, HECTIC_SWITCHING,
THEATRE_SWITCHING, THEATRE_SWITCHING,
CHASE_BACK_AND_FORTH, CHASE_BACK_AND_FORTH,
CHASE_INWARDS,
LAZY_SPARKLES, LAZY_SPARKLES,
VOLATILE_SPARKLES, VOLATILE_SPARKLES,
BUMP_INWARDS, BUMP_INWARDS,

View file

@ -42,11 +42,11 @@ class StairvilleTlbButItsSplb(override val firstChannel: DmxAddress, val inwards
start: Percentage = 0.percent, start: Percentage = 0.percent,
end: Percentage = 0.percent end: Percentage = 0.percent
): Percentage { ): Percentage {
return if (time <= rampUpDuration) { return if (time < rampUpDuration) {
val progress = time / rampUpDuration.toDouble() val progress = time / rampUpDuration.toDouble()
val delta = peak.value - start.value val delta = peak.value - start.value
Percentage(progress * delta + start.value) Percentage(progress * delta + start.value)
} else if (time <= rampUpDuration + sustainDuration) { } else if (time < rampUpDuration + sustainDuration) {
peak peak
} else { } else {
val progress = min((time - rampUpDuration - sustainDuration) / rampDownDuration.toDouble(), 1.0) val progress = min((time - rampUpDuration - sustainDuration) / rampDownDuration.toDouble(), 1.0)
@ -55,7 +55,7 @@ class StairvilleTlbButItsSplb(override val firstChannel: DmxAddress, val inwards
} }
} }
fun reverseIndexIfInwardsIsRight(index: Int) = if (inwardsIsRight) NUMBER_OF_SEGMENTS - index else index fun rIndex(condition: Boolean, index: Int) = if (condition) NUMBER_OF_SEGMENTS - index else index
return when (effect) { return when (effect) {
null -> Array(NUMBER_OF_SEGMENTS) { color } null -> Array(NUMBER_OF_SEGMENTS) { color }
@ -78,13 +78,15 @@ class StairvilleTlbButItsSplb(override val firstChannel: DmxAddress, val inwards
} }
} }
Effect.FLOW_INWARDS, Effect.FLOW_INWARDS_LONG -> { Effect.FLOW_INWARDS, Effect.FLOW_INWARDS_LONG, Effect.FLOW_OUTWARDS, Effect.FLOW_OUTWARDS_LONG -> {
val isOutwards = effect == Effect.FLOW_OUTWARDS || effect == Effect.FLOW_OUTWARDS_LONG
val isLong = effect == Effect.FLOW_INWARDS_LONG || effect == Effect.FLOW_OUTWARDS_LONG
val interval = 1000.0 val interval = 1000.0
val scale = if (effect == Effect.FLOW_INWARDS) 0.5 else 1.5 val scale = if (isLong) 1.5 else 0.5
Array(NUMBER_OF_SEGMENTS) { index -> Array(NUMBER_OF_SEGMENTS) { index ->
val value = Percentage( val value = Percentage(
sin((time + reverseIndexIfInwardsIsRight(index) * (interval / NUMBER_OF_SEGMENTS)) / interval * 2 * PI / scale) sin((time + rIndex(inwardsIsRight xor isOutwards, index) * (interval / NUMBER_OF_SEGMENTS)) / interval * 2 * PI / scale)
/ 2 + 0.5 / 2 + 0.5
) )
@ -92,6 +94,42 @@ class StairvilleTlbButItsSplb(override val firstChannel: DmxAddress, val inwards
} }
} }
Effect.BUMP_INWARDS -> {
val interval = 350.0
Array(NUMBER_OF_SEGMENTS) { index ->
color.multiplyBrightness(
fadeInOut(
(time + rIndex(inwardsIsRight, index) * (interval / NUMBER_OF_SEGMENTS)).mod(interval).roundToLong(),
rampUpDuration = 0,
sustainDuration = 0,
rampDownDuration = (interval * 0.75).roundToLong(),
)
)
}
}
Effect.CHASE_BACK_AND_FORTH -> {
val interval = 350
val fullInterval = interval * 2
val isMovingNegative = time.mod(fullInterval) < interval
val frontIndex = (if (isMovingNegative) time.mod(interval) else interval - time.mod(interval)) / interval.toDouble() * NUMBER_OF_SEGMENTS
Array(NUMBER_OF_SEGMENTS) { index ->
val t = fullInterval + if (isMovingNegative) ((index - frontIndex) * (interval.toDouble() / NUMBER_OF_SEGMENTS))
else ((frontIndex - index) * (interval.toDouble() / NUMBER_OF_SEGMENTS))
color.multiplyBrightness(
fadeInOut(
t.roundToLong(),
rampUpDuration = 0,
sustainDuration = 0,
rampDownDuration = (interval * (3 / 8.0)).roundToLong(),
)
)
}
}
else -> TODO() else -> TODO()
} }
} }

View file

@ -180,7 +180,7 @@ fun SceneBuilderContext.songMittsommernacht() {
BlinderBars.all { BlinderBars.all {
it.color.reset() it.color.reset()
it.brightness.fade(25.percent, 1.seconds) it.brightness.fade(25.percent, 1.seconds)
it.effect.static(StairvilleSplb.Effect.CHASE_INWARDS) it.effect.static(StairvilleSplb.Effect.BUMP_INWARDS)
it.effect.speed.static(80.percent) it.effect.speed.static(80.percent)
} }
} }

View file

@ -12,7 +12,7 @@ import kotlin.time.Duration.Companion.seconds
fun SceneBuilderContext.songStreitDerVampire() { fun SceneBuilderContext.songStreitDerVampire() {
lightStep(StepCue.MusicStart("Streit der Vampire", 1.minutes + 40.seconds)) { lightStep(StepCue.MusicStart("Streit der Vampire", 1.minutes + 40.seconds)) {
BlinderBars.all { BlinderBars.all {
it.effect.static(StairvilleSplb.Effect.CHASE_INWARDS) it.effect.static(StairvilleSplb.Effect.BUMP_INWARDS)
it.effect.speed.static(40.percent) it.effect.speed.static(40.percent)
it.brightness.fade(25.percent, 1.seconds) it.brightness.fade(25.percent, 1.seconds)
} }