# Protoplug

**URL:** <https://forum.renoise.com/t/protoplug/41867>\
**Category:** Off-Topic\
**Created:** [July 5, 2014, 11:53am UTC](https://forum.renoise.com/t/protoplug/41867 "2014-07-05T11:53:19Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![ffx](https://forum.renoise.com/letter_avatar/ffx/32/6_449c533f586939b6e5f246632a46421f.png) [@ffx](https://forum.renoise.com/u/ffx)\
**Post date:** [April 12, 2015, 9:00am UTC](https://forum.renoise.com/t/protoplug/41867/12 "2015-04-12T09:00:03Z")

</div>

Just for testing, regarding discussion of Renoise’s allpass filter device, see here: [https://forum.renoise.com/t/new-tool-3-0-insert-hidden-legacy-renoise-dsp-effect/43441](https://forum.renoise.com/t/new-tool-3-0-insert-hidden-legacy-renoise-dsp-effect/43441)

Algorithm taken from here:[http://denniscronin.net/dsp/vst.html](http://denniscronin.net/dsp/vst.html)

This seems to be the algorithm of the allpass filter dsp device:

```auto
--[[
name: Allpass filter
author: Dennis Cronin, j.r.
--]]

require "include/protoplug"
local mFreq
local z1 = {}
local z2 = {}

z1[0] = 0
z1[1] = 0
z2[0] = 0
z2[1] = 0

function plugin.processBlock(s, smax)
	for cn = 0,1 do
		for i = 0,smax do
			local input = s[cn][i]
			
			
			local wp = (math.pi * mFreq) / plugin.getSampleRate()
			local coef = (1 - wp) / (1 + wp)
			
			z2[cn] = coef * (z2[cn] + input) - z1[cn]
			z1[cn] = input
			
			s[cn][i] = z2[cn]
		
		end
	end
end

params = plugin.manageParams {
	{
		name = "Frequency";
		min = 10;
		max = 20000;
		default = 440;
		changed = function(val) mFreq=val end;
	};
}

```

---

_[View the full topic](https://forum.renoise.com/t/protoplug/41867)._
