Skip to content

Commit

Permalink
fix sample table passing for mc builds and non-mc pd
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-wes committed Oct 7, 2024
1 parent 7fcd6df commit ce8a92d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pdlua.c
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ static t_int *pdlua_perform(t_int *w){
t_signal *sig = (t_signal *)(w[2 + i]);
t_float *in = sig->s_vec;
#if PD_HAVE_MULTICHANNEL
int nchans = sig->s_nchans;
int nchans = sig->s_nchans ? sig->s_nchans : 1;
#else
int nchans = 1;
#endif
Expand Down Expand Up @@ -1123,7 +1123,7 @@ static t_int *pdlua_perform(t_int *w){
t_signal *sig = (t_signal *)(w[2 + o->siginlets + i]);
t_float *out = sig->s_vec;
#if PD_HAVE_MULTICHANNEL
int nchans = sig->s_nchans;
int nchans = sig->s_nchans ? sig->s_nchans : 1;
#else
int nchans = 1;
#endif
Expand Down Expand Up @@ -1177,14 +1177,14 @@ static void pdlua_dsp(t_pdlua *x, t_signal **sp) {
lua_newtable(__L());
for (int i = 0; i < x->siginlets; i++) {
lua_pushinteger(__L(), i + 1);
PDLUA_DEBUG2("pdlua_dsp: inlet: %d, s_nchans: %d", i, sp[i]->s_nchans);
if (g_signal_setmultiout)
if (g_signal_setmultiout) {
#if PD_HAVE_MULTICHANNEL
PDLUA_DEBUG2("pdlua_dsp: inlet: %d, s_nchans: %d", i, sp[i]->s_nchans);
lua_pushinteger(__L(), sp[i]->s_nchans);
#else
lua_pushinteger(__L(), 1); // Pd supports multichannel, but pdlua built without
#endif
else
} else
lua_pushinteger(__L(), 1); // Pd doesn't support multichannel
lua_settable(__L(), -3);
}
Expand Down

0 comments on commit ce8a92d

Please sign in to comment.