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.
Delay_Unit.cpp
00001 /*****************************************************/ 00002 /* Delay_Unit.cpp */ 00003 /* */ 00004 /*****************************************************/ 00005 00006 #define DELAY_MAIN 00007 #include "Delay_Unit.h" 00008 00009 #define LIMIT_P (32767) 00010 #define LIMIT_N (-32768) 00011 00012 int delay(int iEffectIn) { 00013 00014 int iSignal; 00015 00016 // Bypass ? 00017 if(g_iDelayBypass == 0)return iEffectIn; 00018 00019 // Delay 00020 iSignal = (int)g_sDelayBuff[g_usDelayPoint] * g_iDelayFeedBackLevel / 100 + iEffectIn; 00021 00022 // Output Gain 00023 if (iSignal >= LIMIT_P)iSignal = LIMIT_P; 00024 if (iSignal <= LIMIT_N)iSignal = LIMIT_N; 00025 00026 g_sDelayBuff[g_usDelayPoint] = iSignal; 00027 00028 g_usDelayPoint = (g_usDelayPoint + 1) % (MAX_DELAY_POINT * g_iDelayTime / MAX_DELAY_TIME); 00029 00030 return iSignal; 00031 00032 } 00033 00034 #undef DELAY_MAIN
Generated on Sat Jul 16 2022 21:12:01 by
