controlling volume levels


Author
Message
rburtonaus
rburtonaus
Expert (1.4K reputation)Expert (1.4K reputation)Expert (1.4K reputation)Expert (1.4K reputation)Expert (1.4K reputation)Expert (1.4K reputation)Expert (1.4K reputation)Expert (1.4K reputation)Expert (1.4K reputation)
Group: Forum Members
Posts: 8, Visits: 23
I am trying to give subjects the opportunity to set the volume to a comfortable level at the start of each session.
I have set volume as a value as follows:
<values>
/Vol=-5000
</values>
and 
<sound TestSound>
/items = ("TestSound.wav")
/volume = (values.vol)
</sound>

I have tried a variety of ways of setting the variable using blocks and trials but nothing seems to work.
Here is an example:

<trial VolChange>
/inputdevice = mouse
/stimulustimes = [0 = VolumeUp, VolumeDown, Continue; 1000 = TestSound]
/validresponse = (VolumeUp, VolumeDown, Continue)
/correctresponse = (Continue)
</trial>

<block AdjustVol>
/trials = [1-50 = noreplace(VolChange)]
/branch = [if(trial.volchange.response==VolumeUp) values.vol+= 1000]
/branch = [if(trial.volchange.response==VolumeDown) values.vol-= 1000]
/branch = [if(block.adjustvol.correctstreak>0) block.600block]
</block>

Even the last branch (correct streak) doesn't work for me.

I would very much appreciate advice.

Dave
Dave
Supreme Being (864K reputation)Supreme Being (864K reputation)Supreme Being (864K reputation)Supreme Being (864K reputation)Supreme Being (864K reputation)Supreme Being (864K reputation)Supreme Being (864K reputation)Supreme Being (864K reputation)Supreme Being (864K reputation)
Group: Administrators
Posts: 10K, Visits: 60K
There are various syntax errors in your code. Particularly missing double-quotes and inappropriate use of /branch (you want /ontrialend, not /branch):

<values>
/ myvolume = -5000
</values>

<block myblock>
/ trials = [1=mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=mysound, mytext, up, down, stop]
/ inputdevice = mouse
/ validresponse = (up, down, stop)
/ ontrialend = [if (trial.mytrial.response=="down" && values.myvolume > -10000) values.myvolume -= 500]
/ ontrialend = [if (trial.mytrial.response=="up" && values.myvolume < 0) values.myvolume += 500]
/ branch = [if (trial.mytrial.response != "stop") trial.mytrial]
</trial>

<sound mysound>
/ items = ("mywav.wav")
/ volume = values.myvolume
</sound>

<text mytext>
/ items = ("Volume = <%sound.mysound.volume%>")
</text>

<text up>
/ items = ("+")
/ position = (50%, 45%)
</text>

<text down>
/ items = ("-")
/ position = (50%, 55%)
</text>

<text stop>
/ items = ("stop")
/ position = (50%, 75%)
</text>


rburtonaus
rburtonaus
Expert (1.4K reputation)Expert (1.4K reputation)Expert (1.4K reputation)Expert (1.4K reputation)Expert (1.4K reputation)Expert (1.4K reputation)Expert (1.4K reputation)Expert (1.4K reputation)Expert (1.4K reputation)
Group: Forum Members
Posts: 8, Visits: 23
Thank you very much. I posted after a day of struggling. Its a great relief to have something that works.



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search