-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aefeda4
commit 56c1268
Showing
21 changed files
with
246 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## W/2.0 | ||
|
||
More extensively covered in the [W/ Documentation](https://www.whimsicalraps.com/pages/w-type). | ||
|
||
There are separate ops for each supported algorithm: delay, synth, tape. Two | ||
units can be connected using a different i2c address (refer to the official | ||
documentation for more details). The following section describes ops that | ||
control which unit is selected. These ops apply to all algorithms. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
["W/.SEL"] | ||
prototype = "W/.SEL x" | ||
short = "Sets target W/2.0 unit (`1` = primary, `2` = secondary)." | ||
|
||
["W/1"] | ||
prototype = "W/1: ..." | ||
short = "Send following W/2.0 OPs to unit 1 ignoring the currently selected unit." | ||
|
||
["W/2"] | ||
prototype = "W/2: ..." | ||
short = "Send following W/2.0 OPs to unit 2 ignoring the currently selected unit." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#include "ops/wslash_shared.h" | ||
|
||
#include "helpers.h" | ||
#include "teletype.h" | ||
|
||
static void mod_WS1_func(scene_state_t *ss, exec_state_t *es, | ||
command_state_t *cs, | ||
const tele_command_t *post_command); | ||
static void mod_WS2_func(scene_state_t *ss, exec_state_t *es, | ||
command_state_t *cs, | ||
const tele_command_t *post_command); | ||
static void op_WS_SEL_get(const void *data, scene_state_t *ss, exec_state_t *es, | ||
command_state_t *cs); | ||
|
||
// clang-format off | ||
|
||
const tele_mod_t mod_WS1 = MAKE_MOD(W/1, mod_WS1_func, 0); | ||
const tele_mod_t mod_WS2 = MAKE_MOD(W/2, mod_WS2_func, 0); | ||
const tele_op_t op_WS_SEL = MAKE_GET_OP(W/.SEL, op_WS_SEL_get , 1, false); | ||
|
||
// clang-format on | ||
|
||
uint8_t wslash_unit = 1; | ||
|
||
static void mod_WS1_func(scene_state_t *ss, exec_state_t *es, | ||
command_state_t *cs, | ||
const tele_command_t *post_command) { | ||
u8 u = wslash_unit; | ||
wslash_unit = 1; | ||
process_command(ss, es, post_command); | ||
wslash_unit = u; | ||
} | ||
|
||
static void mod_WS2_func(scene_state_t *ss, exec_state_t *es, | ||
command_state_t *cs, | ||
const tele_command_t *post_command) { | ||
u8 u = wslash_unit; | ||
wslash_unit = 2; | ||
process_command(ss, es, post_command); | ||
wslash_unit = u; | ||
} | ||
|
||
static void op_WS_SEL_get(const void *NOTUSED(data), scene_state_t *NOTUSED(ss), | ||
exec_state_t *NOTUSED(es), command_state_t *cs) { | ||
u8 unit = cs_pop(cs); | ||
if (unit > 0 && unit < 3) wslash_unit = unit; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef _OPS_WSLASH_SHARED_H_ | ||
#define _OPS_WSLASH_SHARED_H_ | ||
|
||
#include "ops/op.h" | ||
|
||
extern const tele_mod_t mod_WS1; | ||
extern const tele_mod_t mod_WS2; | ||
|
||
extern const tele_op_t op_WS_SEL; | ||
|
||
extern uint8_t wslash_unit; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.