summaryrefslogtreecommitdiffstats
path: root/quantum/process_keycode/process_music.c
diff options
context:
space:
mode:
authorxyverz <xyverz@gmail.com>2017-01-08 21:47:08 -0800
committerxyverz <xyverz@gmail.com>2017-01-08 21:47:08 -0800
commit99521a448296902d15c597f4d2e170766c4afadb (patch)
tree8daa16747393c2cef6b897fbb88e74ef427df76e /quantum/process_keycode/process_music.c
parent79343f1c6cde28c454eac0a577d0d7dbf3aa2f17 (diff)
parent176b93d08eb5cc0c65a6d571fc2c1fec5f575854 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'quantum/process_keycode/process_music.c')
-rw-r--r--quantum/process_keycode/process_music.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/quantum/process_keycode/process_music.c b/quantum/process_keycode/process_music.c
index bae43943e0..ca68bef6c8 100644
--- a/quantum/process_keycode/process_music.c
+++ b/quantum/process_keycode/process_music.c
@@ -115,7 +115,16 @@ bool process_music(uint16_t keycode, keyrecord_t *record) {
return false;
}
+ #ifdef MUSIC_MODE_CHROMATIC
+ float freq = ((float)220.0)*pow(2.0, -5.0)*pow(2.0,(music_starting_note + record->event.key.col + music_offset)/12.0+(MATRIX_ROWS - record->event.key.row));
+ #elif defined(MUSIC_MODE_GUITAR)
+ float freq = ((float)220.0)*pow(2.0, -5.0)*pow(2.0,(music_starting_note + record->event.key.col + music_offset)/12.0+(float)(MATRIX_ROWS - record->event.key.row + 7)*5.0/12);
+ #elif defined(MUSIC_MODE_VIOLIN)
+ float freq = ((float)220.0)*pow(2.0, -5.0)*pow(2.0,(music_starting_note + record->event.key.col + music_offset)/12.0+(float)(MATRIX_ROWS - record->event.key.row + 5)*7.0/12);
+ #else
float freq = ((float)220.0)*pow(2.0, -5.0)*pow(2.0,(music_starting_note + SCALE[record->event.key.col + music_offset])/12.0+(MATRIX_ROWS - record->event.key.row));
+ #endif
+
if (record->event.pressed) {
play_note(freq, 0xF);
if (music_sequence_recording) {