From 7f33c42a1d380740f6fb61c6112e56f5d228a8b1 Mon Sep 17 00:00:00 2001 From: Moritz Ruth Date: Sat, 8 Mar 2025 14:12:41 +0100 Subject: [PATCH] commit 60 --- .../de/moritzruth/dracula_musical/act/Act1.kt | 54 ++++++++++++++++++- .../dracula_musical/device/Devices.kt | 7 ++- .../device/FuturelightDmh160.kt | 4 +- .../dracula_musical/device/StairvilleSplb.kt | 53 +++++------------- .../theaterdsl/device/DynamicValue.kt | 13 +++++ 5 files changed, 85 insertions(+), 46 deletions(-) diff --git a/src/main/kotlin/de/moritzruth/dracula_musical/act/Act1.kt b/src/main/kotlin/de/moritzruth/dracula_musical/act/Act1.kt index 4ed3b4b..a9fce5f 100644 --- a/src/main/kotlin/de/moritzruth/dracula_musical/act/Act1.kt +++ b/src/main/kotlin/de/moritzruth/dracula_musical/act/Act1.kt @@ -1,6 +1,6 @@ package de.moritzruth.dracula_musical.act -import de.moritzruth.dracula_musical.device.spotRight +import de.moritzruth.dracula_musical.device.* import de.moritzruth.theaterdsl.show.CurtainState import de.moritzruth.theaterdsl.show.ShowBuilderContext import de.moritzruth.theaterdsl.show.StepCue @@ -11,6 +11,12 @@ fun ShowBuilderContext.act1() = act("Erster Akt") { scene("Ouvertüre") { step(StepCue.MusicStart("Ouvertüre", 10.seconds)) { curtainState = CurtainState.CLOSED + + Washs.both { + it.pointAtAudience() + it.colorWheelMode.static(CoemarProWash.ColorWheelMode.WarmWhite) + it.beamAngle.static(0.percent) + } } step(StepCue.MusicEnd) { @@ -34,7 +40,51 @@ fun ShowBuilderContext.act1() = act("Erster Akt") { } step(StepCue.MusicStart("Mittsommernacht", 10.seconds)) { - // + actors { + // TODO: Expand + +"Einwohner von Huntington" + } + + curtainState = CurtainState.OPEN + + onRun { + Tops.both { + it.startRoomMovement(3.0) + it.brightness.fade(100.percent, 2.seconds) + it.colorWheelMode.static(FuturelightDmh160.ColorWheelMode.Rotate(10.percent)) + it.prismMode.static(FuturelightDmh160.PrismMode.FACETS_8) + it.prismRotationSpeed.static(20.percent) + } + + backlightBar.brightness.fade(100.percent, 2.seconds) + backlightBar.color.cycle(12.seconds) + + Washs.both { + it.brightness.fade(100.percent, 2.seconds) + it.beamAngle.fade(100.percent, 2.seconds) + it.pointAtCeiling(6.seconds) + } + + BlinderBars.all { + it.white.static(100.percent) + it.brightness.pulseOnce(3.seconds, 5.seconds, 75.percent) + } + } + } + + lightStep(StepCue.Custom("Schlagzeug-Pattern wechselt")) { + BlinderBars.all { + it.white.static(0.percent) + it.presetSpeed.static(20.percent) + it.preset.static(StairvilleSplb.Preset.STUB) + } + } + + lightStep(StepCue.Custom("Strophe beginnt")) { + BlinderBars.all { + it.presetSpeed.static(50.percent) + it.preset.static(StairvilleSplb.Preset.STUB) + } } } } \ No newline at end of file diff --git a/src/main/kotlin/de/moritzruth/dracula_musical/device/Devices.kt b/src/main/kotlin/de/moritzruth/dracula_musical/device/Devices.kt index edb0028..7463b52 100644 --- a/src/main/kotlin/de/moritzruth/dracula_musical/device/Devices.kt +++ b/src/main/kotlin/de/moritzruth/dracula_musical/device/Devices.kt @@ -26,7 +26,11 @@ object Washs { val both = DeviceGroup(left, right) } -val blinderBars = DeviceGroup(StairvilleSplb(DmxAddress(150u))) +object BlinderBars { + val left = DeviceGroup(StairvilleSplb(DmxAddress(155u)), StairvilleSplb(DmxAddress(178u))) + val right = DeviceGroup(StairvilleSplb(DmxAddress(201u)), StairvilleSplb(DmxAddress(224u))) + val all = left + right +} val backlightBar = StairvilleTlb(DmxAddress(130u)) val sidelight = StairvilleClb4(DmxAddress(140u)) @@ -39,6 +43,7 @@ val devices = persistentSetOf( spotRight, *Tops.both.toTypedArray(), *Washs.both.toTypedArray(), + *BlinderBars.all.toTypedArray(), backlightBar, sidelight, fogMachine diff --git a/src/main/kotlin/de/moritzruth/dracula_musical/device/FuturelightDmh160.kt b/src/main/kotlin/de/moritzruth/dracula_musical/device/FuturelightDmh160.kt index 269159f..a34b363 100644 --- a/src/main/kotlin/de/moritzruth/dracula_musical/device/FuturelightDmh160.kt +++ b/src/main/kotlin/de/moritzruth/dracula_musical/device/FuturelightDmh160.kt @@ -59,8 +59,8 @@ class FuturelightDmh160(override val firstChannel: DmxAddress, private val isRig class Rotate(val speed: Percentage, val backwards: Boolean = false) : ColorWheelMode { override fun getDmxValue() = run { - if (backwards) (speed.value * 15).roundToInt() + 240 - else (speed.value * 15).roundToInt() + 224 + if (backwards) speed.ofRange(240.0..255.0).roundToInt() + else speed.ofRange(224.0..239.0).roundToInt() }.let { DmxValue(it.toUByte()) } } diff --git a/src/main/kotlin/de/moritzruth/dracula_musical/device/StairvilleSplb.kt b/src/main/kotlin/de/moritzruth/dracula_musical/device/StairvilleSplb.kt index a84af0e..a3784fa 100644 --- a/src/main/kotlin/de/moritzruth/dracula_musical/device/StairvilleSplb.kt +++ b/src/main/kotlin/de/moritzruth/dracula_musical/device/StairvilleSplb.kt @@ -4,31 +4,26 @@ import de.moritzruth.theaterdsl.device.* import de.moritzruth.theaterdsl.dmx.DmxAddress import de.moritzruth.theaterdsl.dmx.DmxDataWriter import de.moritzruth.theaterdsl.dmx.DmxValue +import de.moritzruth.theaterdsl.value.Color import de.moritzruth.theaterdsl.value.percent import kotlinx.collections.immutable.ImmutableSet import kotlinx.collections.immutable.persistentSetOf import kotlin.math.roundToInt class StairvilleSplb(override val firstChannel: DmxAddress) : Device { - override val numberOfChannels: UInt = 23u + override val numberOfChannels: UInt = 11u val brightness = PercentageDV() val strobeFrequency = PercentageDV() - val segment1Color = ColorDV() - val segment1White = PercentageDV() - val segment2Color = ColorDV() - val segment2White = PercentageDV() - val segment3Color = ColorDV() - val segment3White = PercentageDV() - val segment4Color = ColorDV() - val segment4White = PercentageDV() + val color = ColorDV(Color.WHITE.copy(brightness = 0.percent)) + val white = PercentageDV() val preset = ConcreteDV(null) val presetSpeed = PercentageDV() enum class Preset(channelValue: UByte) { - COLOR_CHANGE_1(16u); + STUB(16u); val channelValue: DmxValue = DmxValue(channelValue) } @@ -36,14 +31,8 @@ class StairvilleSplb(override val firstChannel: DmxAddress) : Device { override val dvs: ImmutableSet> = persistentSetOf( brightness, strobeFrequency, - segment1Color, - segment1White, - segment2Color, - segment2White, - segment3Color, - segment3White, - segment4Color, - segment4White, + color, + white, preset, presetSpeed ) @@ -69,28 +58,10 @@ class StairvilleSplb(override val firstChannel: DmxAddress) : Device { writer.writePercentage(presetSpeed.getCurrentValue()) - val (r1, g1, b1) = segment1Color.getCurrentValue().getRGB() - writer.writePercentage(r1) - writer.writePercentage(g1) - writer.writePercentage(b1) - writer.writePercentage(segment1White.getCurrentValue()) - - val (r2, g2, b2) = segment2Color.getCurrentValue().getRGB() - writer.writePercentage(r2) - writer.writePercentage(g2) - writer.writePercentage(b2) - writer.writePercentage(segment2White.getCurrentValue()) - - val (r3, g3, b3) = segment3Color.getCurrentValue().getRGB() - writer.writePercentage(r3) - writer.writePercentage(g3) - writer.writePercentage(b3) - writer.writePercentage(segment3White.getCurrentValue()) - - val (r4, g4, b4) = segment4Color.getCurrentValue().getRGB() - writer.writePercentage(r4) - writer.writePercentage(g4) - writer.writePercentage(b4) - writer.writePercentage(segment4White.getCurrentValue()) + val (red, green, blue) = color.getCurrentValue().getRGB() + writer.writePercentage(red) + writer.writePercentage(green) + writer.writePercentage(blue) + writer.writePercentage(white.getCurrentValue()) } } \ No newline at end of file diff --git a/src/main/kotlin/de/moritzruth/theaterdsl/device/DynamicValue.kt b/src/main/kotlin/de/moritzruth/theaterdsl/device/DynamicValue.kt index 35cba29..893c34c 100644 --- a/src/main/kotlin/de/moritzruth/theaterdsl/device/DynamicValue.kt +++ b/src/main/kotlin/de/moritzruth/theaterdsl/device/DynamicValue.kt @@ -198,6 +198,10 @@ class ColorDV(private val initialStaticValue: Color = Color.WHITE) : DynamicValu val deltaBrightness = end.brightness.value - start.brightness.value } + data class Cycle(val start: Color, val interval: Duration) : State { + + } + data class FadeRandomAround(val hue: Angle, val deviation: Angle, val interval: Duration) : State } @@ -227,6 +231,11 @@ class ColorDV(private val initialStaticValue: Color = Color.WHITE) : DynamicValu ) } + is State.Cycle -> { + val progress = (elapsedTime / s.interval).mod(1.0) + s.start.copy(hue = (s.start.hue.degrees + progress * 360.0).degrees.inSingleRotation()) + } + is State.FadeRandomAround -> { val startRandom = Random((elapsedTime / s.interval).toInt() - 1) val endRandom = Random((elapsedTime / s.interval).toInt()) @@ -248,6 +257,10 @@ class ColorDV(private val initialStaticValue: Color = Color.WHITE) : DynamicValu state = State.Fade(start, end, duration) } + fun cycle(interval: Duration, start: Color = getCurrentValue().copy(saturation = 100.percent, brightness = 100.percent)) { + state = State.Cycle(start, interval) + } + fun fadeRandomAround(hue: Angle, deviation: Angle, interval: Duration) { state = State.FadeRandomAround(hue, deviation, interval) }