I am creating an oddball paradigm for an infant study. The experiment shows a 7 minute clip of fantasia. During the video every 6-10 seconds a pair of vibrations are sent out (triggered by an auditory beep sound) with an ISI of 700ms between them and a duration of 100ms for each vibration. For the oddball experiment we’d like to set an expectation of paired stimulation by having x amount of pairs appear first (e.g., 5) and then onwards have paired stimulation occur x% of time (70% chance) whilst 30% only a single vibration occurs.
Below is the code I have related to vibration. Keep in mind I’ve deleted the EEG trigger and tactors (vibration machine) triggers so essentially this looks like an auditory oddball paradigm. My question is how do i set a probability measure? Any help would be greatly appreciated!
# we want to present the tone every
# 6 - 10 seconds for the duration of the trial
# if the sound is not currently playing
if not tactors1.playing and not tactors1.waiting:
# pick how long we will wait for
tactors1ISI = randint(6, 10)
print('tactorISI', tactors1ISI)
tactors1ISIs.append(tactors1ISI)
tactors1Onset = t +tactors1ISI
#we are waiting for the sound to play
tactors1.waiting = True
elif not tactors1.playing and tactors1.waiting:
if t >= tactors1Onset:
print('playing 1st tactor')
first_tactor_played = False
tactors1.play()
tactors1Onsets.append(t)
tactors1.playing = True
tactors1.waiting = False
tactor1_on_times +1
first_tactor_start_time = core.getTime() # Gets a timestamp of the start of the first vibration
first_tactor_played = True
elif tactors1.playing:
if t >= tactors1Onset + tactors1.secs:
tactors1.stop()
tactors1.playing = False
first_tactor_played = True
first_tactor_stop_time = core.getTime()
#2nd vibration
if not tactors2.playing and not tactors2.waiting:
if first_tactor_played == True:
# pick how long we will wait for
tactors2ISI = 0.7
print('tactor2ISI', tactors2ISI)
tactors2ISIs.append(tactors2ISI)
tactors2Onset = t +tactors2ISI
#we are waiting for the sound to play
tactors2.waiting = True
elif not tactors2.playing and tactors2.waiting:
if first_tactor_played == True:
if t >= tactors2Onset:
print('playing 2nd tactor')
tactors2.play()
tactors2Onsets.append(t)
tactors2.playing = True
tactors2.waiting = False
tactor2_on_times +1
#first_tactor_start_time = core.getTime() # Gets a timestamp of the start of the first vibration
elif tactors2.playing:
if t >= tactors2Onset + tactors2.secs:
if first_tactor_played == True:
tactors2.stop()
tactors2.playing = False
first_tactor_played = False