#include "tscope_stop.c"

// "K" = left mouse response
// "L" = right mouse response
// when auditory stop signal is presented, do not respond

int SSD;

void trial()
{
    int tmp1, tmp2, tmp3, tmp4;
    __int64 t1, t2, e1, e2;

    tmp1 = ts_rint(2);
    tmp2 = ts_rint(2);
    tmp3 = 0;
    tmp4 = 0;

    ts_vsync(&t1, &e1);
    if (tmp1 % 2 == 0)          // present stimuli
        ts_printf_centre(0, 0, "K");
    else
        ts_printf_centre(0, 0, "L");

    if (tmp2 % 2 == 0)          // no signal trial 
        tmp3 = ts_go(&t2, &e2);

    else {
        tmp3 = ts_stop(&t2, &e2, SSD);  // signal trial
        SSD = stopsignal.ssd;   // needed when tracking procedure is 
        // implemented, since after each signal 
        // trial, the SSD is adjusted
    }



    if (tmp3 != 0)
        tmp4 = ttm(t2 - t1);

    if (tmp2 % 2 == 0)          // no signal trial 
        fprintf(stderr, "%d\t%d\n", tmp3, tmp4);

    else
        fprintf(stderr, "%d\t%d\t%d\n", tmp3, tmp4, SSD);   // SSD is adjusted ssd

    ts_clrscr();
    ts_wait(mtt(1000));
}


void main()
{
    int i;

    ts_init();
    stop_init();                // always after ts_init(); 
    SSD = 250;                  // start value stop signal delay = 250 ms

    ts_defkey(M1);
    ts_defkey(M2);

// 5 trials with default values of the stop signal task

    for (i = 0; i < 5; i++) {
        trial();
    }

// some changes in the parameters of the stop signal task, dependent of the trial

    for (i = 0; i < 5; i++) {
        stopsignal.step = 15 + i * 5;   // 15 ms change in staircase tracking in stead of the default 50 ms
        stopsignal.freq = 250 + i * 50; // changes in frequency of the auditory stop signal
        trial();
    }

}

END_OF_MAIN();


top
Persoonlijke pagina Universiteit GentTscope
Allegro | Cygwin | Gcc
© See license.html for copyright information