Created
March 12, 2014 20:25
-
-
Save iani/9515571 to your computer and use it in GitHub Desktop.
pi, sin, arrays, plot: Calculating cps to sampling rate ratio, from a series of integers. Algo Comp class AUD812
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Resampling example | |
| For class. | |
| Wed, Mar 12 2014, 18:21 EET | |
| */ | |
| //: Create a signal; | |
| ~signal = (0..(60 * 1000)); | |
| ~signal.plot; | |
| ~signal.sin.plot; | |
| //: | |
| pi.postln; | |
| 2pi; | |
| 3pi; | |
| 4pi; | |
| //: | |
| ~thePies = [0, pi, 2pi, 3pi, 4pi] | |
| //: | |
| pi.sin.round(0.000001); | |
| //: | |
| 2pi.sin.round(0.00001); | |
| //: | |
| 3pi.sin.round(0.00001); | |
| //: | |
| ~thePies.sin.round(0.000000001); | |
| //: | |
| pi.sin; | |
| //: | |
| ((0..(0.6 * 1000)) / 5 * pi).sin.plot; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment