Synthesizer based on the Unzen / Nucleo F746ZG
Dependencies: amakusa mbed-dsp mbed shimabara ukifune unzen_nucleo_f746
Fork of skeleton_unzen_nucleo_f746 by
雲仙フレームワークのテストとして作っているプロジェクトです。中身はどんどん変っていきます。 説明はDSP空挺団の「シンセサイザー」カテゴリーを参照してください。初回は「ドッグフードを食べる」です。
Diff: monophonic.cpp
- Revision:
- 29:8ee84bda128c
- Parent:
- 28:547f19ed6f67
--- a/monophonic.cpp Sat Feb 11 07:44:56 2017 +0000 +++ b/monophonic.cpp Sat Feb 18 04:37:19 2017 +0000 @@ -11,6 +11,7 @@ this->dc_blocker = new DCBlocker( this->block_size ); this->sv_filter = new SVFilter( this->block_size ); this->eg = new EG( this->block_size ); + this->limitter = new amakusa::LimitterLinAtan( this->block_size ); work_buf_a = new float32_t[block_size]; work_buf_b = new float32_t[block_size]; @@ -24,6 +25,7 @@ delete this->dc_blocker; delete this->sv_filter; delete this->eg; + delete this->limitter; delete[] work_buf_a; delete[] work_buf_b; @@ -43,14 +45,17 @@ this->dc_blocker->run( work_buf_a, work_buf_b ); // applying filter. - this->sv_filter->run( work_buf_b, out_buffer ); + this->sv_filter->run( work_buf_b, work_buf_a ); // generate envelope - this->eg->run( work_buf_a ); + this->eg->run( work_buf_b ); // apply envelope for ( int i= 0; i< this->block_size; i++ ) - out_buffer[ i ] *= work_buf_a[ i ]; + work_buf_b[ i ] *= work_buf_a[ i ]; + + // apply amplitude limitter + this->limitter->run( work_buf_b, out_buffer ); } // End of run()