Oddball task
MEDState Notation Repository › Forums › Coding Help Archive › Oddball task
- This topic has 7 replies, 1 voice, and was last updated 8 years, 9 months ago by
Med_Support.
-
AuthorPosts
-
March 10, 2015 at 12:07 pm #12802
Med_Support
ModeratorSarah Delcourte
Hi, I’ve never used MedState notation or any other program langage so I have some difficulties writing a program.
Basically, I would like to program an task where two sounds (1000 Hz, 2000 Hz) are randomly generated, the rats having to respond (by making a nose-poke) only when the 2000 Hz tone is on.
I also would like the tones to have specific presentation frequency: the 1000 Hz tone has to be generated 80 % of the time session, whereas the 2000 Hz has to be presented 20 % of the time.
I don’t know at all how to do this,
Here’s the program I’ve started to write :
\Output ^feeder = 3 [size=78%]^reward = 1[/size] ^tasklight = 4 \Variables \A = Array of Frequencies \B = Holds single value from list A \C = Volume \ Default = 80 dB \D = Duration \ Default = 50 ms \E = Rise/Fall time \ Default = 5 ms \F = Array of seconds for ITI (inter-tone interval) \G = Holds single time value from List F \H = # misses \I = # premature responses \J = # correct responses \t = timer \ Array called by LIST, RAND, & RANDI commands LIST A = 1000Hz, 2000Hz LIST F = 6", 7", 8", 9", 10" \Array of seconds S.S.1 S1, 0.1" : RANDI B=A ---> S2 S2, 0.1": ~InitANL926;~; ~SetFreq(MG, BOX, B);~; ~SetAmp(MG, BOX, C);~; ~SetDur(MG, BOX,D);~; ~SetRF(MG, BOX, E);~; --->S3 S3, 0.1" : ON^reward; ON^feeder ---> S4 S5, 0.1" : OFF^reward; OFF^feeder --->S6 S6, 0.1": RANDI G=F ---> S7 S7, G#t: ---> S8 #R1:ADD I; Z1--->SX S8, 0.5": ~ONFreq(MG, BOX, B);~; ON 17; ON 4 --->S9 #R1:ADD I;Z1--->S6 \ On INPUT1, Nose Poke than PREMATURE and restart state#4 S9, 0.5" :OFF 17 ---> S10 S10, #R1:ADD J; OFF 4--->S1 5": ADD H; OFF 4 ---> SX S.S.2, S1, #start : show 1, misses, h, 2, prema, I, 3, correct, J, 4, timer, t ---> S2 S2, 1" ---> SX
The pascal compiler found errors, listed below :
These errors were not detected by the MED-PC translator.
The following errors were detected:Error found in Trial.MPC, DLL\Trial.pas(11) DLL\Trial.pas(11) DLL\Trial.pas(14) DLL\Trial.pas(68) Error: Missing operator or semicolon
Error found in Trial.MPC, DLL\Trial.pas(69) Error: Missing operator or semicolon
Any help would be really appreciated,
Thank youSarah
March 12, 2015 at 8:56 am #12803Med_Support
ModeratorJim Frei
Hi Sarah,
I can offer more help if you supply more information about how the program is to work.
After the tone plays for 50ms how do you determine whether the response is premature, correct or incorrect?
Does the rat have a certain amount of time to respond or not respond within?
Is a premature response one that happens during the ITI?
Are there any other lights or indicators to the rat when he’s correct and the pellet is dispensed?
The more details you can supply the better I can try to help you.
Take care,
JimMarch 13, 2015 at 11:52 am #12806Med_Support
ModeratorSarah Delcourte
Hi Jim,
Thank you for your quick answer,
A response is correct when the rat nose-poke within 5 seconds of presentation of the target tone ( 2000Hz).
If the rat doesn’t respond within the 5 seconds, the response is missed.
If the rat respond to the non target tone, the response is incorrect.
A premature response occurs during the ITI , or during the beginning of the presentation of the sound .
When the sound is ON, there is a cue light in the hole where the rat has to nose poke. This light turns off when the rat nose-poke (if he does it within the 5 seconds after the tone presentation), or 5 seconds after the tone presentation , indicating that the time has passed.
When the rat makes a correct response, the light in the pellet receptacle turns on during 1 second ( I forgot to change this part on the program code I’ve posted).
I removed the “Hz” following “2000” and “1000” in the “LIST A”, and no more errors occured, but when I launch the program, the sound does not work. I don’t know why.
I’m sorry my english isn’t really good, I hope you will understand what I’m trying to explain.
To summarise :
2 tones ( a traget and a non-target one) are randomly presented to the rat, the rat has to answer, by nose-poking within the 5 seconds following the presentation of the target tone (2000Hz). When the target tone is on, a cue light turns on . If the rat nose poke within the 5 seconds, the cue light turns off, the pellet receptacle light turns on dring 1 second to let the rat know that a pellet has benn dispensed.
Thanks again, if you could help me, it would be so great !
Sarah
March 13, 2015 at 3:03 pm #12808Med_Support
ModeratorJim Frei
Hi Sarah,
Save the attached file to your MPC folder and change the file extension to .mpc. Then read the program to see what values are what and then try the program, I think it does what you’re looking for. Start it with the wizard in Med-PC IV to see your options. If you have questions let me know.
March 16, 2015 at 8:08 am #12810Med_Support
ModeratorSarah Delcourte
A HUGE thank you for what you’ve sent me, I tried the program this morning and it worked perfectly, you saved my life !!
I just have one (last) question. I tried to understand what you’ve written but I am far from being an expert, so I didn’t understand, and can’t make few changes.
When the non target tone is played, and the rat doesn’t respond, in the program, it is an omission. I would like to add another variable to caracterize this particular response. Can I just add the variable or do I have to change other things ( the value of “DIM B”, of B(I) etc ?)
Sorry to bother you with all my questions but I really don’t know nothing about programing
Thanks again for your help, without you I would be lost.
Sarah
March 16, 2015 at 9:02 am #12812Med_Support
ModeratorJim Frei
Hi Sarah,
A few things needed to be changed so I made the changes. Please save the attached file, change the extension to .mpc, compile in Trans IV and then try the program. Let me know.
Take care,
JimMarch 16, 2015 at 1:37 pm #12814Med_Support
ModeratorSarah Delcourte
Everything is perfect ,
Thank you again Jim.
Kind regards,
Sarah
March 16, 2015 at 2:14 pm #12816Med_Support
ModeratorJim Frei
Glad to help.
Jim
-
AuthorPosts
- You must be logged in to reply to this topic.