aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/iem_mp3/iem_mp3.c5
-rw-r--r--src/iem_mp3/makefile_linux46
-rw-r--r--src/iem_mp3/makefile_win4
-rw-r--r--src/iem_mp3/mp3play~.c (renamed from src/iem_mp3/sigmp3play.c)123
-rw-r--r--src/iem_t3_lib/iem_t3_lib.c32
-rw-r--r--src/iem_t3_lib/makefile_linux51
-rw-r--r--src/iem_t3_lib/makefile_win6
-rw-r--r--src/iem_t3_lib/t3_bpe.c12
-rw-r--r--src/iem_t3_lib/t3_delay.c8
-rw-r--r--src/iem_t3_lib/t3_line~.c (renamed from src/iem_t3_lib/sigt3_line.c)47
-rw-r--r--src/iem_t3_lib/t3_metro.c7
-rw-r--r--src/iem_t3_lib/t3_sig~.c (renamed from src/iem_t3_lib/sigt3_sig.c)50
-rw-r--r--src/iem_t3_lib/t3_timer.c13
13 files changed, 211 insertions, 193 deletions
diff --git a/src/iem_mp3/iem_mp3.c b/src/iem_mp3/iem_mp3.c
index 20c7cc1..721d2c4 100644
--- a/src/iem_mp3/iem_mp3.c
+++ b/src/iem_mp3/iem_mp3.c
@@ -3,11 +3,6 @@
iem_mp3 written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
-#ifdef _MSC_VER
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
#include "m_pd.h"
#include "iemlib.h"
diff --git a/src/iem_mp3/makefile_linux b/src/iem_mp3/makefile_linux
new file mode 100644
index 0000000..e8fa3b9
--- /dev/null
+++ b/src/iem_mp3/makefile_linux
@@ -0,0 +1,46 @@
+current: all
+
+.SUFFIXES: .pd_linux
+
+INCLUDE = -I. -I/usr/local/src/pd/src
+
+LDFLAGS = -export-dynamic -shared
+LIB = -ldl -lm -lpthread
+
+#select either the DBG and OPT compiler flags below:
+
+CFLAGS = -DPD -DUNIX -W -Werror -Wno-unused \
+ -Wno-parentheses -Wno-switch -O6 -funroll-loops -fomit-frame-pointer -fno-strict-aliasing \
+ -DDL_OPEN
+
+SYSTEM = $(shell uname -m)
+
+# the sources
+
+SRC = mp3play~.c \
+ iem_mp3.c
+
+TARGET = iem_mp3.pd_linux
+
+
+OBJ = $(SRC:.c=.o)
+
+#
+# ------------------ targets ------------------------------------
+#
+
+clean:
+ rm $(TARGET)
+ rm *.o
+
+all: $(OBJ)
+ @echo :: $(OBJ)
+ $(LD) $(LDFLAGS) -o $(TARGET) *.o $(LIB)
+ strip --strip-unneeded $(TARGET)
+
+$(OBJ) : %.o : %.c
+ $(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $*.c
+
+
+
+
diff --git a/src/iem_mp3/makefile_win b/src/iem_mp3/makefile_win
index 67a0c91..889910f 100644
--- a/src/iem_mp3/makefile_win
+++ b/src/iem_mp3/makefile_win
@@ -15,8 +15,8 @@ PD_WIN_LIB = /NODEFAULTLIB:libc /NODEFAULTLIB:oldnames /NODEFAULTLIB:kernel /NOD
$(PD_INST_PATH)\bin\pthreadVC.lib \
$(PD_INST_PATH)\bin\pd.lib
-SRC = sigmp3play.c \
- iem_mp3.c
+SRC = mp3play~.c \
+ iem_mp3.c
OBJ = $(SRC:.c=.obj)
diff --git a/src/iem_mp3/sigmp3play.c b/src/iem_mp3/mp3play~.c
index e51cc07..e87d108 100644
--- a/src/iem_mp3/sigmp3play.c
+++ b/src/iem_mp3/mp3play~.c
@@ -4,10 +4,10 @@
iem_mp3 written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
/*
- sigmp3play.c - Mpeg Layer III Player for PD
+ mp3play~.c - Mpeg Layer III Player for PD
Version:0.1
05-18-2000
- written by Thomas Musil (musil_at_iem.kug.ac.at), Norbert Math (math_at_iem.kug.ac.at)
+ written by Thomas Musil (musil_at_iem.at), Norbert Math (math_at_iem.kug.ac.at)
IEM Graz
debugged for windows 013-03-2003
@@ -18,11 +18,6 @@ iem_mp3 written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005
*/
-#ifdef _MSC_VER
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
#include "m_pd.h"
#include "iemlib.h"
#include <ctype.h>
@@ -201,7 +196,7 @@ struct iemmp3_newHuff
};
-typedef struct _sigmp3play
+typedef struct _mp3play_tilde
{
t_object x_obj;
float length_sec;
@@ -237,7 +232,7 @@ typedef struct _sigmp3play
t_outlet *x_bangout;
t_outlet *x_floatout;
t_canvas *x_canvas;
-} t_sigmp3play;
+} t_mp3play_tilde;
@@ -274,7 +269,7 @@ static unsigned int getbits(int number_of_bits);
static unsigned int getbits_fast(int number_of_bits);
static unsigned int get1bit(void);
-static void sigmp3play_tick(t_sigmp3play *x);
+static void mp3play_tilde_tick(t_mp3play_tilde *x);
struct iemmp3Struct *iemmp3_gmp;
@@ -723,7 +718,7 @@ static struct iemmp3_newHuff iemmp3_htc[] =
};
-static t_class *sigmp3play_class;
+static t_class *mp3play_tilde_class;
@@ -3131,10 +3126,10 @@ static int synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt)
-static void *sigmp3play_new(void)
+static void *mp3play_tilde_new(void)
{
char *vec;
- t_sigmp3play *x = (t_sigmp3play *)pd_new(sigmp3play_class);
+ t_mp3play_tilde *x = (t_mp3play_tilde *)pd_new(mp3play_tilde_class);
x->file_is_open = 0;
x->play_state = 0;
@@ -3166,7 +3161,7 @@ static void *sigmp3play_new(void)
*vec = 0;
InitMP3(&(x->mp));
x->mp_is_init = 1;
- x->x_clock = clock_new(x, (t_method)sigmp3play_tick);
+ x->x_clock = clock_new(x, (t_method)mp3play_tilde_tick);
outlet_new(&x->x_obj, &s_signal);
outlet_new(&x->x_obj, &s_signal);
x->x_floatout = outlet_new(&x->x_obj, &s_float);
@@ -3176,7 +3171,7 @@ static void *sigmp3play_new(void)
return (x);
}
-static void sigmp3play_cleanup(t_sigmp3play *x)
+static void mp3play_tilde_cleanup(t_mp3play_tilde *x)
{
x->file_is_open = 0;
fclose(x->fh);
@@ -3188,7 +3183,7 @@ static void sigmp3play_cleanup(t_sigmp3play *x)
clock_delay(x->x_clock, 0);
}
-static int sigmp3play_read_frame_length_first(t_sigmp3play *x, int *frsz)
+static int mp3play_tilde_read_frame_length_first(t_mp3play_tilde *x, int *frsz)
{
int framesize, lsf, bitrate_index, sampling_frequency, padding, mpeg25, lay, ret=MP3_EX;
int version, syncword;
@@ -3275,7 +3270,7 @@ static int sigmp3play_read_frame_length_first(t_sigmp3play *x, int *frsz)
}
}
-static int sigmp3play_read_frame_length_next(t_sigmp3play *x, int *frsz, int frame_counter)
+static int mp3play_tilde_read_frame_length_next(t_mp3play_tilde *x, int *frsz, int frame_counter)
{
int framesize, lsf, bitrate_index, sampling_frequency, *begframeseek=x->begframeseek;
unsigned long head;
@@ -3316,13 +3311,13 @@ static int sigmp3play_read_frame_length_next(t_sigmp3play *x, int *frsz, int fra
return(1);
}
-static int sigmp3play_calc_frames(t_sigmp3play *x)
+static int mp3play_tilde_calc_frames(t_mp3play_tilde *x)
{
int *begframeseek=x->begframeseek, i, maxframeseek, framesize, frame_counter;
float length;
fseek(x->fh,0,SEEK_SET);
- if(!sigmp3play_read_frame_length_first(x, &framesize))
+ if(!mp3play_tilde_read_frame_length_first(x, &framesize))
{
if(framesize <= 0)
{
@@ -3350,7 +3345,7 @@ static int sigmp3play_calc_frames(t_sigmp3play *x)
frame_counter = 1;
/*x->curframeseek = maxframeseek;*/
fseek(x->fh, begframeseek[1], SEEK_SET);
- while(!sigmp3play_read_frame_length_next(x, &framesize, frame_counter))
+ while(!mp3play_tilde_read_frame_length_next(x, &framesize, frame_counter))
{
begframeseek[frame_counter+1] = begframeseek[frame_counter] + framesize;
frame_counter++;
@@ -3368,7 +3363,7 @@ static int sigmp3play_calc_frames(t_sigmp3play *x)
return(MP3_EX);
}
-static void sigmp3play_do_open(t_sigmp3play *x, char *str, int calc_it)
+static void mp3play_tilde_do_open(t_mp3play_tilde *x, char *str, int calc_it)
{
int mp3_sr, obj_sr;
int file_size, size, mp3_encode_return=MP3_OK, mp3_read_length, i, j, *begframeseek;
@@ -3419,10 +3414,10 @@ static void sigmp3play_do_open(t_sigmp3play *x, char *str, int calc_it)
x->mp_is_init = 1;
}
if(calc_it)
- mp3_encode_return = sigmp3play_calc_frames(x);
+ mp3_encode_return = mp3play_tilde_calc_frames(x);
if(mp3_encode_return == MP3_EX)
{
- sigmp3play_cleanup(x);
+ mp3play_tilde_cleanup(x);
return;
}
if(x->frame_counter)
@@ -3452,7 +3447,7 @@ static void sigmp3play_do_open(t_sigmp3play *x, char *str, int calc_it)
MY_MP3_MALLOC_IN_SIZE2, &size);
if(mp3_encode_return == MP3_EX)
{
- sigmp3play_cleanup(x);
+ mp3play_tilde_cleanup(x);
return;
}
post ("MPEG %s, Layer: %s, Freq: %ld, mode: %s, modext: %d, BPF : %d",
@@ -3533,9 +3528,9 @@ static void sigmp3play_do_open(t_sigmp3play *x, char *str, int calc_it)
}
}
-static t_int *sigmp3play_perform(t_int *w)
+static t_int *mp3play_tilde_perform(t_int *w)
{
- t_sigmp3play *x = (t_sigmp3play *)(w[1]);
+ t_mp3play_tilde *x = (t_mp3play_tilde *)(w[1]);
t_float *out1 = (t_float *)(w[2]);
t_float *out2 = (t_float *)(w[3]);
int n = (int)(w[4]);
@@ -3545,9 +3540,9 @@ static t_int *sigmp3play_perform(t_int *w)
int mp3_out_index = x->mp3_out_index;
if (!x->file_is_open)
- goto sigmp3play_labelzero;
+ goto mp3play_tilde_labelzero;
if (x->play_state != 1)
- goto sigmp3play_labelzero;
+ goto mp3play_tilde_labelzero;
if(mp3_out_index >= x->mp3_encode_size)
{
@@ -3561,8 +3556,8 @@ static t_int *sigmp3play_perform(t_int *w)
x->mp3_encode_size = size * sizeof(char) / sizeof(short);
else if(mp3_encode_return == MP3_EX)
{
- sigmp3play_cleanup(x);
- goto sigmp3play_labelzero;
+ mp3play_tilde_cleanup(x);
+ goto mp3play_tilde_labelzero;
}
else
{
@@ -3578,8 +3573,8 @@ static t_int *sigmp3play_perform(t_int *w)
}
else
{
- sigmp3play_cleanup(x);
- goto sigmp3play_labelzero;
+ mp3play_tilde_cleanup(x);
+ goto mp3play_tilde_labelzero;
}
fread(x->mp3inbuf, mp3_read_length, sizeof(char), x->fh);
@@ -3588,8 +3583,8 @@ static t_int *sigmp3play_perform(t_int *w)
x->mp3_encode_size = size * sizeof(char) / sizeof(short);
if(mp3_encode_return == MP3_EX)
{
- sigmp3play_cleanup(x);
- goto sigmp3play_labelzero;
+ mp3play_tilde_cleanup(x);
+ goto mp3play_tilde_labelzero;
}
}
}
@@ -3741,7 +3736,7 @@ static t_int *sigmp3play_perform(t_int *w)
}
return (w+5);
-sigmp3play_labelzero:
+mp3play_tilde_labelzero:
while (n--)
{
@@ -3751,16 +3746,16 @@ sigmp3play_labelzero:
return (w+5);
}
-static void sigmp3play_dsp(t_sigmp3play *x, t_signal **sp)
+static void mp3play_tilde_dsp(t_mp3play_tilde *x, t_signal **sp)
{
x->obj_sr = (int)(sp[0]->s_sr);
x->obj_n = (int)(sp[0]->s_n);
- dsp_add(sigmp3play_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n);
+ dsp_add(mp3play_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n);
}
-static void sigmp3play_stop(t_sigmp3play *x)
+static void mp3play_tilde_stop(t_mp3play_tilde *x)
{
if(x->file_is_open)
{
@@ -3769,7 +3764,7 @@ static void sigmp3play_stop(t_sigmp3play *x)
}
}
-static void sigmp3play_start(t_sigmp3play *x)
+static void mp3play_tilde_start(t_mp3play_tilde *x)
{
if(x->file_is_open)
{
@@ -3777,14 +3772,14 @@ static void sigmp3play_start(t_sigmp3play *x)
}
}
-static void sigmp3play_ft1(t_sigmp3play *x, t_floatarg offset)
+static void mp3play_tilde_ft1(t_mp3play_tilde *x, t_floatarg offset)
{
if(offset < 0.0)
offset = 0.0;
x->offset_sec = (float)offset;
}
-static void sigmp3play_pause(t_sigmp3play *x)
+static void mp3play_tilde_pause(t_mp3play_tilde *x)
{
if(x->file_is_open)
{
@@ -3795,32 +3790,32 @@ static void sigmp3play_pause(t_sigmp3play *x)
}
}
-static void sigmp3play_open(t_sigmp3play *x, t_symbol *s)
+static void mp3play_tilde_open(t_mp3play_tilde *x, t_symbol *s)
{
x->frame_counter = 0;
- sigmp3play_do_open(x, (char *)s->s_name, 1);
+ mp3play_tilde_do_open(x, (char *)s->s_name, 1);
}
-static void sigmp3play_open_again(t_sigmp3play *x)
+static void mp3play_tilde_open_again(t_mp3play_tilde *x)
{
x->frame_counter = 0;
- sigmp3play_do_open(x, x->filename, 0);
+ mp3play_tilde_do_open(x, x->filename, 0);
}
-static void sigmp3play_open_at(t_sigmp3play *x, t_symbol *s)
+static void mp3play_tilde_open_at(t_mp3play_tilde *x, t_symbol *s)
{
x->frame_counter = 1;
- sigmp3play_do_open(x, (char *)s->s_name, 1);
+ mp3play_tilde_do_open(x, (char *)s->s_name, 1);
}
-static void sigmp3play_open_again_at(t_sigmp3play *x)
+static void mp3play_tilde_open_again_at(t_mp3play_tilde *x)
{
x->frame_counter = 1;
- sigmp3play_do_open(x, x->filename, 0);
+ mp3play_tilde_do_open(x, x->filename, 0);
}
-static void sigmp3play_tick(t_sigmp3play *x)
+static void mp3play_tilde_tick(t_mp3play_tilde *x)
{
if(x->time1_bang0_handle)
{
@@ -3832,7 +3827,7 @@ static void sigmp3play_tick(t_sigmp3play *x)
}
}
-static void sigmp3play_free(t_sigmp3play *x)
+static void mp3play_tilde_free(t_mp3play_tilde *x)
{
if(x->mp_is_init)
ExitMP3(&(x->mp));
@@ -3844,21 +3839,21 @@ static void sigmp3play_free(t_sigmp3play *x)
clock_free(x->x_clock);
}
-void sigmp3play_setup(void)
+void mp3play_tilde_setup(void)
{
- sigmp3play_class = class_new(gensym("mp3play~"), (t_newmethod)sigmp3play_new,
- (t_method)sigmp3play_free, sizeof(t_sigmp3play), 0, 0);
- class_addmethod(sigmp3play_class, (t_method)sigmp3play_dsp, gensym("dsp"), 0);
- class_addmethod(sigmp3play_class, (t_method)sigmp3play_start, gensym("start"), 0);
- class_addmethod(sigmp3play_class, (t_method)sigmp3play_ft1,
+ mp3play_tilde_class = class_new(gensym("mp3play~"), (t_newmethod)mp3play_tilde_new,
+ (t_method)mp3play_tilde_free, sizeof(t_mp3play_tilde), 0, 0);
+ class_addmethod(mp3play_tilde_class, (t_method)mp3play_tilde_dsp, gensym("dsp"), 0);
+ class_addmethod(mp3play_tilde_class, (t_method)mp3play_tilde_start, gensym("start"), 0);
+ class_addmethod(mp3play_tilde_class, (t_method)mp3play_tilde_ft1,
gensym("ft1"), A_FLOAT, 0);
- class_addmethod(sigmp3play_class, (t_method)sigmp3play_stop, gensym("stop"), 0);
- class_addmethod(sigmp3play_class, (t_method)sigmp3play_pause, gensym("pause"), 0);
- class_addmethod(sigmp3play_class, (t_method)sigmp3play_open_again_at, gensym("open_again_at"), 0);
- class_addmethod(sigmp3play_class, (t_method)sigmp3play_open, gensym("open"), A_DEFSYM, 0);
- class_addmethod(sigmp3play_class, (t_method)sigmp3play_open_again, gensym("open_again"), 0);
- class_addmethod(sigmp3play_class, (t_method)sigmp3play_open_at, gensym("open_at"), A_DEFSYM, 0);
- class_sethelpsymbol(sigmp3play_class, gensym("iemhelp/help-mp3play~"));
+ class_addmethod(mp3play_tilde_class, (t_method)mp3play_tilde_stop, gensym("stop"), 0);
+ class_addmethod(mp3play_tilde_class, (t_method)mp3play_tilde_pause, gensym("pause"), 0);
+ class_addmethod(mp3play_tilde_class, (t_method)mp3play_tilde_open_again_at, gensym("open_again_at"), 0);
+ class_addmethod(mp3play_tilde_class, (t_method)mp3play_tilde_open, gensym("open"), A_DEFSYM, 0);
+ class_addmethod(mp3play_tilde_class, (t_method)mp3play_tilde_open_again, gensym("open_again"), 0);
+ class_addmethod(mp3play_tilde_class, (t_method)mp3play_tilde_open_at, gensym("open_at"), A_DEFSYM, 0);
+ class_sethelpsymbol(mp3play_tilde_class, gensym("iemhelp/help-mp3play~"));
/*post("\nmp3play~ written by thomas musil & norbert math\nV 0.1 iem graz
austria 05 2000\n");*/
}
diff --git a/src/iem_t3_lib/iem_t3_lib.c b/src/iem_t3_lib/iem_t3_lib.c
index 617b202..b911c5d 100644
--- a/src/iem_t3_lib/iem_t3_lib.c
+++ b/src/iem_t3_lib/iem_t3_lib.c
@@ -3,33 +3,9 @@
iem_t3_lib written by Gerhard Eckel, Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
-#ifdef _MSC_VER
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
#include "m_pd.h"
#include "iemlib.h"
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <math.h>
-/*
-#include <ctype.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#ifndef _WIN32
-#include <sys/signal.h>
-#include <unistd.h>
-#endif
-
-#ifdef _WIN32
-#include <io.h>
-#endif
-*/
static t_class *iem_t3_lib_class;
@@ -40,11 +16,11 @@ static void *iem_t3_lib_new(void)
return (x);
}
-void sigt3_line_setup(void);
-void sigt3_sig_setup(void);
void t3_bpe_setup(void);
void t3_delay_setup(void);
+void t3_line_tilde_setup(void);
void t3_metro_setup(void);
+void t3_sig_tilde_setup(void);
void t3_timer_setup(void);
/* ------------------------ setup routine ------------------------- */
@@ -54,11 +30,11 @@ void iem_t3_lib_setup(void)
iem_t3_lib_class = class_new(gensym("iem_t3_lib"), iem_t3_lib_new, 0,
sizeof(t_object), CLASS_NOINLET, 0);
- sigt3_line_setup();
- sigt3_sig_setup();
t3_bpe_setup();
t3_delay_setup();
+ t3_line_tilde_setup();
t3_metro_setup();
+ t3_sig_tilde_setup();
t3_timer_setup();
post("iem_t3_lib (R-1.16) library loaded! (c) Gerhard Eckel, Thomas Musil 05.2005");
diff --git a/src/iem_t3_lib/makefile_linux b/src/iem_t3_lib/makefile_linux
new file mode 100644
index 0000000..3705f69
--- /dev/null
+++ b/src/iem_t3_lib/makefile_linux
@@ -0,0 +1,51 @@
+current: all
+
+.SUFFIXES: .pd_linux
+
+INCLUDE = -I. -I/usr/local/src/pd/src
+
+LDFLAGS = -export-dynamic -shared
+LIB = -ldl -lm -lpthread
+
+#select either the DBG and OPT compiler flags below:
+
+CFLAGS = -DPD -DUNIX -W -Werror -Wno-unused \
+ -Wno-parentheses -Wno-switch -O6 -funroll-loops -fomit-frame-pointer -fno-strict-aliasing \
+ -DDL_OPEN
+
+SYSTEM = $(shell uname -m)
+
+# the sources
+
+SRC = t3_bpe.c \
+ t3_delay.c \
+ t3_line~.c \
+ t3_metro.c \
+ t3_sig~.c \
+ t3_timer.c \
+ iem_t3_lib.c
+
+TARGET = iem_t3_lib.pd_linux
+
+
+OBJ = $(SRC:.c=.o)
+
+#
+# ------------------ targets ------------------------------------
+#
+
+clean:
+ rm $(TARGET)
+ rm *.o
+
+all: $(OBJ)
+ @echo :: $(OBJ)
+ $(LD) $(LDFLAGS) -o $(TARGET) *.o $(LIB)
+ strip --strip-unneeded $(TARGET)
+
+$(OBJ) : %.o : %.c
+ $(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $*.c
+
+
+
+
diff --git a/src/iem_t3_lib/makefile_win b/src/iem_t3_lib/makefile_win
index 80df3ce..30e9a68 100644
--- a/src/iem_t3_lib/makefile_win
+++ b/src/iem_t3_lib/makefile_win
@@ -15,11 +15,11 @@ PD_WIN_LIB = /NODEFAULTLIB:libc /NODEFAULTLIB:oldnames /NODEFAULTLIB:kernel /NOD
$(PD_INST_PATH)\bin\pthreadVC.lib \
$(PD_INST_PATH)\bin\pd.lib
-SRC = sigt3_line.c \
- sigt3_sig.c \
- t3_bpe.c \
+SRC = t3_bpe.c \
t3_delay.c \
+ t3_line~.c \
t3_metro.c \
+ t3_sig~.c \
t3_timer.c \
iem_t3_lib.c
diff --git a/src/iem_t3_lib/t3_bpe.c b/src/iem_t3_lib/t3_bpe.c
index eb72d3c..4b6c5d1 100644
--- a/src/iem_t3_lib/t3_bpe.c
+++ b/src/iem_t3_lib/t3_bpe.c
@@ -3,16 +3,8 @@
iem_t3_lib written by Gerhard Eckel, Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
-#ifdef _MSC_VER
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
#include "m_pd.h"
#include "iemlib.h"
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
/* ------------------------ t3_bpe ---------------------------- */
static t_class *t3_bpe_class;
@@ -42,7 +34,7 @@ static void t3_bpe_stop(t_t3_bpe *x)
static void t3_bpe_tick(t_t3_bpe *x)
{
t_atom *vec = x->x_beg;
- float val;
+ t_float val;
double dticks, time;
int iticks;
@@ -57,7 +49,7 @@ static void t3_bpe_tick(t_t3_bpe *x)
vec += x->x_curindex;
val = atom_getfloat(vec++);
time = (double)atom_getfloat(vec);
- outlet_float(x->x_out_time, (float)time);
+ outlet_float(x->x_out_time, time);
x->x_at[1].a_w.w_float = val;
x->x_at[0].a_w.w_float = x->x_t3_bang;
outlet_list(x->x_obj.ob_outlet, &s_list, 2, x->x_at);
diff --git a/src/iem_t3_lib/t3_delay.c b/src/iem_t3_lib/t3_delay.c
index fc43fb6..e9fb769 100644
--- a/src/iem_t3_lib/t3_delay.c
+++ b/src/iem_t3_lib/t3_delay.c
@@ -3,16 +3,8 @@
iem_t3_lib written by Gerhard Eckel, Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
-#ifdef _MSC_VER
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
#include "m_pd.h"
#include "iemlib.h"
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
/* ------------------------ t3_delay ---------------------------- */
static t_class *t3_delay_class;
diff --git a/src/iem_t3_lib/sigt3_line.c b/src/iem_t3_lib/t3_line~.c
index 108fde2..84aa70f 100644
--- a/src/iem_t3_lib/sigt3_line.c
+++ b/src/iem_t3_lib/t3_line~.c
@@ -3,16 +3,9 @@
iem_t3_lib written by Gerhard Eckel, Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
-#ifdef _MSC_VER
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
#include "m_pd.h"
#include "iemlib.h"
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
/* -------------------------- t3_line~ ------------------------------ */
static t_class *sigt3_line_class;
@@ -21,7 +14,7 @@ typedef struct _sigt3_line
{
t_object x_obj;
t_clock *x_clock;
- float *x_beg;
+ t_float *x_beg;
double x_cur_val;
double x_dst_val;
double x_inlet_val;
@@ -38,7 +31,7 @@ typedef struct _sigt3_line
int x_transient;
} t_sigt3_line;
-static void sigt3_line_nontransient(float *vec, t_sigt3_line *x, int n)
+static void sigt3_line_nontransient(t_float *vec, t_sigt3_line *x, int n)
{
int cur_samps = x->x_cur_samps, i;
double inc = x->x_inc;
@@ -52,7 +45,7 @@ static void sigt3_line_nontransient(float *vec, t_sigt3_line *x, int n)
while(n--)
{
cur_val += inc;
- *vec++ = (float)cur_val;
+ *vec++ = (t_float)cur_val;
}
x->x_cur_val += x->x_inc64;
}
@@ -62,7 +55,7 @@ static void sigt3_line_nontransient(float *vec, t_sigt3_line *x, int n)
while(n--)
{
cur_val += inc;
- *vec++ = (float)cur_val;
+ *vec++ = (t_float)cur_val;
}
x->x_cur_val = x->x_dst_val;
}
@@ -71,18 +64,18 @@ static void sigt3_line_nontransient(float *vec, t_sigt3_line *x, int n)
for(i=0; i<cur_samps; i++)
{
cur_val += inc;
- *vec++ = (float)cur_val;
+ *vec++ = (t_float)cur_val;
}
x->x_cur_val = cur_val = x->x_dst_val;
for(i=cur_samps; i<n; i++)
- *vec++ = (float)cur_val;
+ *vec++ = (t_float)cur_val;
x->x_cur_samps = 0;
}
}
else
{
while(n--)
- *vec++ = (float)cur_val;
+ *vec++ = (t_float)cur_val;
}
}
@@ -94,7 +87,7 @@ static t_int *sigt3_line_perform(t_int *w)
if(x->x_transient)
{
- float *trans = x->x_beg;
+ t_float *trans = x->x_beg;
while(n--)
*out++ = *trans++;
@@ -107,7 +100,7 @@ static t_int *sigt3_line_perform(t_int *w)
static void sigt3_line_tick(t_sigt3_line *x)
{
- float *trans = x->x_beg;
+ t_float *trans = x->x_beg;
int n = x->x_n, t3_bang_samps, cur_samps, i;
double inc, cur_val;
@@ -123,7 +116,7 @@ static void sigt3_line_tick(t_sigt3_line *x)
x->x_cur_samps = 0;
cur_val = x->x_cur_val = x->x_dst_val;
for(i=t3_bang_samps; i<n; i++)
- trans[i] = (float)cur_val;
+ trans[i] = (t_float)cur_val;
}
else
{
@@ -145,7 +138,7 @@ static void sigt3_line_tick(t_sigt3_line *x)
for(i=t3_bang_samps; i<n; i++)
{
cur_val += inc;
- trans[i] = (float)cur_val;
+ trans[i] = (t_float)cur_val;
}
x->x_cur_val += (double)diff * inc;
x->x_cur_samps -= diff;
@@ -155,7 +148,7 @@ static void sigt3_line_tick(t_sigt3_line *x)
for(i=t3_bang_samps; i<n; i++)
{
cur_val += inc;
- trans[i] = (float)cur_val;
+ trans[i] = (t_float)cur_val;
}
x->x_cur_val = x->x_dst_val;
x->x_cur_samps = 0;
@@ -166,12 +159,12 @@ static void sigt3_line_tick(t_sigt3_line *x)
for(i=t3_bang_samps; i<end; i++)
{
cur_val += inc;
- trans[i] = (float)cur_val;
+ trans[i] = (t_float)cur_val;
}
cur_val = x->x_cur_val = x->x_dst_val;
x->x_cur_samps = 0;
for(i=end; i<n; i++)
- trans[i] = (float)cur_val;
+ trans[i] = (t_float)cur_val;
}
}
x->x_transient = 1;
@@ -185,7 +178,7 @@ static void sigt3_line_list(t_sigt3_line *x, t_symbol *s, int ac, t_atom *av)
double time;
x->x_inlet_val = (double)atom_getfloatarg(1, ac, av);
- t3_bang_samps = (int)((float)atom_getfloatarg(0, ac, av)*x->x_ms2samps);
+ t3_bang_samps = (int)((t_float)atom_getfloatarg(0, ac, av)*x->x_ms2samps);
if(t3_bang_samps < 0)
t3_bang_samps = 0;
ticks = t3_bang_samps / x->x_n;
@@ -221,13 +214,13 @@ static void sigt3_line_stop(t_sigt3_line *x)
static void sigt3_line_dsp(t_sigt3_line *x, t_signal **sp)
{
int i;
- float val, *trans;
+ t_float val, *trans;
if(sp[0]->s_n > x->x_n)
{
- freebytes(x->x_beg, x->x_n*sizeof(float));
+ freebytes(x->x_beg, x->x_n*sizeof(t_float));
x->x_n = (int)sp[0]->s_n;
- x->x_beg = (float *)getbytes(x->x_n*sizeof(float));
+ x->x_beg = (t_float *)getbytes(x->x_n*sizeof(t_float));
}
else
x->x_n = (int)sp[0]->s_n;
@@ -244,7 +237,7 @@ static void sigt3_line_dsp(t_sigt3_line *x, t_signal **sp)
static void sigt3_line_free(t_sigt3_line *x)
{
if(x->x_beg)
- freebytes(x->x_beg, x->x_n*sizeof(float));
+ freebytes(x->x_beg, x->x_n*sizeof(t_float));
clock_free(x->x_clock);
}
@@ -254,7 +247,7 @@ static void *sigt3_line_new(t_floatarg init_val)
int i;
x->x_n = (int)sys_getblksize();
- x->x_beg = (float *)getbytes(x->x_n*sizeof(float));
+ x->x_beg = (t_float *)getbytes(x->x_n*sizeof(t_float));
x->x_inlet_val = x->x_cur_val = x->x_dst_val = init_val;
x->x_t3_bang_samps = x->x_cur_samps = x->x_dur_samps = x->x_transient = 0;
x->x_inlet_time = x->x_dst_time = 0.0;
diff --git a/src/iem_t3_lib/t3_metro.c b/src/iem_t3_lib/t3_metro.c
index 5438554..0f96562 100644
--- a/src/iem_t3_lib/t3_metro.c
+++ b/src/iem_t3_lib/t3_metro.c
@@ -3,16 +3,9 @@
iem_t3_lib written by Gerhard Eckel, Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
-#ifdef _MSC_VER
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
#include "m_pd.h"
#include "iemlib.h"
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
/* ------------------------ t3_metro ---------------------------- */
static t_class *t3_metro_class;
diff --git a/src/iem_t3_lib/sigt3_sig.c b/src/iem_t3_lib/t3_sig~.c
index 59ddbdb..41b8969 100644
--- a/src/iem_t3_lib/sigt3_sig.c
+++ b/src/iem_t3_lib/t3_sig~.c
@@ -3,16 +3,8 @@
iem_t3_lib written by Gerhard Eckel, Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
-#ifdef _MSC_VER
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
-
#include "m_pd.h"
#include "iemlib.h"
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
/* -------------------------- sigt3_sig~ ------------------------------ */
static t_class *sigt3_sig_class;
@@ -21,19 +13,19 @@ typedef struct _sigt3_sig
{
t_object x_obj;
t_clock *x_clock;
- float x_old_val;
- float x_new_val;
- float *x_beg;
+ t_float x_old_val;
+ t_float x_new_val;
+ t_float *x_beg;
int x_n;
int x_t3_bang_samps;
int x_transient;
- float x_ms2samps;
- float x_ticks2ms;
+ t_float x_ms2samps;
+ t_float x_ticks2ms;
} t_sigt3_sig;
static void sigt3_sig_tick(t_sigt3_sig *x)
{
- float *trans = x->x_beg, val;
+ t_float *trans = x->x_beg, val;
int n = x->x_n, t3_bang_samps, i;
t3_bang_samps = x->x_t3_bang_samps;
@@ -61,8 +53,8 @@ static void sigt3_sig_list(t_sigt3_sig *x, t_symbol *s, int ac, t_atom *av)
{
int n = x->x_n, t3_bang_samps, ticks;
- t3_bang_samps = (int)((float)atom_getfloatarg(0, ac, av)*x->x_ms2samps);
- x->x_new_val = (float)atom_getfloatarg(1, ac, av);
+ t3_bang_samps = (int)((t_float)atom_getfloatarg(0, ac, av)*x->x_ms2samps);
+ x->x_new_val = (t_float)atom_getfloatarg(1, ac, av);
if(t3_bang_samps < 0)
t3_bang_samps = 0;
ticks = t3_bang_samps / n;
@@ -82,7 +74,7 @@ static t_int *sigt3_sig_perform(t_int *w)
if(x->x_transient)
{
- float *trans = x->x_beg;
+ t_float *trans = x->x_beg;
while(n--)
*out++ = *trans++;
@@ -90,7 +82,7 @@ static t_int *sigt3_sig_perform(t_int *w)
}
else
{
- float val = x->x_new_val;
+ t_float val = x->x_new_val;
while(n--)
*out++ = val;
@@ -106,7 +98,7 @@ static t_int *sigt3_sig_perf8(t_int *w)
if(x->x_transient)
{
- float *trans = x->x_beg;
+ t_float *trans = x->x_beg;
for(i=0; i<n; i+=8, out+=8, trans+=8)
{
@@ -123,7 +115,7 @@ static t_int *sigt3_sig_perf8(t_int *w)
}
else
{
- float val = x->x_new_val;
+ t_float val = x->x_new_val;
for(i=0; i<n; i+=8, out+=8)
{
@@ -143,18 +135,18 @@ static t_int *sigt3_sig_perf8(t_int *w)
static void sigt3_sig_dsp(t_sigt3_sig *x, t_signal **sp)
{
int i;
- float *trans, val;
+ t_float *trans, val;
if(sp[0]->s_n > x->x_n)
{
- freebytes(x->x_beg, x->x_n*sizeof(float));
+ freebytes(x->x_beg, x->x_n*sizeof(t_float));
x->x_n = sp[0]->s_n;
- x->x_beg = (float *)getbytes(x->x_n*sizeof(float));
+ x->x_beg = (t_float *)getbytes(x->x_n*sizeof(t_float));
}
else
x->x_n = sp[0]->s_n;
- x->x_ms2samps = 0.001*(float)sp[0]->s_sr;
- x->x_ticks2ms = (float)x->x_n / x->x_ms2samps;
+ x->x_ms2samps = 0.001*(t_float)sp[0]->s_sr;
+ x->x_ticks2ms = (t_float)x->x_n / x->x_ms2samps;
i = x->x_n;
val = x->x_new_val;
trans = x->x_beg;
@@ -170,7 +162,7 @@ static void sigt3_sig_dsp(t_sigt3_sig *x, t_signal **sp)
static void sigt3_sig_free(t_sigt3_sig *x)
{
if(x->x_beg)
- freebytes(x->x_beg, x->x_n*sizeof(float));
+ freebytes(x->x_beg, x->x_n*sizeof(t_float));
clock_free(x->x_clock);
}
@@ -180,10 +172,10 @@ static void *sigt3_sig_new(t_floatarg init_val)
x->x_new_val = x->x_old_val = init_val;
x->x_n = (int)sys_getblksize();
- x->x_beg = (float *)getbytes(x->x_n*sizeof(float));
+ x->x_beg = (t_float *)getbytes(x->x_n*sizeof(t_float));
x->x_t3_bang_samps = x->x_transient = 0;
- x->x_ms2samps = 0.001 * (float)sys_getsr();
- x->x_ticks2ms = (float)x->x_n / x->x_ms2samps;
+ x->x_ms2samps = 0.001 * (t_float)sys_getsr();
+ x->x_ticks2ms = (t_float)x->x_n / x->x_ms2samps;
x->x_clock = clock_new(x, (t_method)sigt3_sig_tick);
outlet_new(&x->x_obj, &s_signal);
return (x);
diff --git a/src/iem_t3_lib/t3_timer.c b/src/iem_t3_lib/t3_timer.c
index aa9c8b5..1169726 100644
--- a/src/iem_t3_lib/t3_timer.c
+++ b/src/iem_t3_lib/t3_timer.c
@@ -3,16 +3,9 @@
iem_t3_lib written by Gerhard Eckel, Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
-#ifdef _MSC_VER
-#pragma warning( disable : 4244 )
-#pragma warning( disable : 4305 )
-#endif
#include "m_pd.h"
#include "iemlib.h"
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
/* -------------------------- t3_timer ------------------------------ */
static t_class *t3_timer_class;
@@ -24,13 +17,13 @@ typedef struct _t3_timer
double x_t3_off;
} t_t3_timer;
-static void t3_timer_float(t_t3_timer *x, t_float t3_bang)
+static void t3_timer_float(t_t3_timer *x, t_floatarg t3_bang)
{
x->x_settime = (double)clock_getsystime();
x->x_t3_off = (double)t3_bang;
}
-static void t3_timer_ft1(t_t3_timer *x, t_float t3_bang)
+static void t3_timer_ft1(t_t3_timer *x, t_floatarg t3_bang)
{
outlet_float(x->x_obj.ob_outlet, clock_gettimesince(x->x_settime)
+ (double)t3_bang - x->x_t3_off);
@@ -39,7 +32,7 @@ static void t3_timer_ft1(t_t3_timer *x, t_float t3_bang)
static void *t3_timer_new(void)
{
t_t3_timer *x = (t_t3_timer *)pd_new(t3_timer_class);
- t3_timer_float(x, 0.0);
+ t3_timer_float(x, 0.0f);
outlet_new(&x->x_obj, &s_float);
inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_float, gensym("ft1"));
return (x);