erase a sound after XX ms


erase a sound after XX ms

Author
Message
nakayama
nakayama
Esteemed Member
Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)

Group: Forum Members
Posts: 40, Visits: 216
Dear Inquisit Community
I wonder if we could erase a sound after, say 50 ms (50 ms presentation) in:
The response is tap, and the sound presentation is not interfered by the response.

<values>
/interval=1000
</values>

<trial tap>
/ ontrialbegin = [trial.tap.insertstimulustime(sound.tone,values.interval);]
/ stimulustimes = [0=screen,stimulus1,stimulus2]
/ inputdevice = mouse
</trial>

<sound tone>
/ items = ("1000Hz.wav")
/ playthrough = false
</sound>
Thank you in advance.
Wink
Dave
Dave
Supreme Being
Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)

Group: Administrators
Posts: 9.7K, Visits: 45K
nakayama - 8/12/2019
Dear Inquisit Community
I wonder if we could erase a sound after, say 50 ms (50 ms presentation) in:
The response is tap, and the sound presentation is not interfered by the response.

<values>
/interval=1000
</values>

<trial tap>
/ ontrialbegin = [trial.tap.insertstimulustime(sound.tone,values.interval);]
/ stimulustimes = [0=screen,stimulus1,stimulus2]
/ inputdevice = mouse
</trial>

<sound tone>
/ items = ("1000Hz.wav")
/ playthrough = false
</sound>
Thank you in advance.
Wink

Sorry, I don't understand what exactly you want to do. Why don't you simply make the sound file 50ms long? There is no need to erase it when it simply ends.

nakayama
nakayama
Esteemed Member
Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)

Group: Forum Members
Posts: 40, Visits: 216
Dave - 8/13/2019
nakayama - 8/12/2019
Dear Inquisit Community
I wonder if we could erase a sound after, say 50 ms (50 ms presentation) in:
The response is tap, and the sound presentation is not interfered by the response.

<values>
/interval=1000
</values>

<trial tap>
/ ontrialbegin = [trial.tap.insertstimulustime(sound.tone,values.interval);]
/ stimulustimes = [0=screen,stimulus1,stimulus2]
/ inputdevice = mouse
</trial>

<sound tone>
/ items = ("1000Hz.wav")
/ playthrough = false
</sound>
Thank you in advance.
Wink

Sorry, I don't understand what exactly you want to do. Why don't you simply make the sound file 50ms long? There is no need to erase it when it simply ends.

Hi Dave. I have figured it out by cutting the duration of the sound file into 50ms Wink
may I ask another question down here?
every time participants clicked the screen and then a dot appeared at the place where it was clicked.
 I wish the dot produced on the n-1 trial remained on the screen until the onset of the n+1 trial.
  so there are always two dots (produced on the n-1 and the n trials) showed on the screen.
how to fix the following script?
Thank you in advanceWink



Attachments
sample.iqx (2 views, 809 bytes)
Dave
Dave
Supreme Being
Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)

Group: Administrators
Posts: 9.7K, Visits: 45K
nakayama - 8/13/2019
Dave - 8/13/2019
nakayama - 8/12/2019
Dear Inquisit Community
I wonder if we could erase a sound after, say 50 ms (50 ms presentation) in:
The response is tap, and the sound presentation is not interfered by the response.

<values>
/interval=1000
</values>

<trial tap>
/ ontrialbegin = [trial.tap.insertstimulustime(sound.tone,values.interval);]
/ stimulustimes = [0=screen,stimulus1,stimulus2]
/ inputdevice = mouse
</trial>

<sound tone>
/ items = ("1000Hz.wav")
/ playthrough = false
</sound>
Thank you in advance.
Wink

Sorry, I don't understand what exactly you want to do. Why don't you simply make the sound file 50ms long? There is no need to erase it when it simply ends.

Hi Dave. I have figured it out by cutting the duration of the sound file into 50ms Wink
may I ask another question down here?
every time participants clicked the screen and then a dot appeared at the place where it was clicked.
 I wish the dot produced on the n-1 trial remained on the screen until the onset of the n+1 trial.
  so there are always two dots (produced on the n-1 and the n trials) showed on the screen.
how to fix the following script?
Thank you in advanceWink



I you want the dot visible during both trials, you need to have both trials display it:

<block myblock>
/ trials = [1-10=tap]
/ screencolor = white
</block>

<values>
/ ay=0
/ ax=0
/trialnum=0
</values>


<trial tap>
/ ontrialend = [values.trialnum+=1]
/ validresponse = (screen)
/ stimulustimes = [0=screen, a]
/ ontrialend = [values.ax=(trial.tap.responsex/display.width)*100%; values.ay=(trial.tap.responsey/display.height)*100%]
/ inputdevice = mouse
/ branch = [trial.release]
</trial>


<trial release>
/ stimulustimes = [0=a]
/ validresponse =(lbuttondown)
/ inputdevice = mouse
</trial>

<shape a>
/ color = blue
/ shape = circle
/ position = (values.ax,values.ay)
/ size = (10px,10px)
/ erase = false
</shape>

<shape screen>
/ shape = rectangle
/ color = white
/ size = (1920px, 1200px)
/ position = (960px, 600px)
/ erase = false
</shape>

Otherwise the dot painted to the screen by <trial release> will be overwritten by the "screen" stimulus displayed by <trial tap>.

nakayama
nakayama
Esteemed Member
Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)

Group: Forum Members
Posts: 40, Visits: 216
Thank you this works! I wonder why I need to click twice to produce the second dot? After the first dot, I clicked the screen but no dot produced, I had to click the screen again to produce the second one. Could I produce one dot per click? Like this session:

1st trial— 2nd trial—— 3rd trial
Click-dot1 Click-dot2 dot1 disappeared at onset, click-dot3

Thank youSmile
Dave
Dave
Supreme Being
Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)

Group: Administrators
Posts: 9.7K, Visits: 45K
nakayama - 8/13/2019
Thank you this works! I wonder why I need to click twice to produce the second dot? After the first dot, I clicked the screen but no dot produced, I had to click the screen again to produce the second one. Could I produce one dot per click? Like this session:

1st trial— 2nd trial—— 3rd trial
Click-dot1 Click-dot2 dot1 disappeared at onset, click-dot3

Thank youSmile

Not sure I understand. <trial release> does not "produce" a new dot upon click -- it merely displays the dot produced by click in the preceeding <trial tap>.

nakayama
nakayama
Esteemed Member
Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)

Group: Forum Members
Posts: 40, Visits: 216
I ran the script you provided and The current script works like this: first time I clicked the screen, produced a dot. Then the 2nd click, no dots produced. The third time I clicked produced the second dot. The 4th time I clicked erased the first dot.

The thing I want is:
first time I clicked the screen, produced a dot. Then the 2nd click, the second dots produced. Now two dots remain visible on the screen. The 1st dot erased(without extra click) at the beginning of the 3rd tap trial. The 3rd click produced the 3rd dot. Now two dots (2nd,3rd) remains visible....

Is there a way to fix the current scriptSmile?

Dave
Dave
Supreme Being
Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)Supreme Being (665K reputation)

Group: Administrators
Posts: 9.7K, Visits: 45K
nakayama - 8/13/2019
I ran the script you provided and The current script works like this: first time I clicked the screen, produced a dot. Then the 2nd click, no dots produced. The third time I clicked produced the second dot. The 4th time I clicked erased the first dot. The thing I want is: first time I clicked the screen, produced a dot. Then the 2nd click, the second dots produced. Now two dots remain visible on the screen. The 1st dot erased(without extra click) at the beginning of the 3rd tap trial. The 3rd click produced the 3rd dot. Now two dots (2nd,3rd) remains visible....Is there a way to fix the current scriptSmile?

Then you need two "dot" stimuli and you need to actually have your release trial set the position of its dot.

<block myblock>
/ trials = [1-10=tap]
/ screencolor = white
</block>

<values>
/ ay=0
/ ax=0
/ by=0
/ bx=0
/trialnum=0
</values>


<trial tap>
/ ontrialend = [values.trialnum+=1]
/ validresponse = (screen)
/ stimulustimes = [0=screen, a,b]
/ ontrialend = [values.ax=(trial.tap.responsex/display.width)*100%; values.ay=(trial.tap.responsey/display.height)*100%]
/ inputdevice = mouse
/ branch = [trial.release]
</trial>

<trial release>
/ stimulustimes = [0=a,b]
/ ontrialend = [values.bx=(trial.release.responsex/display.width)*100%; values.by=(trial.release.responsey/display.height)*100%]
/ validresponse =(lbuttondown)
/ inputdevice = mouse
</trial>

<shape a>
/ color = blue
/ shape = circle
/ position = (values.ax,values.ay)
/ size = (10px,10px)
/ erase = false
</shape>

<shape b>
/ color = green
/ shape = circle
/ position = (values.bx,values.by)
/ size = (10px,10px)
/ erase = false
</shape>

<shape screen>
/ shape = rectangle
/ color = white
/ size = (1920px, 1200px)
/ position = (960px, 600px)
/ erase = false
</shape>

GO


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....






Millisecond Forums


Search