Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hamoid committed Jun 25, 2024
1 parent c30594f commit cab1552
Show file tree
Hide file tree
Showing 269 changed files with 221 additions and 233 deletions.
2 changes: 1 addition & 1 deletion docs/ORX/compositor.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Compositor
parent: ORX
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 170
has_children: false
---
Expand Down
2 changes: 1 addition & 1 deletion docs/ORX/distanceFields.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Distance fields
parent: ORX
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 220
has_children: false
---
Expand Down
2 changes: 1 addition & 1 deletion docs/ORX/imageFilters.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Image post-processing with filters
parent: ORX
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 160
has_children: false
---
Expand Down
2 changes: 1 addition & 1 deletion docs/ORX/imageFit.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Image fit
parent: ORX
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 200
has_children: false
---
Expand Down
2 changes: 1 addition & 1 deletion docs/ORX/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: ORX
parent: ~
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 1100
has_children: true
---
Expand Down
2 changes: 1 addition & 1 deletion docs/ORX/kinect.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Kinect
parent: ORX
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 120
has_children: false
---
Expand Down
54 changes: 1 addition & 53 deletions docs/ORX/midiControllers.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: MIDI controllers
parent: ORX
last_modified_at: 2024.06.02 16:41:01 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 140
has_children: false
---
Expand Down Expand Up @@ -179,57 +179,5 @@ fun main() = application {
}
}
```

## Using MIDI with a GUI

Implementing a GUI to act as a virtual MIDI controller is
useful to keep the program in a usable state even when the
actual hardware is not available.
The GUI provides the added benefit of visualizing the current MIDI values.

The following example shows how to use parameters with a traditional `class` instead
of an `object`. This class tries to connect to the requested device by name,
creates two parameters, binds them to MIDI control change messages and
updates a GUI based on received MIDI messages.

The program continues to work even if
the hardware is not available, allowing to simulate the MIDI controller
events by adjusting sliders in the GUI.

```kotlin
class MidiDevice(program: Program, deviceName: String, gui: GUI) {
private val controller = program.openMidiDeviceOrNull(deviceName)

@DoubleParameter("radius", 0.0, 100.0)
var radius = 0.0

@DoubleParameter("x", -100.0, 100.0)
var x = 0.0

init {
// List the available MIDI devices. Useful to know what the OS detects
// and what names the devices are given.
listMidiDevices().forEach {
println(it.toString())
}

// If `controller` is null don't do anything with it
controller?.let {
program.bindMidiControl(::radius, controller, 0, 1)
program.bindMidiControl(::x, controller, 0, 2)

// The MidiConsole overlays the message channel and control number of received messages
program.extend(MidiConsole()) {
register(controller)
}
}

gui.add(this)
}
}
```

Note that one can swap GUI for WindowedGUI on OPENRNDR 0.4.5 or newer
to have the GUI on a separate window, typically on a secondary display.

[edit on GitHub](https://github.com/openrndr/openrndr-guide/blob/main/src/main/kotlin/docs/80_ORX/C140_Midi_controllers.kt){: .btn .btn-github }
2 changes: 1 addition & 1 deletion docs/ORX/noise.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Noise
parent: ORX
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 110
has_children: false
---
Expand Down
2 changes: 1 addition & 1 deletion docs/ORX/osc.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: OSC
parent: ORX
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 150
has_children: false
---
Expand Down
2 changes: 1 addition & 1 deletion docs/ORX/poissonFills.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Poisson fills
parent: ORX
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 210
has_children: false
---
Expand Down
50 changes: 2 additions & 48 deletions docs/ORX/quickUIs.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Quick UIs
parent: ORX
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.05.22 16:04:58 +0200
nav_order: 180
has_children: false
---
Expand All @@ -26,7 +26,7 @@ in [`orx-parameters`](https://github.com/openrndr/orx/tree/master/orx-parameters
`orx-gui` is incredibly powerful in combination with the live coding environment
[`orx-olive`](https://github.com/openrndr/orx/tree/master/orx-jvm/orx-olive),
the guide covers that in the
[live coding section](https://guide.openrndr.org/ORX/liveCoding.html).
[live coding section](https://guide.openrndr.org/useCases/liveCoding.html).
That said, it is not a required combination.

## Prerequisites
Expand Down Expand Up @@ -246,52 +246,6 @@ We now see that the sidebar is populated with a _settings_,
_Multiply blend_, _Blue layer_, and an _Approximate gaussian blur_ compartment.
This creates composites that are easy to tweak.

## Live-coding workflow

`orx-gui` is built with the `orx-olive` environment in mind.
Its use is similar to the workflows described prior, however, in live
mode the ui comes with some extra features to make live-coding more fun.
Compartments can be added and removed from the .kts script. The best
part is that `orx-gui` can retain parameter settings between script
changes by default, so nothing jumps around.

In the case of using `orx-gui` from an olive script (`live.kts`) it looks like this

```kotlin
@file:Suppress("UNUSED_LAMBDA_EXPRESSION")
import org.openrndr.Program
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.*
import org.openrndr.extra.compositor.compose
import org.openrndr.extra.compositor.draw
import org.openrndr.extra.compositor.layer
import org.openrndr.extra.compositor.post
import org.openrndr.extra.gui.GUI
import org.openrndr.extra.parameters.*

{ program: Program ->
program.apply {
val gui = GUI()
val settings = @Description("User settings") object : Reloadable() {
@DoubleParameter("x", 0.0, 1000.0)
var x = 0.0
}
val composite = compose {
draw {
drawer.clear(ColorRGBa.PINK)
drawer.circle(settings.x, height / 2.0, 100.0)
}
}
extend(gui) {
add(settings)
}
extend() {
composite.draw(drawer)
}
}
}
```

## Parameter annotations

We have seen some of the annotations in the workflow descriptions
Expand Down
2 changes: 1 addition & 1 deletion docs/ORX/shadeStylePresets.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Shade style presets
parent: ORX
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 190
has_children: false
---
Expand Down
2 changes: 1 addition & 1 deletion docs/advancedTopics/ComputeShaders.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Compute shaders
parent: Advanced topics
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 160
has_children: false
---
Expand Down
2 changes: 1 addition & 1 deletion docs/advancedTopics/applicationFlow.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Application Flow
parent: Advanced topics
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 110
has_children: false
---
Expand Down
4 changes: 2 additions & 2 deletions docs/advancedTopics/headlessApplications.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Headless applications
parent: Advanced topics
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.05.22 14:22:38 +0200
nav_order: 140
has_children: false
---
Expand All @@ -30,7 +30,7 @@ Headless applications cannot draw on the backbuffer, because there
is no backbuffer. In order to draw you need to create a
[RenderTarget](https://guide.openrndr.org/drawing/renderTargets.html) and draw on it.
Render target contents can easily be saved to file, or rendered to
[video](https://guide.openrndr.org/videos/writingToVideoFiles.html).
[video](https://guide.openrndr.org/extensions/writingToVideoFiles.html#writing-to-video-using-render-targets).

#### Mouse and keyboard events

Expand Down
2 changes: 1 addition & 1 deletion docs/advancedTopics/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Advanced topics
parent: ~
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 1110
has_children: true
---
Expand Down
2 changes: 1 addition & 1 deletion docs/advancedTopics/integerColorBuffers.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Integer color buffers
parent: Advanced topics
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 155
has_children: false
---
Expand Down
2 changes: 1 addition & 1 deletion docs/advancedTopics/lowLevelDrawing.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Low-level drawing
parent: Advanced topics
last_modified_at: 2024.01.16 18:11:44 +0100
last_modified_at: 2024.01.15 12:27:05 +0100
nav_order: 150
has_children: false
---
Expand Down
2 changes: 1 addition & 1 deletion docs/advancedTopics/presentationControl.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Presentation Control
parent: Advanced topics
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 120
has_children: false
---
Expand Down
2 changes: 1 addition & 1 deletion docs/animation/basicAnimations.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Basic animation
parent: Animation
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 50
has_children: false
---
Expand Down
2 changes: 1 addition & 1 deletion docs/animation/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Animation
parent: ~
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 1080
has_children: true
---
Expand Down
2 changes: 1 addition & 1 deletion docs/animation/interactiveAnimations.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Interactive animations
parent: Animation
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 100
has_children: false
---
Expand Down
2 changes: 1 addition & 1 deletion docs/bestPractices/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Best practices
parent: ~
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 1098
has_children: true
---
Expand Down
2 changes: 1 addition & 1 deletion docs/debugging/logging.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Logging and debugging
parent: ~
last_modified_at: 2024.01.16 18:11:44 +0100
last_modified_at: 2024.01.15 13:08:17 +0100
nav_order: 1105
has_children: true
---
Expand Down
2 changes: 1 addition & 1 deletion docs/drawing/arrayTextures.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Array textures
parent: Drawing
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 370
has_children: false
---
Expand Down
2 changes: 1 addition & 1 deletion docs/drawing/asynchronousImageLoading.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Asynchronous image loading
parent: Drawing
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 330
has_children: false
---
Expand Down
2 changes: 1 addition & 1 deletion docs/drawing/circlesRectanglesLines.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Drawing circles, rectangles and lines
parent: Drawing
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 100
has_children: false
---
Expand Down
2 changes: 1 addition & 1 deletion docs/drawing/clipping.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Clipping
parent: Drawing
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 320
has_children: false
---
Expand Down
2 changes: 1 addition & 1 deletion docs/drawing/color.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
layout: default
title: Color
parent: Drawing
last_modified_at: 2024.06.02 12:41:53 +0200
last_modified_at: 2024.04.04 18:44:14 +0200
nav_order: 130
has_children: false
---
Expand Down
Loading

0 comments on commit cab1552

Please sign in to comment.