Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
David MacDonald
purr-data
Commits
756fbd5f
Commit
756fbd5f
authored
Jul 23, 2017
by
Jonathan Wilkes
Browse files
make classes instantiate with no arguments
parent
0fdd35c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
externals/bsaylor/partconv~.c
View file @
756fbd5f
...
...
@@ -345,11 +345,25 @@ static void *partconv_new(t_symbol *s, int argc, t_atom *argv)
t_partconv
*
x
=
(
t_partconv
*
)
pd_new
(
partconv_class
);
outlet_new
(
&
x
->
x_obj
,
gensym
(
"signal"
));
t_atom
sane_defaults
[
2
];
if
(
argc
!=
2
)
{
/* Give some sane defaults with no args so we can at least
instantiate and get to the help patch */
if
(
!
argc
)
{
post
(
"partconv~: warning: no arguments given"
);
SETSYMBOL
(
sane_defaults
,
&
s_
);
SETFLOAT
(
sane_defaults
+
1
,
2
.);
argc
=
2
;
argv
=
sane_defaults
;
}
else
{
post
(
"argc = %d"
,
argc
);
error
(
"partconv~: usage: [partconv~ <arrayname> <partsize>]
\n\t
- partition size must be a power of 2 >= blocksize"
);
return
NULL
;
}
}
x
->
arrayname
=
atom_getsymbol
(
argv
);
...
...
externals/bsaylor/pvoc~.c
View file @
756fbd5f
...
...
@@ -315,14 +315,27 @@ static void *pvoc_new(t_symbol *s, int argc, t_atom *argv)
{
t_pvoc
*
x
=
(
t_pvoc
*
)
pd_new
(
pvoc_class
);
int
i
;
t_atom
sane_defaults
[
3
];
inlet_new
(
&
x
->
x_obj
,
&
x
->
x_obj
.
ob_pd
,
&
s_signal
,
&
s_signal
);
// pitch-shift inlet
outlet_new
(
&
x
->
x_obj
,
gensym
(
"signal"
));
if
(
argc
!=
3
)
{
if
(
!
argc
)
{
post
(
"partconv~: warning: no arguments given"
);
SETSYMBOL
(
sane_defaults
,
&
s_
);
SETFLOAT
(
sane_defaults
+
1
,
2
.);
SETFLOAT
(
sane_defaults
+
2
,
2
.);
argc
=
3
;
argv
=
sane_defaults
;
}
else
{
post
(
"argc = %d"
,
argc
);
error
(
"pvoc~: usage: [pvoc~ <arrayname> <fftsize> <overlap>]"
);
return
NULL
;
}
}
x
->
fftsize
=
atom_getfloatarg
(
1
,
argc
,
argv
);
...
...
Write
Preview
Markdown
is supported
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