Using RANDI to choose between two Z-PULSES

MEDState Notation Repository Forums Coding Help Archive Using RANDI to choose between two Z-PULSES

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #13186
    Med_Support
    Moderator
    Jeni Gallagher

    Hi,
    Can I use RANDI to choose between two Z-pulse sets? I want the program to choose and emit a tone, wait 60 seconds for the rat to press the lever, then emit another tone of its choosing, wait another 60 seconds for the rat to press the lever, and repeat this for awhile. Thanks. jeni

    S.S.1,
    S1,
    .01
    
    #13187
    Med_Support
    Moderator
    Gary Bamberger

    I would need to see the entire program in order to be able to answer your questions.

    #13190
    Med_Support
    Moderator
    Jeni Gallagher
    S.S.1,
    S1,
    .01
    
    #13192
    Med_Support
    Moderator
    Gary Bamberger

    There were a couple of problems with your program.

    The first was in S.S.1.  After the timer ran out it would go back to S2 which would force the program to wait for a #START command.  This may have been what you wanted, but it is more common to use an ITI and then end the program after a certain number of trials has been reached.

    In S.S.2 and S.S.3 when it received the #Z1 or #Z2 respectively the program would start looking for responses on the Lever, but it never looked for a signal to stop recording inputs.

    The code below should be much closer to what you want.  I also added in a ITI to show how that would work.

    \ Lime.mpc
    \
    \ Is designed to randomly emit one of two tones every 60 seconds.
    \ The rats will learn that a 2KHz Tone will open up a 60 sec window where if they press
    \ the Lever they will get a reward (Pellet). On the other hand, a 4KHz tone will open up a
    \ window where if they press the Lever they will receive a White Noise buzz.
    
     
    
    \ Inputs
    ^Lever = 1
    
    \ Outputs
    ^White      = 1
    ^Blue       = 2
    ^Green      = 3
    ^Orange     = 4
    ^WhiteNoise = 5
    ^Pellet     = 6
    ^HouseLight = 7
    
     
    
    \ Variables
    \  A = Total # Pellets Delivered
    \  B = Total # White Noise Buzzes Delivered
    
     
    
    LIST D = 1, 2
    LIST E = 60"
    
     
    
    S.S.1,
    S1,
    0.01": ON ^HouseLight ---> S2
    
    S2,
    #START: RANDI N = D; ZN ---> S3        \ Start Procedure of randomly choosing a tone
    
    S3,
    E(0)#T: Z3 ---> S4                     \ Wait for Duration of Session then repeat random selection
    
    S4,
    60": RANDI N = D; ZN ---> S3           \ Inter-Trial Interval
    
     
    
    S.S.2,
    S1,
    #Z1: ON ^White, ^Blue ---> S2          \ Emit 2KHz Tone
    
    S2,
    2": OFF ^White, ^Blue ---> S3          \ Turn Tone off after 2 seconds
    
    S3,
    #R^Lever: ADD A; SHOW 1,Rewards,A; ON ^Pellet ---> S4  \ Show Lever Presses on Screen
    #Z3: ---> S1
    
    S4,
    0.15": OFF ^Pellet ---> S3
    #Z3: OFF ^Pellet ---> S1
    
     
    
    S.S.3,
    S1,
    #Z2: ON ^Green, ^White, ^Blue ---> S2  \ Emit 4KHz tone
    
    S2,
    2": OFF ^Green, ^White, ^Blue ---> S3  \ Turn Tone off after 2 seconds
    
    S3,
    #R^Lever: ADD B; SHOW 2,Buzzes,B; ON ^WhiteNoise ---> S4  \ Show Lever Presses on Screen
    #Z3: ---> S1
    
    S4,
    0.15": OFF ^WhiteNoise ---> S3
    #Z3: OFF ^WhiteNoise ---> S1
    
    #13195
    Med_Support
    Moderator
    Corey Puryear

    I have a question about this last bit of code and why a 2 kHz tone plays when “^White” is called?

    I assume this is because the program is written for a different setup than mine. I have the ANL-926 tone generators (I think that’s the right number…I am not in front of them right now) and would like to use programs like the one above (I recently posted the “Tone Programming”). It is my understanding that the tones have to be set (i.e., frequency, duration, loudness, rise and fall times), and simply assigning ^White = 1 should not work with the ANL-926’s. For my setup, this would simply activate the left lever, since that is in slot 1 on the control box. Is my understanding correct? If so, I would greatly appreciate some pointers that would help me modify the above code to incorporate the ANL-926’s.

    Thanks,
    Corey

    #13197
    Med_Support
    Moderator
    Gary Bamberger

    I believe that this program was written for an ENV-223 Multiple Tone Generator. This device takes four inputs and can generate up to 16 different tones. The tone that is generated depends on which input is turned on.

    For the ANL-926 you have to use the SetFreq, SetAmp, SetRF, SetDur, and on commands in order to get it to work.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.