play sound in preset interval while running other task?


Author
Message
Kim Lien
Kim Lien
Respected Member (444 reputation)Respected Member (444 reputation)Respected Member (444 reputation)Respected Member (444 reputation)Respected Member (444 reputation)Respected Member (444 reputation)Respected Member (444 reputation)Respected Member (444 reputation)Respected Member (444 reputation)
Group: Forum Members
Posts: 4, Visits: 5
Dear All,

I would be very grateful for advice on how to implement a sound in a preset interval on top of another task. 

I would like to modify the Point Subtraction Aggression Paradigm ( http://www.millisecond.com/download/library/psap/ ).
I would like to play the sound of a bell every 2 or 3 minutes during the task as a reminder of previously explained instructions. 

Does anyone know how to implement the sound on top of the PSAP task? 

Any help would be much appreciated.

Best,
Kim Lien 
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: 12K, Visits: 98K
Kim Lien - Thursday, March 8, 2018
Dear All,

I would be very grateful for advice on how to implement a sound in a preset interval on top of another task. 

I would like to modify the Point Subtraction Aggression Paradigm ( http://www.millisecond.com/download/library/psap/ ).
I would like to play the sound of a bell every 2 or 3 minutes during the task as a reminder of previously explained instructions. 

Does anyone know how to implement the sound on top of the PSAP task? 

Any help would be much appreciated.

Best,
Kim Lien 

The most straightforward option would be to:
- Create an audio file (e.g. an MP3) with 2 or 3 minutes of silence and then bell sound at the end.
- Set up a <video> element, with its /loop attribute set to true.
- "Display" the audio during the PSAP blocks

<video remindersound>
/ items = ("2minutesilencethenbell.mp3")
/ loop = true
</video>

<block PSAP>
/ bgstim = (remindersound)
/onblockbegin = [values.PSAPstart = script.elapsedtime]
/onblockbegin = [values.PSAPblocks += 1]
/onblockbegin = [text.letterA.textcolor = black; text.letterB.textcolor = black; text.letterC.textcolor = black]
/onblockbegin = [if (values.restart_total == 1) values.totalpoints = 0]
/onblockbegin = [values.presscounts = 0; values.protection = 0; values.procovationtime = 0;
values.count_optionA = 0; values.count_optionB = 0; values.count_optionC = 0; values.protectiontime = 0;
values.poscolortime = 0; values.negcolortime = 0; values.rt = 0; values.count_provocations; values.lastPFIstealcount = 0]
/ trials = [1 = select]
/stop = [script.elapsedtime >= (values.PSAPstart + (values.blockduration * 60 * 1000))]
/branch = [if (values.number_blocks > values.PSAPblocks && values.restperiod_active == 1) block.rest]
/branch = [if (values.number_blocks > values.PSAPblocks && values.restperiod_active == 0) block.PSAP]
</block>

Kim Lien
Kim Lien
Respected Member (444 reputation)Respected Member (444 reputation)Respected Member (444 reputation)Respected Member (444 reputation)Respected Member (444 reputation)Respected Member (444 reputation)Respected Member (444 reputation)Respected Member (444 reputation)Respected Member (444 reputation)
Group: Forum Members
Posts: 4, Visits: 5
Dave - Thursday, March 8, 2018
Kim Lien - Thursday, March 8, 2018
Dear All,

I would be very grateful for advice on how to implement a sound in a preset interval on top of another task. 

I would like to modify the Point Subtraction Aggression Paradigm ( http://www.millisecond.com/download/library/psap/ ).
I would like to play the sound of a bell every 2 or 3 minutes during the task as a reminder of previously explained instructions. 

Does anyone know how to implement the sound on top of the PSAP task? 

Any help would be much appreciated.

Best,
Kim Lien 

The most straightforward option would be to:
- Create an audio file (e.g. an MP3) with 2 or 3 minutes of silence and then bell sound at the end.
- Set up a <video> element, with its /loop attribute set to true.
- "Display" the audio during the PSAP blocks

<video remindersound>
/ items = ("2minutesilencethenbell.mp3")
/ loop = true
</video>

<block PSAP>
/ bgstim = (remindersound)
/onblockbegin = [values.PSAPstart = script.elapsedtime]
/onblockbegin = [values.PSAPblocks += 1]
/onblockbegin = [text.letterA.textcolor = black; text.letterB.textcolor = black; text.letterC.textcolor = black]
/onblockbegin = [if (values.restart_total == 1) values.totalpoints = 0]
/onblockbegin = [values.presscounts = 0; values.protection = 0; values.procovationtime = 0;
values.count_optionA = 0; values.count_optionB = 0; values.count_optionC = 0; values.protectiontime = 0;
values.poscolortime = 0; values.negcolortime = 0; values.rt = 0; values.count_provocations; values.lastPFIstealcount = 0]
/ trials = [1 = select]
/stop = [script.elapsedtime >= (values.PSAPstart + (values.blockduration * 60 * 1000))]
/branch = [if (values.number_blocks > values.PSAPblocks && values.restperiod_active == 1) block.rest]
/branch = [if (values.number_blocks > values.PSAPblocks && values.restperiod_active == 0) block.PSAP]
</block>

It works! Thank you so much for this super quick and elegant solution!

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search