diff --git a/orx-envelopes/src/commonMain/kotlin/Tracker.kt b/orx-envelopes/src/commonMain/kotlin/Tracker.kt index 7279942b..a650a585 100644 --- a/orx-envelopes/src/commonMain/kotlin/Tracker.kt +++ b/orx-envelopes/src/commonMain/kotlin/Tracker.kt @@ -73,15 +73,29 @@ abstract class Tracker(val clock: Clock) { class ADSRTracker(clock: Clock) : Tracker(clock) { + /** + * The time it takes to transition to 1.0 when calling [triggerOn], usually in seconds. + */ @DoubleParameter("attack", 0.0, 20.0, order = 1) var attack: Double = 0.1 + /** + * The time it takes to transition from 1.0 to the [sustain] level, usually in seconds. + * The decay happens immediately after the attack. + */ @DoubleParameter("decay", 0.0, 20.0, order = 2) var decay: Double = 0.1 + /** + * The sustain level, between 0.0 and 1.0. + * The tracker will keep this value until [triggerOff] is called. + */ @DoubleParameter("sustain", 0.0, 1.0, order = 3) var sustain: Double = 0.9 + /** + * The time it takes to transition back to 0.0 when calling [triggerOff], usually in seconds. + */ @DoubleParameter("release", 0.0, 20.0, order = 4) var release: Double = 0.9 diff --git a/orx-fcurve/README.md b/orx-fcurve/README.md index d4789332..700b1abe 100644 --- a/orx-fcurve/README.md +++ b/orx-fcurve/README.md @@ -210,6 +210,11 @@ For example `(M0 (h1 m1)[3])[2]` expands to `M0 h1 m1 h1 m1 h1 m1 M0 h1 m1 h1 m1 ![DemoFCurve02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fcurve/images/DemoFCurve02Kt.png) +### DemoFCurve03 +[source code](src/jvmDemo/kotlin/DemoFCurve03.kt) + +![DemoFCurve03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fcurve/images/DemoFCurve03Kt.png) + ### DemoFCurveSheet01 [source code](src/jvmDemo/kotlin/DemoFCurveSheet01.kt) diff --git a/orx-fx/src/jvmDemo/kotlin/DemoFluidDistort01.kt b/orx-fx/src/jvmDemo/kotlin/DemoFluidDistort01.kt index c66cf85e..ac55d118 100644 --- a/orx-fx/src/jvmDemo/kotlin/DemoFluidDistort01.kt +++ b/orx-fx/src/jvmDemo/kotlin/DemoFluidDistort01.kt @@ -1,6 +1,7 @@ import org.openrndr.application import org.openrndr.draw.colorBuffer import org.openrndr.draw.createEquivalent +import org.openrndr.extensions.SingleScreenshot import org.openrndr.extra.fx.distort.FluidDistort import org.openrndr.extra.fx.patterns.Checkers @@ -8,15 +9,21 @@ fun main() { application { program { val fd = FluidDistort() - val checkers = Checkers() + val checkers = Checkers() val image = colorBuffer(width, height) val distorted = image.createEquivalent() checkers.size = 64.0 checkers.apply(emptyArray(), image) + if (System.getProperty("takeScreenshot") == "true") { + extensions.filterIsInstance().forEach { + it.delayFrames = 150 + } + } extend { - fd.blend = mouse.position.x/width + // Ensure >0.01 for a better screenshot + fd.blend = (mouse.position.x / width).coerceAtLeast(0.01) fd.apply(image, distorted) drawer.image(distorted) } diff --git a/orx-fx/src/jvmDemo/kotlin/DemoLaserBlur01.kt b/orx-fx/src/jvmDemo/kotlin/DemoLaserBlur01.kt index 90ecdf45..dc1f4767 100644 --- a/orx-fx/src/jvmDemo/kotlin/DemoLaserBlur01.kt +++ b/orx-fx/src/jvmDemo/kotlin/DemoLaserBlur01.kt @@ -20,12 +20,6 @@ // } // // program { -// if (System.getProperty("takeScreenshot") == "true") { -// extend(SingleScreenshot()) { -// this.outputFile = System.getProperty("screenshotPath") -// } -// } -// // val gui = GUI() // val c = compose { // layer { diff --git a/orx-jvm/orx-git-archiver/src/demo/kotlin/GitArchiverDemo01.kt b/orx-jvm/orx-git-archiver/src/demo/kotlin/GitArchiverDemo01.kt index 71eeecd3..6536f0bf 100644 --- a/orx-jvm/orx-git-archiver/src/demo/kotlin/GitArchiverDemo01.kt +++ b/orx-jvm/orx-git-archiver/src/demo/kotlin/GitArchiverDemo01.kt @@ -6,11 +6,6 @@ // //fun main() = application { // program { -// if (System.getProperty("takeScreenshot") == "true") { -// extend(SingleScreenshot()) { -// this.outputFile = System.getProperty("screenshotPath") -// } -// } // val ga = extend(GitArchiver()) { // commitOnRun = true // commitOnRequestAssets = false diff --git a/orx-jvm/orx-gui/src/demo/kotlin/DemoAppearance01.kt b/orx-jvm/orx-gui/src/demo/kotlin/DemoAppearance01.kt index a083f955..dd8c961b 100644 --- a/orx-jvm/orx-gui/src/demo/kotlin/DemoAppearance01.kt +++ b/orx-jvm/orx-gui/src/demo/kotlin/DemoAppearance01.kt @@ -12,13 +12,6 @@ import org.openrndr.shape.Circle */ fun main() = application { program { - // -- this block is for automation purposes only - if (System.getProperty("takeScreenshot") == "true") { - extend(SingleScreenshot()) { - this.outputFile = System.getProperty("screenshotPath") - } - } - val gui = GUI(GUIAppearance(baseColor = ColorRGBa.GRAY.opacify(0.9), barWidth = 400)) gui.compartmentsCollapsedByDefault = false diff --git a/orx-jvm/orx-keyframer/src/demo/kotlin/DemoEvelope01.kt b/orx-jvm/orx-keyframer/src/demo/kotlin/DemoEvelope01.kt index e245555d..8691e9df 100644 --- a/orx-jvm/orx-keyframer/src/demo/kotlin/DemoEvelope01.kt +++ b/orx-jvm/orx-keyframer/src/demo/kotlin/DemoEvelope01.kt @@ -11,11 +11,6 @@ fun main() = application { } val animation = Animation() animation.loadFromJson(URL(resourceUrl("/demo-envelope-01.json"))) - if (System.getProperty("takeScreenshot") == "true") { - extend(SingleScreenshot()) { - this.outputFile = System.getProperty("screenshotPath") - } - } extend { animation(seconds) drawer.circle(animation.position, 100.0) diff --git a/orx-jvm/orx-keyframer/src/demo/kotlin/DemoFull01.kt b/orx-jvm/orx-keyframer/src/demo/kotlin/DemoFull01.kt index e7a1b1b1..cdc0066a 100644 --- a/orx-jvm/orx-keyframer/src/demo/kotlin/DemoFull01.kt +++ b/orx-jvm/orx-keyframer/src/demo/kotlin/DemoFull01.kt @@ -14,11 +14,6 @@ fun main() = application { } val animation = Animation() animation.loadFromJson(URL(resourceUrl("/demo-full-01.json")), format = KeyframerFormat.FULL) - if (System.getProperty("takeScreenshot") == "true") { - extend(SingleScreenshot()) { - this.outputFile = System.getProperty("screenshotPath") - } - } extend { animation(seconds) drawer.fill = animation.color diff --git a/orx-jvm/orx-keyframer/src/demo/kotlin/DemoScrub01.kt b/orx-jvm/orx-keyframer/src/demo/kotlin/DemoScrub01.kt index 6c96a088..cd26d8ae 100644 --- a/orx-jvm/orx-keyframer/src/demo/kotlin/DemoScrub01.kt +++ b/orx-jvm/orx-keyframer/src/demo/kotlin/DemoScrub01.kt @@ -30,11 +30,6 @@ fun main() = application { } } } - if (System.getProperty("takeScreenshot") == "true") { - extend(SingleScreenshot()) { - this.outputFile = System.getProperty("screenshotPath") - } - } extend(cm) class Animation: Keyframer() { val position by Vector2Channel(arrayOf("x", "y")) diff --git a/orx-jvm/orx-keyframer/src/demo/kotlin/DemoSimple01.kt b/orx-jvm/orx-keyframer/src/demo/kotlin/DemoSimple01.kt index 79a78205..d9b58b02 100644 --- a/orx-jvm/orx-keyframer/src/demo/kotlin/DemoSimple01.kt +++ b/orx-jvm/orx-keyframer/src/demo/kotlin/DemoSimple01.kt @@ -11,11 +11,6 @@ fun main() = application { } val animation = Animation() animation.loadFromJson(URL(resourceUrl("/demo-simple-01.json"))) - if (System.getProperty("takeScreenshot") == "true") { - extend(SingleScreenshot()) { - this.outputFile = System.getProperty("screenshotPath") - } - } extend { animation(seconds) drawer.circle(animation.position, 100.0) diff --git a/orx-jvm/orx-keyframer/src/demo/kotlin/DemoSimple02.kt b/orx-jvm/orx-keyframer/src/demo/kotlin/DemoSimple02.kt index 6032fd61..ef6dd442 100644 --- a/orx-jvm/orx-keyframer/src/demo/kotlin/DemoSimple02.kt +++ b/orx-jvm/orx-keyframer/src/demo/kotlin/DemoSimple02.kt @@ -13,11 +13,6 @@ fun main() = application { } val animation = Animation() animation.loadFromJson(URL(resourceUrl("/demo-simple-02.json"))) - if (System.getProperty("takeScreenshot") == "true") { - extend(SingleScreenshot()) { - this.outputFile = System.getProperty("screenshotPath") - } - } extend { animation(seconds) drawer.fill = animation.color diff --git a/orx-jvm/orx-keyframer/src/demo/kotlin/DemoSimpleExpressions01.kt b/orx-jvm/orx-keyframer/src/demo/kotlin/DemoSimpleExpressions01.kt index 605b2dd9..6b14eedd 100644 --- a/orx-jvm/orx-keyframer/src/demo/kotlin/DemoSimpleExpressions01.kt +++ b/orx-jvm/orx-keyframer/src/demo/kotlin/DemoSimpleExpressions01.kt @@ -14,11 +14,6 @@ fun main() = application { val animation = Animation() animation.loadFromJson(URL(resourceUrl("/demo-simple-expressions-01.json")), parameters = mapOf("cycleDuration" to 2.0)) - if (System.getProperty("takeScreenshot") == "true") { - extend(SingleScreenshot()) { - this.outputFile = System.getProperty("screenshotPath") - } - } extend { animation(seconds) drawer.circle(animation.position, animation.radius) diff --git a/orx-jvm/orx-panel/src/demo/kotlin/DemoHorizontalLayout01.kt b/orx-jvm/orx-panel/src/demo/kotlin/DemoHorizontalLayout01.kt index d72b7e38..e4befcb3 100644 --- a/orx-jvm/orx-panel/src/demo/kotlin/DemoHorizontalLayout01.kt +++ b/orx-jvm/orx-panel/src/demo/kotlin/DemoHorizontalLayout01.kt @@ -12,12 +12,6 @@ import org.openrndr.panel.style.* fun main() = application { program { - // -- this block is for automation purposes only - if (System.getProperty("takeScreenshot") == "true") { - extend(SingleScreenshot()) { - this.outputFile = System.getProperty("screenshotPath") - } - } val cm = controlManager { styleSheet(has class_ "horizontal") { paddingLeft = 10.px diff --git a/orx-jvm/orx-panel/src/demo/kotlin/DemoVerticalLayout01.kt b/orx-jvm/orx-panel/src/demo/kotlin/DemoVerticalLayout01.kt index febc56d4..57aa0cc5 100644 --- a/orx-jvm/orx-panel/src/demo/kotlin/DemoVerticalLayout01.kt +++ b/orx-jvm/orx-panel/src/demo/kotlin/DemoVerticalLayout01.kt @@ -8,12 +8,6 @@ import org.openrndr.panel.style.* fun main() = application { program { - // -- this block is for automation purposes only - if (System.getProperty("takeScreenshot") == "true") { - extend(SingleScreenshot()) { - this.outputFile = System.getProperty("screenshotPath") - } - } val cm = controlManager { styleSheet(has class_ "side-bar") { this.height = 100.percent diff --git a/orx-jvm/orx-panel/src/demo/kotlin/DemoWatchDiv01.kt b/orx-jvm/orx-panel/src/demo/kotlin/DemoWatchDiv01.kt index 71d81d3d..ce35ec33 100644 --- a/orx-jvm/orx-panel/src/demo/kotlin/DemoWatchDiv01.kt +++ b/orx-jvm/orx-panel/src/demo/kotlin/DemoWatchDiv01.kt @@ -41,12 +41,6 @@ fun main() = application { } program { - // -- this block is for automation purposes only - if (System.getProperty("takeScreenshot") == "true") { - extend(SingleScreenshot()) { - this.outputFile = System.getProperty("screenshotPath") - } - } val programState = ProgramState() val cm = controlManager { layout { diff --git a/orx-jvm/orx-panel/src/demo/kotlin/DemoWatchObjectDiv01.kt b/orx-jvm/orx-panel/src/demo/kotlin/DemoWatchObjectDiv01.kt index 07409b39..5c2e2e17 100644 --- a/orx-jvm/orx-panel/src/demo/kotlin/DemoWatchObjectDiv01.kt +++ b/orx-jvm/orx-panel/src/demo/kotlin/DemoWatchObjectDiv01.kt @@ -17,12 +17,6 @@ fun main() = application { var z = 0 } program { - // -- this block is for automation purposes only - if (System.getProperty("takeScreenshot") == "true") { - extend(SingleScreenshot()) { - this.outputFile = System.getProperty("screenshotPath") - } - } val programState = State() val cm = controlManager { layout { diff --git a/orx-jvm/orx-rabbit-control/src/demo/kotlin/DemoRabbitControl.kt b/orx-jvm/orx-rabbit-control/src/demo/kotlin/DemoRabbitControl.kt index 4c83073d..bc2d4bf6 100644 --- a/orx-jvm/orx-rabbit-control/src/demo/kotlin/DemoRabbitControl.kt +++ b/orx-jvm/orx-rabbit-control/src/demo/kotlin/DemoRabbitControl.kt @@ -15,13 +15,6 @@ fun main() = application { } program { - // -- this block is for automation purposes only - if (System.getProperty("takeScreenshot") == "true") { - extend(SingleScreenshot()) { - this.outputFile = System.getProperty("screenshotPath") - } - } - val rabbit = RabbitControlServer() val font = loadFont("demo-data/fonts/IBMPlexMono-Regular.ttf", 20.0) val settings = object { diff --git a/orx-jvm/orx-rabbit-control/src/demo/kotlin/DemoRabbitControlManualOverlay.kt b/orx-jvm/orx-rabbit-control/src/demo/kotlin/DemoRabbitControlManualOverlay.kt index 6bc65447..42c70272 100644 --- a/orx-jvm/orx-rabbit-control/src/demo/kotlin/DemoRabbitControlManualOverlay.kt +++ b/orx-jvm/orx-rabbit-control/src/demo/kotlin/DemoRabbitControlManualOverlay.kt @@ -12,13 +12,6 @@ fun main() = application { } program { - // -- this block is for automation purposes only - if (System.getProperty("takeScreenshot") == "true") { - extend(SingleScreenshot()) { - this.outputFile = System.getProperty("screenshotPath") - } - } - val rabbit = RabbitControlServer(showQRUntilClientConnects = false) val settings = object { diff --git a/orx-jvm/orx-rabbit-control/src/demo/kotlin/DemoRabbitHole.kt b/orx-jvm/orx-rabbit-control/src/demo/kotlin/DemoRabbitHole.kt index e95a39cb..d1c03d00 100644 --- a/orx-jvm/orx-rabbit-control/src/demo/kotlin/DemoRabbitHole.kt +++ b/orx-jvm/orx-rabbit-control/src/demo/kotlin/DemoRabbitHole.kt @@ -15,13 +15,6 @@ fun main() = application { } program { - // -- this block is for automation purposes only - if (System.getProperty("takeScreenshot") == "true") { - extend(SingleScreenshot()) { - this.outputFile = System.getProperty("screenshotPath") - } - } - /** * Start RabbitControlServer with a Rabbithole with key 'orxtest' * Please visit https://rabbithole.rabbitcontrol.cc for more information. diff --git a/orx-time-operators/src/demo/kotlin/DemoEnvelope.kt b/orx-time-operators/src/demo/kotlin/DemoEnvelope.kt index 37b16187..9bb12fb4 100644 --- a/orx-time-operators/src/demo/kotlin/DemoEnvelope.kt +++ b/orx-time-operators/src/demo/kotlin/DemoEnvelope.kt @@ -11,11 +11,6 @@ fun main() { val size = Envelope(50.0, 400.0, 0.5, 0.5) val rotation = Envelope(easingFactor = 0.4) - if (System.getProperty("takeScreenshot") == "true") { - extend(SingleScreenshot()) { - this.outputFile = System.getProperty("screenshotPath") - } - } extend(TimeOperators()) { track(size, rotation) } diff --git a/orx-time-operators/src/demo/kotlin/DemoLFO.kt b/orx-time-operators/src/demo/kotlin/DemoLFO.kt index 79e22b84..3785a118 100644 --- a/orx-time-operators/src/demo/kotlin/DemoLFO.kt +++ b/orx-time-operators/src/demo/kotlin/DemoLFO.kt @@ -12,9 +12,8 @@ fun main() { val size = LFO() val rotation = LFO(LFOWave.Sine) if (System.getProperty("takeScreenshot") == "true") { - extend(SingleScreenshot()) { - this.delayFrames = 10 - this.outputFile = System.getProperty("screenshotPath") + extensions.filterIsInstance().forEach { + it.delayFrames = 10 } } extend(TimeOperators()) { diff --git a/orx-timer/README.md b/orx-timer/README.md index 4f052f95..e3227fd7 100644 --- a/orx-timer/README.md +++ b/orx-timer/README.md @@ -33,19 +33,6 @@ fun main() = application { Note that drawing inside the `repeat` action has no effect. Have a look at the demos listed below for an example of `repeat` triggered drawing. -## Demos - - * [Simple `repeat` demonstration](src/demo/kotlin/DemoRepeat01.kt) - * [A `repeat` demonstration with drawing](src/demo/kotlin/DemoRepeat02.kt) - * [Simple `timeOut` demonstration](src/demo/kotlin/DemoTimeOut01.kt) - ## Demos ### DemoRepeat01 diff --git a/orx-timer/src/demo/kotlin/DemoRepeat01.kt b/orx-timer/src/demo/kotlin/DemoRepeat01.kt index 286a4d4d..e32289cd 100644 --- a/orx-timer/src/demo/kotlin/DemoRepeat01.kt +++ b/orx-timer/src/demo/kotlin/DemoRepeat01.kt @@ -1,19 +1,10 @@ import org.openrndr.application -import org.openrndr.extensions.SingleScreenshot import org.openrndr.extra.timer.repeat fun main() = application { program { repeat(2.0) { - println("hello there $seconds" ) - } - if (System.getProperty("takeScreenshot") == "true") { - extend(SingleScreenshot()) { - this.outputFile = System.getProperty("screenshotPath") - } - } - extend { - + println("hello there $seconds") } } -} \ No newline at end of file +} diff --git a/orx-timer/src/demo/kotlin/DemoRepeat02.kt b/orx-timer/src/demo/kotlin/DemoRepeat02.kt index fe16b3ea..8f30fc16 100644 --- a/orx-timer/src/demo/kotlin/DemoRepeat02.kt +++ b/orx-timer/src/demo/kotlin/DemoRepeat02.kt @@ -1,7 +1,6 @@ import org.openrndr.application import org.openrndr.color.ColorRGBa import org.openrndr.events.Event -import org.openrndr.extensions.SingleScreenshot import org.openrndr.extra.timer.repeat /** @@ -19,11 +18,6 @@ fun main() = application { // -- we can not draw here, so we relay the repeat signal to the event event.trigger(null) } - if (System.getProperty("takeScreenshot") == "true") { - extend(SingleScreenshot()) { - this.outputFile = System.getProperty("screenshotPath") - } - } extend { drawer.clear(ColorRGBa.PINK) // -- by explicitly calling deliver we know that the drawing code in the listener will be diff --git a/orx-timer/src/demo/kotlin/DemoTimeOut01.kt b/orx-timer/src/demo/kotlin/DemoTimeOut01.kt index cb641a7c..4a3b1b97 100644 --- a/orx-timer/src/demo/kotlin/DemoTimeOut01.kt +++ b/orx-timer/src/demo/kotlin/DemoTimeOut01.kt @@ -1,16 +1,10 @@ import org.openrndr.application -import org.openrndr.extensions.SingleScreenshot import org.openrndr.extra.timer.timeOut fun main() = application { program { - if (System.getProperty("takeScreenshot") == "true") { - extend(SingleScreenshot()) { - this.outputFile = System.getProperty("screenshotPath") - } - } timeOut(2.0) { - println("hello there $seconds" ) + println("hello there $seconds") } } -} \ No newline at end of file +}