Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #162 from rogerallen/master

Vosim & Membrane Ugen update.
  • Loading branch information...
commit f31c60c388e3234355d91c3265d3d7004e1a2727 2 parents d4478ca + f678fa4
@samaaron samaaron authored
View
5 src/overtone/sc/example.clj
@@ -1,7 +1,10 @@
(ns overtone.sc.example
(:use [overtone.sc.machinery defexample]
[overtone.helpers lib])
- (:require [overtone.sc.examples demand osc trig compander audio-in blackrain]))
+ (:require [overtone.sc.examples demand osc trig compander audio-in blackrain
+ vosim
+ membrane
+ ]))
(defn example
"Fetch and call specific example for gen with key
View
43 src/overtone/sc/examples/membrane.clj
@@ -0,0 +1,43 @@
+(ns overtone.sc.examples.membrane
+ (:use [overtone.sc.machinery defexample]
+ [overtone.sc ugens envelope]))
+
+(defexamples membrane-circle
+ (:mouse
+ "Use mouse button, X and Y locations to play a drum."
+ "The mouse button drives the excitation input of the membrane. The
+ mouse X location drives the tension and the Mouse Y location controls
+ the loss parameter. From the .schelp file. Click and enjoy."
+
+ rate :kr
+ []
+ "
+ (let [excitation (* (env-gen:kr
+ (perc)
+ (mouse-button:kr 0 1 0)
+ 1.0 0.0 0.1 0)
+ (pink-noise))
+ tension (mouse-x 0.01 0.1)
+ loss (mouse-y 0.999999 0.999 EXP)]
+ (membrane-circle excitation tension loss))"
+ contributor "Roger Allen"))
+
+(defexamples membrane-hexagon
+ (:mouse
+ "Use mouse button, X and Y locations to play a drum."
+ "The mouse button drives the excitation input of the membrane. The
+ mouse X location drives the tension and the Mouse Y location controls
+ the loss parameter. From the .schelp file. Click and enjoy."
+
+ rate :kr
+ []
+ "
+ (let [excitation (* (env-gen:kr
+ (perc)
+ (mouse-button:kr 0 1 0)
+ 1.0 0.0 0.1 0)
+ (pink-noise))
+ tension (mouse-x 0.01 0.1)
+ loss (mouse-y 0.999999 0.999 EXP)]
+ (membrane-hexagon excitation tension loss))"
+ contributor "Roger Allen"))
View
41 src/overtone/sc/examples/vosim.clj
@@ -0,0 +1,41 @@
+(ns overtone.sc.examples.vosim
+ (:use [overtone.sc.machinery defexample]
+ [overtone.sc ugens]
+ [overtone.sc.cgens line mix]))
+
+(defexamples vosim
+ (:mouse1
+ "Use mouse X location to control the frequency of the vosim."
+ "The mouse X location controls the frequency of this simple vosim
+ example. From the .schelp file."
+
+ rate :ar
+ []
+ "
+ (vosim (impulse 100) (mouse-x 440 880 1) 3 0.99)"
+ contributor "Roger Allen")
+
+ (:mouse2
+ "Use the mouse X & Y location to modify some random vosim noises."
+ "The mouse X location controls the frequency and the mouse Y
+ location controls the decay factor. A series of random tones is
+ played and augmented by these mouse controls. Example is from the
+ .schelp file."
+
+ rate :ar
+ []
+ "
+ (let [p (t-rand:ar 0.0 1.0 (impulse:ar 6))
+ t (impulse:ar (* 9 (+ 1 (> p 0.95))))
+ f (t-rand:ar [40.0 120.0 220.0] [440.0 990.0 880.0] t)
+ n (t-rand:ar 4.0 [8.0 16.0 32.0] t)
+ d (t-rand:ar [0.2 0.4 0.6] [0.6 0.8 1.0] t)
+ a (t-rand:ar 0.0 [0.2 0.6 1.0] t)
+ l (t-rand:ar -1.0 1.0 t)
+ x (mouse-x:kr 0.25 2.0)
+ y (mouse-y:kr 0.25 1.5)
+ z 9.0
+ x_ (* x (lin-lin (lf-noise2:kr z) -1.0 1.0 0.25 2.0))
+ y_ (* y (lin-lin (lf-noise2:kr z) -1.0 1.0 0.25 2.0))]
+ (out:ar 0 (pan2:ar (mix:ar (* (vosim:ar t (* f x_) n (* d y_)) a)) l 1)))"
+ contributor "Roger Allen"))
View
2  src/overtone/sc/machinery/ugen/metadata/extras/README.md
@@ -31,7 +31,7 @@ Metadata for these ugens needs to be created for them to be available from Overt
[ ] LoopBufUGens
[ ] MCLDUGens
[*] MdaUGens
- [ ] MembraneUGens
+ [*] MembraneUGens
[ ] NCAnalysisUGens
[ ] PitchDetection
[*] RFWUGens
View
53 src/overtone/sc/machinery/ugen/metadata/extras/membrane.clj
@@ -0,0 +1,53 @@
+(ns overtone.sc.machinery.ugen.metadata.extras.membrane
+ (:use [overtone.sc.machinery.ugen common check]))
+
+(def specs
+ [
+ {:name "MembraneCircle"
+ :summary "Waveguide mesh physical models of circular drum membrane."
+ :args [{:name "excitation"
+ :doc "sound in"}
+
+ {:name "tension"
+ :default 0.05
+ :doc "tension of the membrane"}
+
+ {:name "loss"
+ :default 0.99999
+ :doc "loss of the membrane"}]
+
+ :rates #{:ar}
+ :doc "Triangular waveguide meshes of a drum-like membrane. You
+ input some excitation, such as a pulse of noise, and can adjust
+ the tension and loss while it plays.
+
+ Also see MembraneHexagon. The ugens are named after the shape made out
+ of triangular meshes. Obviously you can't make a circle out of
+ triangles, but it tries. At the moment MembraneCircle is a bit
+ bigger than MembraneHexagon, using more waveguides and therefore
+ more CPU.
+
+ These UGens are by Alex McLean (c) 2008."}
+
+ {:name "MembraneHexagon"
+ :summary "Waveguide mesh physical models of hexagonal drum membrane."
+ :args [{:name "excitation"
+ :doc "sound in"}
+
+ {:name "tension"
+ :default 0.05
+ :doc "tension of the membrane"}
+
+ {:name "loss"
+ :default 0.99999
+ :doc "loss of the membrane"}]
+
+ :rates #{:ar}
+ :doc "Triangular waveguide meshes of a drum-like membrane. You
+ input some excitation, such as a pulse of noise, and can adjust
+ the tension and loss while it plays.
+
+ Also see MembraneCircle. The ugens are named after the shape made
+ out of triangular meshes.
+
+ These UGens are by Alex McLean (c) 2008."}])
View
1  src/overtone/sc/machinery/ugen/specs.clj
@@ -24,6 +24,7 @@
extras.bat
extras.vosim
extras.berlach
+ extras.membrane
])
(defn- specs-from-namespaces
Please sign in to comment.
Something went wrong with that request. Please try again.