naspro

view permafrost/examples/amp.pmf @ 178:7169a8909d53

Added Permafrost + small changes
author Stefano D'Angelo <zanga.mail@gmail.com>
date Sun May 02 14:19:58 2010 +0300 (2010-05-02)
parents
children
line source
1 # Permafrost - Physical modelling framework
2 #
3 # Copyright (C) 2009, 2010 Stefano D'Angelo <zanga.mail@gmail.com>
4 #
5 # See the COPYING file for license conditions.
7 import common;
8 import m;
10 block dB_to_lin
11 {
12 input i;
13 output o;
15 o = m_pow(10, i / 20);
16 }
18 system Amp
19 {
20 sync input i;
21 sync output o;
22 async input gain;
24 mul m;
26 o = m.o;
27 m.i1 = i;
28 m.i2 = gain;
29 }
31 system Amp_dB
32 {
33 sync input i;
34 sync output o;
35 async input gain_dB;
37 mul m;
38 dB_to_lin d;
40 o = m.o;
41 m.i1 = i;
42 m.i2 = d.o;
43 d.i = gain_dB;
44 }