commit 60

This commit is contained in:
Moritz Ruth 2025-03-08 14:12:41 +01:00
parent 9237770433
commit 7f33c42a1d
Signed by: moritzruth
GPG key ID: C9BBAB79405EE56D
5 changed files with 85 additions and 46 deletions

View file

@ -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)
}
}
}
}

View file

@ -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

View file

@ -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()) }
}

View file

@ -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<Preset?>(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<DynamicValue<*>> = 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())
}
}

View file

@ -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)
}