コード例 #1
0
ファイル: play.c プロジェクト: EQ4/Pd-for-LibPd
static void *play_new(t_symbol *s, t_floatarg f)
{
    /* one auxiliary signal:  position input */
    t_play *x = (t_play *)arsic_new(play_class, s, (int)f, 0, 1);
    if (x)
    {
	int nch = arsic_getnchannels((t_arsic *)x);
	while (nch--)
	    outlet_new((t_object *)x, &s_signal);
    }
    return (x);
}
コード例 #2
0
ファイル: wave.c プロジェクト: EQ4/Pd-for-LibPd
static void *wave_new(t_symbol *s, t_floatarg f1, t_floatarg f2, t_floatarg f3)
{
    /* three auxiliary signals:  phase, clipstart, and clipend inputs */
    t_wave *x = (t_wave *)arsic_new(wave_class, s, (int)f3, 0, 3);
    if (x)
    {
	int nch = arsic_getnchannels((t_arsic *)x);
	if (f1 < 0) f1 = 0;
	if (f2 < 0) f2 = 0;
	sic_newinlet((t_sic *)x, f1);
	sic_newinlet((t_sic *)x, f2);
	while (nch--)
	    outlet_new((t_object *)x, &s_signal);
	wave_interp(x, 1);
    }
    return (x);
}
コード例 #3
0
ファイル: record.c プロジェクト: amurtet/pd-cyclone
static void *record_new(t_symbol *s, t_floatarg f)
{
    /* one auxiliary signal:  sync output */
    t_record *x = (t_record *)arsic_new(record_class, s, (int)f, 0, 1);
    if (x)
    {
	int nch = arsic_getnchannels((t_arsic *)x);
	arsic_setminsize((t_arsic *)x, 2);
	x->x_appendmode = 0;
	x->x_loopmode = 0;
	record_reset(x);
	x->x_clock = clock_new(x, (t_method)record_tick);
	x->x_clocklasttick = clock_getlogicaltime();
	while (--nch)
	    inlet_new((t_object *)x, (t_pd *)x, &s_signal, &s_signal);
	inlet_new((t_object *)x, (t_pd *)x, &s_float, gensym("ft-2"));
	inlet_new((t_object *)x, (t_pd *)x, &s_float, gensym("ft-1"));
	outlet_new((t_object *)x, &s_signal);
    }
    return (x);
}
コード例 #4
0
ファイル: peek.c プロジェクト: cpenny42/PdScript-Demo
static void *peek_new(t_symbol *s, t_floatarg f1, t_floatarg f2)
{
    int ch = (f1 > 0 ? (int)f1 : 0);
    t_peek *x = (t_peek *)arsic_new(peek_class, s,
				    (ch ? PEEK_MAXCHANNELS : 0), 0, 0);
    if (x)
    {
	if (ch > PEEK_MAXCHANNELS)
	    ch = PEEK_MAXCHANNELS;
	x->x_maxchannels = (ch ? PEEK_MAXCHANNELS : 1);
	x->x_effchannel = x->x_reqchannel = (ch ? ch - 1 : 0);
	/* CHECKED (refman's error) clipping is disabled by default */
	x->x_clipmode = ((int)f2 != 0);
	x->x_pokemode = 0;
	inlet_new((t_object *)x, (t_pd *)x, &s_float, gensym("ft1"));
	inlet_new((t_object *)x, (t_pd *)x, &s_float, gensym("ft2"));
	outlet_new((t_object *)x, &s_float);
	x->x_clock = clock_new(x, (t_method)peek_tick);
	x->x_clocklasttick = clock_getlogicaltime();
	x->x_clockset = 0;
    }
    return (x);
}
コード例 #5
0
ファイル: poke.c プロジェクト: Git689/libpd-cyclone-ios
static void *poke_new(t_symbol *s, t_floatarg f)
{
    int ch = (f > 0 ? (int)f : 0);
    t_poke *x = (t_poke *)arsic_new(poke_class, s,
				    (ch ? POKE_MAXCHANNELS : 0), 2, 0);
    if (x)
    {
	t_inlet *in2;
	if (ch > POKE_MAXCHANNELS)
	    ch = POKE_MAXCHANNELS;
	x->x_maxchannels = (ch ? POKE_MAXCHANNELS : 1);
	x->x_effchannel = x->x_reqchannel = (ch ? ch - 1 : 0);
	/* CHECKED: no float-to-signal conversion.
	   Floats in 2nd inlet are ignored when dsp is on, but only if a signal
	   is connected to this inlet.  Incompatible (revisit LATER). */
	in2 = inlet_new((t_object *)x, (t_pd *)x, &s_signal, &s_signal);
	x->x_indexptr = fragile_inlet_signalscalar(in2);
	inlet_new((t_object *)x, (t_pd *)x, &s_float, gensym("ft2"));
	x->x_clock = clock_new(x, (t_method)poke_tick);
	x->x_clocklasttick = clock_getlogicaltime();
	x->x_clockset = 0;
    }
    return (x);
}