specialise music variables
This commit is contained in:
parent
0edfe55bfe
commit
ae95834f5a
|
@ -1,8 +1,8 @@
|
||||||
#include "process_music.h"
|
#include "process_music.h"
|
||||||
|
|
||||||
bool music_activated = false;
|
bool music_activated = false;
|
||||||
uint8_t starting_note = 0x0C;
|
uint8_t music_starting_note = 0x0C;
|
||||||
int offset = 7;
|
int music_offset = 7;
|
||||||
|
|
||||||
// music sequencer
|
// music sequencer
|
||||||
static bool music_sequence_recording = false;
|
static bool music_sequence_recording = false;
|
||||||
|
@ -115,7 +115,7 @@ bool process_music(uint16_t keycode, keyrecord_t *record) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
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));
|
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));
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
play_note(freq, 0xF);
|
play_note(freq, 0xF);
|
||||||
if (music_sequence_recording) {
|
if (music_sequence_recording) {
|
||||||
|
|
Loading…
Reference in New Issue