summaryrefslogtreecommitdiff
path: root/keyboards/giabalanai/keymaps/party/rgb_matrix_user.inc
diff options
context:
space:
mode:
author3araht <69518343+3araht@users.noreply.github.com>2022-09-01 05:05:43 +0900
committerGitHub <noreply@github.com>2022-08-31 21:05:43 +0100
commit1ccd0c19da8a8b3e0032ffb0446c543dd6c96155 (patch)
tree0eaed54e4488133fbf0dded116fb98cfab962df9 /keyboards/giabalanai/keymaps/party/rgb_matrix_user.inc
parentd4c935d8fa6495f7f925c3109db8e9390136bf79 (diff)
Add giabalanai keyboard (#10125)
by 3araht
Diffstat (limited to 'keyboards/giabalanai/keymaps/party/rgb_matrix_user.inc')
-rw-r--r--keyboards/giabalanai/keymaps/party/rgb_matrix_user.inc57
1 files changed, 57 insertions, 0 deletions
diff --git a/keyboards/giabalanai/keymaps/party/rgb_matrix_user.inc b/keyboards/giabalanai/keymaps/party/rgb_matrix_user.inc
new file mode 100644
index 0000000000..40ce7148d3
--- /dev/null
+++ b/keyboards/giabalanai/keymaps/party/rgb_matrix_user.inc
@@ -0,0 +1,57 @@
+#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED
+RGB_MATRIX_EFFECT(my_solid_reactive_with_CnoteIndicator)
+RGB_MATRIX_EFFECT(my_party_rocks)
+
+# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
+
+bool my_solid_reactive_with_CnoteIndicator(effect_params_t* params) {
+ RGB_MATRIX_USE_LIMITS(led_min, led_max);
+
+ uint16_t max_tick = 65535 / rgb_matrix_config.speed;
+ for (uint8_t i = led_min; i < led_max; i++) {
+ RGB_MATRIX_TEST_LED_FLAGS();
+ HSV hsv = rgb_matrix_config.hsv;
+ switch (i) {
+ // C note indicator
+ case 15:
+ case 19:
+ case 23:
+ case 52:
+ case 56:
+ case 60:
+ case 80: // left hand side, bass C note when counter bass is chosen.
+ // HSV_GOLDENROD
+ hsv.h = 30;
+ hsv.s = 218;
+ hsv.v = 218;
+ break;
+ }
+ uint16_t tick = max_tick;
+ // Reverse search to find most recent key hit
+ for (int8_t j = g_last_hit_tracker.count - 1; j >= 0; j--) {
+ if (g_last_hit_tracker.x[j] == g_led_config.point[i].x && g_last_hit_tracker.y[j] == g_led_config.point[i].y && g_last_hit_tracker.tick[j] < tick) {
+ tick = g_last_hit_tracker.tick[j];
+ break;
+ }
+ }
+
+ uint16_t offset = scale16by8(tick, rgb_matrix_config.speed);
+ hsv.h += qsub8(130, offset);
+ RGB rgb = rgb_matrix_hsv_to_rgb(hsv);
+ rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
+ }
+ return led_max < DRIVER_LED_TOTAL;
+}
+
+bool my_party_rocks(effect_params_t* params) {
+ RGB_MATRIX_USE_LIMITS(led_min, led_max);
+ HSV hsv = {rand() & 0xFF, rand() & 0xFF, rgb_matrix_config.hsv.v};
+ RGB rgb = rgb_matrix_hsv_to_rgb(hsv);
+ // rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
+ rgb_matrix_set_color_all(rgb.r, rgb.g, rgb.b);
+ return led_max < DRIVER_LED_TOTAL;
+}
+
+
+# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
+#endif // RGB_MATRIX_KEYREACTIVE_ENABLED