From 168d180a743737fb126ef6f508fda6ee1f81248f Mon Sep 17 00:00:00 2001 From: Danny Date: Wed, 11 Jul 2018 14:19:09 -0400 Subject: [PATCH] Add macro to play All Star chorus and print lyrics, fixes issues #3345, #3346, #3347, #3348, #3349, #3350 (#3372) --- layouts/community/ortho_4x12/bakingpy/keymap.c | 12 +++++++++++- layouts/community/ortho_4x12/bakingpy/rules.mk | 1 + quantum/audio/song_list.h | 10 ++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/layouts/community/ortho_4x12/bakingpy/keymap.c b/layouts/community/ortho_4x12/bakingpy/keymap.c index a05f741a724..e003513317a 100644 --- a/layouts/community/ortho_4x12/bakingpy/keymap.c +++ b/layouts/community/ortho_4x12/bakingpy/keymap.c @@ -76,7 +76,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LOWER] = LAYOUT_kc_ortho_4x12( //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , + ASTR, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , //|----+----+----+----+----+----| |----+----+----+----+----+----| DEL ,CAPP,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, //|----+----+----+----+----+----| |----+----+----+----+----+----| @@ -135,6 +135,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { float tone_qwerty[][2] = SONG(QWERTY_SOUND); float tone_dvorak[][2] = SONG(DVORAK_SOUND); float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float all_star_song[][2] = SONG(ALL_STAR); #endif void persistent_default_layer_set(uint16_t default_layer) { @@ -199,6 +200,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; + case KC_ASTR: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + SEND_STRING("Hey now, you're an all-star, get your game on, go play. Hey now, you're a rock star, get the show on, get paid. All that glitters is gold. Only shooting stars break the mold."); + PLAY_SONG(all_star_song); + #endif + } + return false; + break; } return true; } diff --git a/layouts/community/ortho_4x12/bakingpy/rules.mk b/layouts/community/ortho_4x12/bakingpy/rules.mk index 02899eafeb5..80e5f82eef1 100644 --- a/layouts/community/ortho_4x12/bakingpy/rules.mk +++ b/layouts/community/ortho_4x12/bakingpy/rules.mk @@ -2,3 +2,4 @@ ifeq ($(LAYOUTS_HAS_RGB),yes) RGBLIGHT_ENABLE = yes endif +AUDIO_ENABLE = yes diff --git a/quantum/audio/song_list.h b/quantum/audio/song_list.h index 8bcc1a9220a..01cc6f4ed19 100644 --- a/quantum/audio/song_list.h +++ b/quantum/audio/song_list.h @@ -435,4 +435,14 @@ Q__NOTE(_AS5), \ Q__NOTE(_C6), \ +#define ALL_STAR \ + E__NOTE(_AS4), Q__NOTE(_FS4), S__NOTE(_FS4), S__NOTE(_DS4), E__NOTE(_FS4), Q__NOTE(_FS4), S__NOTE(_FS4), S__NOTE(_DS4), \ + E__NOTE(_FS4), Q__NOTE(_FS4), Q__NOTE(_FS4), QD_NOTE(_AS4), \ + E__NOTE(_AS4), Q__NOTE(_FS4), S__NOTE(_FS4), S__NOTE(_DS4), E__NOTE(_FS4), Q__NOTE(_FS4), S__NOTE(_FS4), S__NOTE(_DS4), \ + E__NOTE(_FS4), Q__NOTE(_FS4), Q__NOTE(_FS4), Q__NOTE(_AS4), E__NOTE(_REST),\ + Q__NOTE(_AS4), Q__NOTE(_CS5), E__NOTE(_B4), E__NOTE(_CS5), E__NOTE(_DS5), Q__NOTE(_FS5), \ + E__NOTE(_GS5), Q__NOTE(_GS5), E__NOTE(_FS4), E__NOTE(_FS4), E__NOTE(_GS4), E__NOTE(_FS4), \ + E__NOTE(_AS4), Q__NOTE(_GS4), Q__NOTE(_GS4), Q__NOTE(_FS4), Q__NOTE(_GS4), \ + E__NOTE(_AS4), HD_NOTE(_DS4) + #endif