File: DoubleWell2.schelp

package info (click to toggle)
supercollider-sc3-plugins 3.7.1~repack-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 14,332 kB
  • ctags: 11,704
  • sloc: cpp: 140,180; lisp: 14,746; ansic: 2,133; xml: 86; makefile: 82; haskell: 21; sh: 8
file content (87 lines) | stat: -rw-r--r-- 2,434 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
class:: DoubleWell2		

summary:: Forced DoubleWell Oscillator
categories:: UGens>Generators>Chaotic
related:: Classes/DoubleWell, Classes/DoubleWell3

//SLUGens released under the GNU GPL as extensions for SuperCollider 3, by Nick Collins, http://composerprogrammer.com/index.html
keyword:: SLUGens


Description::

Improved Euler ODE solver implementation of the chaotic Forced Double Well Oscillator (see Strogatz, Steven H. (1994) Nonlinear Dynamics and Chaos. Addison-Wesley, Reading, MA. pp441-7). 

D2x +delta*Dx-x+x^3 = F*cos(w*t)

y = Dx

All inputs can have .kr rate UGens plugged in.

classmethods::

method::ar

argument::reset
restart with new initial conditions sampled from initx, inity
argument::ratex
update rate for x
argument::ratey
update rate for y 
argument::f
equation constant
argument::w
equation constant
argument::delta
equation constant
argument::initx
reset value for x
argument::inity
reset value for y

note for me- add a t rate control? or arbitary oscillator input rather than Fcos(wt)


Examples::

code::

//Can be very noisy, high pitched and aliases badly- ie great fun, but watch out for your ears, filter, try out odd param settings. I've turned all the amplitudes down in the following


//defaults, high pitched! WARNING
{Out.ar(0,Pan2.ar(0.1*DoubleWell.ar(Impulse.kr(0),MouseX.kr(0.01,1,'exponential'),MouseY.kr(0.01,1,'exponential'),0.9,0.0001,0.25,LFNoise0.kr(1,0.4,0.5),LFNoise0.kr(1,0.4,0.5)),0.0))}.play


//2 per second
(
{Out.ar(0,Pan2.ar(

CombN.ar(
Resonz.ar(DoubleWell2.ar(Impulse.kr(2),MouseX.kr(0.01,0.1,'exponential'),MouseY.kr(0.01,0.1,'exponential'),3.9,MouseX.kr(0.0001,0.01,'exponential'),0.25,LFNoise0.kr(1,0.4,0.5),LFNoise0.kr(1,10.4,10.5)),1000,0.1),
0.05,0.05,2
)
,0.0))}.play
)



//plotting check of first samples
{DoubleWell2.ar(0,0.1,0.1,0.4,1,0.25,0,0.0)}.plot(0.05, minval:-1, maxval:1)

//gradually changing force
{DoubleWell2.ar(0,0.1,0.1,Line.kr(0.01,0.8,10),1,0.25,0,0.0)}.play


//controlling force- guitar feedback!
{DoubleWell2.ar(0,0.1,0.1,MouseX.kr(0.0,10.0),1,MouseY.kr(0.0,1.0),0,0.0)}.play

//triggering
{DoubleWell2.ar(Impulse.kr(MouseY.kr(1,10, 'exponential')),0.1,0.1,MouseX.kr(0.0,10.0),1,MouseY.kr(0.0,1.0),LFNoise0.kr(2.3,0.2,0.8),LFNoise1.kr(2.37,0.2,0.8))}.play


//overload patch
{DoubleWell2.ar(Dust.kr(LFNoise0.kr(0.5,0.2,0.4)),0.1,0.1,MouseX.kr(0.0,50.0),MouseY.kr(0.0,1.0),0.25, LFNoise0.kr(2.3,0.4,0.5),LFNoise1.kr(2.37,0.4,0.2))}.play


::