control when to stop a sound stimulus


Author
Message
nakayama
nakayama
Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)
Group: Forum Members
Posts: 72, Visits: 408
As always, thank you, Dave.
Best,
nakayama
Nakayama Yao
Nakayama Yao
Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)
Group: Forum Members
Posts: 39, Visits: 230
Hi, Dave. 
I am wondering whether it is possible to track the position of the target, and erase it at random stimulustime, given that its position and onset varies randomly?  
So that they can appear and be erased randomly.
I guess should I use ontrialbegin? Thank you.

<list erase>
/ items = (2500,2600,2700,2800,2900)
/ selectionmode=random
/ selectionrate = always
</list>

<list targetduration>
/ items = (2100,2200,2300,2400,2500)
/ selectionmode=random
/ selectionrate = always
</list>
<trial timepresent1>
...
/ ontrialend = [trial.timepresent1.resetstimulusframes(); list.targetduration.reset(); ]
</trial>  

             

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
Yes, and it works exactly like what you've already done. You've used the insertstimulustime() function to display your target(s) at a random onsets. You only need to do the exact same thing for the stimuli that erase the respective target(s).

nakayama
nakayama
Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)
Group: Forum Members
Posts: 72, Visits: 408
Thank you for your reply. It works when the position of stimulus was set fixed. However, when the position was set according to a list:

...
/hposition=list.hpos1.nextvalue
/vposition=list.vpos1.nextvalue

How should I set the position of
if I want to erase shape 1?
It didn't erase shape1 if I input:

/hposition=shape.1.hposition
/vposition=shape.1.vposition
And input insertstimulus(shape.erase,list.eraseduration.nextvalue) under the same ontrislbegin with shape1


Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
Store positions etc. in global variables (<values> entries), reference those as needed:

<values>
/ s1h = 0
/ s1v = 0
/ s1onset = 0
/ s1duration = 0
/ s2h = 0
/ s2v = 0
/ s2onset = 0
/ s2duration = 0
</values>

<list onsets>
/ items = (2000,2500,3000,3500,4000,4500)
/ selectionrate = always
</list>

<list duration>
/ items = (100,200,300,400,500,600)
/ selectionrate = always
</list>

<list h>
/ items = (20%, 40%, 60%, 80%)
/ selectionrate = always
</list>

<list v>
/ items = (20%, 30%, 40%, 50%, 60%, 70%, 80%)
/ selectionrate = always
</list>

<block someblock>
/ trials = [1-10=sometrial]
</block>

<trial sometrial>
/ ontrialbegin = [values.s1h=list.h.nextvalue; values.s1v=list.v.nextvalue;
    values.s1onset=list.onsets.nextvalue; values.s1duration=list.duration.nextvalue;

    values.s2h=list.h.nextvalue; values.s2v=list.v.nextvalue;
    values.s2onset=list.onsets.nextvalue; values.s2duration=list.duration.nextvalue; ]
/ ontrialbegin = [trial.sometrial.insertstimulustime(shape.s1, values.s1onset);
    trial.sometrial.insertstimulustime(shape.e1, values.s1onset+values.s1duration);

    trial.sometrial.insertstimulustime(shape.s2, values.s2onset);
    trial.sometrial.insertstimulustime(shape.e2, values.s2onset+values.s2duration); ]

/ ontrialend = [trial.sometrial.resetstimulusframes(); list.h.reset(); list.v.reset(); list.duration.reset(); list.onsets.reset(); ]

/ stimulusframes = [1=info]
/ validresponse = (57)

</trial>

<shape s1>
/ shape = rectangle
/ color = red
/ size = (100px, 100px)
/ hposition = values.s1h
/ vposition = values.s1v
</shape>

<shape e1>
/ shape = rectangle
/ color = white
/ size = (100px, 100px)
/ hposition = values.s1h
/ vposition = values.s1v
</shape>

<shape s2>
/ shape = circle
/ color = green
/ size = (100px, 100px)
/ hposition = values.s2h
/ vposition = values.s2v
</shape>

<shape e2>
/ shape = circle
/ color = white
/ size = (100px, 100px)
/ hposition = values.s2h
/ vposition = values.s2v
</shape>

<text info>
/ items = ("S1: Onset = <%values.s1onset%> | Duration = <%values.s1duration%> | X = <%values.s1h%> | Y = <%values.s1v%>
~nS2: Onset = <%values.s2onset%> | Duration = <%values.s2duration%> | X = <%values.s2h%> | Y = <%values.s2v%>")
/ position = (50%, 5%)
/ erase = false
/ size = (90%, 5%)
</text>


nakayama
nakayama
Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)
Group: Forum Members
Posts: 72, Visits: 408
Thank you Dave! this scrip helped a lot!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search