Created
April 8, 2015 16:55
-
-
Save mattearnshaw/cce4d207789d89b6bd2b to your computer and use it in GitHub Desktop.
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
| (def scaffold (load-sample "scaffold.flac")) | |
| (def park (load-sample "hyde-park.flac")) | |
| (def valetta (load-sample "valettasnip.flac")) | |
| (def buf1 (buffer 2048)) | |
| (def buf2 (buffer 2048)) | |
| (definst spectralblend [buf-a 0 buf-b 1 hold-time 60 x-over-time 10] | |
| (let [amp1 2.5 | |
| amp2 1.4540 ; magic numbers for amplitude correction | |
| fft-buf1 (fft buf1 (* amp1 (scaled-play-buf 2 buf-a))) | |
| fft-buf2 (fft buf2 (* amp1 (scaled-play-buf 2 buf-b | |
| ; trigger sample B after hold-time | |
| :trigger (t-delay (env-gen (perc)) hold-time)))) | |
| ; x-over 0 = sample A only, 1 = sample B only | |
| x-over (env-gen (envelope [0 0 1] [hold-time x-over-time]))] | |
| (* amp2 (ifft (pv-morph fft-buf1 fft-buf2 x-over))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment