diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2011-07-31 03:59:16 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@iem.at> | 2015-10-14 15:23:30 +0200 |
commit | d145fa6f792d6c44da2feec90507adb94e40323e (patch) | |
tree | ae3aaf213dbb4273331745802ef1259dce8e2986 /randomblock~ | |
parent | 67af8f6b3f179d5b4ba0747ab971abbeecbedd45 (diff) |
got everything building using the template Makefile
svn path=/trunk/externals/unauthorized/; revision=15173
Diffstat (limited to 'randomblock~')
-rw-r--r-- | randomblock~/INSTALL | 7 | ||||
-rw-r--r-- | randomblock~/mrandtab.pd | 6 | ||||
-rw-r--r-- | randomblock~/randomblock~-help.pd | 15 | ||||
-rw-r--r-- | randomblock~/randomblock~.c | 115 | ||||
-rw-r--r-- | randomblock~/randtab.pd | 43 |
5 files changed, 0 insertions, 186 deletions
diff --git a/randomblock~/INSTALL b/randomblock~/INSTALL deleted file mode 100644 index ae90f70..0000000 --- a/randomblock~/INSTALL +++ /dev/null @@ -1,7 +0,0 @@ -untar in /my/pd/dir/extra
-
-cd /my/pd/dir/extra/randomblock~
-
-make
-
-you're set !!
diff --git a/randomblock~/mrandtab.pd b/randomblock~/mrandtab.pd deleted file mode 100644 index 157111c..0000000 --- a/randomblock~/mrandtab.pd +++ /dev/null @@ -1,6 +0,0 @@ -#N canvas 187 22 737 487 10; -#X obj 138 151 dac~; -#X obj 136 114 randtab; -#X text 174 86 Everything is in the subpatch; -#X connect 1 0 0 0; -#X connect 1 0 0 1; diff --git a/randomblock~/randomblock~-help.pd b/randomblock~/randomblock~-help.pd deleted file mode 100644 index d4b2e5d..0000000 --- a/randomblock~/randomblock~-help.pd +++ /dev/null @@ -1,15 +0,0 @@ -#N canvas 194 211 575 337 10; -#X msg 361 263 \; pd dsp 1; -#X floatatom 192 112 5 0 0; -#X text 191 88 Set upper limit of random values; -#X text 107 123 Not used; -#X obj 121 179 print~; -#X msg 76 156 bang; -#X text 160 29 Generates an audio block starting at a random value -; -#X obj 121 143 randomblock~ 100; -#X text 161 42 This can be used to read a table randomly.; -#X text 161 54 This is illustrated in "mrandtab.pd".; -#X connect 1 0 7 1; -#X connect 5 0 4 0; -#X connect 7 0 4 0; diff --git a/randomblock~/randomblock~.c b/randomblock~/randomblock~.c deleted file mode 100644 index 34d2411..0000000 --- a/randomblock~/randomblock~.c +++ /dev/null @@ -1,115 +0,0 @@ -/* ------------------------ randomblock~ -------------------------------------- */ -/* */ -/* Generates a random signal block */ -/* Written by Yves Degoyon (ydegoyon@free.fr). */ -/* */ -/* 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. */ -/* */ -/* ---------------------------------------------------------------------------- */ - - - -#include <sys/types.h> -#include <string.h> -#include <stdio.h> -#include <errno.h> -#include <stdlib.h> -#include <fcntl.h> -#include <sys/stat.h> -#ifndef __APPLE__ -#include <malloc.h> -#endif -#include <ctype.h> -#include <unistd.h> -#include <time.h> -#include <sys/time.h> - -#include "m_pd.h" /* standard pd stuff */ - -static char *randomblock_version = "randomblock~: generates a random audio block : author : ydegoyon@free.fr"; - -static t_class *randomblock_class; - -typedef struct _randomblock -{ - t_object x_obj; - t_int x_limit; -} t_randomblock; - - /* clean up */ -static void randomblock_free(t_randomblock *x) -{ -} - -static void *randomblock_new(t_float flimit) -{ - t_randomblock *x = (t_randomblock *)pd_new(randomblock_class); - outlet_new(&x->x_obj, &s_signal); - inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_float, gensym("limit")); - if ( flimit <= 0 || flimit > RAND_MAX ) { - post( "randomblock~: wrong creation argument" ); - return NULL; - } - x->x_limit = (int) flimit; - return(x); -} - -static void *randomblock_limit(t_randomblock* x, t_float flimit) -{ - if ( flimit < 0 || flimit > RAND_MAX ) { - post( "randomblock~: wrong random limit" ); - return; - } else { - x->x_limit=(int)flimit; - } -} - -static t_int *randomblock_perform(t_int *w) -{ - t_float *out = (t_float*) w[1]; - int n = (int)(w[2]); - t_randomblock *x = (t_randomblock*) w[3]; - - int rvalue = rand(); - // post("random value : %d", rvalue ); - rvalue = rvalue%(x->x_limit-n); - // post("modulated by %d : %d", (x->x_limit-n), rvalue ); - if ( rvalue < 0 ) rvalue=0; - - while (n--) { - *(out)++=(float)rvalue++; - } - - return (w+4); -} - -static void randomblock_dsp(t_randomblock *x, t_signal **sp) -{ - dsp_add( randomblock_perform, 3, sp[0]->s_vec, sp[0]->s_n, x ) ; -} - -void randomblock_tilde_setup(void) -{ - post(randomblock_version); - randomblock_class = class_new(gensym("randomblock~"), (t_newmethod)randomblock_new, - (t_method)randomblock_free, - sizeof(t_randomblock), 0, A_DEFFLOAT, 0); - class_addmethod( randomblock_class, (t_method)randomblock_dsp, gensym("dsp"), 0); - class_addmethod( randomblock_class, (t_method)randomblock_limit, gensym("limit"), A_FLOAT, 0); -} diff --git a/randomblock~/randtab.pd b/randomblock~/randtab.pd deleted file mode 100644 index 089a86e..0000000 --- a/randomblock~/randtab.pd +++ /dev/null @@ -1,43 +0,0 @@ -#N canvas 187 22 737 487 10; -#X obj 143 114 soundfiler; -#X obj 110 354 *~; -#X msg 138 3 bang; -#X msg 142 92 read -resize \$1 \$2; -#X msg 215 12 bang; -#X obj 515 47 table \$0-music; -#X obj 144 66 pack s s; -#X obj 215 35 f \$0; -#X obj 231 56 makefilename %d-music; -#X symbolatom 247 35 40 0 0; -#X floatatom 163 244 10 0 0; -#X floatatom 142 353 5 0 0; -#X obj 110 303 tabread4~ \$0-music; -#X obj 20 331 print~; -#X msg 19 307 bang; -#X obj 138 29 opanel; -#X obj 109 330 /~ 100; -#X obj 34 235 randomblock~ 1000; -#X obj 241 325 print~; -#X msg 240 301 bang; -#X obj 110 401 outlet~; -#X obj 402 206 block~ 32768 1; -#X connect 0 0 10 0; -#X connect 0 0 17 1; -#X connect 1 0 20 0; -#X connect 2 0 15 0; -#X connect 3 0 0 0; -#X connect 4 0 7 0; -#X connect 6 0 3 0; -#X connect 7 0 8 0; -#X connect 8 0 6 1; -#X connect 11 0 1 1; -#X connect 12 0 16 0; -#X connect 12 0 18 0; -#X connect 14 0 13 0; -#X connect 15 0 4 0; -#X connect 15 0 6 0; -#X connect 15 0 9 0; -#X connect 16 0 1 0; -#X connect 17 0 12 0; -#X connect 17 0 13 0; -#X connect 19 0 18 0; |