• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ plumber_add_ugen函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中plumber_add_ugen函数的典型用法代码示例。如果您正苦于以下问题:C++ plumber_add_ugen函数的具体用法?C++ plumber_add_ugen怎么用?C++ plumber_add_ugen使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了plumber_add_ugen函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: sporth_waveset

int sporth_waveset(sporth_stack *stack, void *ud)
{
    plumber_data *pd = ud;
    SPFLOAT input;
    SPFLOAT out;
    SPFLOAT ilen;
    SPFLOAT rep;
    sp_waveset *waveset;

    switch(pd->mode) {
        case PLUMBER_CREATE:

#ifdef DEBUG_MODE
            plumber_print(pd, "waveset: Creating\n");
#endif

            sp_waveset_create(&waveset);
            plumber_add_ugen(pd, SPORTH_WAVESET, waveset);
            if(sporth_check_args(stack, "fff") != SPORTH_OK) {
                plumber_print(pd,"Not enough arguments for waveset\n");
                stack->error++;
                return PLUMBER_NOTOK;
            }
            ilen = sporth_stack_pop_float(stack);
            rep = sporth_stack_pop_float(stack);
            input = sporth_stack_pop_float(stack);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_INIT:

#ifdef DEBUG_MODE
            plumber_print(pd, "waveset: Initialising\n");
#endif

            ilen = sporth_stack_pop_float(stack);
            rep = sporth_stack_pop_float(stack);
            input = sporth_stack_pop_float(stack);
            waveset = pd->last->ud;
            sp_waveset_init(pd->sp, waveset, ilen);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_COMPUTE:
            ilen = sporth_stack_pop_float(stack);
            rep = sporth_stack_pop_float(stack);
            input = sporth_stack_pop_float(stack);
            waveset = pd->last->ud;
            waveset->rep = rep;
            sp_waveset_compute(pd->sp, waveset, &input, &out);
            sporth_stack_push_float(stack, out);
            break;
        case PLUMBER_DESTROY:
            waveset = pd->last->ud;
            sp_waveset_destroy(&waveset);
            break;
        default:
            plumber_print(pd, "waveset: Unknown mode!\n");
            break;
    }
    return PLUMBER_OK;
}
开发者ID:PaulBatchelor,项目名称:AudioKit,代码行数:60,代码来源:waveset.c


示例2: sporth_ref

int sporth_ref(sporth_stack *stack, void *ud)
{
    plumber_data *pd = ud;
    char *str;
    switch(pd->mode) {
        case PLUMBER_CREATE: 
            plumber_add_ugen(pd, SPORTH_REF, NULL);
            if(sporth_check_args(stack, "s") != SPORTH_OK) {
                stack->error++;
                fprintf(stderr, "ref: Invalid arguments.");
                return PLUMBER_NOTOK;
            }
            sporth_stack_pop_string(stack);
            break;
        case PLUMBER_INIT: 
            str = sporth_stack_pop_string(stack);
            plumber_ftmap_delete(pd, 0);
            /* get reference of the *next* pipe in the plumbing */
            plumber_ftmap_add_userdata(pd, str, pd->next->ud);
            plumber_ftmap_delete(pd, 1);
            break;
        case PLUMBER_COMPUTE: 
            break;
        case PLUMBER_DESTROY: 
            break;
    }
    return PLUMBER_OK;
}
开发者ID:Luckyncl,项目名称:3rd,代码行数:28,代码来源:ref.c


示例3: sporth_in

int sporth_in(sporth_stack *stack, void *ud)
{
    plumber_data *pd = ud;

    SPFLOAT out;
    sp_in *data;
    switch(pd->mode){
        case PLUMBER_CREATE:
            sp_in_create(&data);
            plumber_add_ugen(pd, SPORTH_IN, data);
            break;
        case PLUMBER_INIT:
            data = pd->last->ud;
            sp_in_init(pd->sp, data);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_COMPUTE:
            data = pd->last->ud;
            sp_in_compute(pd->sp, data, NULL, &out);
            sporth_stack_push_float(stack, out);
            break;
        case PLUMBER_DESTROY:
            data = pd->last->ud;
            sp_in_destroy(&data);
            break;
        default:
           printf("Error: Unknown mode!");
           break;
    }
    return PLUMBER_OK;
}
开发者ID:BillGrim,项目名称:AudioKit,代码行数:31,代码来源:in.c


示例4: sporth_palias

int sporth_palias(sporth_stack *stack, void *ud)
{
    plumber_data *pd = ud;
    char *name;
    int id;
    SPFLOAT *foo;

    switch(pd->mode) {
        case PLUMBER_CREATE:
            plumber_add_ugen(pd, SPORTH_PALIAS, NULL);
            if(sporth_check_args(stack, "sf") != SPORTH_OK) {
                fprintf(stderr,"palias: Not enough arguments\n");
                stack->error++;
                return PLUMBER_NOTOK;
            }
            id = floor(sporth_stack_pop_float(stack));
            name = sporth_stack_pop_string(stack);
            foo = &pd->p[id];
            plumber_ftmap_delete(pd, 0);
            plumber_set_var(pd, name, foo);
            plumber_ftmap_delete(pd, 1);
            break;
        case PLUMBER_INIT:
            sporth_stack_pop_float(stack);
            sporth_stack_pop_string(stack);
            break;
        case PLUMBER_COMPUTE:
            sporth_stack_pop_float(stack);
            break;
        default:
            break;
    }

    return PLUMBER_OK;
}
开发者ID:aure,项目名称:Sporth,代码行数:35,代码来源:p.c


示例5: sporth_crossfade

int sporth_crossfade(sporth_stack *stack, void *ud)
{
    plumber_data *pd = ud;
    SPFLOAT in1;
    SPFLOAT in2;
    SPFLOAT out;
    SPFLOAT pos;
    sp_crossfade *crossfade;

    switch(pd->mode) {
        case PLUMBER_CREATE:

#ifdef DEBUG_MODE
            plumber_print(pd, "crossfade: Creating\n");
#endif

            sp_crossfade_create(&crossfade);
            plumber_add_ugen(pd, SPORTH_CROSSFADE, crossfade);
            if(sporth_check_args(stack, "fff") != SPORTH_OK) {
                plumber_print(pd,"Not enough arguments for crossfade\n");
                stack->error++;
                return PLUMBER_NOTOK;
            }
            pos = sporth_stack_pop_float(stack);
            in1 = sporth_stack_pop_float(stack);
            in2 = sporth_stack_pop_float(stack);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_INIT:

#ifdef DEBUG_MODE
            plumber_print(pd, "crossfade: Initialising\n");
#endif

            pos = sporth_stack_pop_float(stack);
            in1 = sporth_stack_pop_float(stack);
            in2 = sporth_stack_pop_float(stack);
            crossfade = pd->last->ud;
            sp_crossfade_init(pd->sp, crossfade);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_COMPUTE:
            pos = sporth_stack_pop_float(stack);
            in1 = sporth_stack_pop_float(stack);
            in2 = sporth_stack_pop_float(stack);
            crossfade = pd->last->ud;
            crossfade->pos = pos;
            sp_crossfade_compute(pd->sp, crossfade, &in1, &in2, &out);
            sporth_stack_push_float(stack, out);
            break;
        case PLUMBER_DESTROY:
            crossfade = pd->last->ud;
            sp_crossfade_destroy(&crossfade);
            break;
        default:
            plumber_print(pd, "crossfade: Unknown mode!\n");
            break;
    }
    return PLUMBER_OK;
}
开发者ID:PaulBatchelor,项目名称:AudioKit,代码行数:60,代码来源:crossfade.c


示例6: sporth_f

int sporth_f(sporth_stack *stack, void *ud)
{
    plumber_data *pd = ud;
    unsigned int fnum;
    sporth_func_d *fd;
    switch(pd->mode) {
        case PLUMBER_CREATE:

#ifdef DEBUG_MODE
            fprintf(stderr, "aux (f)unction: creating\n");
#endif
            fd = malloc(sizeof(sporth_func_d));
           if(sporth_check_args(stack, "f") != SPORTH_OK) {
                fprintf(stderr,"Not enough arguments for aux (f)unction\n");
                stack->error++;
                return PLUMBER_NOTOK;
            }
            plumber_add_ugen(pd, SPORTH_F, fd);
            break;
        case PLUMBER_INIT:

#ifdef DEBUG_MODE
            fprintf(stderr, "aux (f)unction: initialising\n");
#endif
            fnum = (int)sporth_stack_pop_float(stack);

            if(fnum > 16) {
                fprintf(stderr, "Invalid function number %d\n", fnum);
                stack->error++;
                return PLUMBER_NOTOK;
            }

            fd = pd->last->ud;
            fd->fun = pd->f[fnum];

            pd->mode = PLUMBER_CREATE;
            fd->fun(stack, ud);

            pd->mode = PLUMBER_INIT;
            fd->fun(stack, ud);

            break;

        case PLUMBER_COMPUTE:
            fnum = (int)sporth_stack_pop_float(stack);
            fd = pd->last->ud;
            fd->fun(stack, ud);
            break;

        case PLUMBER_DESTROY:
            fd = pd->last->ud;
            fd->fun(stack, ud);
            free(fd);
            break;
        default:
            fprintf(stderr, "aux (f)unction: unknown mode!\n");
            break;
    }
    return PLUMBER_OK;
}
开发者ID:laurentVeliscek,项目名称:AudioKit,代码行数:60,代码来源:f.c


示例7: sporth_delay

int sporth_delay(sporth_stack *stack, void *ud)
{
    plumber_data *pd = ud;
    SPFLOAT input;
    SPFLOAT out;
    SPFLOAT time;
    SPFLOAT feedback;
    sp_delay *delay;

    switch(pd->mode) {
        case PLUMBER_CREATE:

#ifdef DEBUG_MODE
            fprintf(stderr, "delay: Creating\n");
#endif

            sp_delay_create(&delay);
            plumber_add_ugen(pd, SPORTH_DELAY, delay);
            if(sporth_check_args(stack, "fff") != SPORTH_OK) {
                fprintf(stderr,"Not enough arguments for delay\n");
                stack->error++;
                return PLUMBER_NOTOK;
            }
            time = sporth_stack_pop_float(stack);
            feedback = sporth_stack_pop_float(stack);
            input = sporth_stack_pop_float(stack);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_INIT:

#ifdef DEBUG_MODE
            fprintf(stderr, "delay: Initialising\n");
#endif

            time = sporth_stack_pop_float(stack);
            feedback = sporth_stack_pop_float(stack);
            input = sporth_stack_pop_float(stack);
            delay = pd->last->ud;
            sp_delay_init(pd->sp, delay, time);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_COMPUTE:
            time = sporth_stack_pop_float(stack);
            feedback = sporth_stack_pop_float(stack);
            input = sporth_stack_pop_float(stack);
            delay = pd->last->ud;
            delay->feedback = feedback;
            sp_delay_compute(pd->sp, delay, &input, &out);
            sporth_stack_push_float(stack, out);
            break;
        case PLUMBER_DESTROY:
            delay = pd->last->ud;
            sp_delay_destroy(&delay);
            break;
        default:
            fprintf(stderr, "delay: Unknown mode!\n");
            break;
    }
    return PLUMBER_OK;
}
开发者ID:Ferrick90,项目名称:AudioKit,代码行数:60,代码来源:delay.c


示例8: sporth_moogladder

int sporth_moogladder(sporth_stack *stack, void *ud)
{
    plumber_data *pd = ud;
    SPFLOAT input;
    SPFLOAT out;
    SPFLOAT freq;
    SPFLOAT res;
    sp_moogladder *moogladder;

    switch(pd->mode) {
        case PLUMBER_CREATE:

#ifdef DEBUG_MODE
            fprintf(stderr, "moogladder: Creating\n");
#endif

            sp_moogladder_create(&moogladder);
            plumber_add_ugen(pd, SPORTH_MOOGLADDER, moogladder);
            if(sporth_check_args(stack, "fff") != SPORTH_OK) {
                fprintf(stderr,"Not enough arguments for moogladder\n");
                stack->error++;
                return PLUMBER_NOTOK;
            }
            res = sporth_stack_pop_float(stack);
            freq = sporth_stack_pop_float(stack);
            input = sporth_stack_pop_float(stack);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_INIT:

#ifdef DEBUG_MODE
            fprintf(stderr, "moogladder: Initialising\n");
#endif
            res = sporth_stack_pop_float(stack);
            freq = sporth_stack_pop_float(stack);
            input = sporth_stack_pop_float(stack);
            moogladder = pd->last->ud;
            sp_moogladder_init(pd->sp, moogladder);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_COMPUTE:
            res = sporth_stack_pop_float(stack);
            freq = sporth_stack_pop_float(stack);
            input = sporth_stack_pop_float(stack);
            moogladder = pd->last->ud;
            moogladder->freq = freq;
            moogladder->res = res;
            sp_moogladder_compute(pd->sp, moogladder, &input, &out);
            sporth_stack_push_float(stack, out);
            break;
        case PLUMBER_DESTROY:
            moogladder = pd->last->ud;
            sp_moogladder_destroy(&moogladder);
            break;
        default:
            fprintf(stderr, "moogladder: Unknown mode!\n");
            break;
    }
    return PLUMBER_OK;
}
开发者ID:Ferrick90,项目名称:AudioKit,代码行数:60,代码来源:moogladder.c


示例9: sporth_comb

int sporth_comb(sporth_stack *stack, void *ud)
{
    plumber_data *pd = ud;
    SPFLOAT input;
    SPFLOAT out;
    SPFLOAT looptime;
    SPFLOAT revtime;
    sp_comb *comb;

    switch(pd->mode) {
        case PLUMBER_CREATE:

#ifdef DEBUG_MODE
            plumber_print(pd, "comb: Creating\n");
#endif

            sp_comb_create(&comb);
            plumber_add_ugen(pd, SPORTH_COMB, comb);
            if(sporth_check_args(stack, "fff") != SPORTH_OK) {
                plumber_print(pd,"Not enough arguments for comb\n");
                stack->error++;
                return PLUMBER_NOTOK;
            }
            looptime = sporth_stack_pop_float(stack);
            revtime = sporth_stack_pop_float(stack);
            input = sporth_stack_pop_float(stack);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_INIT:

#ifdef DEBUG_MODE
            plumber_print(pd, "comb: Initialising\n");
#endif

            looptime = sporth_stack_pop_float(stack);
            revtime = sporth_stack_pop_float(stack);
            input = sporth_stack_pop_float(stack);
            comb = pd->last->ud;
            sp_comb_init(pd->sp, comb, looptime);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_COMPUTE:
            looptime = sporth_stack_pop_float(stack);
            revtime = sporth_stack_pop_float(stack);
            input = sporth_stack_pop_float(stack);
            comb = pd->last->ud;
            comb->revtime = revtime;
            sp_comb_compute(pd->sp, comb, &input, &out);
            sporth_stack_push_float(stack, out);
            break;
        case PLUMBER_DESTROY:
            comb = pd->last->ud;
            sp_comb_destroy(&comb);
            break;
        default:
            plumber_print(pd, "comb: Unknown mode!\n");
            break;
    }
    return PLUMBER_OK;
}
开发者ID:PaulBatchelor,项目名称:AudioKit,代码行数:60,代码来源:comb.c


示例10: sporth_bpm2dur

int sporth_bpm2dur(sporth_stack *stack, void *ud)
{
    plumber_data *pd = ud;
    bpm2val *data;
    SPFLOAT val;
    switch(pd->mode){
        case PLUMBER_CREATE:
#ifdef DEBUG_MODE
            fprintf(stderr, "bpm2dur: Creating\n");
#endif
            data = malloc(sizeof(bpm2val));
            data->pbpm = -100;
            data->val= -100;
            if(sporth_check_args(stack, "f") != SPORTH_OK) {
                fprintf(stderr, "bpm2dur: not enough args\n");
                stack->error++;
                return PLUMBER_NOTOK;
            }
            val = sporth_stack_pop_float(stack);
            data->pbpm= val;
            data->val= 60.0 / val;
            plumber_add_ugen(pd, SPORTH_BPM2DUR, data);
            sporth_stack_push_float(stack, data->val);
            break;
        case PLUMBER_INIT:
#ifdef DEBUG_MODE
            fprintf(stderr, "bpm2dur: Initializing\n");
#endif
            data = pd->last->ud;
            val = sporth_stack_pop_float(stack);

            if(data->pbpm != val) {
                data->pbpm= val;
                data->val= 60.0 / val;
            }

            sporth_stack_push_float(stack, data->val);
            break;
        case PLUMBER_COMPUTE:
            data = pd->last->ud;
            val = sporth_stack_pop_float(stack);
            if(data->pbpm  != val) {
                data->pbpm= val;
                data->val = 60.0 / val;
            }
            sporth_stack_push_float(stack, data->val);
            break;
        case PLUMBER_DESTROY:
            data = pd->last->ud;
            free(data);
            break;
        default:
            fprintf(stderr,"bpm2dur: unknown mode!");
            stack->error++;
            return PLUMBER_NOTOK;
            break;
    }
    return PLUMBER_OK;
}
开发者ID:Ferrick90,项目名称:AudioKit,代码行数:59,代码来源:bpm.c


示例11: sporth_maygate

int sporth_maygate(sporth_stack *stack, void *ud)
{
    plumber_data *pd = ud;
    SPFLOAT trig;
    SPFLOAT out;
    SPFLOAT prob;
    sp_maygate *maygate;

    switch(pd->mode) {
        case PLUMBER_CREATE:

#ifdef DEBUG_MODE
            fprintf(stderr, "maygate: Creating\n");
#endif

            sp_maygate_create(&maygate);
            plumber_add_ugen(pd, SPORTH_MAYGATE, maygate);
            if(sporth_check_args(stack, "ff") != SPORTH_OK) {
                fprintf(stderr,"Not enough arguments for maygate\n");
                stack->error++;
                return PLUMBER_NOTOK;
            }
            prob = sporth_stack_pop_float(stack);
            trig = sporth_stack_pop_float(stack);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_INIT:

#ifdef DEBUG_MODE
            fprintf(stderr, "maygate: Initialising\n");
#endif

            prob = sporth_stack_pop_float(stack);
            trig = sporth_stack_pop_float(stack);
            maygate = pd->last->ud;
            sp_maygate_init(pd->sp, maygate);
            maygate->mode = 0;
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_COMPUTE:
            prob = sporth_stack_pop_float(stack);
            trig = sporth_stack_pop_float(stack);
            maygate = pd->last->ud;
            maygate->prob = prob;
            sp_maygate_compute(pd->sp, maygate, &trig, &out);
            sporth_stack_push_float(stack, out);
            break;
        case PLUMBER_DESTROY:
            maygate = pd->last->ud;
            sp_maygate_destroy(&maygate);
            break;
        default:
            fprintf(stderr, "maygate: Unknown mode!\n");
            break;
    }
    return PLUMBER_OK;
}
开发者ID:Ferrick90,项目名称:AudioKit,代码行数:57,代码来源:maygate.c


示例12: sporth_print

int sporth_print(sporth_stack *stack, void *ud)
{
    plumber_data *pd = ud;
    sporth_print_d *prnt;
    char *str = NULL; 
    SPFLOAT val = 0;
    switch(pd->mode) {
        case PLUMBER_CREATE:

#ifdef DEBUG_MODE
            fprintf(stderr, "print: Creating\n");
#endif
            prnt = malloc(sizeof(sporth_print_d));
            plumber_add_ugen(pd, SPORTH_PRINT, prnt);
            if(sporth_check_args(stack, "fs") != SPORTH_OK) {
                fprintf(stderr,"Not enough arguments for print\n");
                stack->error++;
                return PLUMBER_NOTOK;
            }
            str = sporth_stack_pop_string(stack);
            val = sporth_stack_pop_float(stack);
            
            strncpy(prnt->label, str, 128);
            prnt->pval = val; 
            prnt->init = 1;
            sporth_stack_push_float(stack, val);
            break;
        case PLUMBER_INIT:

#ifdef DEBUG_MODE
            fprintf(stderr, "print: Initialising\n");
#endif
            prnt = pd->last->ud;
            str = sporth_stack_pop_string(stack);
            val = sporth_stack_pop_float(stack);
            sporth_stack_push_float(stack, val);
            break;
        case PLUMBER_COMPUTE:
            prnt = pd->last->ud;
            val = sporth_stack_pop_float(stack);
            if(val != prnt->pval || prnt->init) {
                prnt->pval = val;
                prnt->init = 0;
                printf("%s: %g\n", prnt->label, val);
            }
            sporth_stack_push_float(stack, val);
            break;
        case PLUMBER_DESTROY:
            prnt = pd->last->ud;
            free(prnt);
            break;
        default:
            fprintf(stderr, "print: Unknown mode!\n");
            break;
    }
    return PLUMBER_OK;
}
开发者ID:laurentVeliscek,项目名称:AudioKit,代码行数:57,代码来源:print.c


示例13: sporth_dmetro

int sporth_dmetro(sporth_stack *stack, void *ud)
{
    plumber_data *pd = ud;
    SPFLOAT out;
    SPFLOAT time;
    sp_dmetro *dmetro;

    switch(pd->mode) {
        case PLUMBER_CREATE:

#ifdef DEBUG_MODE
            fprintf(stderr, "dmetro: Creating\n");
#endif

            sp_dmetro_create(&dmetro);
            plumber_add_ugen(pd, SPORTH_DMETRO, dmetro);
            if(sporth_check_args(stack, "f") != SPORTH_OK) {
                fprintf(stderr,"Not enough arguments for dmetro\n");
                stack->error++;
                return PLUMBER_NOTOK;
            }
            time = sporth_stack_pop_float(stack);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_INIT:

#ifdef DEBUG_MODE
            fprintf(stderr, "dmetro: Initialising\n");
#endif

            time = sporth_stack_pop_float(stack);
            dmetro = pd->last->ud;
            sp_dmetro_init(pd->sp, dmetro);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_COMPUTE:
            if(sporth_check_args(stack, "f") != SPORTH_OK) {
                fprintf(stderr,"Not enough arguments for dmetro\n");
                stack->error++;
                return PLUMBER_NOTOK;
            }
            time = sporth_stack_pop_float(stack);
            dmetro = pd->last->ud;
            dmetro->time = time;
            sp_dmetro_compute(pd->sp, dmetro, NULL, &out);
            sporth_stack_push_float(stack, out);
            break;
        case PLUMBER_DESTROY:
            dmetro = pd->last->ud;
            sp_dmetro_destroy(&dmetro);
            break;
        default:
            fprintf(stderr, "dmetro: Uknown mode!\n");
            break;
    }
    return PLUMBER_OK;
}
开发者ID:BillGrim,项目名称:AudioKit,代码行数:57,代码来源:dmetro.c


示例14: sporth_pdhalf

int sporth_pdhalf(sporth_stack *stack, void *ud)
{
    plumber_data *pd = ud;
    SPFLOAT sig;
    SPFLOAT out;
    SPFLOAT amount;
    sp_pdhalf *pdhalf;

    switch(pd->mode) {
        case PLUMBER_CREATE:

#ifdef DEBUG_MODE
            fprintf(stderr, "pdhalf: Creating\n");
#endif

            sp_pdhalf_create(&pdhalf);
            plumber_add_ugen(pd, SPORTH_PDHALF, pdhalf);
            if(sporth_check_args(stack, "ff") != SPORTH_OK) {
                fprintf(stderr,"Not enough arguments for pdhalf\n");
                stack->error++;
                return PLUMBER_NOTOK;
            }
            amount = sporth_stack_pop_float(stack);
            sig = sporth_stack_pop_float(stack);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_INIT:

#ifdef DEBUG_MODE
            fprintf(stderr, "pdhalf: Initialising\n");
#endif

            amount = sporth_stack_pop_float(stack);
            sig = sporth_stack_pop_float(stack);
            pdhalf = pd->last->ud;
            sp_pdhalf_init(pd->sp, pdhalf);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_COMPUTE:
            amount = sporth_stack_pop_float(stack);
            sig = sporth_stack_pop_float(stack);
            pdhalf = pd->last->ud;
            pdhalf->amount = amount;
            sp_pdhalf_compute(pd->sp, pdhalf, &sig, &out);
            sporth_stack_push_float(stack, out);
            break;
        case PLUMBER_DESTROY:
            pdhalf = pd->last->ud;
            sp_pdhalf_destroy(&pdhalf);
            break;
        default:
            fprintf(stderr, "pdhalf: Unknown mode!\n");
            break;
    }
    return PLUMBER_OK;
}
开发者ID:Luckyncl,项目名称:3rd,代码行数:56,代码来源:pdhalf.c


示例15: sporth_blsaw

int sporth_blsaw(sporth_stack *stack, void *ud)
{
    plumber_data *pd = ud;
    SPFLOAT out;
    SPFLOAT freq;
    SPFLOAT amp;
    sp_blsaw *blsaw;

    switch(pd->mode) {
        case PLUMBER_CREATE:

#ifdef DEBUG_MODE
            fprintf(stderr, "blsaw: Creating\n");
#endif

            sp_blsaw_create(&blsaw);
            plumber_add_ugen(pd, SPORTH_SAW, blsaw);
            if(sporth_check_args(stack, "ff") != SPORTH_OK) {
                fprintf(stderr,"Not enough arguments for blsaw\n");
                stack->error++;
                return PLUMBER_NOTOK;
            }
            amp = sporth_stack_pop_float(stack);
            freq = sporth_stack_pop_float(stack);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_INIT:

#ifdef DEBUG_MODE
            fprintf(stderr, "blsaw: Initialising\n");
#endif
            amp = sporth_stack_pop_float(stack);
            freq = sporth_stack_pop_float(stack);
            blsaw = pd->last->ud;
            sp_blsaw_init(pd->sp, blsaw);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_COMPUTE:
            amp = sporth_stack_pop_float(stack);
            freq = sporth_stack_pop_float(stack);
            blsaw = pd->last->ud;
            *blsaw->freq = freq;
            *blsaw->amp = amp;
            sp_blsaw_compute(pd->sp, blsaw, NULL, &out);
            sporth_stack_push_float(stack, out);
            break;
        case PLUMBER_DESTROY:
            blsaw = pd->last->ud;
            sp_blsaw_destroy(&blsaw);
            break;
        default:
            fprintf(stderr, "blsaw: Unknown mode!\n");
            break;
    }
    return PLUMBER_OK;
}
开发者ID:Ferrick90,项目名称:AudioKit,代码行数:56,代码来源:blsaw.c


示例16: sporth_clip

int sporth_clip(sporth_stack *stack, void *ud)
{
    plumber_data *pd = ud;
    SPFLOAT in;
    SPFLOAT out;
    SPFLOAT lim;
    sp_clip *clip;

    switch(pd->mode) {
        case PLUMBER_CREATE:

#ifdef DEBUG_MODE
            plumber_print(pd, "clip: Creating\n");
#endif

            sp_clip_create(&clip);
            plumber_add_ugen(pd, SPORTH_CLIP, clip);
            if(sporth_check_args(stack, "ff") != SPORTH_OK) {
                plumber_print(pd,"Not enough arguments for clip\n");
                stack->error++;
                return PLUMBER_NOTOK;
            }
            lim = sporth_stack_pop_float(stack);
            in = sporth_stack_pop_float(stack);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_INIT:

#ifdef DEBUG_MODE
            plumber_print(pd, "clip: Initialising\n");
#endif
            lim = sporth_stack_pop_float(stack);
            in = sporth_stack_pop_float(stack);
            clip = pd->last->ud;
            sp_clip_init(pd->sp, clip);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_COMPUTE:
            lim = sporth_stack_pop_float(stack);
            in = sporth_stack_pop_float(stack);
            clip = pd->last->ud;
            clip->lim = lim;
            sp_clip_compute(pd->sp, clip, &in, &out);
            sporth_stack_push_float(stack, out);
            break;
        case PLUMBER_DESTROY:
            clip = pd->last->ud;
            sp_clip_destroy(&clip);
            break;
        default:
            plumber_print(pd, "clip: Unknown mode!\n");
            break;
    }
    return PLUMBER_OK;
}
开发者ID:PaulBatchelor,项目名称:AudioKit,代码行数:55,代码来源:clip.c


示例17: sporth_atone

int sporth_atone(sporth_stack *stack, void *ud)
{
    plumber_data *pd = ud;
    SPFLOAT in;
    SPFLOAT out;
    SPFLOAT hp;
    sp_atone *atone;

    switch(pd->mode) {
        case PLUMBER_CREATE:

#ifdef DEBUG_MODE
            fprintf(stderr, "atone: Creating\n");
#endif

            sp_atone_create(&atone);
            plumber_add_ugen(pd, SPORTH_ATONE, atone);
            if(sporth_check_args(stack, "f") != SPORTH_OK) {
                fprintf(stderr,"Not enough arguments for atone\n");
                stack->error++;
                return PLUMBER_NOTOK;
            }
            hp = sporth_stack_pop_float(stack);
            in = sporth_stack_pop_float(stack);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_INIT:

#ifdef DEBUG_MODE
            fprintf(stderr, "atone: Initialising\n");
#endif
            hp = sporth_stack_pop_float(stack);
            in = sporth_stack_pop_float(stack);
            atone = pd->last->ud;
            sp_atone_init(pd->sp, atone);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_COMPUTE:
            hp = sporth_stack_pop_float(stack);
            in = sporth_stack_pop_float(stack);
            atone = pd->last->ud;
            atone->hp = hp;
            sp_atone_compute(pd->sp, atone, &in, &out);
            sporth_stack_push_float(stack, out);
            break;
        case PLUMBER_DESTROY:
            atone = pd->last->ud;
            sp_atone_destroy(&atone);
            break;
        default:
            fprintf(stderr, "atone: Uknown mode!\n");
            break;
    }
    return PLUMBER_OK;
}
开发者ID:BillGrim,项目名称:AudioKit,代码行数:55,代码来源:atone.c


示例18: sporth_phasor

int sporth_phasor(sporth_stack *stack, void *ud)
{
    plumber_data *pd = ud;
    SPFLOAT out;
    SPFLOAT iphs;
    SPFLOAT freq;
    sp_phasor *phasor;

    switch(pd->mode) {
        case PLUMBER_CREATE:

#ifdef DEBUG_MODE
            fprintf(stderr, "phasor: Creating\n");
#endif

            sp_phasor_create(&phasor);
            plumber_add_ugen(pd, SPORTH_PHASOR, phasor);
            if(sporth_check_args(stack, "ff") != SPORTH_OK) {
                fprintf(stderr,"Not enough arguments for phasor\n");
                stack->error++;
                return PLUMBER_NOTOK;
            }
            iphs = sporth_stack_pop_float(stack);
            freq = sporth_stack_pop_float(stack);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_INIT:

#ifdef DEBUG_MODE
            fprintf(stderr, "phasor: Initialising\n");
#endif
            iphs = sporth_stack_pop_float(stack);
            freq = sporth_stack_pop_float(stack);
            phasor = pd->last->ud;
            sp_phasor_init(pd->sp, phasor, iphs);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_COMPUTE:
            iphs = sporth_stack_pop_float(stack);
            freq = sporth_stack_pop_float(stack);
            phasor = pd->last->ud;
            phasor->freq = freq;
            sp_phasor_compute(pd->sp, phasor, NULL, &out);
            sporth_stack_push_float(stack, out);
            break;
        case PLUMBER_DESTROY:
            phasor = pd->last->ud;
            sp_phasor_destroy(&phasor);
            break;
        default:
            fprintf(stderr, "phasor: Unknown mode!\n");
            break;
    }
    return PLUMBER_OK;
}
开发者ID:Ferrick90,项目名称:AudioKit,代码行数:55,代码来源:phasor.c


示例19: sporth_switch

int sporth_switch(sporth_stack *stack, void *ud)
{
    plumber_data *pd = ud;
    SPFLOAT trig;
    SPFLOAT input_1;
    SPFLOAT input_2;
    SPFLOAT out;
    sp_switch *sw;

    switch(pd->mode) {
        case PLUMBER_CREATE:

#ifdef DEBUG_MODE
            plumber_print(pd, "switch: creating\n");
#endif

            sp_switch_create(&sw);
            plumber_add_ugen(pd, SPORTH_SWITCH, sw);
            break;
        case PLUMBER_INIT:

#ifdef DEBUG_MODE
            plumber_print(pd, "switch: initialising\n");
#endif

            if(sporth_check_args(stack, "fff") != SPORTH_OK) {
                plumber_print(pd,"Not enough arguments for switch\n");
                stack->error++;
                return PLUMBER_NOTOK;
            }
            trig = sporth_stack_pop_float(stack);
            input_1 = sporth_stack_pop_float(stack);
            input_2 = sporth_stack_pop_float(stack);
            sw = pd->last->ud;
            sp_switch_init(pd->sp, sw);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_COMPUTE:
            input_2 = sporth_stack_pop_float(stack);
            input_1 = sporth_stack_pop_float(stack);
            trig = sporth_stack_pop_float(stack);
            sw = pd->last->ud;
            sp_switch_compute(pd->sp, sw, &trig, &input_1, &input_2, &out);
            sporth_stack_push_float(stack, out);
            break;
        case PLUMBER_DESTROY:
            sw = pd->last->ud;
            sp_switch_destroy(&sw);
            break;
        default:
            plumber_print(pd, "switch: unknown mode!\n");
            break;
    }
    return PLUMBER_OK;
}
开发者ID:PaulBatchelor,项目名称:AudioKit,代码行数:55,代码来源:switch.c


示例20: sporth_sdelay

int sporth_sdelay(sporth_stack *stack, void *ud)
{
    plumber_data *pd = ud;
    SPFLOAT input;
    SPFLOAT out;
    SPFLOAT size;
    sp_sdelay *sdelay;

    switch(pd->mode) {
        case PLUMBER_CREATE:

#ifdef DEBUG_MODE
            plumber_print(pd, "sdelay: Creating\n");
#endif

            sp_sdelay_create(&sdelay);
            plumber_add_ugen(pd, SPORTH_SDELAY, sdelay);
            if(sporth_check_args(stack, "ff") != SPORTH_OK) {
                plumber_print(pd,"Not enough arguments for sdelay\n");
                stack->error++;
                return PLUMBER_NOTOK;
            }
            size = sporth_stack_pop_float(stack);
            input = sporth_stack_pop_float(stack);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_INIT:

#ifdef DEBUG_MODE
            plumber_print(pd, "sdelay: Initialising\n");
#endif

            size = sporth_stack_pop_float(stack);
            input = sporth_stack_pop_float(stack);
            sdelay = pd->last->ud;
            sp_sdelay_init(pd->sp, sdelay, size);
            sporth_stack_push_float(stack, 0);
            break;
        case PLUMBER_COMPUTE:
            size = sporth_stack_pop_float(stack);
            input = sporth_stack_pop_float(stack);
            sdelay = pd->last->ud;
            sp_sdelay_compute(pd->sp, sdelay, &input, &out);
            sporth_stack_push_float(stack, out);
            break;
        case PLUMBER_DESTROY:
            sdelay = pd->last->ud;
            sp_sdelay_destroy(&sdelay);
            break;
        default:
            plumber_print(pd, "sdelay: Unknown mode!\n");
            break;
    }
    return PLUMBER_OK;
}
开发者ID:PaulBatchelor,项目名称:AudioKit,代码行数:55,代码来源:sdelay.c



注:本文中的plumber_add_ugen函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ plumed_assert函数代码示例发布时间:2022-05-30
下一篇:
C++ pluma_debug函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap