[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-dev] SF.net SVN: supercollider: [7187] trunk/build/Help/Collections/Harmonics. html



Revision: 7187
          http://svn.sourceforge.net/supercollider/?rev=7187&view=rev
Author:   joshpar
Date:     2008-02-01 13:30:19 -0800 (Fri, 01 Feb 2008)

Log Message:
-----------
add Harmonics help

Added Paths:
-----------
    trunk/build/Help/Collections/Harmonics.html

Added: trunk/build/Help/Collections/Harmonics.html
===================================================================
--- trunk/build/Help/Collections/Harmonics.html	                        (rev 0)
+++ trunk/build/Help/Collections/Harmonics.html	2008-02-01 21:30:19 UTC (rev 7187)
@@ -0,0 +1,168 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd";>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<title></title>
+<meta name="Generator" content="Cocoa HTML Writer">
+<meta name="CocoaVersion" content="949">
+<style type="text/css">
+p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Helvetica}
+p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
+p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
+p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica}
+p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #bf0000}
+p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; min-height: 16.0px}
+p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000; min-height: 12.0px}
+p.p8 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000}
+p.p9 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
+p.p10 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
+span.s1 {color: #000000}
+span.s2 {color: #0000bf}
+span.s3 {color: #606060}
+span.s4 {color: #007300}
+span.Apple-tab-span {white-space:pre}
+</style>
+</head>
+<body>
+<p class="p1"><b>Harmonics</b></p>
+<p class="p2"><br></p>
+<p class="p3">Harmonics objects are convenient factories for creating Arrays that are used to fill buffers using the b_gen sine fill commands on the server.</p>
+<p class="p2"><br></p>
+<p class="p4"><b>Class Methods</b></p>
+<p class="p2"><br></p>
+<p class="p3"><b>*new(size)</b></p>
+<p class="p2"><br></p>
+<p class="p3">Create a new Harmonics array of size. Nothing is filled in for you, until instance methods are applied.</p>
+<p class="p2"><br></p>
+<p class="p5"><span class="s1">a = </span><span class="s2">Harmonics</span><span class="s1">.new(16); </span>// just returns an instance of Harmonics with size</p>
+<p class="p6"><br></p>
+<p class="p4"><b>Instance Methods</b></p>
+<p class="p2"><br></p>
+<p class="p3"><b>ramp(start, step)</b></p>
+<p class="p2"><br></p>
+<p class="p5"><span class="s1">a.ramp(1.0, 1.0); </span>// returns a harmonic series</p>
+<p class="p7"><br></p>
+<p class="p8">b = <span class="s2">Buffer</span>.alloc(s, 512, 1);</p>
+<p class="p5">// harmonic series for freqs, ramp down for amps</p>
+<p class="p8">b.sine2(a.ramp(1.0, 1.0).postln, a.ramp(0.5, -0.025).postln, <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p7"><br></p>
+<p class="p8">z = <span class="s2">SynthDef</span>(<span class="s3">"help-Osc"</span>,{ <span class="s2">arg</span> out=0,bufnum=0;</p>
+<p class="p8"><span class="Apple-tab-span">	</span><span class="s2">Out</span>.ar(out,</p>
+<p class="p8"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="s2">Osc</span>.ar(bufnum, 200, 0, 0.5)</p>
+<p class="p8"><span class="Apple-tab-span">	</span>)</p>
+<p class="p8">});</p>
+<p class="p7"><br></p>
+<p class="p8">y = z.play(s,[<span class="s4">\out</span>, 0, <span class="s4">\bufnum</span>, b]);<span class="Apple-converted-space"> </span></p>
+<p class="p7"><br></p>
+<p class="p8">y.free;</p>
+<p class="p2"><br></p>
+<p class="p3"><b>decay(k) - 1 / ((i+1 ** k)</b></p>
+<p class="p2"><br></p>
+<p class="p9">a.decay(1.0);<span class="Apple-converted-space"> </span></p>
+<p class="p10"><br></p>
+<p class="p9">b.sine2(a.ramp(1.0, 1.0).postln, a.decay(1.0).postln, <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p10"><br></p>
+<p class="p9">y = z.play(s,[<span class="s4">\out</span>, 0, <span class="s4">\bufnum</span>, b]);<span class="Apple-converted-space"> </span></p>
+<p class="p10"><br></p>
+<p class="p9">y.free;</p>
+<p class="p10"><br></p>
+<p class="p3"><b>geom(k) - 1 / (i ** k)</b></p>
+<p class="p2"><br></p>
+<p class="p9">a.geom(1.2);<span class="Apple-converted-space"> </span></p>
+<p class="p10"><br></p>
+<p class="p9">b.sine2(a.ramp(1.0, 1.0).postln, a.geom(1.2).postln, <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p10"><br></p>
+<p class="p9">y = z.play(s,[<span class="s4">\out</span>, 0, <span class="s4">\bufnum</span>, b]);<span class="Apple-converted-space"> </span></p>
+<p class="p10"><br></p>
+<p class="p9">y.free;</p>
+<p class="p10"><br></p>
+<p class="p3"><b>formant(center, width) - create a formant like structure</b></p>
+<p class="p2"><br></p>
+<p class="p9">a.formant(6, 3);<span class="Apple-converted-space"> </span></p>
+<p class="p10"><br></p>
+<p class="p9">b.sine2(a.formant(12, 3).postln, a.geom(1.2), <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p10"><br></p>
+<p class="p9">y = z.play(s,[<span class="s4">\out</span>, 0, <span class="s4">\bufnum</span>, b]);<span class="Apple-converted-space"> </span></p>
+<p class="p10"><br></p>
+<p class="p9">y.free;</p>
+<p class="p10"><br></p>
+<p class="p3"><b>teeth(spacing, start)</b></p>
+<p class="p2"><br></p>
+<p class="p9">a.teeth(6, 3);<span class="Apple-converted-space"> </span></p>
+<p class="p10"><br></p>
+<p class="p9">b.sine2(a.teeth(2, 3).postln, a.geom(1.2), <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p10"><br></p>
+<p class="p9">y = z.play(s,[<span class="s4">\out</span>, 0, <span class="s4">\bufnum</span>, b]);<span class="Apple-converted-space"> </span></p>
+<p class="p10"><br></p>
+<p class="p9">b.sine2(a.teeth(4, 1).postln, a.geom(1.2), <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p9">b.sine2(a.teeth(1, 3).postln, a.geom(1.2), <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p9">b.sine2(a.teeth(2, 3).postln, a.geom(1.2), <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p10"><br></p>
+<p class="p9">y.free;</p>
+<p class="p10"><br></p>
+<p class="p3"><b>cutoff(n) - </b>returns 1.0 to the nth place, fills the rest with 0.0</p>
+<p class="p2"><br></p>
+<p class="p9">a.cutoff(3);<span class="Apple-converted-space"> </span></p>
+<p class="p10"><br></p>
+<p class="p9">b.sine2(a.ramp(1.0, 1.0), a.cutoff(3), <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p10"><br></p>
+<p class="p9">y = z.play(s,[<span class="s4">\out</span>, 0, <span class="s4">\bufnum</span>, b]);<span class="Apple-converted-space"> </span></p>
+<p class="p10"><br></p>
+<p class="p9">b.sine2(a.ramp(1.0, 1.0), a.cutoff(3), <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p9">b.sine2(a.ramp(1.0, 1.0), a.cutoff(5), <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p9">b.sine2(a.ramp(1.0, 1.0), a.cutoff(1), <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p10"><br></p>
+<p class="p9">y.free;</p>
+<p class="p10"><br></p>
+<p class="p3"><b>shelf(start, end, startLevel, endLevel)<span class="Apple-converted-space"> </span></b></p>
+<p class="p2"><br></p>
+<p class="p9">a.shelf(0, 6, 1, 0);<span class="Apple-converted-space"> </span></p>
+<p class="p10"><br></p>
+<p class="p9">b.sine2(a.ramp(1.0, 1.0), a.shelf(0, 6, 1, 0).postln , <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p10"><br></p>
+<p class="p9">y = z.play(s,[<span class="s4">\out</span>, 0, <span class="s4">\bufnum</span>, b]);<span class="Apple-converted-space"> </span></p>
+<p class="p10"><br></p>
+<p class="p9">b.sine2(a.ramp(1.0, 1.0), a.shelf(0, 11, 1, 0).postln , <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p9">b.sine2(a.ramp(1.0, 1.0), a.shelf(2, 6, 1, 0).postln , <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p9">b.sine2(a.ramp(1.0, 1.0), a.shelf(6, 8, 1, 0).postln , <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p10"><br></p>
+<p class="p9">y.free;</p>
+<p class="p10"><br></p>
+<p class="p3"><b>sine(wavelength, iphase, mul, add)<span class="Apple-converted-space"> </span></b></p>
+<p class="p2"><br></p>
+<p class="p9">a.sine(8, 0, 1, 0);<span class="Apple-converted-space"> </span></p>
+<p class="p10"><br></p>
+<p class="p9">b.sine2(a.ramp(1.0, 1.0), a.sine(8, 0, 1, 0).postln , <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p10"><br></p>
+<p class="p9">y = z.play(s,[<span class="s4">\out</span>, 0, <span class="s4">\bufnum</span>, b]);<span class="Apple-converted-space"> </span></p>
+<p class="p10"><br></p>
+<p class="p9">b.sine2(a.ramp(1.0, 1.0), a.sine(4, 0, 1, 0).postln , <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p9">b.sine2(a.ramp(1.0, 1.0), a.sine(2.2, 0.5pi, 0.4, 0.2).postln , <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p9">b.sine2(a.ramp(1.0, 1.0), a.sine(pi, 0.25pi, 0.5, 0).postln , <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p10"><br></p>
+<p class="p9">y.free;</p>
+<p class="p10"><br></p>
+<p class="p3"><b>pulse(wavelength, iphase, duty, mul, add)<span class="Apple-converted-space"> </span></b></p>
+<p class="p2"><br></p>
+<p class="p9">a.pulse(8, 0, 2, 1, 0);<span class="Apple-converted-space"> </span></p>
+<p class="p10"><br></p>
+<p class="p9">b.sine2(a.ramp(1.0, 1.0), a.pulse(8, 0, 2, 1, 0).postln , <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p10"><br></p>
+<p class="p9">y = z.play(s,[<span class="s4">\out</span>, 0, <span class="s4">\bufnum</span>, b]);<span class="Apple-converted-space"> </span></p>
+<p class="p10"><br></p>
+<p class="p9">b.sine2(a.ramp(1.0, 1.0), a.pulse(8, 0, 2, 1, 0).postln , <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p9">b.sine2(a.ramp(1.0, 1.0), a.pulse(4, 0, 2, 0.4, 0.2).postln , <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p9">b.sine2(a.ramp(1.0, 1.0), a.pulse(7, 0.5pi, 3, 0.5, 0.1).postln , <span class="s2">true</span>, <span class="s2">true</span>, <span class="s2">true</span>);</p>
+<p class="p10"><br></p>
+<p class="p9">y.free;</p>
+<p class="p10"><br></p>
+<p class="p3"><b>random methods:</b></p>
+<p class="p2"><b></b><br></p>
+<p class="p3"><b>rand(lo, hi)</b></p>
+<p class="p3"><b>exprand(lo, hi)</b></p>
+<p class="p3"><b>linrand(lo, hi)</b></p>
+<p class="p3"><b>rand2(val)</b></p>
+<p class="p3"><b>coin(prob)</b></p>
+</body>
+</html>


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.