Skip to content
This repository

Vosim & Membrane Ugen update. #162

Merged
merged 3 commits into from almost 2 years ago

2 participants

Roger Allen Sam Aaron
Roger Allen

Added vosim example.

Added membrane ugen metadata and example.

Sam Aaron samaaron merged commit f31c60c into from
Sam Aaron
Owner

Awesome stuff!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
5 src/overtone/sc/example.clj
... ... @@ -1,7 +1,10 @@
1 1 (ns overtone.sc.example
2 2 (:use [overtone.sc.machinery defexample]
3 3 [overtone.helpers lib])
4   - (:require [overtone.sc.examples demand osc trig compander audio-in blackrain]))
  4 + (:require [overtone.sc.examples demand osc trig compander audio-in blackrain
  5 + vosim
  6 + membrane
  7 + ]))
5 8
6 9 (defn example
7 10 "Fetch and call specific example for gen with key
43 src/overtone/sc/examples/membrane.clj
... ... @@ -0,0 +1,43 @@
  1 +(ns overtone.sc.examples.membrane
  2 + (:use [overtone.sc.machinery defexample]
  3 + [overtone.sc ugens envelope]))
  4 +
  5 +(defexamples membrane-circle
  6 + (:mouse
  7 + "Use mouse button, X and Y locations to play a drum."
  8 + "The mouse button drives the excitation input of the membrane. The
  9 + mouse X location drives the tension and the Mouse Y location controls
  10 + the loss parameter. From the .schelp file. Click and enjoy."
  11 +
  12 + rate :kr
  13 + []
  14 + "
  15 + (let [excitation (* (env-gen:kr
  16 + (perc)
  17 + (mouse-button:kr 0 1 0)
  18 + 1.0 0.0 0.1 0)
  19 + (pink-noise))
  20 + tension (mouse-x 0.01 0.1)
  21 + loss (mouse-y 0.999999 0.999 EXP)]
  22 + (membrane-circle excitation tension loss))"
  23 + contributor "Roger Allen"))
  24 +
  25 +(defexamples membrane-hexagon
  26 + (:mouse
  27 + "Use mouse button, X and Y locations to play a drum."
  28 + "The mouse button drives the excitation input of the membrane. The
  29 + mouse X location drives the tension and the Mouse Y location controls
  30 + the loss parameter. From the .schelp file. Click and enjoy."
  31 +
  32 + rate :kr
  33 + []
  34 + "
  35 + (let [excitation (* (env-gen:kr
  36 + (perc)
  37 + (mouse-button:kr 0 1 0)
  38 + 1.0 0.0 0.1 0)
  39 + (pink-noise))
  40 + tension (mouse-x 0.01 0.1)
  41 + loss (mouse-y 0.999999 0.999 EXP)]
  42 + (membrane-hexagon excitation tension loss))"
  43 + contributor "Roger Allen"))
41 src/overtone/sc/examples/vosim.clj
... ... @@ -0,0 +1,41 @@
  1 +(ns overtone.sc.examples.vosim
  2 + (:use [overtone.sc.machinery defexample]
  3 + [overtone.sc ugens]
  4 + [overtone.sc.cgens line mix]))
  5 +
  6 +(defexamples vosim
  7 + (:mouse1
  8 + "Use mouse X location to control the frequency of the vosim."
  9 + "The mouse X location controls the frequency of this simple vosim
  10 + example. From the .schelp file."
  11 +
  12 + rate :ar
  13 + []
  14 + "
  15 + (vosim (impulse 100) (mouse-x 440 880 1) 3 0.99)"
  16 + contributor "Roger Allen")
  17 +
  18 + (:mouse2
  19 + "Use the mouse X & Y location to modify some random vosim noises."
  20 + "The mouse X location controls the frequency and the mouse Y
  21 + location controls the decay factor. A series of random tones is
  22 + played and augmented by these mouse controls. Example is from the
  23 + .schelp file."
  24 +
  25 + rate :ar
  26 + []
  27 + "
  28 + (let [p (t-rand:ar 0.0 1.0 (impulse:ar 6))
  29 + t (impulse:ar (* 9 (+ 1 (> p 0.95))))
  30 + f (t-rand:ar [40.0 120.0 220.0] [440.0 990.0 880.0] t)
  31 + n (t-rand:ar 4.0 [8.0 16.0 32.0] t)
  32 + d (t-rand:ar [0.2 0.4 0.6] [0.6 0.8 1.0] t)
  33 + a (t-rand:ar 0.0 [0.2 0.6 1.0] t)
  34 + l (t-rand:ar -1.0 1.0 t)
  35 + x (mouse-x:kr 0.25 2.0)
  36 + y (mouse-y:kr 0.25 1.5)
  37 + z 9.0
  38 + x_ (* x (lin-lin (lf-noise2:kr z) -1.0 1.0 0.25 2.0))
  39 + y_ (* y (lin-lin (lf-noise2:kr z) -1.0 1.0 0.25 2.0))]
  40 + (out:ar 0 (pan2:ar (mix:ar (* (vosim:ar t (* f x_) n (* d y_)) a)) l 1)))"
  41 + contributor "Roger Allen"))
2  src/overtone/sc/machinery/ugen/metadata/extras/README.md
Source Rendered
@@ -31,7 +31,7 @@ Metadata for these ugens needs to be created for them to be available from Overt
31 31 [ ] LoopBufUGens
32 32 [ ] MCLDUGens
33 33 [*] MdaUGens
34   - [ ] MembraneUGens
  34 + [*] MembraneUGens
35 35 [ ] NCAnalysisUGens
36 36 [ ] PitchDetection
37 37 [*] RFWUGens
53 src/overtone/sc/machinery/ugen/metadata/extras/membrane.clj
... ... @@ -0,0 +1,53 @@
  1 +(ns overtone.sc.machinery.ugen.metadata.extras.membrane
  2 + (:use [overtone.sc.machinery.ugen common check]))
  3 +
  4 +(def specs
  5 + [
  6 + {:name "MembraneCircle"
  7 + :summary "Waveguide mesh physical models of circular drum membrane."
  8 + :args [{:name "excitation"
  9 + :doc "sound in"}
  10 +
  11 + {:name "tension"
  12 + :default 0.05
  13 + :doc "tension of the membrane"}
  14 +
  15 + {:name "loss"
  16 + :default 0.99999
  17 + :doc "loss of the membrane"}]
  18 +
  19 + :rates #{:ar}
  20 + :doc "Triangular waveguide meshes of a drum-like membrane. You
  21 + input some excitation, such as a pulse of noise, and can adjust
  22 + the tension and loss while it plays.
  23 +
  24 + Also see MembraneHexagon. The ugens are named after the shape made out
  25 + of triangular meshes. Obviously you can't make a circle out of
  26 + triangles, but it tries. At the moment MembraneCircle is a bit
  27 + bigger than MembraneHexagon, using more waveguides and therefore
  28 + more CPU.
  29 +
  30 + These UGens are by Alex McLean (c) 2008."}
  31 +
  32 + {:name "MembraneHexagon"
  33 + :summary "Waveguide mesh physical models of hexagonal drum membrane."
  34 + :args [{:name "excitation"
  35 + :doc "sound in"}
  36 +
  37 + {:name "tension"
  38 + :default 0.05
  39 + :doc "tension of the membrane"}
  40 +
  41 + {:name "loss"
  42 + :default 0.99999
  43 + :doc "loss of the membrane"}]
  44 +
  45 + :rates #{:ar}
  46 + :doc "Triangular waveguide meshes of a drum-like membrane. You
  47 + input some excitation, such as a pulse of noise, and can adjust
  48 + the tension and loss while it plays.
  49 +
  50 + Also see MembraneCircle. The ugens are named after the shape made
  51 + out of triangular meshes.
  52 +
  53 + These UGens are by Alex McLean (c) 2008."}])
1  src/overtone/sc/machinery/ugen/specs.clj
@@ -24,6 +24,7 @@
24 24 extras.bat
25 25 extras.vosim
26 26 extras.berlach
  27 + extras.membrane
27 28 ])
28 29
29 30 (defn- specs-from-namespaces

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.