ndil01
|
|
Group: Forum Members
Posts: 6,
Visits: 35
|
+x+x+x+x+xHi there, I have two pieces of music, and I would like to present one of them as background sound in a block based on a participants previous response in a trial. I already know that I can use the /bgstim to play background sound in block (see block.self_referent). But I don't know how to select which piece of music to play based on a participants previous response. That is, in trial.final_choice participants are instructed to press the "a" key to listen to the first piece of music, or the "b" key to listen to the second piece of music. If they press the "a" key I'd like them to hear "Beethoven_PianoConcerto Op58.wav" and if they press the "b" key I'd like them to hear "Mozart_Serenade No13 KV525.wav" (see video.backgroundmusic). One way I thought about achieving this was by adding 1 to values.musicchoice if they select "a" and adding 2 if they select "b", and then using the value of values.musicchoice to determine which song is played during block.self_referent. The problem is I don't know how to map values.musicchoice to the different songs (video.backgroundmusic) and then how to map this to /bgstim in block.self_referent. I'm not even sure it is possible to achieve this at all. Please see the script below, and let me know if there is any more information you need. Many thanks in advanced, ndil01 ***experiment<expt mood_positive> / blocks = [1 = Instructions; 2 = Mood_ratings; 3 = music_choice; 4 = Music_selection; 5 = Self_referent] </expt> ***block where background sound is played<block Self_referent> / trials = [1-4 = self_referent] /screencolor = (yellow) / bgstim = (backgroundmusic) </block> ***the trials with block.self_referent<trial Self_referent> /stimulustimes = [1 = Self_referent; 12000 = nextbutton] /validresponse = (" ") / recorddata = false </trial> ***sound I would like to use<video backgroundmusic> / loop = true / items = ("Beethoven_PianoConcerto Op58.wav", "Mozart_Serenade No13 KV525.wav") </video> ***trial where participant makes a response (or choice of music)<trial final_choice> /stimulustimes = [1 = final_choice] /validresponse = ("a", "b") /recorddata = true /ontrialend = [if (trial.final_choice.response == "a") values.musicchoice + 1; if (trial.final_choice.response == "b") values.musicchoice +2] </trial> ***values I would like to use to map on particular background sound<values> /musicchoice = 0 </values> #0: As a bit of defensive programming, initialize values.musicchoice with a valid value (1 or 2): <values> /musicchoice = 1 </values> #1: Set <video backgroundmusic> / loop = true / items = ("Beethoven_PianoConcerto Op58.wav", "Mozart_Serenade No13 KV525.wav") / select = values.musicchoice</video> #2: Fix the broken syntax in the choice trial: <trial final_choice> /stimulustimes = [1 = final_choice] /validresponse = ("a", "b") /recorddata = true /ontrialend = [if (trial.final_choice.response == 30) values.musicchoice = 1; if (trial.final_choice.response == 48) values.musicchoice = 2]</trial> That should be all. This works perfectly. Thank you for you help! Hi there, I have programmed a script based on the topic of this forum. It's worked perfectly on my computer, however, I passed it to someone else to have a look over and they encountered problems. Basically, when they try to make a response in order to select which sound to play, Inquisit crashes and these errors come up: Inquisit Media Error: Media Foundation: Media Object is not initialised. line 470: file win\MediaFoundationPlayerControl.cpp and this error: Unable to load media file: shows path to folder where music file is contained.
I've tried it on one other computer and the script seemed to work ok, so I'm not sure if it is a problem with her computer or something to do with the script. FYI She used Inquisit Lab to run the script. Here is my script: <values>/musicchoice = 0</values> ***Participants select which piece of music they would like to hear by clicking one of two picture stimuli<block final_choice> /trials = [1 = final_choice] /screencolor = (navy) </block> <trial final_choice> /stimulustimes = [1 = final_choice, 01, 02] /validresponse = (01, 02) /inputdevice = mouse /recorddata = true /ontrialend = [ if(trial.final_choice.response == 01)values.musicchoice = 1; if(trial.final_choice.response == 02)values.musicchoice = 2] </trial> ***The piece of music selected is then played during this block of trials <block Self_referent> / trials = [1-60 = self_referent] /screencolor = (navy) / bgstim = (backgroundmusic) </block> <trial Self_referent> /stimulustimes = [1 = Self_referent; 12000 = nextbutton] /validresponse = (" ") / recorddata = false </trial> ***The music participants select<video backgroundmusic> / loop = true / items = ("Barber_Adagio.wav", "Tomaso_Albinoni.wav") / select = values.musicchoice </video> ***These create the buttons that participants click to select which piece of music they would like to listen to<picture 01> /items = ("piece1.png") /position = (35%, 65%) /size = (15%, 19%) </picture> <picture 02> /items = ("piece2.png") /position = (65%, 65%) /size = (15%, 19%) </picture> Please let me know if you require more information and many thanks in advance. Under Windows, uncompressed WAV files and other formats are handled differently. You should *always* use <sound> for WAV files and <video> for any other formats (e.g. MP3). The <video> element will not handle WAV files under Windows. Macs are able to figure this out internally, but the situation is different under Windows. In short, either convert the WAVs to MP3 and adjust <video backgroundmusic> / loop = true / items = ("Barber_Adagio.mp3", "Tomaso_Albinoni.mp3") / select = values.musicchoice </video> accordingly. Oh I see, that is an easy fix. Thank you again for your help!
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+x+x+x+xHi there, I have two pieces of music, and I would like to present one of them as background sound in a block based on a participants previous response in a trial. I already know that I can use the /bgstim to play background sound in block (see block.self_referent). But I don't know how to select which piece of music to play based on a participants previous response. That is, in trial.final_choice participants are instructed to press the "a" key to listen to the first piece of music, or the "b" key to listen to the second piece of music. If they press the "a" key I'd like them to hear "Beethoven_PianoConcerto Op58.wav" and if they press the "b" key I'd like them to hear "Mozart_Serenade No13 KV525.wav" (see video.backgroundmusic). One way I thought about achieving this was by adding 1 to values.musicchoice if they select "a" and adding 2 if they select "b", and then using the value of values.musicchoice to determine which song is played during block.self_referent. The problem is I don't know how to map values.musicchoice to the different songs (video.backgroundmusic) and then how to map this to /bgstim in block.self_referent. I'm not even sure it is possible to achieve this at all. Please see the script below, and let me know if there is any more information you need. Many thanks in advanced, ndil01 ***experiment<expt mood_positive> / blocks = [1 = Instructions; 2 = Mood_ratings; 3 = music_choice; 4 = Music_selection; 5 = Self_referent] </expt> ***block where background sound is played<block Self_referent> / trials = [1-4 = self_referent] /screencolor = (yellow) / bgstim = (backgroundmusic) </block> ***the trials with block.self_referent<trial Self_referent> /stimulustimes = [1 = Self_referent; 12000 = nextbutton] /validresponse = (" ") / recorddata = false </trial> ***sound I would like to use<video backgroundmusic> / loop = true / items = ("Beethoven_PianoConcerto Op58.wav", "Mozart_Serenade No13 KV525.wav") </video> ***trial where participant makes a response (or choice of music)<trial final_choice> /stimulustimes = [1 = final_choice] /validresponse = ("a", "b") /recorddata = true /ontrialend = [if (trial.final_choice.response == "a") values.musicchoice + 1; if (trial.final_choice.response == "b") values.musicchoice +2] </trial> ***values I would like to use to map on particular background sound<values> /musicchoice = 0 </values> #0: As a bit of defensive programming, initialize values.musicchoice with a valid value (1 or 2): <values> /musicchoice = 1 </values> #1: Set <video backgroundmusic> / loop = true / items = ("Beethoven_PianoConcerto Op58.wav", "Mozart_Serenade No13 KV525.wav") / select = values.musicchoice</video> #2: Fix the broken syntax in the choice trial: <trial final_choice> /stimulustimes = [1 = final_choice] /validresponse = ("a", "b") /recorddata = true /ontrialend = [if (trial.final_choice.response == 30) values.musicchoice = 1; if (trial.final_choice.response == 48) values.musicchoice = 2]</trial> That should be all. This works perfectly. Thank you for you help! Hi there, I have programmed a script based on the topic of this forum. It's worked perfectly on my computer, however, I passed it to someone else to have a look over and they encountered problems. Basically, when they try to make a response in order to select which sound to play, Inquisit crashes and these errors come up: Inquisit Media Error: Media Foundation: Media Object is not initialised. line 470: file win\MediaFoundationPlayerControl.cpp and this error: Unable to load media file: shows path to folder where music file is contained.
I've tried it on one other computer and the script seemed to work ok, so I'm not sure if it is a problem with her computer or something to do with the script. FYI She used Inquisit Lab to run the script. Here is my script: <values>/musicchoice = 0</values> ***Participants select which piece of music they would like to hear by clicking one of two picture stimuli<block final_choice> /trials = [1 = final_choice] /screencolor = (navy) </block> <trial final_choice> /stimulustimes = [1 = final_choice, 01, 02] /validresponse = (01, 02) /inputdevice = mouse /recorddata = true /ontrialend = [ if(trial.final_choice.response == 01)values.musicchoice = 1; if(trial.final_choice.response == 02)values.musicchoice = 2] </trial> ***The piece of music selected is then played during this block of trials <block Self_referent> / trials = [1-60 = self_referent] /screencolor = (navy) / bgstim = (backgroundmusic) </block> <trial Self_referent> /stimulustimes = [1 = Self_referent; 12000 = nextbutton] /validresponse = (" ") / recorddata = false </trial> ***The music participants select<video backgroundmusic> / loop = true / items = ("Barber_Adagio.wav", "Tomaso_Albinoni.wav") / select = values.musicchoice </video> ***These create the buttons that participants click to select which piece of music they would like to listen to<picture 01> /items = ("piece1.png") /position = (35%, 65%) /size = (15%, 19%) </picture> <picture 02> /items = ("piece2.png") /position = (65%, 65%) /size = (15%, 19%) </picture> Please let me know if you require more information and many thanks in advance. Under Windows, uncompressed WAV files and other formats are handled differently. You should *always* use <sound> for WAV files and <video> for any other formats (e.g. MP3). The <video> element will not handle WAV files under Windows. Macs are able to figure this out internally, but the situation is different under Windows. In short, convert the WAVs to MP3 and adjust <video backgroundmusic> / loop = true / items = ("Barber_Adagio.mp3", "Tomaso_Albinoni.mp3") / select = values.musicchoice </video> accordingly.
|
|
|
ndil01
|
|
Group: Forum Members
Posts: 6,
Visits: 35
|
+x+x+xHi there, I have two pieces of music, and I would like to present one of them as background sound in a block based on a participants previous response in a trial. I already know that I can use the /bgstim to play background sound in block (see block.self_referent). But I don't know how to select which piece of music to play based on a participants previous response. That is, in trial.final_choice participants are instructed to press the "a" key to listen to the first piece of music, or the "b" key to listen to the second piece of music. If they press the "a" key I'd like them to hear "Beethoven_PianoConcerto Op58.wav" and if they press the "b" key I'd like them to hear "Mozart_Serenade No13 KV525.wav" (see video.backgroundmusic). One way I thought about achieving this was by adding 1 to values.musicchoice if they select "a" and adding 2 if they select "b", and then using the value of values.musicchoice to determine which song is played during block.self_referent. The problem is I don't know how to map values.musicchoice to the different songs (video.backgroundmusic) and then how to map this to /bgstim in block.self_referent. I'm not even sure it is possible to achieve this at all. Please see the script below, and let me know if there is any more information you need. Many thanks in advanced, ndil01 ***experiment<expt mood_positive> / blocks = [1 = Instructions; 2 = Mood_ratings; 3 = music_choice; 4 = Music_selection; 5 = Self_referent] </expt> ***block where background sound is played<block Self_referent> / trials = [1-4 = self_referent] /screencolor = (yellow) / bgstim = (backgroundmusic) </block> ***the trials with block.self_referent<trial Self_referent> /stimulustimes = [1 = Self_referent; 12000 = nextbutton] /validresponse = (" ") / recorddata = false </trial> ***sound I would like to use<video backgroundmusic> / loop = true / items = ("Beethoven_PianoConcerto Op58.wav", "Mozart_Serenade No13 KV525.wav") </video> ***trial where participant makes a response (or choice of music)<trial final_choice> /stimulustimes = [1 = final_choice] /validresponse = ("a", "b") /recorddata = true /ontrialend = [if (trial.final_choice.response == "a") values.musicchoice + 1; if (trial.final_choice.response == "b") values.musicchoice +2] </trial> ***values I would like to use to map on particular background sound<values> /musicchoice = 0 </values> #0: As a bit of defensive programming, initialize values.musicchoice with a valid value (1 or 2): <values> /musicchoice = 1 </values> #1: Set <video backgroundmusic> / loop = true / items = ("Beethoven_PianoConcerto Op58.wav", "Mozart_Serenade No13 KV525.wav") / select = values.musicchoice</video> #2: Fix the broken syntax in the choice trial: <trial final_choice> /stimulustimes = [1 = final_choice] /validresponse = ("a", "b") /recorddata = true /ontrialend = [if (trial.final_choice.response == 30) values.musicchoice = 1; if (trial.final_choice.response == 48) values.musicchoice = 2]</trial> That should be all. This works perfectly. Thank you for you help! Hi there, I have programmed a script based on the topic of this forum. It's worked perfectly on my computer, however, I passed it to someone else to have a look over and they encountered problems. Basically, when they try to make a response in order to select which sound to play, Inquisit crashes and these errors come up: Inquisit Media Error: Media Foundation: Media Object is not initialised. line 470: file win\MediaFoundationPlayerControl.cpp and this error: Unable to load media file: shows path to folder where music file is contained.
I've tried it on one other computer and the script seemed to work ok, so I'm not sure if it is a problem with her computer or something to do with the script. FYI She used Inquisit Lab to run the script. Here is my script: <values>/musicchoice = 0</values> ***Participants select which piece of music they would like to hear by clicking one of two picture stimuli<block final_choice> /trials = [1 = final_choice] /screencolor = (navy) </block> <trial final_choice> /stimulustimes = [1 = final_choice, 01, 02] /validresponse = (01, 02) /inputdevice = mouse /recorddata = true /ontrialend = [ if(trial.final_choice.response == 01)values.musicchoice = 1; if(trial.final_choice.response == 02)values.musicchoice = 2] </trial> ***The piece of music selected is then played during this block of trials <block Self_referent> / trials = [1-60 = self_referent] /screencolor = (navy) / bgstim = (backgroundmusic) </block> <trial Self_referent> /stimulustimes = [1 = Self_referent; 12000 = nextbutton] /validresponse = (" ") / recorddata = false </trial> ***The music participants select<video backgroundmusic> / loop = true / items = ("Barber_Adagio.wav", "Tomaso_Albinoni.wav") / select = values.musicchoice </video> ***These create the buttons that participants click to select which piece of music they would like to listen to<picture 01> /items = ("piece1.png") /position = (35%, 65%) /size = (15%, 19%) </picture> <picture 02> /items = ("piece2.png") /position = (65%, 65%) /size = (15%, 19%) </picture> Please let me know if you require more information and many thanks in advance.
|
|
|
ndil01
|
|
Group: Forum Members
Posts: 6,
Visits: 35
|
+x+xHi there, I have two pieces of music, and I would like to present one of them as background sound in a block based on a participants previous response in a trial. I already know that I can use the /bgstim to play background sound in block (see block.self_referent). But I don't know how to select which piece of music to play based on a participants previous response. That is, in trial.final_choice participants are instructed to press the "a" key to listen to the first piece of music, or the "b" key to listen to the second piece of music. If they press the "a" key I'd like them to hear "Beethoven_PianoConcerto Op58.wav" and if they press the "b" key I'd like them to hear "Mozart_Serenade No13 KV525.wav" (see video.backgroundmusic). One way I thought about achieving this was by adding 1 to values.musicchoice if they select "a" and adding 2 if they select "b", and then using the value of values.musicchoice to determine which song is played during block.self_referent. The problem is I don't know how to map values.musicchoice to the different songs (video.backgroundmusic) and then how to map this to /bgstim in block.self_referent. I'm not even sure it is possible to achieve this at all. Please see the script below, and let me know if there is any more information you need. Many thanks in advanced, ndil01 ***experiment<expt mood_positive> / blocks = [1 = Instructions; 2 = Mood_ratings; 3 = music_choice; 4 = Music_selection; 5 = Self_referent] </expt> ***block where background sound is played<block Self_referent> / trials = [1-4 = self_referent] /screencolor = (yellow) / bgstim = (backgroundmusic) </block> ***the trials with block.self_referent<trial Self_referent> /stimulustimes = [1 = Self_referent; 12000 = nextbutton] /validresponse = (" ") / recorddata = false </trial> ***sound I would like to use<video backgroundmusic> / loop = true / items = ("Beethoven_PianoConcerto Op58.wav", "Mozart_Serenade No13 KV525.wav") </video> ***trial where participant makes a response (or choice of music)<trial final_choice> /stimulustimes = [1 = final_choice] /validresponse = ("a", "b") /recorddata = true /ontrialend = [if (trial.final_choice.response == "a") values.musicchoice + 1; if (trial.final_choice.response == "b") values.musicchoice +2] </trial> ***values I would like to use to map on particular background sound<values> /musicchoice = 0 </values> #0: As a bit of defensive programming, initialize values.musicchoice with a valid value (1 or 2): <values> /musicchoice = 1 </values> #1: Set <video backgroundmusic> / loop = true / items = ("Beethoven_PianoConcerto Op58.wav", "Mozart_Serenade No13 KV525.wav") / select = values.musicchoice</video> #2: Fix the broken syntax in the choice trial: <trial final_choice> /stimulustimes = [1 = final_choice] /validresponse = ("a", "b") /recorddata = true /ontrialend = [if (trial.final_choice.response == 30) values.musicchoice = 1; if (trial.final_choice.response == 48) values.musicchoice = 2]</trial> That should be all. This works perfectly. Thank you for you help!
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+xHi there, I have two pieces of music, and I would like to present one of them as background sound in a block based on a participants previous response in a trial. I already know that I can use the /bgstim to play background sound in block (see block.self_referent). But I don't know how to select which piece of music to play based on a participants previous response. That is, in trial.final_choice participants are instructed to press the "a" key to listen to the first piece of music, or the "b" key to listen to the second piece of music. If they press the "a" key I'd like them to hear "Beethoven_PianoConcerto Op58.wav" and if they press the "b" key I'd like them to hear "Mozart_Serenade No13 KV525.wav" (see video.backgroundmusic). One way I thought about achieving this was by adding 1 to values.musicchoice if they select "a" and adding 2 if they select "b", and then using the value of values.musicchoice to determine which song is played during block.self_referent. The problem is I don't know how to map values.musicchoice to the different songs (video.backgroundmusic) and then how to map this to /bgstim in block.self_referent. I'm not even sure it is possible to achieve this at all. Please see the script below, and let me know if there is any more information you need. Many thanks in advanced, ndil01 ***experiment<expt mood_positive> / blocks = [1 = Instructions; 2 = Mood_ratings; 3 = music_choice; 4 = Music_selection; 5 = Self_referent] </expt> ***block where background sound is played<block Self_referent> / trials = [1-4 = self_referent] /screencolor = (yellow) / bgstim = (backgroundmusic) </block> ***the trials with block.self_referent<trial Self_referent> /stimulustimes = [1 = Self_referent; 12000 = nextbutton] /validresponse = (" ") / recorddata = false </trial> ***sound I would like to use<video backgroundmusic> / loop = true / items = ("Beethoven_PianoConcerto Op58.wav", "Mozart_Serenade No13 KV525.wav") </video> ***trial where participant makes a response (or choice of music)<trial final_choice> /stimulustimes = [1 = final_choice] /validresponse = ("a", "b") /recorddata = true /ontrialend = [if (trial.final_choice.response == "a") values.musicchoice + 1; if (trial.final_choice.response == "b") values.musicchoice +2] </trial> ***values I would like to use to map on particular background sound<values> /musicchoice = 0 </values> #0: As a bit of defensive programming, initialize values.musicchoice with a valid value (1 or 2): <values> /musicchoice = 1 </values> #1: Set <video backgroundmusic> / loop = true / items = ("Beethoven_PianoConcerto Op58.wav", "Mozart_Serenade No13 KV525.wav") / select = values.musicchoice</video> #2: Fix the broken syntax in the choice trial: <trial final_choice> /stimulustimes = [1 = final_choice] /validresponse = ("a", "b") /recorddata = true /ontrialend = [if (trial.final_choice.response == 30) values.musicchoice = 1; if (trial.final_choice.response == 48) values.musicchoice = 2]</trial> That should be all.
|
|
|
ndil01
|
|
Group: Forum Members
Posts: 6,
Visits: 35
|
Hi there,
I have two pieces of music, and I would like to present one of them as background sound in a block based on a participants previous response in a trial.
I already know that I can use the /bgstim to play background sound in block (see block.self_referent). But I don't know how to select which piece of music to play based on a participants previous response. That is, in trial.final_choice participants are instructed to press the "a" key to listen to the first piece of music, or the "b" key to listen to the second piece of music. If they press the "a" key I'd like them to hear "Beethoven_PianoConcerto Op58.wav" and if they press the "b" key I'd like them to hear "Mozart_Serenade No13 KV525.wav" (see video.backgroundmusic).
One way I thought about achieving this was by adding 1 to values.musicchoice if they select "a" and adding 2 if they select "b", and then using the value of values.musicchoice to determine which song is played during block.self_referent. The problem is I don't know how to map values.musicchoice to the different songs (video.backgroundmusic) and then how to map this to /bgstim in block.self_referent. I'm not even sure it is possible to achieve this at all.
Please see the script below, and let me know if there is any more information you need.
Many thanks in advanced, ndil01
***experiment
<expt mood_positive> / blocks = [1 = Instructions; 2 = Mood_ratings; 3 = music_choice; 4 = Music_selection; 5 = Self_referent] </expt>
***block where background sound is played
<block Self_referent> / trials = [1-4 = self_referent] /screencolor = (yellow) / bgstim = (backgroundmusic) </block>
***the trials with block.self_referent
<trial Self_referent> /stimulustimes = [1 = Self_referent; 12000 = nextbutton] /validresponse = (" ") / recorddata = false </trial>
***sound I would like to use
<video backgroundmusic> / loop = true / items = ("Beethoven_PianoConcerto Op58.wav", "Mozart_Serenade No13 KV525.wav") </video>
***trial where participant makes a response (or choice of music)
<trial final_choice> /stimulustimes = [1 = final_choice] /validresponse = ("a", "b") /recorddata = true /ontrialend = [if (trial.final_choice.response == "a") values.musicchoice + 1; if (trial.final_choice.response == "b") values.musicchoice +2] </trial>
***values I would like to use to map on particular background sound
<values> /musicchoice = 0 </values>
|
|
|