Skip to content

Instantly share code, notes, and snippets.

@jbclements
Created November 14, 2013 00:35
Show Gist options
  • Save jbclements/7459187 to your computer and use it in GitHub Desktop.
Save jbclements/7459187 to your computer and use it in GitHub Desktop.
network example with filtering
#lang racket
(require rsound)
(require rsound/filter
rsound/reverb-typed)
(require plot)
;(play ding)
(define (s sec) (* 44100 sec))
(define samp (rs-read/clip "/tmp/everyday-sunshine.wav" (s 0) (s 10)))
#;(play samp)
(define (control f) (+ 0.4 (* 0.3 (sin (* f 0.5 7.123792865282977e-05)))))
#;(plot (function control)
#:x-min 0
#:x-max (* 10 44100))
(define (sawtooth f) (/ (modulo f 220) 220))
#;(plot (function sawtooth)
#:x-min 0
#:x-max 100)
(play (signal->rsound (s 9)
(network ()
[f ((simple-ctr 0 1))]
[st (+ (rs-ith/left samp f)
(rs-ith/left samp (+ 6 f)))]
[out (lpf/dynamic 0.2 st)])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment