Skip to content

Instantly share code, notes, and snippets.

@ctford
Created July 8, 2012 21:11
Show Gist options
  • Save ctford/3072824 to your computer and use it in GitHub Desktop.
Save ctford/3072824 to your computer and use it in GitHub Desktop.
Reduced bell
(definst bell# [frequency 440 duration 4.0]
(let [harmonic-decay [1.0 0.5 0.25 0.125]
ring (reduce + (map-indexed
(fn [harmonic proportion]
(let [envelope (env-gen (perc 0.01 (* duration proportion)))
overtone (* (inc harmonic) frequency)]
(* envelope proportion (sin-osc overtone))))
harmonic-decay))]
(detect-silence ring :action FREE)
ring))
@neatonk
Copy link

neatonk commented Jul 8, 2012

I'm pretty sure (reduce + partials) and (mix partials) should have the same sonic result. Try it out and see.

@ctford
Copy link
Author

ctford commented Jul 15, 2012

Yep, sounds the same to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment