This is from justinkim/PWM_Tone_Library modified for six octaves.
Fork of PWM_Tone_Library by
Revision 2:1d3262096227, committed 2017-04-18
- Comitter:
- MTYarnell
- Date:
- Tue Apr 18 15:57:38 2017 +0000
- Parent:
- 0:d06af372d384
- Commit message:
- Modified as part of "Hexi_Acceleromagnetic_Synth" 2017, Michael Yarnell, Alec Pierce. ; Octaves 1, 2, and 6 were added after calculation based on 3, 4, and 5.
Changed in this revision
pwm_tone.cpp | Show annotated file Show diff for this revision Revisions of this file |
pwm_tone.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r d06af372d384 -r 1d3262096227 pwm_tone.cpp --- a/pwm_tone.cpp Fri Jul 24 05:01:45 2015 +0000 +++ b/pwm_tone.cpp Tue Apr 18 15:57:38 2017 +0000 @@ -28,7 +28,7 @@ /** * @brief Auto tunes Function * @param name : Choose the PwmOut - period : this param is tune value. (C_3...B_5) + period : this param is tune value. (C_1...B_6) beat : this param is beat value. (1..16) 1 means 1/16 beat * @retval None */
diff -r d06af372d384 -r 1d3262096227 pwm_tone.h --- a/pwm_tone.h Fri Jul 24 05:01:45 2015 +0000 +++ b/pwm_tone.h Tue Apr 18 15:57:38 2017 +0000 @@ -3,6 +3,32 @@ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ +#define Do1 33 //C octave1 +#define Do1s 35 //C# +#define Re1 37 //D +#define Re1s 39 //D# +#define Mi1 41 //E +#define Fa1 44 //F +#define Fa1s 46 //F# +#define So1 49 //G +#define So1s 52 //G# +#define La1 55 //A +#define La1s 58 //A# +#define Ti1 62 //B + +#define Do2 66 //C octave2 +#define Do2s 69 //C# +#define Re2 74 //D +#define Re2s 78 //D# +#define Mi2 83 //E +#define Fa2 87 //F +#define Fa2s 93 //F# +#define So2 98 //G +#define So2s 104 //G# +#define La2 110 //A +#define La2s 117 //A# +#define Ti2 124 //B + #define Do3 131 //C octave3 #define Do3s 139 //C# #define Re3 147 //D @@ -15,6 +41,7 @@ #define La3 220 //A #define La3s 233 //A# #define Ti3 247 //B + #define Do4 262 //C octave4 #define Do4s 277 //C# #define Re4 294 //D @@ -27,6 +54,7 @@ #define La4 440 //A #define La4s 466 //A# #define Ti4 494 //B + #define Do5 523 //C octave5 #define Do5s 554 //C# #define Re5 587 //D @@ -40,6 +68,19 @@ #define La5s 932 //A# #define Ti5 988 //B +#define Do6 1045 //C octave6 +#define Do6s 1107 //C# +#define Re6 1173 //D +#define Re6s 1243 //D# +#define Mi6 1317 //E +#define Fa6 1395 //F +#define Fa6s 1478 //F# +#define So6 1566 //G +#define So6s 1659 //G# +#define La6 1757 //A +#define La6s 1861 //A# +#define Ti6 1972 //B + /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ void Tune(PwmOut name, int period, int beat);