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.
Diff: Envelope/Envelope.cpp
- Revision:
- 30:08cc4ec58d07
- Parent:
- 19:08862f49cd9e
- Child:
- 31:cfdb014ff086
--- a/Envelope/Envelope.cpp Mon May 25 20:00:31 2020 +0000
+++ b/Envelope/Envelope.cpp Tue May 26 10:17:47 2020 +0000
@@ -21,23 +21,19 @@
rv=r*r*52;// max 63700 = 4 seconds
samples=0; //initialise sample counter
a_vec=a_vector_calc(av); //initialise a value for a dif
- d_vec=d_vector_calc(dv,sv);
+ d_vec=d_vector_calc(dv,sv); //initialise a value for d dif
at=0;//initialises
- /*
#ifdef SLOW_TIME
printf("INITIATING ENVELOPE\n");
printf("a=%d,av= %d,a vector= %d\n",a,av,a_vec);
printf("d=%d,dv= %d,d vector= %d\n",d,dv,d_vec);
printf("s=%d,sv= %d\n",s,sv);
#endif
-*/
}
-
if (samples<=av) {
at=at+a_vec; //max=63980
out=(in*at/63980)+32767;
//printf("ATTACK");
-
} else if(samples>av && samples<=av+dv) {
at=at-d_vec;
out=(in*at/63980)+32767;