|
|
@ -242,7 +242,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|
|
|
case _QWERTY:
|
|
|
|
case _QWERTY:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
if (record->event.pressed) {
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
play_notes(&tone_qwerty, 4, false);
|
|
|
|
play_notes(&tone_qwerty, 4, false, 0);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
persistant_default_layer_set(1UL<<_QWERTY);
|
|
|
|
persistant_default_layer_set(1UL<<_QWERTY);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -250,7 +250,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|
|
|
case _COLEMAK:
|
|
|
|
case _COLEMAK:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
if (record->event.pressed) {
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
play_notes(&tone_colemak, 6, false);
|
|
|
|
play_notes(&tone_colemak, 6, false, 1);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
persistant_default_layer_set(1UL<<_COLEMAK);
|
|
|
|
persistant_default_layer_set(1UL<<_COLEMAK);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -258,7 +258,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|
|
|
case _DVORAK:
|
|
|
|
case _DVORAK:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
if (record->event.pressed) {
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
play_notes(&tone_dvorak, 8, false);
|
|
|
|
play_notes(&tone_dvorak, 8, false, 10);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
persistant_default_layer_set(1UL<<_DVORAK);
|
|
|
|
persistant_default_layer_set(1UL<<_DVORAK);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -302,7 +302,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|
|
|
if (record->event.pressed) {
|
|
|
|
if (record->event.pressed) {
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
audio_on();
|
|
|
|
audio_on();
|
|
|
|
play_notes(&start_up, 4, false);
|
|
|
|
play_notes(&start_up, 4, false, 0);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -317,7 +317,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|
|
|
case 9:
|
|
|
|
case 9:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
if (record->event.pressed) {
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
play_notes(&tone_music, 8, false);
|
|
|
|
play_notes(&tone_music, 8, false, 0);
|
|
|
|
layer_on(_MUSIC);
|
|
|
|
layer_on(_MUSIC);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -333,9 +333,9 @@ void process_action_user(keyrecord_t *record) {
|
|
|
|
|
|
|
|
|
|
|
|
if (IS_LAYER_ON(_MUSIC)) {
|
|
|
|
if (IS_LAYER_ON(_MUSIC)) {
|
|
|
|
if (record->event.pressed) {
|
|
|
|
if (record->event.pressed) {
|
|
|
|
play_note(((double)261.626)*pow(2.0, -3.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)), 0xF);
|
|
|
|
play_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)), 0xF);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
stop_note(((double)261.626)*pow(2.0, -3.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)));
|
|
|
|
stop_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -344,6 +344,6 @@ void process_action_user(keyrecord_t *record) {
|
|
|
|
void matrix_init_user(void) {
|
|
|
|
void matrix_init_user(void) {
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
init_notes();
|
|
|
|
init_notes();
|
|
|
|
play_notes(&start_up, 4, false);
|
|
|
|
play_notes(&start_up, 4, false, 0);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|