diff options
author | Tim Blechmann <timblech@users.sourceforge.net> | 2003-05-21 10:50:37 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@iem.at> | 2015-10-14 15:11:53 +0200 |
commit | 432472fe416edfb1f5548e7a4998e62869ff41e5 (patch) | |
tree | 60c7a6f2bf060376ac0034a235f6ffd193503b7e /tbext/source | |
parent | 17183cc3fbcb83724b82a5bfccb8351dda5ca27e (diff) |
This commit was generated by cvs2svn to compensate for changes in r641,
which included commits to RCS files with non-trunk default branches.
svn path=/trunk/externals/tb/; revision=642
Diffstat (limited to 'tbext/source')
-rw-r--r-- | tbext/source/main.cpp | 64 | ||||
-rw-r--r-- | tbext/source/tbpow~.cpp | 100 | ||||
-rw-r--r-- | tbext/source/tbroute.cpp | 112 | ||||
-rw-r--r-- | tbext/source/tbsig~.cpp | 85 | ||||
-rw-r--r-- | tbext/source/tbsroute~.cpp | 109 | ||||
-rw-r--r-- | tbext/source/tbstrg.cpp | 95 |
6 files changed, 565 insertions, 0 deletions
diff --git a/tbext/source/main.cpp b/tbext/source/main.cpp new file mode 100644 index 0000000..c4317fd --- /dev/null +++ b/tbext/source/main.cpp @@ -0,0 +1,64 @@ +/* Copyright (c) 2003 Tim Blechmann. */ +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL */ +/* WARRANTIES, see the file, "COPYING" in this distribution. */ +/* */ +/* */ +/* tbext is the collection of some external i wrote. */ +/* some are useful, others aren't... */ +/* */ +/* */ +/* tbext uses the flext C++ layer for Max/MSP and PD externals. */ +/* get it at http://www.parasitaere-kapazitaeten.de/PD/ext */ +/* thanks to Thomas Grill */ +/* */ +/* */ +/* */ +/* 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. */ +/* */ +/* See file LICENSE for further informations on licensing terms. */ +/* */ +/* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* */ +/* Based on PureData by Miller Puckette and others. */ +/* */ +/* */ +/* */ +/* coded while listening to: Hamid Drake & Assif Tsahar: Soul Bodies, Vol. 1 */ +/* I.S.O.: I.S.O */ +/* */ + + + +#include <flext.h> +#define TBEXT_VERSION "0.01" + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 400) +#error upgrade your flext version!!!!!! +#endif + +void ttbext_setup() +{ + post("TBEXT: by tim blechmann"); + post("version "TBEXT_VERSION); + post("compiled on "__DATE__); + post(""); + + FLEXT_SETUP(tbroute); + FLEXT_SETUP(tbstrg); + FLEXT_DSP_SETUP(tbsroute); + FLEXT_DSP_SETUP(tbsig); + FLEXT_DSP_SETUP(tbpow); + +} + +FLEXT_LIB_SETUP(tbext,ttbext_setup) diff --git a/tbext/source/tbpow~.cpp b/tbext/source/tbpow~.cpp new file mode 100644 index 0000000..14a383c --- /dev/null +++ b/tbext/source/tbpow~.cpp @@ -0,0 +1,100 @@ +/* Copyright (c) 2003 Tim Blechmann. */ +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL */ +/* WARRANTIES, see the file, "COPYING" in this distribution. */ +/* */ +/* */ +/* tbpow~ calculates the power of each sample. In fact i expected it to sound */ +/* better than it does. but maybe someone is interested in using it... */ +/* */ +/* */ +/* tbpow~ uses the flext C++ layer for Max/MSP and PD externals. */ +/* get it at http://www.parasitaere-kapazitaeten.de/PD/ext */ +/* thanks to Thomas Grill */ +/* */ +/* */ +/* */ +/* 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. */ +/* */ +/* See file LICENSE for further informations on licensing terms. */ +/* */ +/* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* */ +/* Based on PureData by Miller Puckette and others. */ +/* */ +/* */ +/* */ +/* coded while listening to: Assif Tsahar & Susie Ibarra: Home Cookin' */ +/* Painkiller: Talisman */ +/* */ + + + +#include <flext.h> + +#include <cmath> + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401) +#error upgrade your flext version!!!!!! +#endif + +class tbpow: public flext_dsp +{ + FLEXT_HEADER(tbpow,flext_dsp); + +public: // constructor + tbpow(); + +protected: + virtual void m_signal (int n, float *const *in, float *const *out); + + void set_power(float f); + +private: + float power; + + FLEXT_CALLBACK_1(set_power,float) + +}; + + +FLEXT_LIB_DSP("tbpow~",tbpow); + +tbpow::tbpow() +{ + AddInSignal(); + AddInFloat(); + AddOutSignal(); + + FLEXT_ADDMETHOD(1,set_power); + power=1; +} + + +void tbpow::m_signal(int n, float *const *in, float *const *out) +{ + const float *ins=in[0]; + float *outs = out[0]; + + while (n--) + { + *outs = pow(*ins,power); + *outs++; + *ins++; + } + +} + +void tbpow::set_power(float f) +{ + power=f; +} diff --git a/tbext/source/tbroute.cpp b/tbext/source/tbroute.cpp new file mode 100644 index 0000000..83d85a0 --- /dev/null +++ b/tbext/source/tbroute.cpp @@ -0,0 +1,112 @@ +/* Copyright (c) 2003 Tim Blechmann. */ +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL */ +/* WARRANTIES, see the file, "COPYING" in this distribution. */ +/* */ +/* */ +/* tbroute is an advanced router. */ +/* the signal to the first inlet is being routed to the outlet specified */ +/* by the second inlet. */ +/* the number of outlets is specified by the creation argument */ +/* */ +/* */ +/* tbroute uses the flext C++ layer for Max/MSP and PD externals. */ +/* get it at http://www.parasitaere-kapazitaeten.de/PD/ext */ +/* thanks to Thomas Grill */ +/* */ +/* */ +/* */ +/* 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. */ +/* */ +/* See file LICENSE for further informations on licensing terms. */ +/* */ +/* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* */ +/* Based on PureData by Miller Puckette and others. */ +/* */ +/* */ +/* */ +/* coded while listening to: Hamid Drake & Assif Tsahar: Soul Bodies, Vol. 1 */ +/* I.S.O.: I.S.O */ +/* */ +/* */ + + +#include <flext.h> + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 400) +#error upgrade your flext version!!!!!! +#endif + +class tbroute: public flext_base +{ + FLEXT_HEADER(tbroute,flext_base); + +public: // constructor + tbroute(t_int chan); + +protected: + void route(t_float f); + + void routebang(); + void set_route(t_int i); + +private: + FLEXT_CALLBACK_1(route,t_float); + + FLEXT_CALLBACK(routebang); + FLEXT_CALLBACK_1(set_route,t_int); + t_int dest; +}; + + +FLEXT_LIB_1("tbroute",tbroute,int); + +tbroute::tbroute(t_int chan) +{ + AddInAnything(); + AddInInt(); + + for (t_int i=0; i!=chan;++i) + { + AddOutAnything(); + } + + FLEXT_ADDMETHOD(0,route); + FLEXT_ADDBANG(0,routebang); + FLEXT_ADDMETHOD(1,set_route); + dest=0; +} + +void tbroute::route(t_float f) +{ + ToOutFloat(dest,f); +} + + +void tbroute::routebang() +{ + ToOutBang(dest); +} + +void tbroute::set_route(t_int i) +{ + --i; + if ((i>-1) && (i<CntOut())) + { + dest=i; + } + else + { + post("no such outlet"); + } +} diff --git a/tbext/source/tbsig~.cpp b/tbext/source/tbsig~.cpp new file mode 100644 index 0000000..cda79cc --- /dev/null +++ b/tbext/source/tbsig~.cpp @@ -0,0 +1,85 @@ +/* Copyright (c) 2003 Tim Blechmann. */ +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL */ +/* WARRANTIES, see the file, "COPYING" in this distribution. */ +/* */ +/* */ +/* tbsig~ is gives you the sign of an audio signal. should be useful to create */ +/* a square oscillator or some noisy sounds */ +/* */ +/* */ +/* tbsig~ uses the flext C++ layer for Max/MSP and PD externals. */ +/* get it at http://www.parasitaere-kapazitaeten.de/PD/ext */ +/* thanks to Thomas Grill */ +/* */ +/* */ +/* */ +/* 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. */ +/* */ +/* See file LICENSE for further informations on licensing terms. */ +/* */ +/* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* */ +/* Based on PureData by Miller Puckette and others. */ +/* */ +/* */ +/* */ +/* coded while listening to: Peter Broetzmann & Hamid Drake: The Dried Rat-Dog */ +/* */ +/* */ + + + +#include <flext.h> + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401) +#error upgrade your flext version!!!!!! +#endif + +class tbsig: public flext_dsp +{ + FLEXT_HEADER(tbsig,flext_dsp); + +public: // constructor + tbsig(); + +protected: + virtual void m_signal (int n, float *const *in, float *const *out); + +}; + + +FLEXT_LIB_DSP("tbsig~",tbsig); + +tbsig::tbsig() +{ + AddInSignal(); + AddOutSignal(); +} + + +void tbsig::m_signal(int n, float *const *in, float *const *out) +{ + const float *ins=in[0]; + float *outs = out[0]; + + while (n--) + { + if (*ins>0) + *outs = 1; + else + *outs = -1; + *outs++; + *ins++; + } + +} diff --git a/tbext/source/tbsroute~.cpp b/tbext/source/tbsroute~.cpp new file mode 100644 index 0000000..3d2264d --- /dev/null +++ b/tbext/source/tbsroute~.cpp @@ -0,0 +1,109 @@ +/* Copyright (c) 2003 Tim Blechmann. */ +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL */ +/* WARRANTIES, see the file, "COPYING" in this distribution. */ +/* */ +/* */ +/* tbsroute~ is an advanced signal router. */ +/* the signal to the first inlet is being routed to the outlet specified */ +/* by the second inlet. */ +/* the number of outlets is specified by the creation argument */ +/* */ +/* */ +/* tbsroute~ uses the flext C++ layer for Max/MSP and PD externals. */ +/* get it at http://www.parasitaere-kapazitaeten.de/PD/ext */ +/* thanks to Thomas Grill */ +/* */ +/* */ +/* */ +/* 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. */ +/* */ +/* See file LICENSE for further informations on licensing terms. */ +/* */ +/* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* */ +/* Based on PureData by Miller Puckette and others. */ +/* */ +/* */ +/* */ +/* coded while listening to: AMM: AMMMUSIC 1966 */ +/* Sun Ra: Dancing Shadows */ +/* */ + + +#include <flext.h> + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401) +#error upgrade your flext version!!!!!! +#endif + +class tbsroute: public flext_dsp +{ + FLEXT_HEADER(tbsroute,flext_dsp) + +public: // constructor + tbsroute(int chan); + +protected: + virtual void m_signal (int n, float *const *in, float *const *out); + void set_route(int i); + +private: + FLEXT_CALLBACK_1(set_route,t_int) + t_int dest; +}; + + +FLEXT_LIB_DSP_1("tbroute~",tbsroute,int) + + tbsroute::tbsroute(t_int chan):dest(0) +{ + AddInSignal(); + AddInInt(); + + for (t_int i=0; i!=chan;++i) + { + AddOutSignal(); + } + + FLEXT_ADDMETHOD(1,set_route); +} + + +void tbsroute::m_signal(int n, float *const *in, float *const *out) +{ + + CopySamples(out[dest],in[0],n); + + for (int i = 0; i != CntOutSig(); i++) + if (i!=dest) ZeroSamples(out[i],n); + + + + +} + + +void tbsroute::set_route(t_int i) +{ + --i; + if ((i>-1) && (i<CntOutSig())) + { + dest=i; + post("routing to outlet %i",i+1); + } + else + { + post("no such outlet"); + } + +} diff --git a/tbext/source/tbstrg.cpp b/tbext/source/tbstrg.cpp new file mode 100644 index 0000000..c71c7da --- /dev/null +++ b/tbext/source/tbstrg.cpp @@ -0,0 +1,95 @@ +/* Copyright (c) 2003 Tim Blechmann. */ +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL */ +/* WARRANTIES, see the file, "COPYING" in this distribution. */ +/* */ +/* tbstrg can be used to switch between several modules. it requires a creation */ +/* argument (number of outlets). */ +/* if you send an integer to the inlet this outlet will get the message 1, the */ +/* outlet, that was active earlier, will get the message 0. */ +/* */ +/* */ +/* tbstrg uses the flext C++ layer for Max/MSP and PD externals. */ +/* get it at http://www.parasitaere-kapazitaeten.de/PD/ext */ +/* thanks to Thomas Grill */ +/* */ +/* */ +/* */ +/* 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. */ +/* */ +/* See file LICENSE for further informations on licensing terms. */ +/* */ +/* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* */ +/* Based on PureData by Miller Puckette and others. */ +/* */ +/* */ +/* */ +/* coded while listening to: Bob Ostertag - DJ Of The Month */ +/* John Zorn's Cobra: Tokyo Operations '94 */ +/* */ +/* */ + + + +#include <flext.h> + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 400) +#error upgrade your flext version!!!!!! +#endif + +class tbstrg: public flext_base +{ + FLEXT_HEADER(tbstrg,flext_base); + +public: // constructor + tbstrg(t_int chan); + +protected: + void set_route(t_int i); + +private: + + FLEXT_CALLBACK_1(set_route,t_int); + t_int dest; +}; + + +FLEXT_LIB_1("tbstrg",tbstrg,int); + +tbstrg::tbstrg(t_int chan) +{ + AddInInt(); + + for (t_int i=0; i!=chan;++i) + { + AddOutAnything(); + } + + + FLEXT_ADDMETHOD(0,set_route); + dest=0; +} + +void tbstrg::set_route(t_int i) +{ + if (i != dest) + { + --i; + if ((i>-1) && (i<CntOut())) + { + ToOutInt(dest,0); + dest=i; + ToOutInt(dest,1); + } + } +} |