forked from mirrors/qmk_userspace
fixes audio prescaler to emit correct freq
This commit is contained in:
parent
b8d2e66638
commit
c83aa16f1d
3 changed files with 36 additions and 34 deletions
|
@ -186,48 +186,48 @@ const uint16_t PROGMEM fn_actions[] = {
|
|||
|
||||
#ifdef AUDIO_ENABLE
|
||||
float start_up[][2] = {
|
||||
{440.0*pow(2.0,(50)/12.0), 20},
|
||||
{440.0*pow(2.0,(62)/12.0), 8},
|
||||
{440.0*pow(2.0,(54)/12.0), 20},
|
||||
{440.0*pow(2.0,(62)/12.0), 8}
|
||||
{440.0*pow(2.0,(14)/12.0), 20},
|
||||
{440.0*pow(2.0,(26)/12.0), 8},
|
||||
{440.0*pow(2.0,(18)/12.0), 20},
|
||||
{440.0*pow(2.0,(26)/12.0), 8}
|
||||
};
|
||||
|
||||
float tone_qwerty[][2] = {
|
||||
{440.0*pow(2.0,(59)/12.0), 8},
|
||||
{440.0*pow(2.0,(60)/12.0), 8},
|
||||
{440.0*pow(2.0,(23)/12.0), 8},
|
||||
{440.0*pow(2.0,(24)/12.0), 8},
|
||||
{0, 4},
|
||||
{440.0*pow(2.0,(67)/12.0), 16}
|
||||
{440.0*pow(2.0,(31)/12.0), 16}
|
||||
};
|
||||
|
||||
float tone_colemak[][2] = {
|
||||
{440.0*pow(2.0,(59)/12.0), 8},
|
||||
{440.0*pow(2.0,(60)/12.0), 8},
|
||||
{440.0*pow(2.0,(23)/12.0), 8},
|
||||
{440.0*pow(2.0,(24)/12.0), 8},
|
||||
{0, 4},
|
||||
{440.0*pow(2.0,(67)/12.0), 12},
|
||||
{440.0*pow(2.0,(31)/12.0), 12},
|
||||
{0, 4},
|
||||
{440.0*pow(2.0,(71)/12.0), 12}
|
||||
{440.0*pow(2.0,(35)/12.0), 12}
|
||||
};
|
||||
|
||||
float tone_dvorak[][2] = {
|
||||
{440.0*pow(2.0,(59)/12.0), 8},
|
||||
{440.0*pow(2.0,(60)/12.0), 8},
|
||||
{440.0*pow(2.0,(23)/12.0), 8},
|
||||
{440.0*pow(2.0,(24)/12.0), 8},
|
||||
{0, 4},
|
||||
{440.0*pow(2.0,(67)/12.0), 8},
|
||||
{440.0*pow(2.0,(31)/12.0), 8},
|
||||
{0, 4},
|
||||
{440.0*pow(2.0,(69)/12.0), 8},
|
||||
{440.0*pow(2.0,(33)/12.0), 8},
|
||||
{0, 4},
|
||||
{440.0*pow(2.0,(67)/12.0), 8}
|
||||
{440.0*pow(2.0,(31)/12.0), 8}
|
||||
};
|
||||
|
||||
float tone_music[][2] = {
|
||||
{440.0*pow(2.0,(48)/12.0), 8},
|
||||
{440.0*pow(2.0,(50)/12.0), 8},
|
||||
{440.0*pow(2.0,(52)/12.0), 8},
|
||||
{440.0*pow(2.0,(53)/12.0), 8},
|
||||
{440.0*pow(2.0,(55)/12.0), 8},
|
||||
{440.0*pow(2.0,(57)/12.0), 8},
|
||||
{440.0*pow(2.0,(59)/12.0), 8},
|
||||
{440.0*pow(2.0,(60)/12.0), 8}
|
||||
{440.0*pow(2.0,(12)/12.0), 8},
|
||||
{440.0*pow(2.0,(14)/12.0), 8},
|
||||
{440.0*pow(2.0,(16)/12.0), 8},
|
||||
{440.0*pow(2.0,(17)/12.0), 8},
|
||||
{440.0*pow(2.0,(19)/12.0), 8},
|
||||
{440.0*pow(2.0,(21)/12.0), 8},
|
||||
{440.0*pow(2.0,(23)/12.0), 8},
|
||||
{440.0*pow(2.0,(24)/12.0), 8}
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -333,9 +333,9 @@ void process_action_user(keyrecord_t *record) {
|
|||
|
||||
if (IS_LAYER_ON(_MUSIC)) {
|
||||
if (record->event.pressed) {
|
||||
play_note(((double)261.626)*pow(2.0, -2.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)), 0xF);
|
||||
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);
|
||||
} else {
|
||||
stop_note(((double)261.626)*pow(2.0, -2.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)));
|
||||
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)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue