diff options
| author | yum <yum.food.vr@gmail.com> | 2022-10-02 17:24:17 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2022-10-02 17:24:17 -0700 |
| commit | 7e7a0d1c4179fb1a0cc771a25ad56be6b5dd5405 (patch) | |
| tree | 51cc9159d27c2ae5addde50f9b9a271c0d5dccff /osc_ctrl.py | |
| parent | 9222e7e9a21704dd6083adf8f53ce4437ba64a74 (diff) | |
Paging now works for other players at 40 characters per second
* Shorten animations to 1 frame
* Eliminate fx internal transition delays
* These were causing the shader parameters to interpolate, causing the
inconsistent / flickering letters I was seeing
Diffstat (limited to 'osc_ctrl.py')
| -rw-r--r-- | osc_ctrl.py | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/osc_ctrl.py b/osc_ctrl.py index 8a7d41c..a1e5c6c 100644 --- a/osc_ctrl.py +++ b/osc_ctrl.py @@ -78,9 +78,24 @@ def updateCell(cell_idx, letter_encoded, s0, s1, s2): addr="/avatar/parameters/" + getSelectParam(cell_idx, 2) client.send_message(addr, s2) +def enable(): + for i in range(0, NUM_LAYERS): + addr="/avatar/parameters/" + getEnableParam(i) + client.send_message(addr, True) + +def disable(): + for i in range(0, NUM_LAYERS): + addr="/avatar/parameters/" + getEnableParam(i) + client.send_message(addr, False) + # Send a cell all at once. # `which_cell` is an integer in the range [0,8). def sendMessageCellDiscrete(msg_cell, which_cell): + # Disable each layer. + disable() + + time.sleep(CELL_TX_TIME_S / 2.0) + # Really long messages just wrap back around. which_cell = (which_cell % 8) @@ -94,25 +109,15 @@ def sendMessageCellDiscrete(msg_cell, which_cell): updateCell(i, msg_cell[i], s0, s1, s2) # Wait for convergence. - time.sleep(CELL_TX_TIME_S / 3.0) + time.sleep(CELL_TX_TIME_S / 4.0) # Enable each layer. # TODO(yum_food) for some reason, if we don't active every layer, the # desired subset won't reliably fire. Why? - for i in range(0, NUM_LAYERS): - addr="/avatar/parameters/" + getEnableParam(i) - client.send_message(addr, True) + enable() # Wait for convergence. - time.sleep(CELL_TX_TIME_S / 3.0) - - # Disable each layer. - for i in range(0, NUM_LAYERS): - addr="/avatar/parameters/" + getEnableParam(i) - client.send_message(addr, False) - - # Wait for convergence. - time.sleep(CELL_TX_TIME_S / 3.0) + time.sleep(CELL_TX_TIME_S / 4.0) # Send a cell smoothly spread out over the course of CELL_TX_TIME_S. # `which_cell` is an integer in the range [0,8). @@ -259,10 +264,8 @@ def closeBoard(): if __name__ == "__main__": generateEncoding(state) #openBoard() - clear() + #clear() for line in fileinput.input(): sendMessage(line) - sendMessage("") - |
