Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Srashti Mittal
purr-data
Commits
f09ad326
Commit
f09ad326
authored
Sep 30, 2019
by
Jonathan Wilkes
Browse files
Merge branch 't_int-casts-squashed'
parents
a7adef65
03494071
Changes
475
Hide whitespace changes
Inline
Side-by-side
externals/autotune/autotune~.c
View file @
f09ad326
...
...
@@ -547,7 +547,7 @@ void autotune_dsp(t_autotune *x, t_signal **sp, short *count)
if
(
x
->
fs
!=
sp
[
0
]
->
s_sr
)
autotune_init
(
x
,
sp
[
0
]
->
s_sr
);
dsp_add
(
autotune_perform
,
4
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
sp
[
0
]
->
s_n
);
dsp_add
(
autotune_perform
,
4
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
(
t_int
)
sp
[
0
]
->
s_n
);
}
...
...
externals/bassemu~/bassemu~.c
View file @
f09ad326
...
...
@@ -230,7 +230,8 @@ static t_int *bassemu_perform(t_int *ww)
static
void
bassemu_dsp
(
t_bassemu
*
x
,
t_signal
**
sp
)
{
x
->
sr
=
sp
[
0
]
->
s_sr
;
dsp_add
(
bassemu_perform
,
4
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
sp
[
0
]
->
s_n
);
dsp_add
(
bassemu_perform
,
4
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
(
t_int
)
sp
[
0
]
->
s_n
);
}
static
void
recalc
(
t_bassemu
*
x
)
...
...
externals/bsaylor/aenv~.c
View file @
f09ad326
...
...
@@ -99,7 +99,7 @@ static t_int *aenv_perform(t_int *w)
static
void
aenv_dsp
(
t_aenv
*
x
,
t_signal
**
sp
)
{
dsp_add
(
aenv_perform
,
3
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
0
]
->
s_n
);
dsp_add
(
aenv_perform
,
3
,
x
,
sp
[
0
]
->
s_vec
,
(
t_int
)
sp
[
0
]
->
s_n
);
}
static
void
aenv_float
(
t_aenv
*
x
,
t_float
f
)
...
...
externals/bsaylor/partconv~.c
View file @
f09ad326
...
...
@@ -65,6 +65,7 @@ typedef struct _partconv {
int
nbins
;
int
nparts
;
int
ir_prepared
;
int
hosed
;
/* set if our array doesn't exist */
int
pd_blocksize
;
// partitions of impulse response
...
...
@@ -121,6 +122,16 @@ static void partconv_deal_work(t_partconv *x)
#include
"altivec-perform.inc.c"
#else
static
t_int
*
partconv_perform_hosed
(
t_int
*
w
)
{
t_float
*
out
=
(
t_float
*
)(
w
[
3
]);
int
n
=
(
int
)(
w
[
4
]);
int
i
;
for
(
i
=
0
;
i
<
n
;
i
++
)
out
[
i
]
=
0
;
return
(
w
+
5
);
}
static
t_int
*
partconv_perform
(
t_int
*
w
)
{
t_partconv
*
x
=
(
t_partconv
*
)(
w
[
1
]);
...
...
@@ -132,7 +143,6 @@ static t_int *partconv_perform(t_int *w)
int
k
;
// bin
int
p
;
// partition
int
endpart
;
#ifdef USE_SSE
int
v1
;
int
v2
;
...
...
@@ -148,7 +158,6 @@ static t_int *partconv_perform(t_int *w)
float
*
sumbuf1ptr
;
float
*
sumbuf2ptr
;
memcpy
(
&
(
x
->
inbuf
[
x
->
inbufpos
]),
in
,
n
*
sizeof
(
float
));
// gather a block of input into input buffer
x
->
inbufpos
+=
n
;
if
(
x
->
inbufpos
>=
x
->
partsize
)
{
...
...
@@ -235,13 +244,12 @@ static t_int *partconv_perform(t_int *w)
static
void
partconv_free
(
t_partconv
*
x
)
{
int
i
;
fftwf_free
(
x
->
inbuf
);
for
(
i
=
0
;
i
<
x
->
nparts
;
i
++
)
fftwf_free
(
x
->
irpart_td
[
i
]);
fftwf_free
(
x
->
input_td
);
fftwf_destroy_plan
(
x
->
input_plan
);
for
(
i
=
0
;
i
<
x
->
nsumbufs
;
i
++
)
{
for
(
i
=
0
;
i
<
x
->
nsumbufs
;
i
++
)
{
fftwf_free
(
x
->
sumbufs
[
i
].
fd
);
fftwf_destroy_plan
(
x
->
sumbufs
[
i
].
plan
);
}
...
...
@@ -259,20 +267,25 @@ static void partconv_set(t_partconv *x, t_symbol *s)
// get the array from pd
x
->
arrayname
=
s
;
if
(
!
(
arrayobj
=
(
t_garray
*
)
pd_findbyclass
(
x
->
arrayname
,
garray_class
)))
{
if
(
*
x
->
arrayname
->
s_name
)
{
pd_error
(
x
,
"partconv~: %s: no such array"
,
x
->
arrayname
->
s_name
);
return
;
}
x
->
hosed
=
1
;
if
(
x
->
arrayname
&&
*
x
->
arrayname
->
s_name
)
pd_error
(
x
,
"partconv~: %s: no such array"
,
x
->
arrayname
->
s_name
);
else
pd_error
(
x
,
"partconv~: need an array name"
);
return
;
}
else
if
(
!
garray_getfloatarray
(
arrayobj
,
&
arraysize
,
&
array
))
{
x
->
hosed
=
1
;
pd_error
(
x
,
"%s: bad template"
,
x
->
arrayname
->
s_name
);
return
;
}
else
{
x
->
hosed
=
0
;
}
// if the IR has already been prepared, free everything first
if
(
x
->
ir_prepared
==
1
)
{
partconv_free
(
x
);
}
// caculate number of partitions
x
->
nparts
=
arraysize
/
x
->
partsize
;
if
(
arraysize
%
x
->
partsize
!=
0
)
...
...
@@ -336,8 +349,12 @@ static void partconv_dsp(t_partconv *x, t_signal **sp)
if
(
x
->
ir_prepared
==
0
)
{
partconv_set
(
x
,
x
->
arrayname
);
}
dsp_add
(
partconv_perform
,
4
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
sp
[
0
]
->
s_n
);
if
(
x
->
hosed
)
dsp_add
(
partconv_perform_hosed
,
4
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
(
t_int
)
sp
[
0
]
->
s_n
);
else
dsp_add
(
partconv_perform
,
4
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
(
t_int
)
sp
[
0
]
->
s_n
);
}
static
void
*
partconv_new
(
t_symbol
*
s
,
int
argc
,
t_atom
*
argv
)
...
...
@@ -352,11 +369,12 @@ static void *partconv_new(t_symbol *s, int argc, t_atom *argv)
instantiate and get to the help patch */
if
(
!
argc
)
{
post
(
"partconv~: warning: no arguments given"
);
SETSYMBOL
(
sane_defaults
,
&
s_
);
SETFLOAT
(
sane_defaults
+
1
,
2
.);
SETFLOAT
(
sane_defaults
+
1
,
64
.);
argc
=
2
;
argv
=
sane_defaults
;
pd_error
(
x
,
"partconv~: no arguments given. Setting some "
"sane defaults to keep Purr Data from crashing."
);
}
else
{
...
...
externals/bsaylor/pvoc~.c
View file @
f09ad326
...
...
@@ -258,7 +258,7 @@ static t_int *pvoc_perform(t_int *w)
static
void
pvoc_dsp
(
t_pvoc
*
x
,
t_signal
**
sp
)
{
dsp_add
(
pvoc_perform
,
5
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
sp
[
2
]
->
s_vec
,
sp
[
0
]
->
s_n
);
dsp_add
(
pvoc_perform
,
5
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
sp
[
2
]
->
s_vec
,
(
t_int
)
sp
[
0
]
->
s_n
);
}
// adapted from jsarlo's windowing library
...
...
externals/bsaylor/susloop~.c
View file @
f09ad326
...
...
@@ -88,7 +88,7 @@ static t_int *susloop_perform(t_int *w)
static
void
susloop_dsp
(
t_susloop
*
x
,
t_signal
**
sp
)
{
dsp_add
(
susloop_perform
,
4
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
sp
[
0
]
->
s_n
);
dsp_add
(
susloop_perform
,
4
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
(
t_int
)
sp
[
0
]
->
s_n
);
}
static
void
*
susloop_new
(
t_symbol
*
s
,
int
argc
,
t_atom
*
argv
)
...
...
externals/bsaylor/svf~.c
View file @
f09ad326
...
...
@@ -124,7 +124,7 @@ static t_int *svf_perform(t_int *w)
static
void
svf_dsp
(
t_svf
*
x
,
t_signal
**
sp
)
{
dsp_add
(
svf_perform
,
7
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
sp
[
2
]
->
s_vec
,
sp
[
3
]
->
s_vec
,
sp
[
4
]
->
s_vec
,
sp
[
0
]
->
s_n
);
dsp_add
(
svf_perform
,
7
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
sp
[
2
]
->
s_vec
,
sp
[
3
]
->
s_vec
,
sp
[
4
]
->
s_vec
,
(
t_int
)
sp
[
0
]
->
s_n
);
}
static
void
*
svf_new
(
t_symbol
*
s
,
int
argc
,
t_atom
*
argv
)
...
...
externals/bsaylor/zhzxh~.c
View file @
f09ad326
...
...
@@ -59,7 +59,7 @@ static t_int *zhzxh_perform(t_int *w)
static
void
zhzxh_dsp
(
t_zhzxh
*
x
,
t_signal
**
sp
)
{
dsp_add
(
zhzxh_perform
,
4
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
sp
[
0
]
->
s_n
);
dsp_add
(
zhzxh_perform
,
4
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
(
t_int
)
sp
[
0
]
->
s_n
);
}
static
void
*
zhzxh_new
(
t_symbol
*
s
,
int
argc
,
t_atom
*
argv
)
...
...
externals/creb/modules++/biquadseries~.cc
View file @
f09ad326
...
...
@@ -77,7 +77,7 @@ static t_int *biquadseries_perform(t_int *w)
static
void
biquadseries_dsp
(
t_biquadseries
*
x
,
t_signal
**
sp
)
{
dsp_add
(
biquadseries_perform
,
4
,
x
->
biquadseries
,
sp
[
0
]
->
s_n
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
);
dsp_add
(
biquadseries_perform
,
4
,
x
->
biquadseries
,
(
t_int
)
sp
[
0
]
->
s_n
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
);
}
void
biquadseries_free
(
void
)
...
...
externals/creb/modules++/blosc~.cc
View file @
f09ad326
...
...
@@ -478,30 +478,30 @@ static void blosc_dsp(t_blosc *x, t_signal **sp)
if
(
x
->
x_ctl
.
c_waveform
==
gensym
(
"syncsaw"
)){
x
->
x_ctl
.
c_scale
=
1.0
;
x
->
x_ctl
.
c_scale_update
=
1.0
;
dsp_add
(
blosc_perform_hardsync_saw
,
5
,
&
x
->
x_ctl
,
sp
[
0
]
->
s_n
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
sp
[
2
]
->
s_vec
);
dsp_add
(
blosc_perform_hardsync_saw
,
5
,
&
x
->
x_ctl
,
(
t_int
)
sp
[
0
]
->
s_n
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
sp
[
2
]
->
s_vec
);
}
/* 1 osc */
else
if
(
x
->
x_ctl
.
c_waveform
==
gensym
(
"pulse"
)){
x
->
x_ctl
.
c_scale
=
1.0
;
x
->
x_ctl
.
c_scale_update
=
1.0
;
dsp_add
(
blosc_perform_pulse
,
4
,
&
x
->
x_ctl
,
sp
[
0
]
->
s_n
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
);
dsp_add
(
blosc_perform_pulse
,
4
,
&
x
->
x_ctl
,
(
t_int
)
sp
[
0
]
->
s_n
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
);
}
else
if
(
x
->
x_ctl
.
c_waveform
==
gensym
(
"pulse2"
)){
x
->
x_ctl
.
c_phase_inc_scale
*=
2
;
x
->
x_ctl
.
c_scale
=
1.0
;
x
->
x_ctl
.
c_scale_update
=
-
1.0
;
dsp_add
(
blosc_perform_pulse
,
4
,
&
x
->
x_ctl
,
sp
[
0
]
->
s_n
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
);
dsp_add
(
blosc_perform_pulse
,
4
,
&
x
->
x_ctl
,
(
t_int
)
sp
[
0
]
->
s_n
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
);
}
else
if
(
x
->
x_ctl
.
c_waveform
==
gensym
(
"comparator"
)){
x
->
x_ctl
.
c_scale
=
1.0
;
x
->
x_ctl
.
c_scale_update
=
1.0
;
dsp_add
(
blosc_perform_comparator
,
4
,
&
x
->
x_ctl
,
sp
[
0
]
->
s_n
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
);
dsp_add
(
blosc_perform_comparator
,
4
,
&
x
->
x_ctl
,
(
t_int
)
sp
[
0
]
->
s_n
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
);
}
else
{
x
->
x_ctl
.
c_scale
=
1.0
;
x
->
x_ctl
.
c_scale_update
=
1.0
;
dsp_add
(
blosc_perform_saw
,
4
,
&
x
->
x_ctl
,
sp
[
0
]
->
s_n
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
);
dsp_add
(
blosc_perform_saw
,
4
,
&
x
->
x_ctl
,
(
t_int
)
sp
[
0
]
->
s_n
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
);
}
...
...
externals/creb/modules++/filterortho~.cc
View file @
f09ad326
...
...
@@ -68,7 +68,8 @@ static t_int *filterortho_perform(t_int *w)
static
void
filterortho_dsp
(
t_filterortho
*
x
,
t_signal
**
sp
)
{
dsp_add
(
filterortho_perform
,
4
,
x
->
filterortho
,
sp
[
0
]
->
s_n
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
);
dsp_add
(
filterortho_perform
,
4
,
x
->
filterortho
,
(
t_int
)
sp
[
0
]
->
s_n
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
);
}
void
filterortho_free
(
t_filterortho
*
x
)
...
...
externals/creb/modules/abs~.c
View file @
f09ad326
...
...
@@ -30,7 +30,7 @@ static t_int *abs_perform(t_int *w)
static
void
abs_dsp
(
t_abs
*
x
,
t_signal
**
sp
)
{
dsp_add
(
abs_perform
,
4
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
sp
[
0
]
->
s_n
);
dsp_add
(
abs_perform
,
4
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
(
t_int
)
sp
[
0
]
->
s_n
);
}
static
void
*
abs_new
(
void
)
...
...
externals/creb/modules/bdiag~.c
View file @
f09ad326
...
...
@@ -215,7 +215,7 @@ static void bdiag_dsp(t_bdiag *x, t_signal **sp)
}
dsp_add
(
bdiag_perform
,
4
,
&
x
->
x_ctl
,
sp
[
0
]
->
s_n
,
dsp_add
(
bdiag_perform
,
4
,
&
x
->
x_ctl
,
(
t_int
)
sp
[
0
]
->
s_n
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
);
}
...
...
externals/creb/modules/bfft~.c
View file @
f09ad326
...
...
@@ -177,7 +177,7 @@ static void bfft_dsp(t_bfft *x, t_signal **sp)
in
=
out
;
}
dsp_add
(
bfft_perform
,
4
,
&
x
->
x_ctl
,
n
,
in
,
out
);
dsp_add
(
bfft_perform
,
4
,
&
x
->
x_ctl
,
(
t_int
)
n
,
in
,
out
);
}
...
...
@@ -196,7 +196,7 @@ static void ibfft_dsp(t_bfft *x, t_signal **sp)
in
=
out
;
}
dsp_add
(
ibfft_perform
,
4
,
&
x
->
x_ctl
,
n
,
in
,
out
);
dsp_add
(
ibfft_perform
,
4
,
&
x
->
x_ctl
,
(
t_int
)
n
,
in
,
out
);
}
...
...
@@ -214,7 +214,7 @@ static void fht_dsp(t_bfft *x, t_signal **sp)
in
=
out
;
}
dsp_add
(
fht_perform
,
4
,
&
x
->
x_ctl
,
n
,
in
,
out
);
dsp_add
(
fht_perform
,
4
,
&
x
->
x_ctl
,
(
t_int
)
n
,
in
,
out
);
}
...
...
externals/creb/modules/bitsplit~.c
View file @
f09ad326
...
...
@@ -71,7 +71,7 @@ static void bitsplit_dsp(t_bitsplit *x, t_signal **sp)
for
(
i
=
0
;
i
<
x
->
x_ctl
.
c_outputs
;
i
++
){
x
->
x_ctl
.
c_output
[
i
]
=
sp
[
i
+
1
]
->
s_vec
;
}
dsp_add
(
bitsplit_perform
,
2
,
&
x
->
x_ctl
,
sp
[
0
]
->
s_n
);
dsp_add
(
bitsplit_perform
,
2
,
&
x
->
x_ctl
,
(
t_int
)
sp
[
0
]
->
s_n
);
}
...
...
externals/creb/modules/blocknorm~.c
View file @
f09ad326
...
...
@@ -90,7 +90,7 @@ static void blocknorm_dsp(t_blocknorm *x, t_signal **sp)
x
->
x_ctl
.
c_input
[
i
]
=
sp
[
i
]
->
s_vec
;
x
->
x_ctl
.
c_output
[
i
]
=
sp
[
c
+
i
]
->
s_vec
;
}
dsp_add
(
blocknorm_perform
,
2
,
&
x
->
x_ctl
,
sp
[
0
]
->
s_n
);
dsp_add
(
blocknorm_perform
,
2
,
&
x
->
x_ctl
,
(
t_int
)
sp
[
0
]
->
s_n
);
}
...
...
externals/creb/modules/bmatrix~.c
View file @
f09ad326
...
...
@@ -102,7 +102,8 @@ static void matrix_dsp(t_matrix *x, t_signal **sp)
for
(
i
=
0
;
i
<
n
;
i
++
)
x
->
x_ctl
.
c_A
[
i
]
=
1
;
dsp_add
(
matrix_perform
,
4
,
&
x
->
x_ctl
,
sp
[
0
]
->
s_n
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
);
dsp_add
(
matrix_perform
,
4
,
&
x
->
x_ctl
,
(
t_int
)
sp
[
0
]
->
s_n
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
);
}
...
...
externals/creb/modules/bwin~.c
View file @
f09ad326
...
...
@@ -138,7 +138,7 @@ static void window_dsp(t_window *x, t_signal **sp)
window_type
(
x
,
x
->
x_type
,
x
->
x_typearg
);
}
dsp_add
(
window_perform
,
4
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
n
);
dsp_add
(
window_perform
,
4
,
x
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
(
t_int
)
n
);
}
static
void
window_free
(
t_window
*
x
)
...
...
externals/creb/modules/cheby~.c
View file @
f09ad326
...
...
@@ -91,7 +91,7 @@ static t_int *cheby_perform(t_int *w)
static
void
cheby_dsp
(
t_cheby
*
x
,
t_signal
**
sp
)
{
dsp_add
(
cheby_perform
,
4
,
&
x
->
x_ctl
,
sp
[
0
]
->
s_n
,
dsp_add
(
cheby_perform
,
4
,
&
x
->
x_ctl
,
(
t_int
)
sp
[
0
]
->
s_n
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
);
}
...
...
externals/creb/modules/cmath~.c
View file @
f09ad326
...
...
@@ -126,7 +126,7 @@ static t_int *cmath_perform_nifft(t_int *w)
static
void
cmath_dsp
(
t_cmath
*
x
,
t_signal
**
sp
)
{
dsp_add
(
x
->
x_perf
,
5
,
sp
[
0
]
->
s_n
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
sp
[
2
]
->
s_vec
,
sp
[
3
]
->
s_vec
);
dsp_add
(
x
->
x_perf
,
5
,
(
t_int
)
sp
[
0
]
->
s_n
,
sp
[
0
]
->
s_vec
,
sp
[
1
]
->
s_vec
,
sp
[
2
]
->
s_vec
,
sp
[
3
]
->
s_vec
);
}
void
cmath_free
(
void
)
...
...
Prev
1
2
3
4
5
…
24
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment