summaryrefslogtreecommitdiffstats
path: root/quantum/audio/voices.c
diff options
context:
space:
mode:
authorErez Zukerman <ezuk@madmimi.com>2016-04-26 14:25:45 +0300
committerErez Zukerman <ezuk@madmimi.com>2016-04-26 14:25:45 +0300
commit0edc7a9d87ecbbce580cbbd0b0fffaad24f37f83 (patch)
treed1c775a932a34a66c5c16463d3b2aa96c32a6601 /quantum/audio/voices.c
parentea091e7f1b2bca0103de38c2a59b4cce6bade0a8 (diff)
parentbf56838fe99aafd37559d560e47b707a83c87588 (diff)
Merge branch 'master' of github.com:jackhumbert/qmk_firmware
Diffstat (limited to 'quantum/audio/voices.c')
-rw-r--r--quantum/audio/voices.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/quantum/audio/voices.c b/quantum/audio/voices.c
index de9f8ae544..0921bd5931 100644
--- a/quantum/audio/voices.c
+++ b/quantum/audio/voices.c
@@ -1,5 +1,6 @@
#include "voices.h"
#include "stdlib.h"
+#include "vibrato_lut.h"
// these are imported from audio.c
extern uint16_t envelope_index;
@@ -99,6 +100,36 @@ float voice_envelope(float frequency) {
if ((envelope_index % 8) == 0)
note_timbre = 0;
break;
+ case delayed_vibrato:
+ polyphony_rate = 0;
+ note_timbre = TIMBRE_50;
+ #define VOICE_VIBRATO_DELAY 150
+ #define VOICE_VIBRATO_SPEED 50
+ switch (compensated_index) {
+ case 0 ... VOICE_VIBRATO_DELAY:
+ break;
+ default:
+ frequency = frequency * VIBRATO_LUT[(int)fmod((((float)compensated_index - (VOICE_VIBRATO_DELAY + 1))/1000*VOICE_VIBRATO_SPEED), VIBRATO_LUT_LENGTH)];
+ break;
+ }
+ break;
+ // case delayed_vibrato_octave:
+ // polyphony_rate = 0;
+ // if ((envelope_index % 2) == 1) {
+ // note_timbre = 0.55;
+ // } else {
+ // note_timbre = 0.45;
+ // }
+ // #define VOICE_VIBRATO_DELAY 150
+ // #define VOICE_VIBRATO_SPEED 50
+ // switch (compensated_index) {
+ // case 0 ... VOICE_VIBRATO_DELAY:
+ // break;
+ // default:
+ // frequency = frequency * VIBRATO_LUT[(int)fmod((((float)compensated_index - (VOICE_VIBRATO_DELAY + 1))/1000*VOICE_VIBRATO_SPEED), VIBRATO_LUT_LENGTH)];
+ // break;
+ // }
+ // break;
// case duty_fifth_down:
// note_timbre = 0.5;
// if ((envelope_index % 3) == 0)