commit #50
This commit is contained in:
parent
6f0e3b4f44
commit
5428459b9f
4 changed files with 16 additions and 7 deletions
|
@ -111,7 +111,7 @@ fun ShowBuilderContext.secondAct() = act("Zweiter Akt") {
|
||||||
Tops.both.forEach {
|
Tops.both.forEach {
|
||||||
it.brightness.fade(20.percent, 5.seconds)
|
it.brightness.fade(20.percent, 5.seconds)
|
||||||
it.colorWheelMode.static(FuturelightDmh160.ColorWheelMode.Orange)
|
it.colorWheelMode.static(FuturelightDmh160.ColorWheelMode.Orange)
|
||||||
it.prismMode.static(FuturelightDmh160.PrismMode.FACETS_8)
|
it.prismMode.static(FuturelightDmh160.PrismMode.FROST)
|
||||||
it.startRoomMovement(3.0)
|
it.startRoomMovement(3.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -321,7 +321,7 @@ fun ShowBuilderContext.thirdAct() = act("Dritter Akt") {
|
||||||
|
|
||||||
Tops.both.forEach {
|
Tops.both.forEach {
|
||||||
it.colorWheelMode.static(FuturelightDmh160.ColorWheelMode.DarkBlue)
|
it.colorWheelMode.static(FuturelightDmh160.ColorWheelMode.DarkBlue)
|
||||||
it.prismMode.static(FuturelightDmh160.PrismMode.FACETS_8)
|
it.prismMode.static(FuturelightDmh160.PrismMode.FROST)
|
||||||
it.prismRotationSpeed.static(20.percent)
|
it.prismRotationSpeed.static(20.percent)
|
||||||
it.startRoomMovement(8.0)
|
it.startRoomMovement(8.0)
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@ import de.moritzruth.theaterdsl.value.degrees
|
||||||
import kotlinx.collections.immutable.persistentSetOf
|
import kotlinx.collections.immutable.persistentSetOf
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
import kotlin.time.Duration.Companion.minutes
|
import kotlin.time.Duration.Companion.minutes
|
||||||
import kotlin.time.Duration.Companion.seconds
|
|
||||||
|
|
||||||
class FuturelightDmh160(override val firstChannel: DmxAddress, private val isRight: Boolean) : Device {
|
class FuturelightDmh160(override val firstChannel: DmxAddress, private val isRight: Boolean) : Device {
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -90,10 +89,10 @@ class FuturelightDmh160(override val firstChannel: DmxAddress, private val isRig
|
||||||
val prismMode = ConcreteDV(PrismMode.OPEN)
|
val prismMode = ConcreteDV(PrismMode.OPEN)
|
||||||
val prismRotationSpeed = PercentageDV()
|
val prismRotationSpeed = PercentageDV()
|
||||||
|
|
||||||
fun startRoomMovement(rotationsPerMinute: Double) {
|
fun startRoomMovement(rotationsPerMinute: Double) { // TODO: Test
|
||||||
// TODO: Ersetzen durch ellipse
|
val period = 1.minutes / rotationsPerMinute
|
||||||
pan.sine(1.minutes / rotationsPerMinute, 0.degrees, 360.degrees)
|
pan.rampUp(period) // spin
|
||||||
tilt.fade(120.degrees, 3.seconds)
|
tilt.sine(period, minimum = 100.degrees, maximum = 120.degrees, start = 120.degrees)
|
||||||
}
|
}
|
||||||
|
|
||||||
override val dvs = persistentSetOf(
|
override val dvs = persistentSetOf(
|
||||||
|
|
|
@ -39,6 +39,7 @@ abstract class DoubleDV<T>(private val initialStaticValue: Double) : DynamicValu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data class Ramp(val period: Duration, val start: Double, val end: Double) : State
|
||||||
data class Step(val steps: ImmutableList<Double>, val interval: Duration, val startIndex: Int) : State
|
data class Step(val steps: ImmutableList<Double>, val interval: Duration, val startIndex: Int) : State
|
||||||
data class PulseOnce(val rampUpDuration: Duration, val rampDownDuration: Duration, val peakValue: Double, val start: Double, val end: Double) : State
|
data class PulseOnce(val rampUpDuration: Duration, val rampDownDuration: Duration, val peakValue: Double, val start: Double, val end: Double) : State
|
||||||
}
|
}
|
||||||
|
@ -70,6 +71,8 @@ abstract class DoubleDV<T>(private val initialStaticValue: Double) : DynamicValu
|
||||||
(fromZeroToOne * (s.maximum - s.minimum) + s.minimum)
|
(fromZeroToOne * (s.maximum - s.minimum) + s.minimum)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is State.Ramp -> elapsedTime.inWholeMilliseconds.rem(s.period.inWholeMilliseconds) * (s.end - s.start) + s.start
|
||||||
|
|
||||||
is State.Step -> {
|
is State.Step -> {
|
||||||
val index = (elapsedTime / s.interval).toInt() + s.startIndex
|
val index = (elapsedTime / s.interval).toInt() + s.startIndex
|
||||||
s.steps[index.mod(s.steps.size)]
|
s.steps[index.mod(s.steps.size)]
|
||||||
|
@ -114,6 +117,13 @@ abstract class DoubleDV<T>(private val initialStaticValue: Double) : DynamicValu
|
||||||
state = State.Sine(fromDomain(minimum), fromDomain(maximum), b, c)
|
state = State.Sine(fromDomain(minimum), fromDomain(maximum), b, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun ramp(period: Duration, start: T, end: T) {
|
||||||
|
state = State.Ramp(period, fromDomain(start), fromDomain(end))
|
||||||
|
}
|
||||||
|
|
||||||
|
fun rampUp(period: Duration) = ramp(period, minimumValue, maximumValue)
|
||||||
|
fun rampDown(period: Duration) = ramp(period, maximumValue, minimumValue)
|
||||||
|
|
||||||
fun steps(steps: List<T>, interval: Duration, startIndex: Int = 0) {
|
fun steps(steps: List<T>, interval: Duration, startIndex: Int = 0) {
|
||||||
state = State.Step(steps.map(this::fromDomain).toImmutableList(), interval, startIndex)
|
state = State.Step(steps.map(this::fromDomain).toImmutableList(), interval, startIndex)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue