Millisecond Forums

How to play a sound file by pressing on a picture

https://forums.millisecond.com/Topic2388.aspx

By plush - 1/14/2009

Hi!

I am starting to learn inquisit, and I would like to know how you can play a sound file by pressing with the mouse on a picture, without going to the next frame.

Thank you
By seandr - 1/14/2009

Hi There,


You can define a picture as follows:


<picture mypic>
/ items = ("mypic.jpg")
/ position = (50%, 20%)
</picture>


and a sound as follows:


<sound mysound>
/ items = ("mysound.wav")
</sound>


Finally, you can connect them using a <trial> element:


<trial mytrial>
/ stimulustimes = [1=mypic]
/ inputdevice = mouse
/ validresponse = (mypic)
/ responsemessage = (mypic, mysound, 0)
/ responseinterrupt = trial
</trial>


That should hopefully give you the idea.


-Sean


By plush - 1/14/2009

Thank you for the answer!

I have another question though.

How do I embed trials, within trials? Or how do I make sure both trial start at the same time? Because on one level, I am working with button press-action trials while on a second level I am working with embedding all the pictures and text on the same screen.

<trial mytrial>
/ stimulustimes = [1=play]
/ inputdevice = mouse
/ validresponse = (play)
/ responsemessage = (play, musicstimuli, 0)
/ responseinterrupt = trial
</trial>

+

<trial myturn>
/ pretrialpause = 500
/ stimulusframes=[1=musicstimulitext, participant1, participant2]
/ validresponse = (28)
/ inputdevice=keyboard
</trial>

= ..?


By Dave - 1/16/2009

I'm not sure I fully understand what you're trying to accomplish. Please take the time to write up and post a more specific description of the overall procedure you're struggling to implement. However, I might make a few general points:

(1) Trials cannot be embedded within other trials, nor can Inquisit currently start / run two (or more) seperate trials at the same time. Inquisit is currently limited to running a single trial in order to collect a single response at a given time. Inquisit currently is also restricted to a single response modality (i.e. keyboard input OR mouse input OR response box input, etc) per trial.

(2) If all you want is a more complex event following your first trial (when subjects click on a picture in order to start playing a sound), you should look at the '/ responsetrial' attribute as an alternative to the '/ responsemessage' command you're currently working with.

Hope this helps,
~Dave

P.S.: One further note - if you really want to learn how to use Inquisit, it would be a good idea to start with some of the tutorials contained in the Inquisit helpfile. This would give you a pretty good idea about how Inquisit actually works...
By plush - 1/22/2009

Thank you for the response. I understand now that one trial can only deal with one input modality. I am trying to study the tutorials in depth to get a feeling of inquisit, but I still have a few specific questions.

My experiment needs to be set up like this:

1. trial myturn1: the participant hears a song and can indicate to repeat the song or go on to the next trial.
2. trial myturn2: the participant needs to perform an action (asking a question to a confederate), and presses the next button when he/she is done.
3. trial otherturn: the participant needs to indicate whether the response the confederate gave was correct or incorrect. A score is adjusted accordingly when the next myturn trial starts.

Problems:

a) to repeat a song, should I use

trialresponse (refresh, myturn1)
OR
/ branch [ if ( trial.myturn.response == refresh) trial.myturn].

The first worked but did not reload  the same stimuli, the latter the did not work at all.

b) how can I achieve to have the same stimuli loaded across trials so that trial myturn1, myturn2, and otherturn show the same number on the scoreboard, and also show the same song title as text.

* remark: the feedback by the confederate is fixed, so I'll already know the score - pattern.

---------------------------------------------------------------------------------------
*** DEFAULTS ***
---------------------------------------------------------------------------------------       

<defaults>
/ fontstyle = ("Courier New", 14pt)
/ screencolor = (255, 255, 255)
</defaults>

<instruct>
/ nextkey = (28)
/ prevkey = (14)
/ prevlabel = "Druk op 'Backspace' om terug te gaan"
/ lastlabel = "Druk op 'Enter' om door te gaan"
/ nextlabel = "Druk op 'Enter' om door te gaan"
/ font = ("Arial", -18, 400, 0, 34)
</instruct>

***Stimuli Score Board ***

<text scoreboard1>
/ items = ("Score:")
/ position = (20%, 17%)
/ fontstyle = ("Arial", 20pt, true)
</text>

<counter scoreselector>
/ select = sequence (1-30)
</counter>

<text scoreboard2>
/ items = scoreboard
/ select = scoreselector
/ position = (20%, 20%)
/ fontstyle = ("Arial", 20pt, true)
</text>

<item scoreboard>
/ 1 = "     0     "
/ 2 = "     10     "
/ 3 = "     -5     "
/ 4 = "     5     "
/ 5 = "     15     "
/ 6 = "     25     "
/ 7 = "     35     "
/ 8 = "     20     "
/ 9 = "     30     "
/10 = "     40     "
/11 = "     25     "
/12 = "     35     "
/13 = "     45     "
/14 = "     30     "
/15 = "     40     "
/16 = "     25     "
/17 = "     10     "
/18 = "     20     "
/19 = "     30     "
/20 = "     40     "
/21 = "     25     "
/22 = "     10     "
/23 = "     -5     "
/24 = "     -20     "
/25 = "     -10     "
/26 = "     0     "
/27 = "     -15     "
/28 = "     -30     "
/29 = "     -45     "
/30 = "     -60     "
</item>

*** Stimuli Titels Liedjes*** (Song Titles)

<counter musicstimulitextselector>
/ select = sequence (1-30)
</counter>

<text musicstimulitext>
/ items = musicstimulitext
/ position = (70%, 20%)
/ select = musicstimulitextselector
</text>

<item musicstimulitext>
/ 1 = "        Op Een Grote Paddestoel        "
/ 2 = "        3 Maal 3 Is Negen        "
/ 3 = "        Iene Miene Mutte        "
/ 4 = "        Lang Zullen Ze Leven        "
/ 5 = "        Sinterklaas Kapoentje        "
/ 6 = "        Het Regent        "
/ 7 = "        Alle Eendjes Zwemmen in het Water      "
/ 8 = "        Ik Zag 2 Beren        "
/ 9 = "        O Denneboom        "
/10 = "        Schipper Mag Ik Overvaren        "
/11 = "        Hoofd, Schouders, Knie en Teen        "
/12 = "        Sinterklaasje Bonne Bonne Bonne        "
/13 = "        Ozewiezewoze        "
/14 = "        Altijd Is Kortjakje Ziek        "
/15 = "        De Mosselman        "
/16 = "        Daar Word Aan De Deur Geklopt        "
/17 = "        Slaap Kindje Slaap        "
/18 = "        Poesje Mauw        "
/19 = "        Zakdoekje Leggen        "
/20 = "        Vader Jacob        "
/21 = "        Berenbotje        "
/22 = "        Moriaantje        "
/23 = "        Dat Gaat Naar Den Bosch Toe        "
/24 = "        Altijd is Kortjakje Ziek        "
/25 = "        Rije Rije Rije        "
/26 = "        Klap Eens In De Handjes        "
/27 = "        Zevensprong        "
/28 = "        Er Is Er Een Jarig        "
/29 = "        In Holland Staat Een Huis        "
/30 = "        Zagen Zagen        "
</item>

*** Stimuli Geluiden*** (Songs)
<counter musicselector>
/ select = sequence (1-30)
</counter>

<sound musicstimuli>
/ items = musicstimuli
/ select = musicselector
</sound>

<item musicstimuli>
/ 1 = "1.paddestoel.wav"
/ 2 = "2.3x3.wav"
/ 3 = "3.ienemiene.wav"
/ 4 = "4.langleven.wav"
/ 5 = "5.kapoentje.wav"
/ 6 = "6.hetregent.wav"
/ 7 = "7.eendzwem.wav"
/ 8 = "8.2beren.wav"
/ 9 = "9.denneboom.wav"
/10 = "10.schipper.wav"
/11 = "11.hoofd.wav"
/12 = "12.sintbonne.wav"
/13 = "13.ozewiezewoze.wav"
/14 = "14.kortjakje.wav"
/15 = "15.mosselman.wav"
/16 = "16.deurgeklopt.wav"
/17 = "17.slaapkind.wav"
/18 = "18.poesje.wav"
/19 = "19.zakdoekje.wav"
/20 = "20.jacob.wav"
/21 = "21.berenbotje.wav"
/22 = "22.moriaantje.wav"
/23 = "23.denbosch.wav"
/24 = "24.huygen.wav"
/25 = "25.rijerije.wav"
/26 = "26.klaphand.wav"
/27 = "27.zeven.wav"
/28 = "28.eenjarig.wav"
/29 = "29.hollandhuis.wav"
/30 = "30.zagen.wav"
</item>

*** Stimuli Plaatjes *** (pictures)

<picture participant1>
/ items = ("participant1.jpg")
/ size = (33%, 33%)
/ position = (20%, 50%)
</picture>

<picture participant2>
/ items = ("participant2.jpg")
/ size = (33%, 33%)
/ position = (25%, 57%)
</picture>

<picture participant11>
/ items = ("participant1.jpg")
/ size = (33%, 33%)
/ position = (25%, 57%)
</picture>

<picture participant22>
/ items = ("participant2.jpg")
/ size = (33%, 33%)
/ position = (20%, 50%)
</picture>

<picture good>
/ items = ("correct.gif")
/ size = (10%, 10%)
/ position = (65%, 50%)
</picture>

<picture incorrect>
/ items = ("incorrect.gif")
/ size = (10%, 10%)
/ position = (75%, 50%)
</picture>

<picture next>
/ items = ("next.jpg")
/ size = (10%, 10%)
/ position = (80%, 50%)
</picture>

<picture refresh>
/ items = ("refresh.jpg")
/ size = (10%, 10%)
/ position = (60%, 50%)
</picture>

<picture next2>
/ items = ("next.jpg")
/ size = (10%, 10%)
/ position = (70%, 50%)
</picture>

------------------------------------------------------------------------------------
*** INSTRUCTION PAGES *****
------------------------------------------------------------------------------------

<page welcome>
^^^^
Hoi! Je staat op het punt om te beginnen met de muziektest!
^^^
Dit betekent dat je deuntjes moet gaan tikken.
^^^^
Het is belangrijk dat je dit erg nauwkeurig doet, want in een ander hokje zit een andere proefpersoon 'de rader', die de liedjes kort heeft bestudeerd voor het experiment begon.
^^^^
Hij of zij moet zo goed mogelijk raden welk deuntje jij tikt, en zijn/haar beloning is gekoppeld aan de eindscore.
</page>

<page page1>
Je zult misschien niet alle liedjes kennen, daarom krijg je van ons wat hulp.
^^
Je krijgt namelijk elk liedje te horen.
</page>

<page end>
Dit deel van het experiment is nu afgelopen.
^^^^

</page>

------------------------------------------------------------------------------------
*** TRIALS *****
------------------------------------------------------------------------------------

<trial myturn1>
/ pretrialpause = 1500
/ stimulusframes=[1=musicstimulitext, participant1, participant2, scoreboard1, scoreboard2, refresh, next, musicstimuli]
/ inputdevice=mouse
/ validresponse = (refresh, next)
</trial>

<trial myturn2>
/ stimulusframes=[1=musicstimulitext, participant1, participant2, scoreboard1, scoreboard2, next2]
/ inputdevice=mouse
/ validresponse = (next2)
</trial>

<trial otherturn>
/ stimulusframes=[1=musicstimulitext, participant22, participant11, good, incorrect, scoreboard1, scoreboard2]
/ inputdevice = mouse
/ correctresponse = (good, incorrect)
</trial>

------------------------------------------------------------------------------------
*** BLOCKS *****
------------------------------------------------------------------------------------

<block one>
/ trials = [1-90 = myturn1, myturn2, otherturn]
</block>

------------------------------------------------------------------------------------
*** EXPERIMENT***
------------------------------------------------------------------------------------

<expt>
/ subjects = (1 of 1)
/ blocks = [1=one]
/ preinstructions = (welcome, page1)
/ postinstructions = (end)
</expt>
By Dave - 1/23/2009

Hey there,

thanks for providing the details. The file attached to this post should give you the desired behavior. Please check it out and then report back (I actually require you to do this!). The general approach I used is this:

- 'Linking' the different counters to select corresponding items.
- Forcing the counters to select a single, constant value.
- Incrementing this value if - and only if - the whole 3 trial sequence (myturn1, myturn2, otherturn) is absolved so that the next set of items gets selected.

Best wishes,
~Dave
By plush - 2/1/2009

Works perfectly!

thx for the help!
By Klemens - 9/17/2009

Hi Dave, Hi Plush, Hi Sean,


I stumbled across the same problem as Plush did. I'd like to be able to play back a soundfile repeatedly by clicking on a button / picture. To further complicate things, there should be a likert element on the same frame.


As I understood from your post, Dave, this would require to "nest" trials within trials, which is not possible in Inquisit at this time - or is it?


Best,


Klemens

By Dave - 9/17/2009

As I understood from your post, Dave, this would require to "nest" trials within trials, which is not possible in Inquisit at this time - or is it?


I don't see why one would need to "nest" trials in this case.


I stumbled across the same problem as Plush did. I'd like to be able to play back a soundfile repeatedly by clicking on a button / picture. To further complicate things, there should be a likert element on the same frame.


Here's what you need to do:


(1) Don't (!) use Inquisit's <likert> element in this case. Instead build your own likert scale as exemplified by this sample script: http://www.millisecond.com/download/samples/v2/CustomLikert/customlikert.zip


(2) Add your sound stim and the button as an additional stimulus / response to the custom likert <trial>.


(3) Apply branching logic to the <trial>: If subject clicks on button, repeat the trial. If subject submits a rating, move on to the next trial.


(4) Be careful about item selection. In case of a button press you need to avoid selecting a new sound stim (in case you have several). Use dummy trials to do the item selection.


Regards,


~Dave

By Klemens - 9/21/2009

Hi Dave,



thanks for your quick reply - this is a great forum!! I spent the last few days trying to figure out a way to link the approach you suggested with some advice from older post about paired comparisons (http://www.millisecond.com/community/forums/t/1106.aspxhttp://www.millisecond.com/community/forums/p/976/2511.aspx)


I should have been more specific from the beginning: What I'd like to do is a paired comparisons-study with several auditory stimuli. In each comparison trial, the two sounds to be compared should only be triggered by user action (i.e. by clicking on one of two sound buttons, as opposed to clicking on the likert scale in order to give a rating).


Here's what I've accomplished so far:



  1. I've already set up the paired comparisons part using two linked counters that generate the randomized pairs.

  2. As you suggested, Dave, I've built my own likert scale and added the scale as well and two picture-buttons to my comparison trial.

  3. I tried to include some branching, so that the comparison trial is repeated when a button is clicked, whereas a dummy trial is started when a rating is given.

  4. Clicking on a button starts playback of the sound stim (via the "responsemessage"-attribute).

  5. In order to randomize within the stimulus pairs, I use counters to switch the position of the buttons.


What I do not know yet is how to set up the dummy trial that selects new sound stimuli. Also, clicking the buttons starts playing the sound stims, but unfortunately starts a new trial at the same time (which is not a big surprise).



    Here's my script:


    <sound sound1>
    / items = sounds
    / select = sound1select
    </sound>


    <sound sound2>
    / items = sounds
    / select = sound2select
    </sound>


    <item sounds>
    /1 = "stimulus1.wav"
    /2 = "stimulus2.wav"
    /3 = "stimulus3.wav"
    /4 = "stimulus4.wav" 
    </item>


    <counter sound1select>
    / items = (
    1, 1, 1,
    2, 2,
    3)
    / select = noreplace 
    </counter>


    <counter sound2select>
    / items = (
    2, 3, 4,
    3, 4,
    4)
    / select = current(sound1select) 
    </counter>


    <picture button1>
    / items = ("button1.jpg")
    / position = (counter.bswitch1.selectedvalue, 35%)
    / erase = true(255, 255, 255)
    </picture>


    <picture button2>
    / items = ("button2.jpg")
    / position = (counter.bswitch2.selectedvalue, 35%)
    / erase = true(255, 255, 255)
    </picture>


    <counter bswitch1>
    / items = (40, 60)
    / select = noreplace
    / selectionrate = always
    </counter>


    <counter bswitch2>
    / items = (60, 40)
    / select = current(bswitch1)
    </counter>


    <trial comparison>
    / stimulusframes = [1=button1, button2, likertscale, b1, b2, b3, b4, b5, b6, b7]
    / inputdevice = mouse
    / validresponse = (button1, button2, b1, b2, b3, b4, b5, b6, b7)
    / responsemessage = (button1, sound1, 0)
    / responsemessage = (button2, sound2, 0)
    / responseinterrupt = trial
    / branch = [if (trial.comparison.response == button1|| trial.comparison.response == button2) trial.comparison]
    / branch = [if (trial.comparison.response == b1  || trial.comparison.response == b2  || trial.comparison.response == b3  || trial.comparison.response == b4  || trial.comparison.response == b5  || trial.comparison.response == b6  || trial.comparison.response == b7) trial.itemselection]
    </trial>


    <trial itemselection>
    ???
    / branch = [trial.comparison]
    </trial>


    <block allcomparisons>
    / trials = [1-6= noreplace(comparison)]
    </block> 



    Thanks a lot for your help for which I'm very, very grateful,


    Klemens


    By Dave - 9/21/2009

    I'd be willing to invest a little time and look into this. However, I'd appreciate if you could put the script you pasted above as well as all supporting files (pictures, sounds) into a zip-file and either attach it to this thread (see the 'options' tab when replying) or upload it somewhere else. I'd like to have something to work with that will actually parse instead of throwing missing file errors on end...


    ~Dave

    By Klemens - 9/21/2009

    Hi Dave,



    I really appreciate your help. You can download the zip file from the link below:


    http://rapidshare.com/files/283436577/Paired_Comparison.zip.html



    Best,


    Klemens

    By Dave - 9/21/2009

    Hi Klemens,


    got the file and will take a look. Probably not gonna get to this today, but will post tomorrow.


    ~Dave

    By Klemens - 9/22/2009

    Hi Dave,


    I'm just thinking about splitting up the comparison trial and the stimulus selection "dummy" trial and place them in seperate blocks. In this way, I could set the selectionrate of the stimulus selection counter to "block". Then I'd be able to branch to a new block containing only the dummy trial after a rating has been given, whereas clicking on the buttons does not change blocks but only plays back the sound and afterwards repeats the comparison trial.


    Do you think this could work?


    Best, Klemens

    By Dave - 9/22/2009

    This might work, but honestly doesn't strike me as a particularly efficient approach. Alas, you might want to check out the script attached to this reply first. I've tweaked your setup quite a bit. Item selection is done via a dummy trial as indicated earlier. And since you want participants to rate two sounds on their similarity, the script now only allows submitting a rating if the participant has actually listened to each sound at least once. Hope you can make something out of it...


    ~Dave

    By Klemens - 9/22/2009

    Dave: You made my day!


    Now I see what you had in mind when talking about "dummy trials". I also love the way you used the value items to only allow progression to the next stimulus selection trial when both sounds have finished playing!


    Thanks a lot, this did really help!


    Best,


    Klemens 

    By Dave - 9/22/2009

    Dave: You made my day!


    Thank you -- reading this makes my day!


    Now I see what you had in mind when talking about "dummy trials".


    I use the term "dummy trials" for <trial> elements that solely perform supplemental tasks (item selection, imposing constraints, etc.). These trials usually don't require any subject interaction / responses and most of the time participants won't even know they exist. FYI, if you're familiar with E-Prime, trials set up like this essentially behave like "inline script".


    I also love the way you used the value items to only allow progression to the next stimulus selection trial when both sounds have finished playing!


    I just thought this would make sense. I'm glad you agree.


    Good luck with your research!


    ~Dave

    By Klemens - 11/1/2009

    Hello,


    after a little break I'm still/again working on the paired comparison script, pondering a new question:


    Is it somehow possible to combine one sound stimulus (activated by a button) and several likert ratings in one trial? I'm thinking of something like a surveypage with one sound button and several slider questions, but unfortunately the surveypage element does neither allow a responsemessage attribute (which is neccessary for playing back the sound) nor branching to dummy trials (which is neccessary for randomized stimulus selection).


    I guess I'll have to do it by using custom likert scales again? But in this case, I'd have to define countless picture items and randomization of the different questions within one trial would also be quite cumbersome...


    I'm grateful for every comment!


    Cheers,


    Klemens 

    By Inquisitive - 2/3/2011

    I think I'm asking for something similar as the others in this thread, but can't figure what's happening in the scripts that are posted (what are dummy trials?)



    I have several (~6) audio stimuli that I need to play, one stimulus per page.  I want participants to be able to repeat the sound, but so far, I haven't figured out a way to do that.  When I press repeat, it plays a new sound file.  I could do each trial separately, but the problem then is that the stimuli won't be presented in random order.  I've copy pasted the script:



    <trial sounddemo>
    / stimulustimes = [0=soundcaption; 0=soundicon]
    / validresponse = (soundicon, clicknext)
    / responsetrial = (soundicon, soundicon)
    </trial>

    <trial soundicon>
    / stimulustimes = [0=call,soundicon; 10000=clicknext, clickrepeat]
    / validresponse = (soundicon, clicknext)
    / responsetrial = (soundicon, soundicon)
    </trial>

    <text soundcaption>
    / items = ("Click the icon to listen to the sound.")
    / size = (450,200)
    / txcolor = (0, 0, 0)
    / valign = bottom
    </text>

    <text clickrepeat>
    / items = ("Click the icon to repeat")
    / valign = bottom
    / txcolor = (0, 0, 0)
    / position = (50, 36)
    </text>

    <picture soundicon>
    / items = ("soundicon.jpg")
    / position = (50, 50)
    </picture>

    <text clicknext>
    / items = ("Click here to continue")
    / txcolor = (0, 0, 0)
    / position = (50, 67)
    / fontstyle = ("Verdana", 14pt, true)
    </text>

    <sound call>
    / items = audiosamples
    / select = noreplace
    / playthrough = true
    / pan = 0
    </sound>



    <item audiosamples>
    /1 = "M1.wav"
    /2 = "F1.wav"
    /3 = "AM1.wav"
    /4 = "AF1.wav"
    /5 = "AM2.wav"
    /6 = "M2.wav"
    </item>

    By Dave - 2/3/2011

    (what are dummy trials?)


    Dummy trials are <trial> elements that perform only helper functions like stimulus selection, scoring, etc. and are effectively invisible to subjects. Anyway, have you given the script I attached on the previous page a look? It does pretty much exactly what you're asking for.


    ~Dave

    By Inquisitive - 2/3/2011

    Yeah I took a look but really couldn't make anything of it, partly because I wasn't sure if it was actually doing what I need my task to do.  I'll take a closer look and inspect it and let you know which things I get tripped up on.



    Thanks.

    By Inquisitive - 2/3/2011

    I've implemented the counter in my script and this now fixes the "repeat" problem.  Now when I press repeat it does play the same audio clip.


    The problem I have now is that the stimuli are not presented in random order:  I copied all of the same counter features that I thought were relevant in the plush script, and what I now get is:


    First trial plays the 2nd audio file, 2nd trial plays the 3rd audio file, 3rd trial plays the 4th and so on.  My guess is that it's because of the lines:



    <values>
    / mastercounter = 1
    </values>


    and


    / ontrialend = [values.mastercounter = values.mastercounter + 1]



    It seems to me that this script is not designed to play stimuli randomly.  Maybe I am misunderstanding some part of it?



    Also, I didn't understand why this "stop" line is included; seems redundant:


    ./ trials = [1-90 = myturn1, myturn2, otherturn]
    / stop = [values.mastercounter > 30]

    By Dave - 2/3/2011

    Well, you're looking at the wrong script. See "PairComp_Rev2.exp" attached to the last post on the previous page and re-read the posts related to that script. And no -- none of the lines are redundant.


    ~Dave

    By Inquisitive - 2/5/2011

    I took a look at the correct script this time, and it's a mess.  Since his task is a paired comparison, there is a lot of extra stuff in there that I can't tell if it's related or not to what I need to do.  I assume the dummy trials are the things at the bottom?  I couldn't really figure out what was going on there either.

    By Dave - 2/5/2011

    <defaults>
    / inputdevice = mouse
    </defaults>

    <values>
    / itemnumber = 0
    </values>

    <counter mysounds>
    / select = noreplace(1-6)
    </counter>

    <text clicktoplaysound>
    / items = ("Click me, hear sound.")
    </text>

    <text sound>
    / items = sounditems
    / select = values.itemnumber
    </text>

    <item sounditems>
    / 1 = "01.wav"
    / 2 = "02.wav"
    / 3 = "03.wav"
    / 4 = "04.wav"
    / 5 = "05.wav"
    / 6 = "06.wav"
    </item>

    <text nextsound>
    / items = ("Next")
    / position = (25%, 75%)
    </text>

    <text repeatsound>
    / items = ("Repeat")
    / position = (75%, 75%)
    </text>

    <trial click>
    / ontrialbegin = [values.itemnumber=counter.mysounds.selectedvalue]
    / stimulusframes = [1=clicktoplaysound]
    / validresponse = (clicktoplaysound)
    / branch = [trial.play]
    </trial>

    <trial play>
    / stimulusframes = [1=sound, repeatsound, nextsound]
    / validresponse = (repeatsound, nextsound)
    / branch = [if(trial.play.response=="repeatsound")trial.play]
    </trial>

    <block myblock>
    / trials = [1-6=click]
    </block>

    By Inquisitive - 2/5/2011

    Yay!!! After much tweaking, checking and double checking and editing, it looks like I've got it working how I want it.  Thanks a bunch!

    By Inquisitive - 2/27/2011

    I have a big problem that I didn't account for.  I'm scheduled to start running people in two days and didn't think of the fact that I need to have some way of pairing the number of stimulus (which audio sample they receive) to their responses to that stimulus.  Currently all I can do is enter them by hand via the SPSS output, because the stimulus number and the response are not on the same line.  Is there a way to ask for the current stimulus number as one of the data outputs?  Then I would have that stimulus number in the same row as the response to the stimulus.



    Thanks in advance.

    By Dave - 2/27/2011

    Yes. Please see the documentation for the <data> element and the /columns attribute.

    By Inquisitive - 2/27/2011

    Hmmm...Thanks for pointing me to that, but I'm still very puzzled.  I enter stimulusnumber as a column, and that spits out the info that I need, but not in the spot I need it to enter into SPSS.  It would be easy enough to just copy paste that column one cell downward, but the problem I run into is this:



    The first trial they listen to the audio sample.  Then they are asked 2 questions about the trial.  So there is only one row that contains the stimulusnumber that I need to match responses to.  Meanwhile, I have 2 rows with responses.  See the attached image, where the two values of "3" are the responses to the stimulus.  What would be the best way for me to get those to line up?

    By Dave - 2/27/2011

    You must either customize Inquisit's raw data output (which is why I referred you to those documentation topics)

    <data>
    / columns = [..., sound.mysound.selectedindex, ...]
    [...]
    </data>

    or restructure your data in SPSS, preferrably using SPSS syntax (which isn't hard either).

    Regards,
    ~Dave

    By Inquisitive - 2/27/2011

    I'd rather fix the problem using Inquisit's data output than using SPSS's syntax.  I have no experience with programming, but at least I have been using Inquisit for a few weeks now.


    I apologize for my denseness, but I can't figure out a way to do this by changing Inquisit's data output.  I believe you that it's possible, I just don't know how to do it.  Looking at the documentation (data and columns help sections in Inquisit) you pointed me to and trying a few different methods hasn't worked.  In your most recent post, I tried entering sounds.(mysound).stimulusitem, but it gave me an error message and didn't output anything.



    Edit:  I see you edited that post and replaced stimulusitem with selectedindex.  I now get a column of 1's, but I imagine there must be a way to change that?

    By Inquisitive - 2/27/2011

    Ah, I figured it out!  sound.mysound.selectedvalue did the trick.  Thanks for getting me in the right direction, I can rest easy now.

    By Dave - 2/27/2011

    Yep, my bad. I picked the wrong property.