aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2006-05-25 16:47:32 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2006-05-25 16:47:32 +0000
commitb2b4597a1b5e4b43c1d10c0e19ca17d77355fea5 (patch)
treea92c8265a151d685f46040853bbc4c487153b818
parentd962ed33f6b5fe3040cfbd798f63ab9aa36d1f9e (diff)
appended externals/creb/system/envelope_util.c to the end to make building dead simple
svn path=/trunk/externals/creb/; revision=5128
-rw-r--r--modules/eadsr~.c33
-rw-r--r--modules/ead~.c33
-rw-r--r--modules/ear~.c33
3 files changed, 99 insertions, 0 deletions
diff --git a/modules/eadsr~.c b/modules/eadsr~.c
index 8111223..af1b90b 100644
--- a/modules/eadsr~.c
+++ b/modules/eadsr~.c
@@ -172,3 +172,36 @@ void eadsr_tilde_setup(void)
}
+/*
+ * Utility functions for exponential decay
+ * Copyright (c) 2000-2003 by Tom Schouten
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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 GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include "extlib_util.h"
+
+float milliseconds_2_one_minus_realpole(float time)
+{
+ float r;
+
+ if (time < 0.0f) time = 0.0f;
+ r = -expm1(1000.0f * log(ENVELOPE_RANGE) / (sys_getsr() * time));
+ if (!(r < 1.0f)) r = 1.0f;
+
+ //post("%f",r);
+ return r;
+}
diff --git a/modules/ead~.c b/modules/ead~.c
index 1fe09b7..49ca87d 100644
--- a/modules/ead~.c
+++ b/modules/ead~.c
@@ -156,3 +156,36 @@ void ead_tilde_setup(void)
class_addmethod(ead_class, (t_method)ead_decay, gensym("decay"), A_FLOAT, 0);
}
+/*
+ * Utility functions for exponential decay
+ * Copyright (c) 2000-2003 by Tom Schouten
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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 GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include "extlib_util.h"
+
+float milliseconds_2_one_minus_realpole(float time)
+{
+ float r;
+
+ if (time < 0.0f) time = 0.0f;
+ r = -expm1(1000.0f * log(ENVELOPE_RANGE) / (sys_getsr() * time));
+ if (!(r < 1.0f)) r = 1.0f;
+
+ //post("%f",r);
+ return r;
+}
diff --git a/modules/ear~.c b/modules/ear~.c
index ac70ab1..dcee56e 100644
--- a/modules/ear~.c
+++ b/modules/ear~.c
@@ -142,3 +142,36 @@ void ear_tilde_setup(void)
}
+/*
+ * Utility functions for exponential decay
+ * Copyright (c) 2000-2003 by Tom Schouten
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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 GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include "extlib_util.h"
+
+float milliseconds_2_one_minus_realpole(float time)
+{
+ float r;
+
+ if (time < 0.0f) time = 0.0f;
+ r = -expm1(1000.0f * log(ENVELOPE_RANGE) / (sys_getsr() * time));
+ if (!(r < 1.0f)) r = 1.0f;
+
+ //post("%f",r);
+ return r;
+}