-
Notifications
You must be signed in to change notification settings - Fork 2
/
Distortion.m
40 lines (40 loc) · 1.12 KB
/
Distortion.m
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
classdef Distortion < audioPlugin
properties
Gain = 0.5;
Out = 0.5;
end
properties (Access=private)
model
end
properties (Constant)
PluginInterface = audioPluginInterface(...
audioPluginParameter('Gain',...
'DisplayName',...
'Gain',...
'Mapping',{'lin',0,1},'Label',...
'%'),...
audioPluginParameter('Out',...
'DisplayName',....
'Output',...
'Mapping',{'lin',0,1},'Label','%'));
end
methods
function plugin = Distortion
plugin.model = distortionModel(plugin.getSampleRate);
end
function Output = process(plugin, in)
[sig, ~] = plugin.model.process(in*plugin.Gain);
Output = sig*plugin.Out;
%Output = in*plugin.Out;
end
function reset(plugin)
plugin.model = distortionModel(plugin.getSampleRate);
end
function set.Gain(plugin, val)
plugin.Gain = val;
end
function set.Out(plugin, val)
plugin.Out = val;
end
end
end