forked from eberdahl/SaM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
simple_snare.mdl
94 lines (78 loc) · 4.03 KB
/
simple_snare.mdl
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# This is a very simple snare "drum" model of two small masses bouncing
# on top of a resonant membrane. The sound output corresponds to
# the positions of the bouncing masses.
# MDL file for Synth-A-Modeler
#
# (c) Edgar Berdahl, 2012
# Audio Communication Group
# Technical University of Berlin
#
# -------------------------------------------------------------------
#
# The above copyright notice including the copyright holders and this
# permission notice shall be included in all copies, substantial
# portions, or derivatives of the Software and Software portions.
#
# The end-user documentation included with the redistribution, if any,
# must include the following acknowledgment: "This software was
# developed at least in part using Synth-A-Modeler, which is a modular
# and open-source environment for designing physical models (see
# https://github.com/eberdahl/SaM)", in the same place and form as other
# third-party acknowledgments. In addition, this acknowledgment must
# appear in the software itself in the same form and location as other
# such third-party acknowledgments.
#
# Alternatively, if software is generated using Synth-A-Modeler, then
# the end-user documentation included with the generated software, if
# any, must include the following statement: "This software was generated
# using Synth-A-Modeler, which is a modular and open-source environment
# for designing physical models (see https://github.com/eberdahl/SaM)",
# in the same place and form as other third-party acknowledgments. In
# addition, this acknowledgment must appear prominently in any software
# generated by Synth-A-Modeler in the same form and location as other
# such third-party acknowledgments, and in such a manner that users
# will be aware that the software was generated by Synth-A-Modeler.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation except subject to the additional
# attribution requirements described beneath the copyright notice above.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the modified GNU General Public
# License along with this program.
faustcode:touchStiffnL=hslider("touchStiffnL", 18000.0, 2000.0, 20000.0, 1000.0);
faustcode:touchStiffnR=hslider("touchStiffnR", 13000.0, 2000.0, 20000.0, 1000.0);
faustcode:massL=hslider("massL", 0.000007, 0.000003, 0.00001, 0.000001);
faustcode:massR=hslider("massR", 0.000004, 0.000003, 0.00001, 0.000001);
faustcode:massMembrane=hslider("massMembrane", 0.08, 0.0001, 0.1, 0.0001);
faustcode:decayTimeMembrane =hslider("decayTimeMembrane", 0.08, 0.01, 1.0, 0.01);
faustcode:freqMembrane=hslider("freqMembrane",170.0, 30.0, 2000.0, 10.0);
faustcode:touchDamp=hslider("touchDamp",0.01,0.00,0.5,0.01);
faustcode:gravParam=hslider("gravParam",30.0,1.0,100.0,1.0);
faustcode:vol=hslider("Ze Volume",27.0,-40.0,40.0,1.0) : db2linear : onePoleBLT(2.0); // LP filter with cutoff frequency at 2Hz helps eliminate zipper noise
mass(massL,0.0,0.0),msnr1;
mass(massR,0.0,0.0),msnr2;
resonators(freqMembrane, decayTimeMembrane, massMembrane),r1;
ground(0.0),g;
#ground(-0.1),gunder;
port( ),dev1;
port( ),dev2;
# For the snares
touch(touchStiffnL,0.03,0.0),ttsrn1,r1,msnr1;
link(gravParam,0.00,0.0), lsrn1,g,msnr1;
touch(touchStiffnR,0.03,0.0),ttsrn2,r1,msnr2;
link(gravParam,0.00,0.0), lsrn2,g,msnr2;
link(50.0,0.001,0.0),ldev2,dev2,g;
touch(100.0,touchDamp,0.0),tt,dev1,r1;
# Actually for this particular model, the highpass filter isn't necessary ...
#audioout,a1,((r1*(0.0)+msnr1*(1000.0)):*(vol));
#audioout,a2,(r1*(0.0)+msnr2*(1000.0));
#audioout,a1,(r1*(0.0)+msnr1*(1000.0)):*(vol);
#audioout,a2,(r1*(0.0)+msnr2*(1000.0)):*(vol);
audioout,a1,(r1*(0.0)+msnr1*(1000.0)):*(vol):defaultOutputDSP;
audioout,a2,(r1*(0.0)+msnr2*(1000.0)):*(vol):defaultOutputDSP;