From d4581f7da744822e09790d93b15d3478374e74fe Mon Sep 17 00:00:00 2001 From: Greg Wuller Date: Tue, 3 Jan 2017 00:15:43 -0800 Subject: [PATCH 1/8] progress ii arp --- src/ops/hardware.c | 75 +++++++++++++++++++++++++++++++++++++++++++++- src/ops/hardware.h | 8 +++++ src/ops/op.c | 3 +- src/ops/op.h | 2 +- 4 files changed, 85 insertions(+), 3 deletions(-) diff --git a/src/ops/hardware.c b/src/ops/hardware.c index 40486497..e5c9441a 100644 --- a/src/ops/hardware.c +++ b/src/ops/hardware.c @@ -153,6 +153,19 @@ static void op_CY_POS_set(const void *data, scene_state_t *ss, exec_state_t *es, static void op_CY_REV_get(const void *data, scene_state_t *ss, exec_state_t *es, command_state_t *cs); +static void op_ARP_STYLE_get(const void *data, scene_state_t *ss, + exec_state_t *es, command_state_t *cs); +static void op_ARP_HOLD_get(const void *data, scene_state_t *ss, + exec_state_t *es, command_state_t *cs); +static void op_ARP_STEPS_get(const void *data, scene_state_t *ss, + exec_state_t *es, command_state_t *cs); +static void op_ARP_DIST_get(const void *data, scene_state_t *ss, + exec_state_t *es, command_state_t *cs); +static void op_ARP_GATE_get(const void *data, scene_state_t *ss, + exec_state_t *es, command_state_t *cs); +static void op_ARP_DIV_get(const void *data, scene_state_t *ss, + exec_state_t *es, command_state_t *cs); + // clang-format off const tele_op_t op_CV = MAKE_GET_SET_OP(CV , op_CV_get , op_CV_set , 1, true); @@ -209,6 +222,13 @@ const tele_op_t op_CY_RESET = MAKE_GET_OP(CY.RES , op_CY_RESET_get const tele_op_t op_CY_POS = MAKE_GET_SET_OP(CY.POS , op_CY_POS_get , op_CY_POS_set , 1, true); const tele_op_t op_CY_REV = MAKE_GET_OP(CY.REV , op_CY_REV_get , 1, false); +const tele_op_t op_ARP_STYLE = MAKE_GET_OP(ARP.STYLE , op_ARP_STYLE_get , 2, false); +const tele_op_t op_ARP_HOLD = MAKE_GET_OP(ARP.HOLD , op_ARP_HOLD_get , 1, false); +const tele_op_t op_ARP_STEPS = MAKE_GET_OP(ARP.STEPS , op_ARP_STEPS_get , 2, false); +const tele_op_t op_ARP_DIST = MAKE_GET_OP(ARP.DIST , op_ARP_DIST_get , 2, false); +const tele_op_t op_ARP_GATE = MAKE_GET_OP(ARP.GATE , op_ARP_GATE_get , 2, false); +const tele_op_t op_ARP_DIV = MAKE_GET_OP(ARP.DIV , op_ARP_DIV_get , 2, false); + // clang-format on @@ -1064,4 +1084,57 @@ static void op_CY_REV_get(const void *data, scene_state_t *ss, exec_state_t *es, int16_t a = cs_pop(cs); uint8_t d[] = { II_CY_REV, a }; tele_ii_tx(II_CY_ADDR, d, 2); -} \ No newline at end of file +} + +static void op_ARP_STYLE_get(const void *NOTUSED(data), + scene_state_t *NOTUSED(ss), + exec_state_t *NOTUSED(es), command_state_t *cs) { + int16_t a = cs_pop(cs); + int16_t b = cs_pop(cs); + uint8_t d[] = { II_ARP_STYLE, a >> 8, a & 0xff, b >> 8, b & 0xff }; + tele_ii_tx(II_ARP_ADDR, d, 5); +} + +static void op_ARP_HOLD_get(const void *NOTUSED(data), + scene_state_t *NOTUSED(ss), + exec_state_t *NOTUSED(es), command_state_t *cs) { + int16_t a = cs_pop(cs); + uint8_t d[] = { II_ARP_HOLD, a >> 8, a & 0xff }; + tele_ii_tx(II_ARP_ADDR, d, 3); +} + +static void op_ARP_STEPS_get(const void *NOTUSED(data), + scene_state_t *NOTUSED(ss), + exec_state_t *NOTUSED(es), command_state_t *cs) { + int16_t a = cs_pop(cs); + int16_t b = cs_pop(cs); + uint8_t d[] = { II_ARP_STEPS, a >> 8, a & 0xff, b >> 8, b & 0xff }; + tele_ii_tx(II_ARP_ADDR, d, 5); +} + +static void op_ARP_DIST_get(const void *NOTUSED(data), + scene_state_t *NOTUSED(ss), + exec_state_t *NOTUSED(es), command_state_t *cs) { + int16_t a = cs_pop(cs); + int16_t b = cs_pop(cs); + uint8_t d[] = { II_ARP_DIST, a >> 8, a & 0xff, b >> 8, b & 0xff }; + tele_ii_tx(II_ARP_ADDR, d, 5); +} + +static void op_ARP_GATE_get(const void *NOTUSED(data), + scene_state_t *NOTUSED(ss), + exec_state_t *NOTUSED(es), command_state_t *cs) { + int16_t a = cs_pop(cs); + int16_t b = cs_pop(cs); + uint8_t d[] = { II_ARP_GATE, a >> 8, a & 0xff, b >> 8, b & 0xff }; + tele_ii_tx(II_ARP_ADDR, d, 5); +} + +static void op_ARP_DIV_get(const void *NOTUSED(data), + scene_state_t *NOTUSED(ss), + exec_state_t *NOTUSED(es), command_state_t *cs) { + int16_t a = cs_pop(cs); + int16_t b = cs_pop(cs); + uint8_t d[] = { II_ARP_DIV, a >> 8, a & 0xff, b >> 8, b & 0xff }; + tele_ii_tx(II_ARP_ADDR, d, 5); +} diff --git a/src/ops/hardware.h b/src/ops/hardware.h index 11a72661..fc6be42d 100644 --- a/src/ops/hardware.h +++ b/src/ops/hardware.h @@ -57,4 +57,12 @@ extern const tele_op_t op_CY_RESET; extern const tele_op_t op_CY_POS; extern const tele_op_t op_CY_REV; +extern const tele_op_t op_ARP_STYLE; +extern const tele_op_t op_ARP_HOLD; +extern const tele_op_t op_ARP_STEPS; +extern const tele_op_t op_ARP_DIST; +extern const tele_op_t op_ARP_GATE; +extern const tele_op_t op_ARP_DIV; + + #endif diff --git a/src/ops/op.c b/src/ops/op.c index 5577d4d6..32829cf4 100644 --- a/src/ops/op.c +++ b/src/ops/op.c @@ -46,7 +46,8 @@ const tele_op_t *tele_ops[OPS] = { &op_KR_POS, &op_KR_LOOP_ST, &op_KR_LOOP_LEN, &op_KR_RESET, &op_MP_PRESET1, &op_MP_RESET1, &op_MP_STOP1, &op_MP_SCALE, &op_MP_PERIOD, &op_LV_PRESET, &op_LV_RESET, &op_LV_POS, &op_LV_L_ST, &op_LV_L_LEN, &op_LV_L_DIR, - &op_CY_PRESET, &op_CY_RESET, &op_CY_POS, &op_CY_REV, + &op_CY_PRESET, &op_CY_RESET, &op_CY_POS, &op_CY_REV, &op_ARP_STYLE, + &op_ARP_HOLD, &op_ARP_STEPS, &op_ARP_DIST, &op_ARP_GATE, &op_ARP_DIV, // maths &op_ADD, &op_SUB, &op_MUL, &op_DIV, &op_MOD, &op_RAND, &op_RRAND, &op_TOSS, diff --git a/src/ops/op.h b/src/ops/op.h index 7c165280..d1aa7d73 100644 --- a/src/ops/op.h +++ b/src/ops/op.h @@ -25,7 +25,7 @@ typedef struct { const uint8_t params; } tele_mod_t; -#define OPS 180 +#define OPS 186 extern const tele_op_t *tele_ops[OPS]; #define MODS 7 From d9dcba041bb0c2d325410381165c4307fd88434d Mon Sep 17 00:00:00 2001 From: Greg Wuller Date: Thu, 5 Jan 2017 01:58:55 -0800 Subject: [PATCH 2/8] arp ii reset, trans --- libavr32 | 2 +- src/ops/hardware.c | 47 ++++++++++++++++++++++++++++++++++------------ src/ops/hardware.h | 2 ++ src/ops/op.c | 1 + src/ops/op.h | 2 +- 5 files changed, 40 insertions(+), 14 deletions(-) diff --git a/libavr32 b/libavr32 index bb0e4e61..bdf04d75 160000 --- a/libavr32 +++ b/libavr32 @@ -1 +1 @@ -Subproject commit bb0e4e61506b95497587895b38627d0f0c69b8dd +Subproject commit bdf04d75d7be7936e3572df8d9ce9832eba596cb diff --git a/src/ops/hardware.c b/src/ops/hardware.c index e5c9441a..45dc6b23 100644 --- a/src/ops/hardware.c +++ b/src/ops/hardware.c @@ -165,6 +165,10 @@ static void op_ARP_GATE_get(const void *data, scene_state_t *ss, exec_state_t *es, command_state_t *cs); static void op_ARP_DIV_get(const void *data, scene_state_t *ss, exec_state_t *es, command_state_t *cs); +static void op_ARP_RESET_get(const void *data, scene_state_t *ss, + exec_state_t *es, command_state_t *cs); +static void op_ARP_TRANS_get(const void *data, scene_state_t *ss, + exec_state_t *es, command_state_t *cs); // clang-format off @@ -228,6 +232,8 @@ const tele_op_t op_ARP_STEPS = MAKE_GET_OP(ARP.STEPS , op_ARP_STEPS_get const tele_op_t op_ARP_DIST = MAKE_GET_OP(ARP.DIST , op_ARP_DIST_get , 2, false); const tele_op_t op_ARP_GATE = MAKE_GET_OP(ARP.GATE , op_ARP_GATE_get , 2, false); const tele_op_t op_ARP_DIV = MAKE_GET_OP(ARP.DIV , op_ARP_DIV_get , 2, false); +const tele_op_t op_ARP_RESET = MAKE_GET_OP(ARP.RESET , op_ARP_RESET_get , 1, false); +const tele_op_t op_ARP_TRANS = MAKE_GET_OP(ARP.TRANS , op_ARP_TRANS_get , 2, false); // clang-format on @@ -1091,16 +1097,16 @@ static void op_ARP_STYLE_get(const void *NOTUSED(data), exec_state_t *NOTUSED(es), command_state_t *cs) { int16_t a = cs_pop(cs); int16_t b = cs_pop(cs); - uint8_t d[] = { II_ARP_STYLE, a >> 8, a & 0xff, b >> 8, b & 0xff }; - tele_ii_tx(II_ARP_ADDR, d, 5); + uint8_t d[] = { II_ARP_STYLE, a & 0xff, b & 0xff }; + tele_ii_tx(II_ARP_ADDR, d, 3); } static void op_ARP_HOLD_get(const void *NOTUSED(data), scene_state_t *NOTUSED(ss), exec_state_t *NOTUSED(es), command_state_t *cs) { int16_t a = cs_pop(cs); - uint8_t d[] = { II_ARP_HOLD, a >> 8, a & 0xff }; - tele_ii_tx(II_ARP_ADDR, d, 3); + uint8_t d[] = { II_ARP_HOLD, a & 0xff }; + tele_ii_tx(II_ARP_ADDR, d, 2); } static void op_ARP_STEPS_get(const void *NOTUSED(data), @@ -1108,8 +1114,8 @@ static void op_ARP_STEPS_get(const void *NOTUSED(data), exec_state_t *NOTUSED(es), command_state_t *cs) { int16_t a = cs_pop(cs); int16_t b = cs_pop(cs); - uint8_t d[] = { II_ARP_STEPS, a >> 8, a & 0xff, b >> 8, b & 0xff }; - tele_ii_tx(II_ARP_ADDR, d, 5); + uint8_t d[] = { II_ARP_STEPS, a & 0xff, b & 0xff }; + tele_ii_tx(II_ARP_ADDR, d, 3); } static void op_ARP_DIST_get(const void *NOTUSED(data), @@ -1117,8 +1123,8 @@ static void op_ARP_DIST_get(const void *NOTUSED(data), exec_state_t *NOTUSED(es), command_state_t *cs) { int16_t a = cs_pop(cs); int16_t b = cs_pop(cs); - uint8_t d[] = { II_ARP_DIST, a >> 8, a & 0xff, b >> 8, b & 0xff }; - tele_ii_tx(II_ARP_ADDR, d, 5); + uint8_t d[] = { II_ARP_DIST, a & 0xff, b >> 8, b & 0xff }; + tele_ii_tx(II_ARP_ADDR, d, 4); } static void op_ARP_GATE_get(const void *NOTUSED(data), @@ -1126,8 +1132,8 @@ static void op_ARP_GATE_get(const void *NOTUSED(data), exec_state_t *NOTUSED(es), command_state_t *cs) { int16_t a = cs_pop(cs); int16_t b = cs_pop(cs); - uint8_t d[] = { II_ARP_GATE, a >> 8, a & 0xff, b >> 8, b & 0xff }; - tele_ii_tx(II_ARP_ADDR, d, 5); + uint8_t d[] = { II_ARP_GATE, a & 0xff, b & 0xff }; + tele_ii_tx(II_ARP_ADDR, d, 3); } static void op_ARP_DIV_get(const void *NOTUSED(data), @@ -1135,6 +1141,23 @@ static void op_ARP_DIV_get(const void *NOTUSED(data), exec_state_t *NOTUSED(es), command_state_t *cs) { int16_t a = cs_pop(cs); int16_t b = cs_pop(cs); - uint8_t d[] = { II_ARP_DIV, a >> 8, a & 0xff, b >> 8, b & 0xff }; - tele_ii_tx(II_ARP_ADDR, d, 5); + uint8_t d[] = { II_ARP_DIV, a & 0xff, b & 0xff }; + tele_ii_tx(II_ARP_ADDR, d, 3); +} + +static void op_ARP_RESET_get(const void *NOTUSED(data), + scene_state_t *NOTUSED(ss), + exec_state_t *NOTUSED(es), command_state_t *cs) { + int16_t a = cs_pop(cs); + uint8_t d[] = { II_ARP_RESET, a }; + tele_ii_tx(II_ARP_ADDR, d, 2); +} + +static void op_ARP_TRANS_get(const void *NOTUSED(data), + scene_state_t *NOTUSED(ss), + exec_state_t *NOTUSED(es), command_state_t *cs) { + int16_t a = cs_pop(cs); + int16_t b = cs_pop(cs); + uint8_t d[] = { II_ARP_TRANS, a, b >> 8, b & 0xff }; + tele_ii_tx(II_ARP_ADDR, d, 4); } diff --git a/src/ops/hardware.h b/src/ops/hardware.h index fc6be42d..13e563d0 100644 --- a/src/ops/hardware.h +++ b/src/ops/hardware.h @@ -63,6 +63,8 @@ extern const tele_op_t op_ARP_STEPS; extern const tele_op_t op_ARP_DIST; extern const tele_op_t op_ARP_GATE; extern const tele_op_t op_ARP_DIV; +extern const tele_op_t op_ARP_RESET; +extern const tele_op_t op_ARP_TRANS; #endif diff --git a/src/ops/op.c b/src/ops/op.c index 32829cf4..16f26bdd 100644 --- a/src/ops/op.c +++ b/src/ops/op.c @@ -48,6 +48,7 @@ const tele_op_t *tele_ops[OPS] = { &op_LV_RESET, &op_LV_POS, &op_LV_L_ST, &op_LV_L_LEN, &op_LV_L_DIR, &op_CY_PRESET, &op_CY_RESET, &op_CY_POS, &op_CY_REV, &op_ARP_STYLE, &op_ARP_HOLD, &op_ARP_STEPS, &op_ARP_DIST, &op_ARP_GATE, &op_ARP_DIV, + &op_ARP_RESET, &op_ARP_TRANS, // maths &op_ADD, &op_SUB, &op_MUL, &op_DIV, &op_MOD, &op_RAND, &op_RRAND, &op_TOSS, diff --git a/src/ops/op.h b/src/ops/op.h index d1aa7d73..3c99585e 100644 --- a/src/ops/op.h +++ b/src/ops/op.h @@ -25,7 +25,7 @@ typedef struct { const uint8_t params; } tele_mod_t; -#define OPS 186 +#define OPS 188 extern const tele_op_t *tele_ops[OPS]; #define MODS 7 From c6ed154222fc26ec1749ef5c77476156d02c0b6e Mon Sep 17 00:00:00 2001 From: Greg Wuller Date: Fri, 6 Jan 2017 12:35:40 -0800 Subject: [PATCH 3/8] arp ii: reset, trans, slew --- src/ops/hardware.c | 16 ++++++++++++++-- src/ops/hardware.h | 1 + src/ops/op.c | 2 +- src/ops/op.h | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/ops/hardware.c b/src/ops/hardware.c index 45dc6b23..6b6b6bfd 100644 --- a/src/ops/hardware.c +++ b/src/ops/hardware.c @@ -169,6 +169,8 @@ static void op_ARP_RESET_get(const void *data, scene_state_t *ss, exec_state_t *es, command_state_t *cs); static void op_ARP_TRANS_get(const void *data, scene_state_t *ss, exec_state_t *es, command_state_t *cs); +static void op_ARP_SLEW_get(const void *data, scene_state_t *ss, + exec_state_t *es, command_state_t *cs); // clang-format off @@ -226,14 +228,15 @@ const tele_op_t op_CY_RESET = MAKE_GET_OP(CY.RES , op_CY_RESET_get const tele_op_t op_CY_POS = MAKE_GET_SET_OP(CY.POS , op_CY_POS_get , op_CY_POS_set , 1, true); const tele_op_t op_CY_REV = MAKE_GET_OP(CY.REV , op_CY_REV_get , 1, false); -const tele_op_t op_ARP_STYLE = MAKE_GET_OP(ARP.STYLE , op_ARP_STYLE_get , 2, false); +const tele_op_t op_ARP_STYLE = MAKE_GET_OP(ARP.STY , op_ARP_STYLE_get , 2, false); const tele_op_t op_ARP_HOLD = MAKE_GET_OP(ARP.HOLD , op_ARP_HOLD_get , 1, false); const tele_op_t op_ARP_STEPS = MAKE_GET_OP(ARP.STEPS , op_ARP_STEPS_get , 2, false); const tele_op_t op_ARP_DIST = MAKE_GET_OP(ARP.DIST , op_ARP_DIST_get , 2, false); const tele_op_t op_ARP_GATE = MAKE_GET_OP(ARP.GATE , op_ARP_GATE_get , 2, false); const tele_op_t op_ARP_DIV = MAKE_GET_OP(ARP.DIV , op_ARP_DIV_get , 2, false); -const tele_op_t op_ARP_RESET = MAKE_GET_OP(ARP.RESET , op_ARP_RESET_get , 1, false); +const tele_op_t op_ARP_RESET = MAKE_GET_OP(ARP.RES , op_ARP_RESET_get , 1, false); const tele_op_t op_ARP_TRANS = MAKE_GET_OP(ARP.TRANS , op_ARP_TRANS_get , 2, false); +const tele_op_t op_ARP_SLEW = MAKE_GET_OP(ARP.SLEW , op_ARP_SLEW_get , 2, false); // clang-format on @@ -1161,3 +1164,12 @@ static void op_ARP_TRANS_get(const void *NOTUSED(data), uint8_t d[] = { II_ARP_TRANS, a, b >> 8, b & 0xff }; tele_ii_tx(II_ARP_ADDR, d, 4); } + +static void op_ARP_SLEW_get(const void *NOTUSED(data), + scene_state_t *NOTUSED(ss), + exec_state_t *NOTUSED(es), command_state_t *cs) { + int16_t a = cs_pop(cs); + int16_t b = cs_pop(cs); + uint8_t d[] = { II_ARP_SLEW, a, b >> 8, b & 0xff }; + tele_ii_tx(II_ARP_ADDR, d, 4); +} diff --git a/src/ops/hardware.h b/src/ops/hardware.h index 13e563d0..8d358587 100644 --- a/src/ops/hardware.h +++ b/src/ops/hardware.h @@ -65,6 +65,7 @@ extern const tele_op_t op_ARP_GATE; extern const tele_op_t op_ARP_DIV; extern const tele_op_t op_ARP_RESET; extern const tele_op_t op_ARP_TRANS; +extern const tele_op_t op_ARP_SLEW; #endif diff --git a/src/ops/op.c b/src/ops/op.c index 16f26bdd..b20580ac 100644 --- a/src/ops/op.c +++ b/src/ops/op.c @@ -48,7 +48,7 @@ const tele_op_t *tele_ops[OPS] = { &op_LV_RESET, &op_LV_POS, &op_LV_L_ST, &op_LV_L_LEN, &op_LV_L_DIR, &op_CY_PRESET, &op_CY_RESET, &op_CY_POS, &op_CY_REV, &op_ARP_STYLE, &op_ARP_HOLD, &op_ARP_STEPS, &op_ARP_DIST, &op_ARP_GATE, &op_ARP_DIV, - &op_ARP_RESET, &op_ARP_TRANS, + &op_ARP_RESET, &op_ARP_TRANS, &op_ARP_SLEW, // maths &op_ADD, &op_SUB, &op_MUL, &op_DIV, &op_MOD, &op_RAND, &op_RRAND, &op_TOSS, diff --git a/src/ops/op.h b/src/ops/op.h index 3c99585e..fd1344eb 100644 --- a/src/ops/op.h +++ b/src/ops/op.h @@ -25,7 +25,7 @@ typedef struct { const uint8_t params; } tele_mod_t; -#define OPS 188 +#define OPS 189 extern const tele_op_t *tele_ops[OPS]; #define MODS 7 From 766e0ac74ceaa5ab565cfb9430d8f45c35405bd7 Mon Sep 17 00:00:00 2001 From: Greg Wuller Date: Sun, 8 Jan 2017 16:51:51 -0800 Subject: [PATCH 4/8] arp ii; rot, fill, er commands --- src/ops/hardware.c | 37 +++++++++++++++++++++++++++++++++++++ src/ops/hardware.h | 3 +++ src/ops/op.c | 3 ++- src/ops/op.h | 2 +- 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/ops/hardware.c b/src/ops/hardware.c index 6b6b6bfd..3a68f918 100644 --- a/src/ops/hardware.c +++ b/src/ops/hardware.c @@ -171,6 +171,12 @@ static void op_ARP_TRANS_get(const void *data, scene_state_t *ss, exec_state_t *es, command_state_t *cs); static void op_ARP_SLEW_get(const void *data, scene_state_t *ss, exec_state_t *es, command_state_t *cs); +static void op_ARP_FILL_get(const void *data, scene_state_t *ss, + exec_state_t *es, command_state_t *cs); +static void op_ARP_ROT_get(const void *data, scene_state_t *ss, + exec_state_t *es, command_state_t *cs); +static void op_ARP_ER_get(const void *data, scene_state_t *ss, exec_state_t *es, + command_state_t *cs); // clang-format off @@ -237,6 +243,9 @@ const tele_op_t op_ARP_DIV = MAKE_GET_OP(ARP.DIV , op_ARP_DIV_get const tele_op_t op_ARP_RESET = MAKE_GET_OP(ARP.RES , op_ARP_RESET_get , 1, false); const tele_op_t op_ARP_TRANS = MAKE_GET_OP(ARP.TRANS , op_ARP_TRANS_get , 2, false); const tele_op_t op_ARP_SLEW = MAKE_GET_OP(ARP.SLEW , op_ARP_SLEW_get , 2, false); +const tele_op_t op_ARP_FILL = MAKE_GET_OP(ARP.FILL , op_ARP_FILL_get , 2, false); +const tele_op_t op_ARP_ROT = MAKE_GET_OP(ARP.ROT , op_ARP_ROT_get , 2, false); +const tele_op_t op_ARP_ER = MAKE_GET_OP(ARP.ER , op_ARP_ER_get , 4, false); // clang-format on @@ -1173,3 +1182,31 @@ static void op_ARP_SLEW_get(const void *NOTUSED(data), uint8_t d[] = { II_ARP_SLEW, a, b >> 8, b & 0xff }; tele_ii_tx(II_ARP_ADDR, d, 4); } + +static void op_ARP_FILL_get(const void *NOTUSED(data), + scene_state_t *NOTUSED(ss), + exec_state_t *NOTUSED(es), command_state_t *cs) { + int16_t a = cs_pop(cs); + int16_t b = cs_pop(cs); + uint8_t d[] = { II_ARP_FILL, a, b }; + tele_ii_tx(II_ARP_ADDR, d, 3); +} + +static void op_ARP_ROT_get(const void *NOTUSED(data), + scene_state_t *NOTUSED(ss), + exec_state_t *NOTUSED(es), command_state_t *cs) { + int16_t a = cs_pop(cs); + int16_t b = cs_pop(cs); + uint8_t d[] = { II_ARP_ROT, a, b >> 8, b & 0xff }; + tele_ii_tx(II_ARP_ADDR, d, 4); +} + +static void op_ARP_ER_get(const void *NOTUSED(data), scene_state_t *NOTUSED(ss), + exec_state_t *NOTUSED(es), command_state_t *cs) { + int16_t a = cs_pop(cs); + int16_t b = cs_pop(cs); + int16_t c = cs_pop(cs); + int16_t e = cs_pop(cs); + uint8_t d[] = { II_ARP_ER, a, b, c, e >> 8, e & 0xff }; + tele_ii_tx(II_ARP_ADDR, d, 6); +} diff --git a/src/ops/hardware.h b/src/ops/hardware.h index 8d358587..7b2c99ee 100644 --- a/src/ops/hardware.h +++ b/src/ops/hardware.h @@ -66,6 +66,9 @@ extern const tele_op_t op_ARP_DIV; extern const tele_op_t op_ARP_RESET; extern const tele_op_t op_ARP_TRANS; extern const tele_op_t op_ARP_SLEW; +extern const tele_op_t op_ARP_FILL; +extern const tele_op_t op_ARP_ROT; +extern const tele_op_t op_ARP_ER; #endif diff --git a/src/ops/op.c b/src/ops/op.c index b20580ac..eded832e 100644 --- a/src/ops/op.c +++ b/src/ops/op.c @@ -48,7 +48,8 @@ const tele_op_t *tele_ops[OPS] = { &op_LV_RESET, &op_LV_POS, &op_LV_L_ST, &op_LV_L_LEN, &op_LV_L_DIR, &op_CY_PRESET, &op_CY_RESET, &op_CY_POS, &op_CY_REV, &op_ARP_STYLE, &op_ARP_HOLD, &op_ARP_STEPS, &op_ARP_DIST, &op_ARP_GATE, &op_ARP_DIV, - &op_ARP_RESET, &op_ARP_TRANS, &op_ARP_SLEW, + &op_ARP_RESET, &op_ARP_TRANS, &op_ARP_SLEW, &op_ARP_FILL, &op_ARP_ROT, + &op_ARP_ER, // maths &op_ADD, &op_SUB, &op_MUL, &op_DIV, &op_MOD, &op_RAND, &op_RRAND, &op_TOSS, diff --git a/src/ops/op.h b/src/ops/op.h index fd1344eb..bbd8e139 100644 --- a/src/ops/op.h +++ b/src/ops/op.h @@ -25,7 +25,7 @@ typedef struct { const uint8_t params; } tele_mod_t; -#define OPS 189 +#define OPS 192 extern const tele_op_t *tele_ops[OPS]; #define MODS 7 From fba53de19ecdb4ecbdf5cdece8b2dc6648a7d543 Mon Sep 17 00:00:00 2001 From: Greg Wuller Date: Sun, 8 Jan 2017 19:59:32 -0800 Subject: [PATCH 5/8] arp ii; replaced div/steps with rpt - refined/shorted tt terms for arp commands - change trans to shift (matching jt terminology) --- src/ops/hardware.c | 50 ++++++++++++++++++---------------------------- src/ops/hardware.h | 5 ++--- src/ops/op.c | 5 ++--- src/ops/op.h | 2 +- 4 files changed, 24 insertions(+), 38 deletions(-) diff --git a/src/ops/hardware.c b/src/ops/hardware.c index 3a68f918..ce0a8dda 100644 --- a/src/ops/hardware.c +++ b/src/ops/hardware.c @@ -157,17 +157,15 @@ static void op_ARP_STYLE_get(const void *data, scene_state_t *ss, exec_state_t *es, command_state_t *cs); static void op_ARP_HOLD_get(const void *data, scene_state_t *ss, exec_state_t *es, command_state_t *cs); -static void op_ARP_STEPS_get(const void *data, scene_state_t *ss, - exec_state_t *es, command_state_t *cs); -static void op_ARP_DIST_get(const void *data, scene_state_t *ss, - exec_state_t *es, command_state_t *cs); +static void op_ARP_RPT_get(const void *data, scene_state_t *ss, + exec_state_t *es, command_state_t *cs); static void op_ARP_GATE_get(const void *data, scene_state_t *ss, exec_state_t *es, command_state_t *cs); static void op_ARP_DIV_get(const void *data, scene_state_t *ss, exec_state_t *es, command_state_t *cs); static void op_ARP_RESET_get(const void *data, scene_state_t *ss, exec_state_t *es, command_state_t *cs); -static void op_ARP_TRANS_get(const void *data, scene_state_t *ss, +static void op_ARP_SHIFT_get(const void *data, scene_state_t *ss, exec_state_t *es, command_state_t *cs); static void op_ARP_SLEW_get(const void *data, scene_state_t *ss, exec_state_t *es, command_state_t *cs); @@ -234,16 +232,15 @@ const tele_op_t op_CY_RESET = MAKE_GET_OP(CY.RES , op_CY_RESET_get const tele_op_t op_CY_POS = MAKE_GET_SET_OP(CY.POS , op_CY_POS_get , op_CY_POS_set , 1, true); const tele_op_t op_CY_REV = MAKE_GET_OP(CY.REV , op_CY_REV_get , 1, false); -const tele_op_t op_ARP_STYLE = MAKE_GET_OP(ARP.STY , op_ARP_STYLE_get , 2, false); -const tele_op_t op_ARP_HOLD = MAKE_GET_OP(ARP.HOLD , op_ARP_HOLD_get , 1, false); -const tele_op_t op_ARP_STEPS = MAKE_GET_OP(ARP.STEPS , op_ARP_STEPS_get , 2, false); -const tele_op_t op_ARP_DIST = MAKE_GET_OP(ARP.DIST , op_ARP_DIST_get , 2, false); -const tele_op_t op_ARP_GATE = MAKE_GET_OP(ARP.GATE , op_ARP_GATE_get , 2, false); +const tele_op_t op_ARP_STYLE = MAKE_GET_OP(ARP.STY , op_ARP_STYLE_get , 1, false); +const tele_op_t op_ARP_HOLD = MAKE_GET_OP(ARP.HLD , op_ARP_HOLD_get , 1, false); +const tele_op_t op_ARP_RPT = MAKE_GET_OP(ARP.RPT , op_ARP_RPT_get , 3, false); +const tele_op_t op_ARP_GATE = MAKE_GET_OP(ARP.GT , op_ARP_GATE_get , 2, false); const tele_op_t op_ARP_DIV = MAKE_GET_OP(ARP.DIV , op_ARP_DIV_get , 2, false); const tele_op_t op_ARP_RESET = MAKE_GET_OP(ARP.RES , op_ARP_RESET_get , 1, false); -const tele_op_t op_ARP_TRANS = MAKE_GET_OP(ARP.TRANS , op_ARP_TRANS_get , 2, false); +const tele_op_t op_ARP_SHIFT = MAKE_GET_OP(ARP.SHIFT , op_ARP_SHIFT_get , 2, false); const tele_op_t op_ARP_SLEW = MAKE_GET_OP(ARP.SLEW , op_ARP_SLEW_get , 2, false); -const tele_op_t op_ARP_FILL = MAKE_GET_OP(ARP.FILL , op_ARP_FILL_get , 2, false); +const tele_op_t op_ARP_FILL = MAKE_GET_OP(ARP.FIL , op_ARP_FILL_get , 2, false); const tele_op_t op_ARP_ROT = MAKE_GET_OP(ARP.ROT , op_ARP_ROT_get , 2, false); const tele_op_t op_ARP_ER = MAKE_GET_OP(ARP.ER , op_ARP_ER_get , 4, false); @@ -1108,9 +1105,8 @@ static void op_ARP_STYLE_get(const void *NOTUSED(data), scene_state_t *NOTUSED(ss), exec_state_t *NOTUSED(es), command_state_t *cs) { int16_t a = cs_pop(cs); - int16_t b = cs_pop(cs); - uint8_t d[] = { II_ARP_STYLE, a & 0xff, b & 0xff }; - tele_ii_tx(II_ARP_ADDR, d, 3); + uint8_t d[] = { II_ARP_STYLE, a }; + tele_ii_tx(II_ARP_ADDR, d, 2); } static void op_ARP_HOLD_get(const void *NOTUSED(data), @@ -1121,22 +1117,14 @@ static void op_ARP_HOLD_get(const void *NOTUSED(data), tele_ii_tx(II_ARP_ADDR, d, 2); } -static void op_ARP_STEPS_get(const void *NOTUSED(data), - scene_state_t *NOTUSED(ss), - exec_state_t *NOTUSED(es), command_state_t *cs) { - int16_t a = cs_pop(cs); - int16_t b = cs_pop(cs); - uint8_t d[] = { II_ARP_STEPS, a & 0xff, b & 0xff }; - tele_ii_tx(II_ARP_ADDR, d, 3); -} - -static void op_ARP_DIST_get(const void *NOTUSED(data), - scene_state_t *NOTUSED(ss), - exec_state_t *NOTUSED(es), command_state_t *cs) { +static void op_ARP_RPT_get(const void *NOTUSED(data), + scene_state_t *NOTUSED(ss), + exec_state_t *NOTUSED(es), command_state_t *cs) { int16_t a = cs_pop(cs); int16_t b = cs_pop(cs); - uint8_t d[] = { II_ARP_DIST, a & 0xff, b >> 8, b & 0xff }; - tele_ii_tx(II_ARP_ADDR, d, 4); + int16_t c = cs_pop(cs); + uint8_t d[] = { II_ARP_RPT, a, b, c >> 8, c & 0xff }; + tele_ii_tx(II_ARP_ADDR, d, 5); } static void op_ARP_GATE_get(const void *NOTUSED(data), @@ -1165,12 +1153,12 @@ static void op_ARP_RESET_get(const void *NOTUSED(data), tele_ii_tx(II_ARP_ADDR, d, 2); } -static void op_ARP_TRANS_get(const void *NOTUSED(data), +static void op_ARP_SHIFT_get(const void *NOTUSED(data), scene_state_t *NOTUSED(ss), exec_state_t *NOTUSED(es), command_state_t *cs) { int16_t a = cs_pop(cs); int16_t b = cs_pop(cs); - uint8_t d[] = { II_ARP_TRANS, a, b >> 8, b & 0xff }; + uint8_t d[] = { II_ARP_SHIFT, a, b >> 8, b & 0xff }; tele_ii_tx(II_ARP_ADDR, d, 4); } diff --git a/src/ops/hardware.h b/src/ops/hardware.h index 7b2c99ee..05a0d6c4 100644 --- a/src/ops/hardware.h +++ b/src/ops/hardware.h @@ -59,12 +59,11 @@ extern const tele_op_t op_CY_REV; extern const tele_op_t op_ARP_STYLE; extern const tele_op_t op_ARP_HOLD; -extern const tele_op_t op_ARP_STEPS; -extern const tele_op_t op_ARP_DIST; +extern const tele_op_t op_ARP_RPT; extern const tele_op_t op_ARP_GATE; extern const tele_op_t op_ARP_DIV; extern const tele_op_t op_ARP_RESET; -extern const tele_op_t op_ARP_TRANS; +extern const tele_op_t op_ARP_SHIFT; extern const tele_op_t op_ARP_SLEW; extern const tele_op_t op_ARP_FILL; extern const tele_op_t op_ARP_ROT; diff --git a/src/ops/op.c b/src/ops/op.c index eded832e..9eee9d57 100644 --- a/src/ops/op.c +++ b/src/ops/op.c @@ -47,9 +47,8 @@ const tele_op_t *tele_ops[OPS] = { &op_MP_RESET1, &op_MP_STOP1, &op_MP_SCALE, &op_MP_PERIOD, &op_LV_PRESET, &op_LV_RESET, &op_LV_POS, &op_LV_L_ST, &op_LV_L_LEN, &op_LV_L_DIR, &op_CY_PRESET, &op_CY_RESET, &op_CY_POS, &op_CY_REV, &op_ARP_STYLE, - &op_ARP_HOLD, &op_ARP_STEPS, &op_ARP_DIST, &op_ARP_GATE, &op_ARP_DIV, - &op_ARP_RESET, &op_ARP_TRANS, &op_ARP_SLEW, &op_ARP_FILL, &op_ARP_ROT, - &op_ARP_ER, + &op_ARP_HOLD, &op_ARP_RPT, &op_ARP_GATE, &op_ARP_DIV, &op_ARP_RESET, + &op_ARP_SHIFT, &op_ARP_SLEW, &op_ARP_FILL, &op_ARP_ROT, &op_ARP_ER, // maths &op_ADD, &op_SUB, &op_MUL, &op_DIV, &op_MOD, &op_RAND, &op_RRAND, &op_TOSS, diff --git a/src/ops/op.h b/src/ops/op.h index bbd8e139..082001a9 100644 --- a/src/ops/op.h +++ b/src/ops/op.h @@ -25,7 +25,7 @@ typedef struct { const uint8_t params; } tele_mod_t; -#define OPS 192 +#define OPS 191 extern const tele_op_t *tele_ops[OPS]; #define MODS 7 From ea382aa68420e5400fa642e1f125d92c164a6e84 Mon Sep 17 00:00:00 2001 From: Greg Wuller Date: Sun, 8 Jan 2017 20:07:00 -0800 Subject: [PATCH 6/8] use euclidean from libavr32 --- module/config.mk | 4 +- src/euclidean/data.c | 657 ------------------------------------- src/euclidean/data.h | 37 --- src/euclidean/euclidean.c | 45 --- src/euclidean/euclidean.h | 6 - src/euclidean/euclidean.hs | 86 ----- 6 files changed, 2 insertions(+), 833 deletions(-) delete mode 100644 src/euclidean/data.c delete mode 100644 src/euclidean/data.h delete mode 100644 src/euclidean/euclidean.c delete mode 100644 src/euclidean/euclidean.h delete mode 100755 src/euclidean/euclidean.hs diff --git a/module/config.mk b/module/config.mk index fd982529..e41f720e 100644 --- a/module/config.mk +++ b/module/config.mk @@ -67,8 +67,6 @@ CSRCS = \ ../src/state.c \ ../src/table.c \ ../src/teletype.c \ - ../src/euclidean/euclidean.c \ - ../src/euclidean/data.c \ ../src/ops/op.c \ ../src/ops/constants.c \ ../src/ops/controlflow.c \ @@ -82,6 +80,8 @@ CSRCS = \ ../src/ops/variables.c \ ../libavr32/src/adc.c \ ../libavr32/src/events.c \ + ../libavr32/src/euclidean/euclidean.c \ + ../libavr32/src/euclidean/data.c \ ../libavr32/src/fix.c \ ../libavr32/src/font.c \ ../libavr32/src/i2c.c \ diff --git a/src/euclidean/data.c b/src/euclidean/data.c deleted file mode 100644 index e47a9e3b..00000000 --- a/src/euclidean/data.c +++ /dev/null @@ -1,657 +0,0 @@ -// clang-format off - -const char table_euclidean_1[2][1] = { - {0b00000000}, - {0b10000000} -}; - -const char table_euclidean_2[3][1] = { - {0b00000000}, - {0b10000000}, - {0b11000000} -}; - -const char table_euclidean_3[4][1] = { - {0b00000000}, - {0b10000000}, - {0b11000000}, - {0b11100000} -}; - -const char table_euclidean_4[5][1] = { - {0b00000000}, - {0b10000000}, - {0b10100000}, - {0b10110000}, - {0b11110000} -}; - -const char table_euclidean_5[6][1] = { - {0b00000000}, - {0b10000000}, - {0b10100000}, - {0b10101000}, - {0b10111000}, - {0b11111000} -}; - -const char table_euclidean_6[7][1] = { - {0b00000000}, - {0b10000000}, - {0b10010000}, - {0b10101000}, - {0b10110100}, - {0b10111100}, - {0b11111100} -}; - -const char table_euclidean_7[8][1] = { - {0b00000000}, - {0b10000000}, - {0b10010000}, - {0b10010100}, - {0b10110100}, - {0b10110110}, - {0b10111110}, - {0b11111110} -}; - -const char table_euclidean_8[9][1] = { - {0b00000000}, - {0b10000000}, - {0b10001000}, - {0b10010010}, - {0b10101010}, - {0b10110110}, - {0b10111011}, - {0b10111111}, - {0b11111111} -}; - -const char table_euclidean_9[10][2] = { - {0b00000000, 0b00000000}, - {0b10000000, 0b00000000}, - {0b10001000, 0b00000000}, - {0b10010010, 0b00000000}, - {0b10010101, 0b00000000}, - {0b10110101, 0b00000000}, - {0b10110110, 0b10000000}, - {0b10111011, 0b10000000}, - {0b10111111, 0b10000000}, - {0b11111111, 0b10000000} -}; - -const char table_euclidean_10[11][2] = { - {0b00000000, 0b00000000}, - {0b10000000, 0b00000000}, - {0b10000100, 0b00000000}, - {0b10001001, 0b00000000}, - {0b10010100, 0b10000000}, - {0b10101010, 0b10000000}, - {0b10110101, 0b10000000}, - {0b10111011, 0b01000000}, - {0b10111101, 0b11000000}, - {0b10111111, 0b11000000}, - {0b11111111, 0b11000000} -}; - -const char table_euclidean_11[12][2] = { - {0b00000000, 0b00000000}, - {0b10000000, 0b00000000}, - {0b10000100, 0b00000000}, - {0b10001000, 0b10000000}, - {0b10010100, 0b10000000}, - {0b10010101, 0b01000000}, - {0b10110101, 0b01000000}, - {0b10110101, 0b10100000}, - {0b10111011, 0b10100000}, - {0b10111101, 0b11100000}, - {0b10111111, 0b11100000}, - {0b11111111, 0b11100000} -}; - -const char table_euclidean_12[13][2] = { - {0b00000000, 0b00000000}, - {0b10000000, 0b00000000}, - {0b10000010, 0b00000000}, - {0b10001000, 0b10000000}, - {0b10010010, 0b01000000}, - {0b10010100, 0b10100000}, - {0b10101010, 0b10100000}, - {0b10110101, 0b10100000}, - {0b10110110, 0b11010000}, - {0b10111011, 0b10110000}, - {0b10111110, 0b11110000}, - {0b10111111, 0b11110000}, - {0b11111111, 0b11110000} -}; - -const char table_euclidean_13[14][2] = { - {0b00000000, 0b00000000}, - {0b10000000, 0b00000000}, - {0b10000010, 0b00000000}, - {0b10000100, 0b01000000}, - {0b10001001, 0b00100000}, - {0b10010100, 0b10100000}, - {0b10010101, 0b01010000}, - {0b10110101, 0b01010000}, - {0b10110101, 0b10101000}, - {0b10111011, 0b01101000}, - {0b10111101, 0b11011000}, - {0b10111110, 0b11111000}, - {0b10111111, 0b11111000}, - {0b11111111, 0b11111000} -}; - -const char table_euclidean_14[15][2] = { - {0b00000000, 0b00000000}, - {0b10000000, 0b00000000}, - {0b10000001, 0b00000000}, - {0b10000100, 0b00100000}, - {0b10001001, 0b00010000}, - {0b10010100, 0b10010000}, - {0b10010101, 0b00101000}, - {0b10101010, 0b10101000}, - {0b10110101, 0b01101000}, - {0b10110101, 0b10110100}, - {0b10111011, 0b01110100}, - {0b10111101, 0b11101100}, - {0b10111111, 0b01111100}, - {0b10111111, 0b11111100}, - {0b11111111, 0b11111100} -}; - -const char table_euclidean_15[16][2] = { - {0b00000000, 0b00000000}, - {0b10000000, 0b00000000}, - {0b10000001, 0b00000000}, - {0b10000100, 0b00100000}, - {0b10001001, 0b00010000}, - {0b10010010, 0b01001000}, - {0b10010100, 0b10100100}, - {0b10010101, 0b01010100}, - {0b10110101, 0b01010100}, - {0b10110101, 0b10101100}, - {0b10110110, 0b11011010}, - {0b10111011, 0b01110110}, - {0b10111101, 0b11101110}, - {0b10111111, 0b01111110}, - {0b10111111, 0b11111110}, - {0b11111111, 0b11111110} -}; - -const char table_euclidean_16[17][2] = { - {0b00000000, 0b00000000}, - {0b10000000, 0b00000000}, - {0b10000000, 0b10000000}, - {0b10000010, 0b00010000}, - {0b10001000, 0b10001000}, - {0b10001001, 0b00100100}, - {0b10010100, 0b10010100}, - {0b10010101, 0b00101010}, - {0b10101010, 0b10101010}, - {0b10110101, 0b01101010}, - {0b10110101, 0b10110101}, - {0b10111011, 0b01101101}, - {0b10111011, 0b10111011}, - {0b10111110, 0b11110111}, - {0b10111111, 0b10111111}, - {0b10111111, 0b11111111}, - {0b11111111, 0b11111111} -}; - -const char table_euclidean_17[18][3] = { - {0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000000, 0b00000000}, - {0b10000000, 0b10000000, 0b00000000}, - {0b10000010, 0b00001000, 0b00000000}, - {0b10000100, 0b01000100, 0b00000000}, - {0b10001001, 0b00010010, 0b00000000}, - {0b10010100, 0b10010010, 0b00000000}, - {0b10010101, 0b00101001, 0b00000000}, - {0b10010101, 0b01010101, 0b00000000}, - {0b10110101, 0b01010101, 0b00000000}, - {0b10110101, 0b01101011, 0b00000000}, - {0b10110101, 0b10110110, 0b10000000}, - {0b10111011, 0b01110110, 0b10000000}, - {0b10111101, 0b11011101, 0b10000000}, - {0b10111110, 0b11111011, 0b10000000}, - {0b10111111, 0b10111111, 0b10000000}, - {0b10111111, 0b11111111, 0b10000000}, - {0b11111111, 0b11111111, 0b10000000} -}; - -const char table_euclidean_18[19][3] = { - {0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000000, 0b00000000}, - {0b10000000, 0b01000000, 0b00000000}, - {0b10000010, 0b00001000, 0b00000000}, - {0b10000100, 0b01000010, 0b00000000}, - {0b10001001, 0b00010010, 0b00000000}, - {0b10010010, 0b01001001, 0b00000000}, - {0b10010100, 0b10010100, 0b10000000}, - {0b10010101, 0b01001010, 0b10000000}, - {0b10101010, 0b10101010, 0b10000000}, - {0b10110101, 0b01011010, 0b10000000}, - {0b10110101, 0b10110101, 0b10000000}, - {0b10110110, 0b11011011, 0b01000000}, - {0b10111011, 0b01110110, 0b11000000}, - {0b10111101, 0b11011110, 0b11000000}, - {0b10111110, 0b11111011, 0b11000000}, - {0b10111111, 0b11011111, 0b11000000}, - {0b10111111, 0b11111111, 0b11000000}, - {0b11111111, 0b11111111, 0b11000000} -}; - -const char table_euclidean_19[20][3] = { - {0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000000, 0b00000000}, - {0b10000000, 0b01000000, 0b00000000}, - {0b10000001, 0b00000100, 0b00000000}, - {0b10000100, 0b01000010, 0b00000000}, - {0b10001001, 0b00010001, 0b00000000}, - {0b10001001, 0b00100100, 0b10000000}, - {0b10010100, 0b10010100, 0b10000000}, - {0b10010101, 0b00101010, 0b01000000}, - {0b10010101, 0b01010101, 0b01000000}, - {0b10110101, 0b01010101, 0b01000000}, - {0b10110101, 0b01101010, 0b11000000}, - {0b10110101, 0b10110101, 0b10100000}, - {0b10111011, 0b01101101, 0b10100000}, - {0b10111011, 0b01110111, 0b01100000}, - {0b10111101, 0b11011110, 0b11100000}, - {0b10111111, 0b01111101, 0b11100000}, - {0b10111111, 0b11011111, 0b11100000}, - {0b10111111, 0b11111111, 0b11100000}, - {0b11111111, 0b11111111, 0b11100000} -}; - -const char table_euclidean_20[21][3] = { - {0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00100000, 0b00000000}, - {0b10000001, 0b00000010, 0b00000000}, - {0b10000100, 0b00100001, 0b00000000}, - {0b10001000, 0b10001000, 0b10000000}, - {0b10001001, 0b00100010, 0b01000000}, - {0b10010100, 0b10010010, 0b01000000}, - {0b10010100, 0b10100101, 0b00100000}, - {0b10010101, 0b01001010, 0b10100000}, - {0b10101010, 0b10101010, 0b10100000}, - {0b10110101, 0b01011010, 0b10100000}, - {0b10110101, 0b10101101, 0b01100000}, - {0b10110101, 0b10110110, 0b11010000}, - {0b10111011, 0b01101110, 0b11010000}, - {0b10111011, 0b10111011, 0b10110000}, - {0b10111101, 0b11101111, 0b01110000}, - {0b10111111, 0b01111110, 0b11110000}, - {0b10111111, 0b11101111, 0b11110000}, - {0b10111111, 0b11111111, 0b11110000}, - {0b11111111, 0b11111111, 0b11110000} -}; - -const char table_euclidean_21[22][3] = { - {0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00100000, 0b00000000}, - {0b10000001, 0b00000010, 0b00000000}, - {0b10000010, 0b00010000, 0b10000000}, - {0b10000100, 0b01000100, 0b01000000}, - {0b10001001, 0b00010010, 0b00100000}, - {0b10010010, 0b01001001, 0b00100000}, - {0b10010100, 0b10010100, 0b10010000}, - {0b10010101, 0b00101010, 0b01010000}, - {0b10010101, 0b01010101, 0b01010000}, - {0b10110101, 0b01010101, 0b01010000}, - {0b10110101, 0b01101010, 0b11010000}, - {0b10110101, 0b10110101, 0b10110000}, - {0b10110110, 0b11011011, 0b01101000}, - {0b10111011, 0b01110110, 0b11101000}, - {0b10111101, 0b11011101, 0b11011000}, - {0b10111110, 0b11110111, 0b10111000}, - {0b10111111, 0b01111110, 0b11111000}, - {0b10111111, 0b11101111, 0b11111000}, - {0b10111111, 0b11111111, 0b11111000}, - {0b11111111, 0b11111111, 0b11111000} -}; - -const char table_euclidean_22[23][3] = { - {0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00010000, 0b00000000}, - {0b10000000, 0b10000001, 0b00000000}, - {0b10000010, 0b00010000, 0b01000000}, - {0b10000100, 0b01000010, 0b00100000}, - {0b10001001, 0b00010001, 0b00100000}, - {0b10001001, 0b00100100, 0b10010000}, - {0b10010100, 0b10010010, 0b10010000}, - {0b10010101, 0b00101001, 0b01001000}, - {0b10010101, 0b01010010, 0b10101000}, - {0b10101010, 0b10101010, 0b10101000}, - {0b10110101, 0b01010110, 0b10101000}, - {0b10110101, 0b01101011, 0b01011000}, - {0b10110101, 0b10110110, 0b10110100}, - {0b10111011, 0b01101101, 0b10110100}, - {0b10111011, 0b01110111, 0b01101100}, - {0b10111101, 0b11011110, 0b11101100}, - {0b10111110, 0b11110111, 0b11011100}, - {0b10111111, 0b10111111, 0b01111100}, - {0b10111111, 0b11110111, 0b11111100}, - {0b10111111, 0b11111111, 0b11111100}, - {0b11111111, 0b11111111, 0b11111100} -}; - -const char table_euclidean_23[24][3] = { - {0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00010000, 0b00000000}, - {0b10000000, 0b10000000, 0b10000000}, - {0b10000010, 0b00010000, 0b01000000}, - {0b10000100, 0b01000010, 0b00100000}, - {0b10001001, 0b00010001, 0b00010000}, - {0b10001001, 0b00100010, 0b01001000}, - {0b10010100, 0b10010010, 0b01001000}, - {0b10010100, 0b10010100, 0b10100100}, - {0b10010101, 0b01001010, 0b10010100}, - {0b10010101, 0b01010101, 0b01010100}, - {0b10110101, 0b01010101, 0b01010100}, - {0b10110101, 0b01011010, 0b10110100}, - {0b10110101, 0b10110101, 0b10101100}, - {0b10110101, 0b10110110, 0b11011010}, - {0b10111011, 0b01101110, 0b11011010}, - {0b10111011, 0b01110111, 0b01110110}, - {0b10111101, 0b11011110, 0b11101110}, - {0b10111110, 0b11110111, 0b11011110}, - {0b10111111, 0b10111111, 0b10111110}, - {0b10111111, 0b11110111, 0b11111110}, - {0b10111111, 0b11111111, 0b11111110}, - {0b11111111, 0b11111111, 0b11111110} -}; - -const char table_euclidean_24[25][3] = { - {0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00001000, 0b00000000}, - {0b10000000, 0b10000000, 0b10000000}, - {0b10000010, 0b00001000, 0b00100000}, - {0b10000100, 0b01000010, 0b00010000}, - {0b10001000, 0b10001000, 0b10001000}, - {0b10001001, 0b00100010, 0b01000100}, - {0b10010010, 0b01001001, 0b00100100}, - {0b10010100, 0b10010100, 0b10010100}, - {0b10010101, 0b00101001, 0b01010010}, - {0b10010101, 0b01010010, 0b10101010}, - {0b10101010, 0b10101010, 0b10101010}, - {0b10110101, 0b01010110, 0b10101010}, - {0b10110101, 0b01101011, 0b01010110}, - {0b10110101, 0b10110101, 0b10110101}, - {0b10110110, 0b11011011, 0b01101101}, - {0b10111011, 0b01101110, 0b11011101}, - {0b10111011, 0b10111011, 0b10111011}, - {0b10111101, 0b11011110, 0b11110111}, - {0b10111110, 0b11111011, 0b11101111}, - {0b10111111, 0b10111111, 0b10111111}, - {0b10111111, 0b11111011, 0b11111111}, - {0b10111111, 0b11111111, 0b11111111}, - {0b11111111, 0b11111111, 0b11111111} -}; - -const char table_euclidean_25[26][4] = { - {0b00000000, 0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00001000, 0b00000000, 0b00000000}, - {0b10000000, 0b01000000, 0b01000000, 0b00000000}, - {0b10000001, 0b00000100, 0b00010000, 0b00000000}, - {0b10000100, 0b00100001, 0b00001000, 0b00000000}, - {0b10000100, 0b01000100, 0b01000100, 0b00000000}, - {0b10001001, 0b00010001, 0b00100010, 0b00000000}, - {0b10001001, 0b00100100, 0b10010010, 0b00000000}, - {0b10010100, 0b10010010, 0b10010010, 0b00000000}, - {0b10010100, 0b10100101, 0b00101001, 0b00000000}, - {0b10010101, 0b01001010, 0b10100101, 0b00000000}, - {0b10010101, 0b01010101, 0b01010101, 0b00000000}, - {0b10110101, 0b01010101, 0b01010101, 0b00000000}, - {0b10110101, 0b01011010, 0b10101101, 0b00000000}, - {0b10110101, 0b10101101, 0b01101011, 0b00000000}, - {0b10110101, 0b10110110, 0b10110110, 0b10000000}, - {0b10111011, 0b01101101, 0b10110110, 0b10000000}, - {0b10111011, 0b01110111, 0b01101110, 0b10000000}, - {0b10111101, 0b11011101, 0b11011101, 0b10000000}, - {0b10111101, 0b11101111, 0b01111011, 0b10000000}, - {0b10111111, 0b01111101, 0b11110111, 0b10000000}, - {0b10111111, 0b11011111, 0b11011111, 0b10000000}, - {0b10111111, 0b11111011, 0b11111111, 0b10000000}, - {0b10111111, 0b11111111, 0b11111111, 0b10000000}, - {0b11111111, 0b11111111, 0b11111111, 0b10000000} -}; - -const char table_euclidean_26[27][4] = { - {0b00000000, 0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000100, 0b00000000, 0b00000000}, - {0b10000000, 0b01000000, 0b00100000, 0b00000000}, - {0b10000001, 0b00000100, 0b00001000, 0b00000000}, - {0b10000010, 0b00010000, 0b10000100, 0b00000000}, - {0b10000100, 0b01000100, 0b00100010, 0b00000000}, - {0b10001001, 0b00010001, 0b00100010, 0b00000000}, - {0b10001001, 0b00100100, 0b01001001, 0b00000000}, - {0b10010100, 0b10010010, 0b01001001, 0b00000000}, - {0b10010100, 0b10010100, 0b10100100, 0b10000000}, - {0b10010101, 0b00101001, 0b01010010, 0b10000000}, - {0b10010101, 0b01010100, 0b10101010, 0b10000000}, - {0b10101010, 0b10101010, 0b10101010, 0b10000000}, - {0b10110101, 0b01010101, 0b10101010, 0b10000000}, - {0b10110101, 0b01101011, 0b01010110, 0b10000000}, - {0b10110101, 0b10110101, 0b10101101, 0b10000000}, - {0b10110101, 0b10110110, 0b11011011, 0b01000000}, - {0b10111011, 0b01101101, 0b11011011, 0b01000000}, - {0b10111011, 0b01110111, 0b01101110, 0b11000000}, - {0b10111101, 0b11011101, 0b11101110, 0b11000000}, - {0b10111110, 0b11110111, 0b10111101, 0b11000000}, - {0b10111111, 0b01111101, 0b11111011, 0b11000000}, - {0b10111111, 0b11011111, 0b11101111, 0b11000000}, - {0b10111111, 0b11111101, 0b11111111, 0b11000000}, - {0b10111111, 0b11111111, 0b11111111, 0b11000000}, - {0b11111111, 0b11111111, 0b11111111, 0b11000000} -}; - -const char table_euclidean_27[28][4] = { - {0b00000000, 0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000100, 0b00000000, 0b00000000}, - {0b10000000, 0b01000000, 0b00100000, 0b00000000}, - {0b10000001, 0b00000100, 0b00001000, 0b00000000}, - {0b10000010, 0b00010000, 0b01000010, 0b00000000}, - {0b10000100, 0b01000010, 0b00100001, 0b00000000}, - {0b10001001, 0b00010001, 0b00010001, 0b00000000}, - {0b10001001, 0b00100010, 0b01001000, 0b10000000}, - {0b10010010, 0b01001001, 0b00100100, 0b10000000}, - {0b10010100, 0b10010010, 0b10010010, 0b10000000}, - {0b10010101, 0b00101001, 0b01001010, 0b01000000}, - {0b10010101, 0b01001010, 0b10100101, 0b01000000}, - {0b10010101, 0b01010101, 0b01010101, 0b01000000}, - {0b10110101, 0b01010101, 0b01010101, 0b01000000}, - {0b10110101, 0b01011010, 0b10101101, 0b01000000}, - {0b10110101, 0b01101011, 0b01011010, 0b11000000}, - {0b10110101, 0b10110110, 0b10110110, 0b10100000}, - {0b10110110, 0b11011011, 0b01101101, 0b10100000}, - {0b10111011, 0b01101110, 0b11011011, 0b10100000}, - {0b10111011, 0b01110111, 0b01110111, 0b01100000}, - {0b10111101, 0b11011110, 0b11101111, 0b01100000}, - {0b10111110, 0b11110111, 0b11011110, 0b11100000}, - {0b10111111, 0b01111101, 0b11111011, 0b11100000}, - {0b10111111, 0b11011111, 0b11101111, 0b11100000}, - {0b10111111, 0b11111101, 0b11111111, 0b11100000}, - {0b10111111, 0b11111111, 0b11111111, 0b11100000}, - {0b11111111, 0b11111111, 0b11111111, 0b11100000} -}; - -const char table_euclidean_28[29][4] = { - {0b00000000, 0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000010, 0b00000000, 0b00000000}, - {0b10000000, 0b00100000, 0b00010000, 0b00000000}, - {0b10000001, 0b00000010, 0b00000100, 0b00000000}, - {0b10000010, 0b00010000, 0b01000010, 0b00000000}, - {0b10000100, 0b01000010, 0b00010001, 0b00000000}, - {0b10001000, 0b10001000, 0b10001000, 0b10000000}, - {0b10001001, 0b00010010, 0b00100100, 0b01000000}, - {0b10001001, 0b00100100, 0b10010010, 0b01000000}, - {0b10010100, 0b10010010, 0b01010010, 0b01000000}, - {0b10010100, 0b10010100, 0b10100101, 0b00100000}, - {0b10010101, 0b00101010, 0b01010100, 0b10100000}, - {0b10010101, 0b01010100, 0b10101010, 0b10100000}, - {0b10101010, 0b10101010, 0b10101010, 0b10100000}, - {0b10110101, 0b01010101, 0b10101010, 0b10100000}, - {0b10110101, 0b01101010, 0b11010101, 0b10100000}, - {0b10110101, 0b10110101, 0b10101101, 0b01100000}, - {0b10110101, 0b10110110, 0b11010110, 0b11010000}, - {0b10111011, 0b01101101, 0b10110110, 0b11010000}, - {0b10111011, 0b01110110, 0b11101101, 0b11010000}, - {0b10111011, 0b10111011, 0b10111011, 0b10110000}, - {0b10111101, 0b11011110, 0b11110111, 0b01110000}, - {0b10111110, 0b11110111, 0b11011110, 0b11110000}, - {0b10111111, 0b01111110, 0b11111101, 0b11110000}, - {0b10111111, 0b11101111, 0b11110111, 0b11110000}, - {0b10111111, 0b11111110, 0b11111111, 0b11110000}, - {0b10111111, 0b11111111, 0b11111111, 0b11110000}, - {0b11111111, 0b11111111, 0b11111111, 0b11110000} -}; - -const char table_euclidean_29[30][4] = { - {0b00000000, 0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000010, 0b00000000, 0b00000000}, - {0b10000000, 0b00100000, 0b00001000, 0b00000000}, - {0b10000000, 0b10000001, 0b00000010, 0b00000000}, - {0b10000010, 0b00010000, 0b01000001, 0b00000000}, - {0b10000100, 0b01000010, 0b00010000, 0b10000000}, - {0b10000100, 0b01000100, 0b01000100, 0b01000000}, - {0b10001001, 0b00010001, 0b00100010, 0b00100000}, - {0b10001001, 0b00100100, 0b01001001, 0b00100000}, - {0b10010100, 0b10010010, 0b01001001, 0b00100000}, - {0b10010100, 0b10010100, 0b10100100, 0b10100000}, - {0b10010101, 0b00101001, 0b01010010, 0b10010000}, - {0b10010101, 0b01010010, 0b10101001, 0b01010000}, - {0b10010101, 0b01010101, 0b01010101, 0b01010000}, - {0b10110101, 0b01010101, 0b01010101, 0b01010000}, - {0b10110101, 0b01010110, 0b10101011, 0b01010000}, - {0b10110101, 0b01101011, 0b01010110, 0b10110000}, - {0b10110101, 0b10110101, 0b10101101, 0b10101000}, - {0b10110101, 0b10110110, 0b11011011, 0b01101000}, - {0b10111011, 0b01101101, 0b11011011, 0b01101000}, - {0b10111011, 0b01110111, 0b01101110, 0b11101000}, - {0b10111101, 0b11011101, 0b11011101, 0b11011000}, - {0b10111101, 0b11011110, 0b11110111, 0b10111000}, - {0b10111110, 0b11110111, 0b11011111, 0b01111000}, - {0b10111111, 0b10111111, 0b01111110, 0b11111000}, - {0b10111111, 0b11101111, 0b11111011, 0b11111000}, - {0b10111111, 0b11111110, 0b11111111, 0b11111000}, - {0b10111111, 0b11111111, 0b11111111, 0b11111000}, - {0b11111111, 0b11111111, 0b11111111, 0b11111000} -}; - -const char table_euclidean_30[31][4] = { - {0b00000000, 0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000001, 0b00000000, 0b00000000}, - {0b10000000, 0b00100000, 0b00001000, 0b00000000}, - {0b10000000, 0b10000001, 0b00000001, 0b00000000}, - {0b10000010, 0b00001000, 0b00100000, 0b10000000}, - {0b10000100, 0b00100001, 0b00001000, 0b01000000}, - {0b10000100, 0b01000100, 0b00100010, 0b00100000}, - {0b10001001, 0b00010001, 0b00010010, 0b00100000}, - {0b10001001, 0b00100010, 0b01001000, 0b10010000}, - {0b10010010, 0b01001001, 0b00100100, 0b10010000}, - {0b10010100, 0b10010010, 0b10010010, 0b01010000}, - {0b10010100, 0b10100101, 0b00101001, 0b01001000}, - {0b10010101, 0b01001010, 0b10010101, 0b00101000}, - {0b10010101, 0b01010101, 0b00101010, 0b10101000}, - {0b10101010, 0b10101010, 0b10101010, 0b10101000}, - {0b10110101, 0b01010101, 0b01101010, 0b10101000}, - {0b10110101, 0b01011010, 0b10110101, 0b01101000}, - {0b10110101, 0b10101101, 0b01101011, 0b01011000}, - {0b10110101, 0b10110110, 0b10110110, 0b11010100}, - {0b10110110, 0b11011011, 0b01101101, 0b10110100}, - {0b10111011, 0b01101110, 0b11011011, 0b10110100}, - {0b10111011, 0b01110111, 0b01110110, 0b11101100}, - {0b10111101, 0b11011101, 0b11101110, 0b11101100}, - {0b10111101, 0b11101111, 0b01111011, 0b11011100}, - {0b10111110, 0b11111011, 0b11101111, 0b10111100}, - {0b10111111, 0b10111111, 0b01111111, 0b01111100}, - {0b10111111, 0b11101111, 0b11111011, 0b11111100}, - {0b10111111, 0b11111111, 0b01111111, 0b11111100}, - {0b10111111, 0b11111111, 0b11111111, 0b11111100}, - {0b11111111, 0b11111111, 0b11111111, 0b11111100} -}; - -const char table_euclidean_31[32][4] = { - {0b00000000, 0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000001, 0b00000000, 0b00000000}, - {0b10000000, 0b00010000, 0b00000100, 0b00000000}, - {0b10000000, 0b10000001, 0b00000001, 0b00000000}, - {0b10000001, 0b00000100, 0b00010000, 0b01000000}, - {0b10000010, 0b00010000, 0b10000100, 0b00100000}, - {0b10000100, 0b01000100, 0b00100010, 0b00010000}, - {0b10001001, 0b00010001, 0b00010001, 0b00010000}, - {0b10001001, 0b00100010, 0b01000100, 0b10001000}, - {0b10001001, 0b00100100, 0b10010010, 0b01001000}, - {0b10010100, 0b10010010, 0b01010010, 0b01001000}, - {0b10010100, 0b10010100, 0b10100100, 0b10100100}, - {0b10010101, 0b00101001, 0b01010010, 0b10010100}, - {0b10010101, 0b01010010, 0b10101010, 0b01010100}, - {0b10010101, 0b01010101, 0b01010101, 0b01010100}, - {0b10110101, 0b01010101, 0b01010101, 0b01010100}, - {0b10110101, 0b01010110, 0b10101010, 0b11010100}, - {0b10110101, 0b01101011, 0b01010110, 0b10110100}, - {0b10110101, 0b10110101, 0b10101101, 0b10101100}, - {0b10110101, 0b10110110, 0b11010110, 0b11011010}, - {0b10111011, 0b01101101, 0b10110110, 0b11011010}, - {0b10111011, 0b01101110, 0b11011101, 0b10111010}, - {0b10111011, 0b01110111, 0b01110111, 0b01110110}, - {0b10111101, 0b11011101, 0b11101110, 0b11110110}, - {0b10111110, 0b11110111, 0b10111101, 0b11101110}, - {0b10111111, 0b01111101, 0b11110111, 0b11011110}, - {0b10111111, 0b10111111, 0b01111111, 0b01111110}, - {0b10111111, 0b11110111, 0b11111101, 0b11111110}, - {0b10111111, 0b11111111, 0b01111111, 0b11111110}, - {0b10111111, 0b11111111, 0b11111111, 0b11111110}, - {0b11111111, 0b11111111, 0b11111111, 0b11111110} -}; - -const char table_euclidean_32[33][4] = { - {0b00000000, 0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000000, 0b00000000, 0b00000000}, - {0b10000000, 0b00000000, 0b10000000, 0b00000000}, - {0b10000000, 0b00010000, 0b00000010, 0b00000000}, - {0b10000000, 0b10000000, 0b10000000, 0b10000000}, - {0b10000001, 0b00000100, 0b00001000, 0b00100000}, - {0b10000010, 0b00010000, 0b10000010, 0b00010000}, - {0b10000100, 0b01000010, 0b00010001, 0b00001000}, - {0b10001000, 0b10001000, 0b10001000, 0b10001000}, - {0b10001001, 0b00010001, 0b00100010, 0b01000100}, - {0b10001001, 0b00100100, 0b10001001, 0b00100100}, - {0b10010100, 0b10010010, 0b01001001, 0b00100100}, - {0b10010100, 0b10010100, 0b10010100, 0b10010100}, - {0b10010101, 0b00101001, 0b01001010, 0b01010010}, - {0b10010101, 0b01001010, 0b10010101, 0b01001010}, - {0b10010101, 0b01010101, 0b00101010, 0b10101010}, - {0b10101010, 0b10101010, 0b10101010, 0b10101010}, - {0b10110101, 0b01010101, 0b01101010, 0b10101010}, - {0b10110101, 0b01011010, 0b10110101, 0b01011010}, - {0b10110101, 0b01101011, 0b01011010, 0b11010110}, - {0b10110101, 0b10110101, 0b10110101, 0b10110101}, - {0b10110101, 0b10110110, 0b11011011, 0b01101101}, - {0b10111011, 0b01101101, 0b10111011, 0b01101101}, - {0b10111011, 0b01110111, 0b01101110, 0b11011101}, - {0b10111011, 0b10111011, 0b10111011, 0b10111011}, - {0b10111101, 0b11011110, 0b11110111, 0b01111011}, - {0b10111110, 0b11110111, 0b10111110, 0b11110111}, - {0b10111111, 0b01111101, 0b11111011, 0b11101111}, - {0b10111111, 0b10111111, 0b10111111, 0b10111111}, - {0b10111111, 0b11110111, 0b11111110, 0b11111111}, - {0b10111111, 0b11111111, 0b10111111, 0b11111111}, - {0b10111111, 0b11111111, 0b11111111, 0b11111111}, - {0b11111111, 0b11111111, 0b11111111, 0b11111111} -}; diff --git a/src/euclidean/data.h b/src/euclidean/data.h deleted file mode 100644 index 791b7d5d..00000000 --- a/src/euclidean/data.h +++ /dev/null @@ -1,37 +0,0 @@ -// clang-format off - -#ifndef _EUCLIDEAN_DATA_H_ -#define _EUCLIDEAN_DATA_H_ -extern const char table_euclidean_1[2][1]; -extern const char table_euclidean_2[3][1]; -extern const char table_euclidean_3[4][1]; -extern const char table_euclidean_4[5][1]; -extern const char table_euclidean_5[6][1]; -extern const char table_euclidean_6[7][1]; -extern const char table_euclidean_7[8][1]; -extern const char table_euclidean_8[9][1]; -extern const char table_euclidean_9[10][2]; -extern const char table_euclidean_10[11][2]; -extern const char table_euclidean_11[12][2]; -extern const char table_euclidean_12[13][2]; -extern const char table_euclidean_13[14][2]; -extern const char table_euclidean_14[15][2]; -extern const char table_euclidean_15[16][2]; -extern const char table_euclidean_16[17][2]; -extern const char table_euclidean_17[18][3]; -extern const char table_euclidean_18[19][3]; -extern const char table_euclidean_19[20][3]; -extern const char table_euclidean_20[21][3]; -extern const char table_euclidean_21[22][3]; -extern const char table_euclidean_22[23][3]; -extern const char table_euclidean_23[24][3]; -extern const char table_euclidean_24[25][3]; -extern const char table_euclidean_25[26][4]; -extern const char table_euclidean_26[27][4]; -extern const char table_euclidean_27[28][4]; -extern const char table_euclidean_28[29][4]; -extern const char table_euclidean_29[30][4]; -extern const char table_euclidean_30[31][4]; -extern const char table_euclidean_31[32][4]; -extern const char table_euclidean_32[33][4]; -#endif diff --git a/src/euclidean/euclidean.c b/src/euclidean/euclidean.c deleted file mode 100644 index b61930ce..00000000 --- a/src/euclidean/euclidean.c +++ /dev/null @@ -1,45 +0,0 @@ -#include "euclidean.h" -#include "data.h" - -static const char* table_euclidean[32] = { - (const char*)table_euclidean_1, (const char*)table_euclidean_2, - (const char*)table_euclidean_3, (const char*)table_euclidean_4, - (const char*)table_euclidean_5, (const char*)table_euclidean_6, - (const char*)table_euclidean_7, (const char*)table_euclidean_8, - (const char*)table_euclidean_9, (const char*)table_euclidean_10, - (const char*)table_euclidean_11, (const char*)table_euclidean_12, - (const char*)table_euclidean_13, (const char*)table_euclidean_14, - (const char*)table_euclidean_15, (const char*)table_euclidean_16, - (const char*)table_euclidean_17, (const char*)table_euclidean_18, - (const char*)table_euclidean_19, (const char*)table_euclidean_20, - (const char*)table_euclidean_21, (const char*)table_euclidean_22, - (const char*)table_euclidean_23, (const char*)table_euclidean_24, - (const char*)table_euclidean_25, (const char*)table_euclidean_26, - (const char*)table_euclidean_27, (const char*)table_euclidean_28, - (const char*)table_euclidean_29, (const char*)table_euclidean_30, - (const char*)table_euclidean_31, (const char*)table_euclidean_32 -}; - -static char get_byte(const char* a, int n) { - return a[n / 8]; -} - -static int get_bit(const char* a, int k) { - char byte = get_byte(a, k); - int bit_index = 7 - (k % 8); - return (byte & (1 << bit_index)) != 0; -} - -int euclidean(int fill, int len, int step) { - if (len < 1 || len > 32) return 0; - if (fill < 1 || fill > len) return 0; - - const char* len_table = table_euclidean[len - 1]; - int entry_size = len / 8; - if (len % 8 > 0) entry_size++; - const char* table = &len_table[fill * entry_size]; - // adjust step, s.t. 0 <= step < len - int remainder = step % len; - int modulo = remainder < 0 ? remainder + len : remainder; - return get_bit(table, modulo); -} diff --git a/src/euclidean/euclidean.h b/src/euclidean/euclidean.h deleted file mode 100644 index 7b04c4ff..00000000 --- a/src/euclidean/euclidean.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _EUCLIDEAN_H_ -#define _EUCLIDEAN_H_ - -extern int euclidean(int fill, int len, int step); - -#endif diff --git a/src/euclidean/euclidean.hs b/src/euclidean/euclidean.hs deleted file mode 100755 index b288c346..00000000 --- a/src/euclidean/euclidean.hs +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env runhaskell - --- Generate data.h and data.c - -import Data.List (intercalate, partition, unfoldr) - --- http://unthingable.eat-up.org/tag/music.html - --- | Euclidean rhythm generator -euclidean :: Int -- ^ fill steps - -> Int -- ^ total steps - -> [Bool] -euclidean k n = concat . efold $ - replicate k [True] ++ replicate (n - k) [False] - --- | A hybrid of zip and outer join, takes two lists of different lengths and --- concatenates their elements pairwise -ezip :: [[a]] -> [[a]] -> [[a]] -ezip x [] = x -ezip [] x = x -ezip (x:xs) (y:ys) = (x ++ y) : ezip xs ys - --- | Repeatedly applies the tail end of the sequence under construction to the --- head, using ezip, until either there are 3 or fewer subpatterns or the --- pattern is cyclic. -efold :: Eq a => [[a]] -> [[a]] -efold xs - | length xs <= 3 = xs - | null a = xs - | otherwise = efold $ ezip a b - where (a, b) = partition (/= last xs) xs - --- | All the Euclidean rhythms of a given length -allEuclideans :: Int -> [[Bool]] -allEuclideans n = fmap (`euclidean` n) [0..n] - --- | Pad a list of `Bool` with False out to length `n` -pad :: Int -> [Bool] -> [Bool] -pad n xs - | length xs >= n = xs - | otherwise = pad n $ xs ++ [False] - --- | Chunking algorithm -chunk :: Int -> [a] -> [[a]] -chunk n = takeWhile (not.null) . unfoldr (Just . splitAt n) - --- | Split a list of bools into a list of list of bools, each padded to 8 bits --- (e.g char) -bitArray :: [Bool] -> [[Bool]] -bitArray xs = pad 8 <$> chunk 8 xs - -bitArrayCLiteral :: [[[Bool]]] -> String -bitArrayCLiteral xs = multiLineCArray $ oneLineCArray <$> (fmap . fmap) bitCLiteral xs - where oneLineCArray :: [String] -> String - oneLineCArray ys = "{" ++ intercalate ", " ys ++ "}" - multiLineCArray :: [String] -> String - multiLineCArray ys = "{\n" ++ intercalate ",\n" (fmap ("\t"++) ys) ++ "\n}" - bitCLiteral :: [Bool] -> String - bitCLiteral ys = "0b" ++ fmap lit ys - where lit True = '1' - lit False = '0' - -bytes :: Int -> Int -bytes x = x `div` 8 + p - where p = if x `rem` 8 > 0 then 1 else 0 - -arrayPrototype :: Int -> String -arrayPrototype x = "const char table_euclidean_" ++ show x ++ "[" ++ show (x + 1) ++ "][" ++ show (bytes x) ++ "]" - -array :: Int -> String -array x = arrayPrototype x ++ " = " ++ bitArrayCLiteral (bitArray <$> allEuclideans x) ++ ";" - -dataC :: String -dataC = "// clang-format off\n\n" ++ - intercalate "\n\n" (fmap array [1..32]) ++ "\n" - -headerC :: String -headerC = "// clang-format off\n\n" ++ - "#ifndef _EUCLIDEAN_DATA_H_\n" ++ - "#define _EUCLIDEAN_DATA_H_\n" ++ - concatMap (\i -> "extern " ++ arrayPrototype i ++ ";\n") [1..32] ++ - "#endif\n" - -main :: IO () -main = do writeFile "data.h" headerC - writeFile "data.c" dataC From 0ac17b2f22064f119a55085bed722618683622d0 Mon Sep 17 00:00:00 2001 From: Greg Wuller Date: Tue, 17 Jan 2017 18:47:29 -0800 Subject: [PATCH 7/8] mid ii: shift, slew --- src/ops/hardware.c | 24 ++++++++++++++++++++++++ src/ops/hardware.h | 3 +++ src/ops/op.c | 7 ++++--- src/ops/op.h | 2 +- 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/ops/hardware.c b/src/ops/hardware.c index ce0a8dda..20855f95 100644 --- a/src/ops/hardware.c +++ b/src/ops/hardware.c @@ -153,6 +153,11 @@ static void op_CY_POS_set(const void *data, scene_state_t *ss, exec_state_t *es, static void op_CY_REV_get(const void *data, scene_state_t *ss, exec_state_t *es, command_state_t *cs); +static void op_MID_SHIFT_get(const void *data, scene_state_t *ss, + exec_state_t *es, command_state_t *cs); +static void op_MID_SLEW_get(const void *data, scene_state_t *ss, + exec_state_t *es, command_state_t *cs); + static void op_ARP_STYLE_get(const void *data, scene_state_t *ss, exec_state_t *es, command_state_t *cs); static void op_ARP_HOLD_get(const void *data, scene_state_t *ss, @@ -232,6 +237,9 @@ const tele_op_t op_CY_RESET = MAKE_GET_OP(CY.RES , op_CY_RESET_get const tele_op_t op_CY_POS = MAKE_GET_SET_OP(CY.POS , op_CY_POS_get , op_CY_POS_set , 1, true); const tele_op_t op_CY_REV = MAKE_GET_OP(CY.REV , op_CY_REV_get , 1, false); +const tele_op_t op_MID_SHIFT = MAKE_GET_OP(MID.SHIFT , op_MID_SHIFT_get , 1, false); +const tele_op_t op_MID_SLEW = MAKE_GET_OP(MID.SLEW , op_MID_SLEW_get , 1, false); + const tele_op_t op_ARP_STYLE = MAKE_GET_OP(ARP.STY , op_ARP_STYLE_get , 1, false); const tele_op_t op_ARP_HOLD = MAKE_GET_OP(ARP.HLD , op_ARP_HOLD_get , 1, false); const tele_op_t op_ARP_RPT = MAKE_GET_OP(ARP.RPT , op_ARP_RPT_get , 3, false); @@ -1101,6 +1109,22 @@ static void op_CY_REV_get(const void *data, scene_state_t *ss, exec_state_t *es, tele_ii_tx(II_CY_ADDR, d, 2); } +static void op_MID_SHIFT_get(const void *NOTUSED(data), + scene_state_t *NOTUSED(ss), + exec_state_t *NOTUSED(es), command_state_t *cs) { + int16_t a = cs_pop(cs); + uint8_t d[] = { II_MID_SHIFT, a >> 8, a & 0xff }; + tele_ii_tx(II_MID_ADDR, d, 3); +} + +static void op_MID_SLEW_get(const void *NOTUSED(data), + scene_state_t *NOTUSED(ss), + exec_state_t *NOTUSED(es), command_state_t *cs) { + int16_t a = cs_pop(cs); + uint8_t d[] = { II_MID_SLEW, a >> 8, a & 0xff }; + tele_ii_tx(II_MID_ADDR, d, 3); +} + static void op_ARP_STYLE_get(const void *NOTUSED(data), scene_state_t *NOTUSED(ss), exec_state_t *NOTUSED(es), command_state_t *cs) { diff --git a/src/ops/hardware.h b/src/ops/hardware.h index 05a0d6c4..17de9020 100644 --- a/src/ops/hardware.h +++ b/src/ops/hardware.h @@ -57,6 +57,9 @@ extern const tele_op_t op_CY_RESET; extern const tele_op_t op_CY_POS; extern const tele_op_t op_CY_REV; +extern const tele_op_t op_MID_SHIFT; +extern const tele_op_t op_MID_SLEW; + extern const tele_op_t op_ARP_STYLE; extern const tele_op_t op_ARP_HOLD; extern const tele_op_t op_ARP_RPT; diff --git a/src/ops/op.c b/src/ops/op.c index 9eee9d57..2364d9d7 100644 --- a/src/ops/op.c +++ b/src/ops/op.c @@ -46,9 +46,10 @@ const tele_op_t *tele_ops[OPS] = { &op_KR_POS, &op_KR_LOOP_ST, &op_KR_LOOP_LEN, &op_KR_RESET, &op_MP_PRESET1, &op_MP_RESET1, &op_MP_STOP1, &op_MP_SCALE, &op_MP_PERIOD, &op_LV_PRESET, &op_LV_RESET, &op_LV_POS, &op_LV_L_ST, &op_LV_L_LEN, &op_LV_L_DIR, - &op_CY_PRESET, &op_CY_RESET, &op_CY_POS, &op_CY_REV, &op_ARP_STYLE, - &op_ARP_HOLD, &op_ARP_RPT, &op_ARP_GATE, &op_ARP_DIV, &op_ARP_RESET, - &op_ARP_SHIFT, &op_ARP_SLEW, &op_ARP_FILL, &op_ARP_ROT, &op_ARP_ER, + &op_CY_PRESET, &op_CY_RESET, &op_CY_POS, &op_CY_REV, &op_MID_SLEW, + &op_MID_SHIFT, &op_ARP_STYLE, &op_ARP_HOLD, &op_ARP_RPT, &op_ARP_GATE, + &op_ARP_DIV, &op_ARP_RESET, &op_ARP_SHIFT, &op_ARP_SLEW, &op_ARP_FILL, + &op_ARP_ROT, &op_ARP_ER, // maths &op_ADD, &op_SUB, &op_MUL, &op_DIV, &op_MOD, &op_RAND, &op_RRAND, &op_TOSS, diff --git a/src/ops/op.h b/src/ops/op.h index 082001a9..26208039 100644 --- a/src/ops/op.h +++ b/src/ops/op.h @@ -25,7 +25,7 @@ typedef struct { const uint8_t params; } tele_mod_t; -#define OPS 191 +#define OPS 193 extern const tele_op_t *tele_ops[OPS]; #define MODS 7 From 63129edbdb65dac46ccda38b64ee5c08922a28f8 Mon Sep 17 00:00:00 2001 From: Greg Wuller Date: Tue, 17 Jan 2017 20:35:09 -0800 Subject: [PATCH 8/8] latest libavr32 --- libavr32 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavr32 b/libavr32 index bdf04d75..a5328063 160000 --- a/libavr32 +++ b/libavr32 @@ -1 +1 @@ -Subproject commit bdf04d75d7be7936e3572df8d9ce9832eba596cb +Subproject commit a53280636102c5dc3a39cb2a495a3d279842cd31