{
	"patcher" : 	{
		"fileversion" : 1,
		"appversion" : 		{
			"major" : 6,
			"minor" : 0,
			"revision" : 8
		}
,
		"rect" : [ 765.0, 437.0, 921.0, 622.0 ],
		"bgcolor" : [ 0.9, 0.9, 0.9, 1.0 ],
		"bglocked" : 0,
		"openinpresentation" : 0,
		"default_fontsize" : 12.0,
		"default_fontface" : 0,
		"default_fontname" : "Arial",
		"gridonopen" : 0,
		"gridsize" : [ 15.0, 15.0 ],
		"gridsnaponopen" : 0,
		"statusbarvisible" : 2,
		"toolbarvisible" : 1,
		"boxanimatetime" : 200,
		"imprint" : 0,
		"enablehscroll" : 1,
		"enablevscroll" : 1,
		"devicewidth" : 0.0,
		"description" : "",
		"digest" : "",
		"tags" : "",
		"boxes" : [ 			{
				"box" : 				{
					"fontname" : "Arial",
					"fontsize" : 12.0,
					"id" : "obj-1",
					"maxclass" : "newobj",
					"numinlets" : 0,
					"numoutlets" : 1,
					"outlettype" : [ "" ],
					"patching_rect" : [ 24.0, 16.0, 30.0, 20.0 ],
					"text" : "in 1"
				}

			}
, 			{
				"box" : 				{
					"fontname" : "Arial",
					"fontsize" : 12.0,
					"id" : "obj-2",
					"maxclass" : "newobj",
					"numinlets" : 0,
					"numoutlets" : 1,
					"outlettype" : [ "" ],
					"patching_rect" : [ 871.0, 31.0, 30.0, 20.0 ],
					"text" : "in 2"
				}

			}
, 			{
				"box" : 				{
					"code" : "History z0(0.), z1(0.), z2(0.), z3(0.);\r\nParam k(0.), A(0.);\r\nwc = PI * (in2 * 1./samplerate); // PI is Nyquist frequency \n// wc = 2 * tan(0.5*wc); // dewarping, not required with 2x oversampling\nwc2 = wc*wc;\nwc3 = wc2*wc;\nwc4 = wc3*wc;\nb = 1 / (1+8*wc+20*wc2+16*wc3+2*wc4);\ng = 2*wc4 * b;\n\n// current state\ns = (z0*wc3 + z1*(wc2+2*wc3) + z2*(wc+4*wc2+2*wc3) + z3*(1+6*wc+9*wc2+2*wc3)) * b;\n\n// solve feedback loop (linear)\ny4 = (g*in1 + s) / (1 + g*k);\n\n// input clipping\ny0 = tanh(in1 - k*y4);\n\n// Compute all integrator outputs (y1, y2, y3, y4).\n// Unlike in the well-known Moog transistor ladder, this gets quite nasty (OL - no shit!) due the\n// inherent coupling between filter stages.\ny1 = (y0*(2*wc+12*wc2+20*wc3+8*wc4) + z0*(1+6*wc+10*wc2+4*wc3) + z1*(2*wc+8*wc2+6*wc3) + z2*(2*wc2+4*wc3) + z3*2*wc3)*b;\ny2 = (y0*(2*wc2+8*wc3+6*wc4) + z0*(wc+4*wc2+3*wc3) + z1*(1+6*wc+11*wc2+6*wc3) + z2*(wc+4*wc2+4*wc3) + z3*(wc2+2*wc3))*b;\ny3 = (y0*(2*wc3+4*wc4) + z0*(wc2+2*wc3) + z1*(wc+4*wc2+4*wc3) + z2*(1+6*wc+10*wc2+4*wc3) + z3*(wc+4*wc2+2*wc3))*b;\ny4 = g*y0 + s;\n\n// update filter state\nz0 += 4*wc*(y0 - y1 + y2);\nz1 += 2*wc*(y1 - 2*y2 + y3);\nz2 += 2*wc*(y2 - 2*y3 + y4);\nz3 += 2*wc*(y3 - 2*y4);\n\nout1 = A*y4;",
					"fontname" : "Arial",
					"fontsize" : 12.0,
					"id" : "obj-3",
					"maxclass" : "codebox",
					"numinlets" : 2,
					"numoutlets" : 1,
					"outlettype" : [ "" ],
					"patching_rect" : [ 24.0, 68.0, 866.0, 500.0 ]
				}

			}
, 			{
				"box" : 				{
					"fontname" : "Arial",
					"fontsize" : 12.0,
					"id" : "obj-4",
					"maxclass" : "newobj",
					"numinlets" : 1,
					"numoutlets" : 0,
					"patching_rect" : [ 24.0, 588.0, 37.0, 20.0 ],
					"text" : "out 1"
				}

			}
 ],
		"lines" : [ 			{
				"patchline" : 				{
					"destination" : [ "obj-3", 0 ],
					"disabled" : 0,
					"hidden" : 0,
					"source" : [ "obj-1", 0 ]
				}

			}
, 			{
				"patchline" : 				{
					"destination" : [ "obj-3", 1 ],
					"disabled" : 0,
					"hidden" : 0,
					"source" : [ "obj-2", 0 ]
				}

			}
, 			{
				"patchline" : 				{
					"destination" : [ "obj-4", 0 ],
					"disabled" : 0,
					"hidden" : 0,
					"source" : [ "obj-3", 0 ]
				}

			}
 ]
	}

}
