Synthesizer based on the Unzen / Nucleo F746ZG

Dependencies:   amakusa mbed-dsp mbed shimabara ukifune unzen_nucleo_f746

Fork of skeleton_unzen_nucleo_f746 by seiichi horie

雲仙フレームワークのテストとして作っているプロジェクトです。中身はどんどん変っていきます。 説明はDSP空挺団の「シンセサイザー」カテゴリーを参照してください。初回は「ドッグフードを食べる」です。

Revision:
24:c77331e72374
Parent:
22:dc2cbe8db9d9
Child:
26:e99f71165e19
diff -r 58626090fce3 -r c77331e72374 vfo.cpp
--- a/vfo.cpp	Sun Feb 05 06:25:03 2017 +0000
+++ b/vfo.cpp	Wed Feb 08 21:16:41 2017 +0000
@@ -94,10 +94,14 @@
 {
         // calc the half_way;
     this-> half_way = this->Fs * this-> duty_cycle;
+    
+        // make it integer multiple of frequency
+    this->half_way /= this->frequency;
+    this->half_way *= this->frequency;
 
         // forbid to be zero.
     if ( this-> half_way < this->frequency )
-        half_way = this->frequency;              
+        this->half_way = this->frequency;              
         
         // for triangle wave;
     this->rising_rate = 1.0 / this->half_way;