Skip to content

Commit 16c6de5

Browse files
author
vlazzarini
committed
added otadilter
1 parent 4329915 commit 16c6de5

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed

docs/examples/otafilter.csd

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<CsoundSynthesizer>
2+
<CsOptions>
3+
-odac -d
4+
</CsOptions>
5+
<CsInstruments>
6+
7+
0dbfs = 1
8+
nchnls = 2
9+
10+
instr 1
11+
12+
a1 rand p4
13+
af expon 20, p3, 20000
14+
a2,a3 otafilter a1, af, 1.2, 1.5
15+
out a2, a3
16+
17+
endin
18+
19+
</CsInstruments>
20+
<CsScore>
21+
i1 0 15 0.5
22+
</CsScore>
23+
</CsoundSynthesizer>

docs/opcodes/otafilter.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<!--
2+
id:otafilter
3+
category:Signal Modifiers:Standard Filters:Resonant
4+
-->
5+
# otafilter
6+
Resonant 4pole non-linear lowpass filter.
7+
8+
Otafilter is a version of [vclpf](../opcodes/vclpf.md) with
9+
non-linearities inserted in the signal path. It attempts to
10+
model the saturation behaviour of an operational transconductance
11+
amplifier (OTA), which is commonly used in the implementation
12+
of analogue filters. The filter has two outputs: the usual 4-pole
13+
output plus a tap midway through the filter structure after the
14+
second stage (a 2-pole output).
15+
16+
## Syntax
17+
=== "Modern"
18+
``` csound-orc
19+
sig4:a, sig2:a = otafilter(in:a, cf:{a,k}, res:{a,k}, drive:k[, stor:i])
20+
```
21+
22+
=== "Classic"
23+
``` csound-orc
24+
asig4,asig2 otafilter ain, xcf, xres, kdrive[, istor]
25+
```
26+
27+
### Initialization
28+
29+
_stor_ --initial disposition of internal data space. Since filtering incorporates a feedback loop of previous output, the initial status of the storage space used is significant. A zero value will clear the space; a non-zero value will allow previous information to remain. The default value is 0.
30+
31+
### Performance
32+
33+
_sig4_ -- 4-pole output
34+
35+
_sig2_ -- 2-pole output
36+
37+
_in_ -- input signal.
38+
39+
_cf_ -- filter cutoff frequency (a- or k-rate)
40+
41+
_res_ -- resonance, between 0 and 1. Higher values will make the
42+
filter self-oscillate (a- or k-rate).
43+
44+
_drive_ -- filter drive gain (0 - no drive, > 0 - increased drive)
45+
46+
## Examples
47+
48+
Here is an example of the otafilter opcode. It uses the file [otafilter.csd](../examples/otafilter.csd).
49+
50+
``` csound-csd title="Example of the otafilter opcode." linenums="1"
51+
--8<-- "examples/otafilter.csd"
52+
```
53+
54+
## See also
55+
56+
[Standard Filters: Resonant Low-pass filters](../sigmod/standard.md)
57+
58+
## Credits
59+
60+
Author: Victor Lazzarini<br>
61+
April 2024<br>

0 commit comments

Comments
 (0)