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:
22:dc2cbe8db9d9
Parent:
18:b9b1116f8768
Child:
26:e99f71165e19
--- a/signal_processing.cpp	Sat Feb 04 15:05:44 2017 +0000
+++ b/signal_processing.cpp	Sun Feb 05 06:16:49 2017 +0000
@@ -54,6 +54,7 @@
     // Duty Cycle of VFO
 void SignalProcessing::set_vfo_duty_cycle( float duty )
 {
+    duty *= 0.5f;                        // [0.0,0.5]
     this->enter_critical_section();     // forbidden interrrupt.
     this->note->set_vfo_duty_cycle( duty );
     this->leave_critical_section();     // now, ok to accept interrupt.
@@ -76,7 +77,39 @@
     this->leave_critical_section();     // now, ok to accept interrupt.
 }
 
+        // Set the lpf/hpf/bpf
+void SignalProcessing::set_filter_mode( svf_mode mode )
+{
+    this->enter_critical_section();     // forbidden interrrupt.
+    this->note->set_filter_mode( mode );
+    this->leave_critical_section();     // now, ok to accept interrupt.
+}
 
+        // Set the Q value. 
+void SignalProcessing::set_filter_Q( float Q )
+{
+        // range of the parameter Q ( volume input ) is [0,1.0].
+        // Transform it to [0.1,10]
+    Q *= 9.9f;
+    Q += 0.1f;
+    
+    this->enter_critical_section();     // forbidden interrrupt.
+    this->note->set_filter_Q( Q );
+    this->leave_critical_section();     // now, ok to accept interrupt.
+}
+
+        // Set the f_factor value. 
+void SignalProcessing::set_filter_f_factor( float f_factor )
+{
+        // range of the parameter f_factor ( volume input ) is [0,1.0].
+        // Transform it to [0.1,5.0]
+    f_factor *= 4.9f;
+    f_factor += 0.1f;
+    
+    this->enter_critical_section();     // forbidden interrrupt.
+    this->note->set_filter_f_factor( f_factor );
+    this->leave_critical_section();     // now, ok to accept interrupt.
+}
 
 /************************** skeleton dependent methond. ***********************/
         // essential members. Do not touch.