721
edits
Line 53: | Line 53: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
For our envelope follower, we just decay the peak signal with every new sample by a decay factor that is slightly smaller then 1 (e.g. 0.95). | For our envelope follower, we just decay the peak signal with every new sample by a decay factor that is slightly smaller then 1 (e.g. 0.95). | ||
To get a bit more accuracy you might want to get the absolute value of our signal before tracking the maximum. | [To get a bit more accuracy you might want to get the absolute value of our signal before tracking the maximum.] | ||
With the help of the [https://www.pjrc.com/teensy/td_libs_AudioNewObjects.html teensy documentation] and [[:File:envelope_follower_template.zip|my empty template file]] you should be able to grasp how | With the help of the [https://www.pjrc.com/teensy/td_libs_AudioNewObjects.html teensy documentation] and [[:File:envelope_follower_template.zip|my empty template file]] you should be able to grasp how to write your own code for the teensy audio library. Basically you write your own teensy audio object by including a C++ class that is structured as documented in the link above. This class will receive a pointer to the audio input stream coming from the piezo and can do some work on it. Look at my blank example file to see how to access the audio samples from the piezo. If you have questions about the template code please ask on our [https://signal.group/#CjQKIGr9R1a7Znwe1Ca0pmbx3rvHHzDaS1c_LnmgwwVk1KoSEhB6aHUiokel3vtGVoTErtfB signal group]! | ||
Happy Coding!!! |