Protoplug

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

Algorithm taken from here:http://denniscronin.net/dsp/vst.html

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

--[[
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;
	};
}