Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of STM32FMSynth by
Diff: main.cpp
- Revision:
- 16:c2f912cdd919
- Parent:
- 15:34ba7c2ef718
- Child:
- 17:65437c94ab1b
--- a/main.cpp Fri Dec 08 02:15:05 2017 +0000
+++ b/main.cpp Fri Dec 08 03:41:22 2017 +0000
@@ -27,17 +27,17 @@
BusIn numerator(PA_8, PA_9, PA_10, PA_11);
BusIn denominator(PA_12, PA_13, PA_14, PA_15);
-Serial pc(USBTX, USBRX);
+//Serial pc(USBTX, USBRX);
Ticker synthesisClock;
#define numKeys 49
//constants
-const int carrierIncrements[] = {107, 113, 120, 127, 135, 143, 151, 160, 170,
- 180, 190, 202, 214, 227, 240, 254, 270, 286, 303, 321, 340, 360, 381, 404,
- 428, 454, 481, 509, 540, 572, 606, 642, 680, 720, 763, 809, 857, 908, 962,
- 1019, 1080, 1144, 1212, 1284, 1360, 1441, 1527, 1618, 1714};
+const int carrierIncrements[] = {214, 227, 240, 254, 270, 286, 303, 321, 340,
+ 360, 381, 404, 428, 454, 481, 509, 540, 572, 606, 642, 680, 720, 763, 809,
+ 857, 908, 962, 1019, 1080, 1144, 1212, 1284, 1360, 1441, 1527, 1618, 1714,
+ 1816, 1924, 2039, 2160, 2288, 2424, 2568, 2721, 2883, 3055, 3236, 3429};
#define attackLimit 0xFFFF
#define U_PI 3.14159265358979
//non-constants
@@ -161,7 +161,7 @@
// wave += fastSin(testTone);
wave = wave * Volume >> 16;
- wave = wave << 3;
+ //wave = wave << 3;
wave = (wave > 32767) ? 32767 : wave;
wave = (wave < -32768) ? - 32768 : wave;
@@ -176,7 +176,7 @@
int64_t keytemp = 0;
- pc.printf("Starting up...");
+ //pc.printf("Starting up...");
FMmult = 1;
Volume = 0;
modVol = 0;
@@ -199,9 +199,9 @@
carR = 0;
keyBank.mode(PullNone);
- synthesisClock.attach(synthesize, 0.000025);//debug
+ synthesisClock.attach(synthesize, 0.00005);//debug
- pc.printf("done.\r\n");
+ //pc.printf("done.\r\n");
while(true){
ratNumer = 0xf & ~ numerator;
ratDenom = 0xf & ~ denominator;
