Skip to content

Commit a0f693e

Browse files
SOFIE-3367 feat: allows to cofigure an offset-factor between the L and R joycon … (Sofie-Automation#1231)
* feat: allows to cofigure an offset-factor between the L and R joycon joysticks to compensate for different rates. New URL param is called joycon_rightHandOffset. Used to be hardcoded to 1.4 which now is a default. (cherry picked from commit 9d186ae) * feat: adds docs
1 parent 8da63de commit a0f693e

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

meteor/client/ui/Prompter/PrompterView.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ interface PrompterConfig {
4444
joycon_rangeNeutralMin?: number
4545
joycon_rangeNeutralMax?: number
4646
joycon_rangeFwdMax?: number
47+
joycon_rightHandOffset?: number
4748
pedal_speedMap?: number[]
4849
pedal_reverseSpeedMap?: number[]
4950
pedal_rangeRevMin?: number
@@ -144,6 +145,7 @@ export class PrompterViewInner extends MeteorReactComponent<Translated<IProps &
144145
joycon_rangeNeutralMin: parseInt(firstIfArray(queryParams['joycon_rangeNeutralMin']) as string, 10) || undefined,
145146
joycon_rangeNeutralMax: parseInt(firstIfArray(queryParams['joycon_rangeNeutralMax']) as string, 10) || undefined,
146147
joycon_rangeFwdMax: parseInt(firstIfArray(queryParams['joycon_rangeFwdMax']) as string, 10) || undefined,
148+
joycon_rightHandOffset: parseInt(firstIfArray(queryParams['joycon_rightHandOffset']) as string, 10) || undefined,
147149
pedal_speedMap:
148150
queryParams['pedal_speedMap'] === undefined
149151
? undefined

meteor/client/ui/Prompter/controller/joycon-device.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export class JoyConController extends ControllerAbstract {
1717
private rangeNeutralMin = -0.25 // pedal "back" position where reverse-range transistions to the neutral x
1818
private rangeNeutralMax = 0.25 // pedal "front" position where scrolling starts, the 0 speed origin
1919
private rangeFwdMax = 1 // pedal "all front" position where scrolling is maxed out
20+
private rightHandOffset = 1.4 // factor increased by 1.4 to account for the R joystick being less sensitive than L
2021
private speedMap = [1, 2, 3, 4, 5, 8, 12, 30]
2122
private reverseSpeedMap = [1, 2, 3, 4, 5, 8, 12, 30]
2223
private deadBand = 0.25
@@ -40,6 +41,7 @@ export class JoyConController extends ControllerAbstract {
4041
this.rangeNeutralMin = view.configOptions.joycon_rangeNeutralMin || this.rangeNeutralMin
4142
this.rangeNeutralMax = view.configOptions.joycon_rangeNeutralMax || this.rangeNeutralMax
4243
this.rangeFwdMax = view.configOptions.joycon_rangeFwdMax || this.rangeFwdMax
44+
this.rightHandOffset = view.configOptions.joycon_rightHandOffset || this.rightHandOffset
4345
this.speedMap = view.configOptions.joycon_speedMap || this.speedMap
4446
this.reverseSpeedMap = view.configOptions.joycon_reverseSpeedMap || this.reverseSpeedMap
4547
this.deadBand = Math.min(Math.abs(this.rangeNeutralMin), Math.abs(this.rangeNeutralMax))
@@ -249,8 +251,8 @@ export class JoyConController extends ControllerAbstract {
249251
if (joycon.mode === 'L') {
250252
lastSeenSpeed = joycon.axes[0] * -1 // in this mode, L is "negative"
251253
} else if (joycon.mode === 'R') {
252-
lastSeenSpeed = joycon.axes[0] * 1.4 // in this mode, R is "positive"
253-
// factor increased by 1.4 to account for the R joystick being less sensitive than L
254+
lastSeenSpeed = joycon.axes[0] * this.rightHandOffset // in this mode, R is "positive"
255+
// rightHandOffset allows for different rates between the two controllers
254256
}
255257
this.timestampOfLastUsedJoyconInput = joycon.timestamp
256258
}
@@ -260,8 +262,8 @@ export class JoyConController extends ControllerAbstract {
260262
if (Math.abs(joycon.axes[1]) > this.deadBand) {
261263
lastSeenSpeed = joycon.axes[1] * -1 // in this mode, we are "negative" on both sticks....
262264
} else if (Math.abs(joycon.axes[3]) > this.deadBand) {
263-
lastSeenSpeed = joycon.axes[3] * -1.4 // in this mode, we are "negative" on both sticks....
264-
// factor increased by 1.4 to account for the R joystick being less sensitive than L
265+
lastSeenSpeed = joycon.axes[3] * this.rightHandOffset * -1 // in this mode, we are "negative" on both sticks....
266+
// rightHandOffset allows for different rates between the two controllers
265267
}
266268
this.timestampOfLastUsedJoyconInput = joycon.timestamp
267269
}

packages/documentation/docs/user-guide/features/prompter.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The prompter UI can be configured using query parameters:
2828
| `showmarker` | 0 / 1 | If the marker is not set to "hide", control if the marker is hidden or not | `1` |
2929
| `showscroll` | 0 / 1 | Whether the scroll bar should be shown | `1` |
3030
| `followtake` | 0 / 1 | Whether the prompter should automatically scroll to current segment when the operator TAKE:s it | `1` |
31-
| `showoverunder` | 0 / 1 | The timer in the top-right of the prompter, showing the overtime/undertime of the current show. | `1` |
31+
| `showoverunder` | 0 / 1 | The timer in the top-right of the prompter, showing the overtime/undertime of the current show. | `1` |
3232
| `debug` | 0 / 1 | Whether to display a debug box showing controller input values and the calculated speed the prompter is currently scrolling at. Used to tweak speedMaps and ranges. | `0` |
3333

3434
Example: [http://127.0.0.1/prompter/studio0/?mode=mouse&followtake=0&fontsize=20](http://127.0.0.1/prompter/studio0/?mode=mouse&followtake=0&fontsize=20)
@@ -37,9 +37,9 @@ Example: [http://127.0.0.1/prompter/studio0/?mode=mouse&followtake=0&fontsize=20
3737

3838
The prompter can be controlled by different types of controllers. The control mode is set by a query parameter, like so: `?mode=mouse`.
3939

40-
| Query parameter | Description |
41-
| :---------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
42-
| Default | Controlled by both mouse and keyboard |
40+
| Query parameter | Description |
41+
| :---------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
42+
| Default | Controlled by both mouse and keyboard |
4343
| `?mode=mouse` | Controlled by mouse only. [See configuration details](prompter.md#control-using-mouse-scroll-wheel) |
4444
| `?mode=keyboard` | Controlled by keyboard only. [See configuration details](prompter.md#control-using-keyboard) |
4545
| `?mode=shuttlekeyboard` | Controlled by a Contour Design ShuttleXpress, X-keys Jog and Shuttle or any compatible, configured as keyboard-ish device. [See configuration details](prompter.md#control-using-contour-shuttlexpress-or-x-keys) |
@@ -117,7 +117,7 @@ If you want to use traditional analogue pedals with 5 volt TRS connection, a con
117117
- `pedal_rangeNeutralMax` has to be greater than `pedal_rangeNeutralMin`
118118
- `pedal_rangeFwdMax` has to be greater than `pedal_rangeNeutralMax`
119119

120-
![Yamaha FC7 mapped for both a forward \(80-127\) and backwards \(0-35\) range.](/img/docs/main/features/yamaha-fc7.jpg)
120+
![Yamaha FC7 mapped for both a forward (80-127) and backwards (0-35) range.](/img/docs/main/features/yamaha-fc7.jpg)
121121

122122
The default values allow for both going forwards and backwards. This matches the _Yamaha FC7_ expression pedal. The default values create a forward-range from 80-127, a neutral zone from 35-80 and a reverse-range from 0-35.
123123

@@ -158,6 +158,7 @@ The Joycons can operate in 3 modes, the L-stick, the R-stick or both L+R sticks
158158
| `joycon_rangeNeutralMin` | number | The beginning of the backwards-range. | `-0.25` |
159159
| `joycon_rangeNeutralMax` | number | The minimum input to run forward, the start of the forward-range \(min speed\). This is also the end of any "deadband" you want filter out before starting moving forwards. | `0.25` |
160160
| `joycon_rangeFwdMax` | number | The maximum input, the end of the forward-range \(max speed\) | `1` |
161+
| `joycon_rightHandOffset` | number | A ratio to increase or decrease the R Joycon joystick sensitivity relative to the L Joycon. | `1.4` |
161162

162163
- `joycon_rangeNeutralMin` has to be greater than `joycon_rangeRevMin`
163164
- `joycon_rangeNeutralMax` has to be greater than `joycon_rangeNeutralMin`

0 commit comments

Comments
 (0)