]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
adds fifth and fourth down voices
authorJack Humbert <jack.humb@gmail.com>
Fri, 22 Apr 2016 05:02:50 +0000 (01:02 -0400)
committerJack Humbert <jack.humb@gmail.com>
Fri, 22 Apr 2016 05:02:50 +0000 (01:02 -0400)
quantum/audio/voices.c
quantum/audio/voices.h

index 98631f0cb47736b9d40c3bf88a1f42db4c6ed6d6..8b3978f3d805e83d1364256d1f8b5e9beb3ea0d9 100644 (file)
@@ -84,6 +84,21 @@ float voice_envelope(float frequency) {
         case duty_octave_down:
             polyphony_rate = 0;
             note_timbre = (envelope_index % 2) * .125 + .375 * 2;
+            if ((envelope_index % 4) == 0)
+                note_timbre = 0.5;
+            if ((envelope_index % 8) == 0)
+                note_timbre = 0;
+        break;
+        case duty_fifth_down:
+            note_timbre = 0.5;
+            if ((envelope_index % 5) == 0)
+                note_timbre = 0.75;
+        break;
+        case duty_fourth_down:
+            if ((envelope_index % 12) == 0)
+                note_timbre = 0.25;
+            else
+                note_timbre = 0.5;
         break;
     }
 
index 5aa99f4b1d7131ab19b69cba667e53d600a5fb97..718671f77f43571a319b6b29e8dab6f6f6da49c4 100644 (file)
@@ -16,6 +16,8 @@ typedef enum {
     octave_crunch,
     duty_osc,
     duty_octave_down,
+    duty_fifth_down,
+    duty_fourth_down,
     number_of_voices // important that this is last
 } voice_type;