diff options
| author | Jack Humbert <jack.humb@gmail.com> | 2016-12-12 16:06:41 -0500 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2016-12-12 16:06:41 -0500 |
| commit | ae95834f5af7404c04e6fe3446019046278d814b (patch) | |
| tree | f73447fc32940c7bc6b691a83567186d1afbc991 /quantum/process_keycode/process_music.c | |
| parent | 0edfe55bfe4afd037918ff73e49552a28f39a5ca (diff) | |
| download | qmk_firmware-ae95834f5af7404c04e6fe3446019046278d814b.tar.gz qmk_firmware-ae95834f5af7404c04e6fe3446019046278d814b.zip | |
specialise music variables
Diffstat (limited to 'quantum/process_keycode/process_music.c')
| -rw-r--r-- | quantum/process_keycode/process_music.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/quantum/process_keycode/process_music.c b/quantum/process_keycode/process_music.c index 2d52e47a7..bae43943e 100644 --- a/quantum/process_keycode/process_music.c +++ b/quantum/process_keycode/process_music.c | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | #include "process_music.h" | 1 | #include "process_music.h" |
| 2 | 2 | ||
| 3 | bool music_activated = false; | 3 | bool music_activated = false; |
| 4 | uint8_t starting_note = 0x0C; | 4 | uint8_t music_starting_note = 0x0C; |
| 5 | int offset = 7; | 5 | int music_offset = 7; |
| 6 | 6 | ||
| 7 | // music sequencer | 7 | // music sequencer |
| 8 | static bool music_sequence_recording = false; | 8 | static bool music_sequence_recording = false; |
| @@ -115,7 +115,7 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { | |||
| 115 | return false; | 115 | return false; |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | float freq = ((float)220.0)*pow(2.0, -5.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)); | 118 | 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)); |
| 119 | if (record->event.pressed) { | 119 | if (record->event.pressed) { |
| 120 | play_note(freq, 0xF); | 120 | play_note(freq, 0xF); |
| 121 | if (music_sequence_recording) { | 121 | if (music_sequence_recording) { |
