-
Notifications
You must be signed in to change notification settings - Fork 0
/
Broadband_tonotopy.psyexp
182 lines (182 loc) · 16.4 KB
/
Broadband_tonotopy.psyexp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<?xml version="1.0" ?>
<PsychoPy2experiment encoding="utf-8" version="2022.2.4">
<Settings>
<Param val="4" valType="str" updates="None" name="Audio latency priority"/>
<Param val="ptb" valType="str" updates="None" name="Audio lib"/>
<Param val="" valType="str" updates="None" name="Completed URL"/>
<Param val="auto" valType="str" updates="None" name="Data file delimiter"/>
<Param val="u'data/%s_%s_%s' % (expInfo['participant'], expName, expInfo['date'])" valType="code" updates="None" name="Data filename"/>
<Param val="True" valType="bool" updates="None" name="Enable Escape"/>
<Param val="{'participant': '', 'session': '001'}" valType="code" updates="None" name="Experiment info"/>
<Param val="True" valType="bool" updates="None" name="Force stereo"/>
<Param val="True" valType="bool" updates="None" name="Full-screen window"/>
<Param val="" valType="str" updates="None" name="HTML path"/>
<Param val="" valType="str" updates="None" name="Incomplete URL"/>
<Param val="testMonitor" valType="str" updates="None" name="Monitor"/>
<Param val="[]" valType="list" updates="None" name="Resources"/>
<Param val="False" valType="bool" updates="None" name="Save csv file"/>
<Param val="False" valType="bool" updates="None" name="Save excel file"/>
<Param val="False" valType="bool" updates="None" name="Save hdf5 file"/>
<Param val="True" valType="bool" updates="None" name="Save log file"/>
<Param val="True" valType="bool" updates="None" name="Save psydat file"/>
<Param val="True" valType="bool" updates="None" name="Save wide csv file"/>
<Param val="1" valType="num" updates="None" name="Screen"/>
<Param val="True" valType="bool" updates="None" name="Show info dlg"/>
<Param val="False" valType="bool" updates="None" name="Show mouse"/>
<Param val="height" valType="str" updates="None" name="Units"/>
<Param val="" valType="str" updates="None" name="Use version"/>
<Param val="[2560, 1440]" valType="list" updates="None" name="Window size (pixels)"/>
<Param val="avg" valType="str" updates="None" name="blendMode"/>
<Param val="$[0,0,0]" valType="color" updates="None" name="color"/>
<Param val="rgb" valType="str" updates="None" name="colorSpace"/>
<Param val="100.1.1.1" valType="str" updates="None" name="elAddress"/>
<Param val="FILTER_LEVEL_2" valType="str" updates="None" name="elDataFiltering"/>
<Param val="FILTER_LEVEL_OFF" valType="str" updates="None" name="elLiveFiltering"/>
<Param val="EYELINK 1000 DESKTOP" valType="str" updates="None" name="elModel"/>
<Param val="ELLIPSE_FIT" valType="str" updates="None" name="elPupilAlgorithm"/>
<Param val="PUPIL_AREA" valType="str" updates="None" name="elPupilMeasure"/>
<Param val="1000" valType="num" updates="None" name="elSampleRate"/>
<Param val="False" valType="bool" updates="None" name="elSimMode"/>
<Param val="RIGHT_EYE" valType="str" updates="None" name="elTrackEyes"/>
<Param val="PUPIL_CR_TRACKING" valType="str" updates="None" name="elTrackingMode"/>
<Param val="broad" valType="str" updates="None" name="expName"/>
<Param val="on Sync" valType="str" updates="None" name="exportHTML"/>
<Param val="None" valType="str" updates="None" name="eyetracker"/>
<Param val="127.0.0.1" valType="str" updates="None" name="gpAddress"/>
<Param val="4242" valType="num" updates="None" name="gpPort"/>
<Param val="ioHub" valType="str" updates="None" name="keyboardBackend"/>
<Param val="exp" valType="code" updates="None" name="logging level"/>
<Param val="('MIDDLE_BUTTON',)" valType="list" updates="None" name="mgBlink"/>
<Param val="CONTINUOUS" valType="str" updates="None" name="mgMove"/>
<Param val="0.5" valType="num" updates="None" name="mgSaccade"/>
<Param val="0.6" valType="num" updates="None" name="plConfidenceThreshold"/>
<Param val="True" valType="bool" updates="None" name="plPupilCaptureRecordingEnabled"/>
<Param val="" valType="str" updates="None" name="plPupilCaptureRecordingLocation"/>
<Param val="127.0.0.1" valType="str" updates="None" name="plPupilRemoteAddress"/>
<Param val="50020" valType="num" updates="None" name="plPupilRemotePort"/>
<Param val="1000" valType="num" updates="None" name="plPupilRemoteTimeoutMs"/>
<Param val="False" valType="bool" updates="None" name="plPupillometryOnly"/>
<Param val="psychopy_iohub_surface" valType="str" updates="None" name="plSurfaceName"/>
<Param val="" valType="str" updates="None" name="tbLicenseFile"/>
<Param val="" valType="str" updates="None" name="tbModel"/>
<Param val="60" valType="num" updates="None" name="tbSampleRate"/>
<Param val="" valType="str" updates="None" name="tbSerialNo"/>
</Settings>
<Routines>
<Routine name="sync">
<TextComponent name="starttext">
<Param val="white" valType="color" updates="constant" name="color"/>
<Param val="rgb" valType="str" updates="constant" name="colorSpace"/>
<Param val="1" valType="num" updates="constant" name="contrast"/>
<Param val="False" valType="bool" updates="None" name="disabled"/>
<Param val="" valType="code" updates="None" name="durationEstim"/>
<Param val="None" valType="str" updates="constant" name="flip"/>
<Param val="Open Sans" valType="str" updates="constant" name="font"/>
<Param val="LTR" valType="str" updates="None" name="languageStyle"/>
<Param val="0.1" valType="num" updates="constant" name="letterHeight"/>
<Param val="starttext" valType="code" updates="None" name="name"/>
<Param val="" valType="num" updates="constant" name="opacity"/>
<Param val="0" valType="num" updates="constant" name="ori"/>
<Param val="(0, 0)" valType="list" updates="constant" name="pos"/>
<Param val="True" valType="bool" updates="None" name="saveStartStop"/>
<Param val="" valType="code" updates="None" name="startEstim"/>
<Param val="time (s)" valType="str" updates="None" name="startType"/>
<Param val="0.0" valType="code" updates="None" name="startVal"/>
<Param val="duration (s)" valType="str" updates="None" name="stopType"/>
<Param val="" valType="code" updates="constant" name="stopVal"/>
<Param val="True" valType="bool" updates="None" name="syncScreenRefresh"/>
<Param val="Press “s” to start" valType="str" updates="constant" name="text"/>
<Param val="from exp settings" valType="str" updates="None" name="units"/>
<Param val="" valType="num" updates="constant" name="wrapWidth"/>
</TextComponent>
<KeyboardComponent name="key_resp">
<Param val="'s'" valType="list" updates="constant" name="allowedKeys"/>
<Param val="" valType="str" updates="constant" name="correctAns"/>
<Param val="False" valType="bool" updates="None" name="disabled"/>
<Param val="True" valType="bool" updates="constant" name="discard previous"/>
<Param val="" valType="code" updates="None" name="durationEstim"/>
<Param val="True" valType="bool" updates="constant" name="forceEndRoutine"/>
<Param val="key_resp" valType="code" updates="None" name="name"/>
<Param val="True" valType="bool" updates="None" name="saveStartStop"/>
<Param val="" valType="code" updates="None" name="startEstim"/>
<Param val="time (s)" valType="str" updates="None" name="startType"/>
<Param val="0.0" valType="code" updates="None" name="startVal"/>
<Param val="duration (s)" valType="str" updates="None" name="stopType"/>
<Param val="" valType="code" updates="constant" name="stopVal"/>
<Param val="last key" valType="str" updates="constant" name="store"/>
<Param val="False" valType="bool" updates="constant" name="storeCorrect"/>
<Param val="False" valType="bool" updates="constant" name="syncScreenRefresh"/>
</KeyboardComponent>
</Routine>
<Routine name="play_tone">
<CodeComponent name="code_Tones">
<Param val="" valType="extendedCode" updates="constant" name="Before Experiment"/>
<Param val="" valType="extendedCode" updates="constant" name="Before JS Experiment"/>
<Param val="count=0" valType="extendedCode" updates="constant" name="Begin Experiment"/>
<Param val="" valType="extendedCode" updates="constant" name="Begin JS Experiment"/>
<Param val="" valType="extendedCode" updates="constant" name="Begin JS Routine"/>
<Param val="current_volumes=volumes[count]&#10;current_tones=tones[count]&#10;current_bands=bands[count]" valType="extendedCode" updates="constant" name="Begin Routine"/>
<Param val="Py" valType="str" updates="None" name="Code Type"/>
<Param val="" valType="extendedCode" updates="constant" name="Each Frame"/>
<Param val="" valType="extendedCode" updates="constant" name="Each JS Frame"/>
<Param val="" valType="extendedCode" updates="constant" name="End Experiment"/>
<Param val="" valType="extendedCode" updates="constant" name="End JS Experiment"/>
<Param val="" valType="extendedCode" updates="constant" name="End JS Routine"/>
<Param val="if count==2904:&#10; count=0&#10;else: count+=1&#10;&#10;&#10;thisExp.addData('volume', current_volumes)&#10;thisExp.addData('tones', current_tones)&#10;thisExp.addData('band', current_bands)" valType="extendedCode" updates="constant" name="End Routine"/>
<Param val="False" valType="bool" updates="None" name="disabled"/>
<Param val="code_Tones" valType="code" updates="None" name="name"/>
</CodeComponent>
<SoundComponent name="Tones">
<Param val="False" valType="bool" updates="None" name="disabled"/>
<Param val="" valType="code" updates="None" name="durationEstim"/>
<Param val="True" valType="bool" updates="constant" name="hamming"/>
<Param val="Tones" valType="code" updates="None" name="name"/>
<Param val="True" valType="bool" updates="None" name="saveStartStop"/>
<Param val="$current_tones" valType="str" updates="set every repeat" name="sound"/>
<Param val="" valType="code" updates="None" name="startEstim"/>
<Param val="time (s)" valType="str" updates="None" name="startType"/>
<Param val="0.025" valType="code" updates="None" name="startVal"/>
<Param val="duration (s)" valType="str" updates="None" name="stopType"/>
<Param val="0.075" valType="code" updates="constant" name="stopVal"/>
<Param val="True" valType="bool" updates="constant" name="syncScreenRefresh"/>
<Param val="current_volumes" valType="num" updates="set every repeat" name="volume"/>
</SoundComponent>
</Routine>
<Routine name="setup">
<CodeComponent name="code">
<Param val="import random&#10;import numpy as np" valType="extendedCode" updates="constant" name="Before Experiment"/>
<Param val="" valType="extendedCode" updates="constant" name="Before JS Experiment"/>
<Param val="frequencies = np.arange(125,8000)&#10;&#10;dx = 4/7875&#10;X = np.arange(-2, 2, dx)&#10;Y = np.exp(-X ** 2)&#10;Y /= (dx * Y).sum()&#10;CY = np.cumsum(Y * dx)&#10;CY = CY/sum(CY)&#10;&#10;band = ['low','high']&#10;sband = np.repeat("silence",88)&#10;hband = np.repeat("high",88)&#10;lband = np.repeat("low",88)&#10;svolume = np.ones(88)*0&#10;lvolume = np.ones(88)*1&#10;hvolume = np.ones(88)*1&#10;&#10;tones = np.ones(88)*100&#10;bands = sband&#10;volumes = svolume" valType="extendedCode" updates="constant" name="Begin Experiment"/>
<Param val="" valType="extendedCode" updates="constant" name="Begin JS Experiment"/>
<Param val="tones = np.ones(88)*100&#10;bands = sband&#10;volumes = svolume&#10;&#10;for i in range (1,9):&#10; random.shuffle(band)&#10;&#10; if band[0] == 'low':&#10; tones = np.hstack((tones, np.random.choice(frequencies,88,p=CY[::-1])))&#10; bands = np.hstack((bands,lband))&#10; volumes = np.hstack((volumes,lvolume))&#10; tones = np.hstack((tones, np.ones(88)*100))&#10; bands = np.hstack((bands,sband))&#10; volumes = np.hstack((volumes,svolume))&#10; tones = np.hstack((tones, np.random.choice(frequencies,88,p=CY)))&#10; bands = np.hstack((bands,hband))&#10; volumes = np.hstack((volumes,hvolume))&#10; tones = np.hstack((tones, np.ones(88)*100))&#10; bands = np.hstack((bands,sband))&#10; volumes = np.hstack((volumes,svolume))&#10; else:&#10; tones = np.hstack((tones, np.random.choice(frequencies,88,p=CY)))&#10; bands = np.hstack((bands,hband))&#10; volumes = np.hstack((volumes,hvolume))&#10; tones = np.hstack((tones, np.ones(88)*100))&#10; bands = np.hstack((bands,sband))&#10; volumes = np.hstack((volumes,svolume))&#10; tones = np.hstack((tones, np.random.choice(frequencies,88,p=CY[::-1])))&#10; bands = np.hstack((bands,lband))&#10; volumes = np.hstack((volumes,lvolume))&#10; tones = np.hstack((tones, np.ones(88)*100))&#10; bands = np.hstack((bands,sband))&#10; volumes = np.hstack((volumes,svolume))" valType="extendedCode" updates="constant" name="Begin JS Routine"/>
<Param val="for i in range (1,9):&#10; random.shuffle(band)&#10;&#10; if band[0] == 'low':&#10; tones = np.hstack((tones, np.random.choice(frequencies,88,p=CY[::-1])))&#10; bands = np.hstack((bands,lband))&#10; volumes = np.hstack((volumes,lvolume))&#10; tones = np.hstack((tones, np.ones(88)*100))&#10; bands = np.hstack((bands,sband))&#10; volumes = np.hstack((volumes,svolume))&#10; tones = np.hstack((tones, np.random.choice(frequencies,88,p=CY)))&#10; bands = np.hstack((bands,hband))&#10; volumes = np.hstack((volumes,hvolume))&#10; tones = np.hstack((tones, np.ones(88)*100))&#10; bands = np.hstack((bands,sband))&#10; volumes = np.hstack((volumes,svolume))&#10; else:&#10; tones = np.hstack((tones, np.random.choice(frequencies,88,p=CY)))&#10; bands = np.hstack((bands,hband))&#10; volumes = np.hstack((volumes,hvolume))&#10; tones = np.hstack((tones, np.ones(88)*100))&#10; bands = np.hstack((bands,sband))&#10; volumes = np.hstack((volumes,svolume))&#10; tones = np.hstack((tones, np.random.choice(frequencies,88,p=CY[::-1])))&#10; bands = np.hstack((bands,lband))&#10; volumes = np.hstack((volumes,lvolume))&#10; tones = np.hstack((tones, np.ones(88)*100))&#10; bands = np.hstack((bands,sband))&#10; volumes = np.hstack((volumes,svolume))" valType="extendedCode" updates="constant" name="Begin Routine"/>
<Param val="Py" valType="str" updates="None" name="Code Type"/>
<Param val="" valType="extendedCode" updates="constant" name="Each Frame"/>
<Param val="" valType="extendedCode" updates="constant" name="Each JS Frame"/>
<Param val="" valType="extendedCode" updates="constant" name="End Experiment"/>
<Param val="" valType="extendedCode" updates="constant" name="End JS Experiment"/>
<Param val="" valType="extendedCode" updates="constant" name="End JS Routine"/>
<Param val="#thisExp.addData('volume', volumes)&#10;#thisExp.addData('tones', tones)&#10;#thisExp.addData('band', bands)" valType="extendedCode" updates="constant" name="End Routine"/>
<Param val="False" valType="bool" updates="None" name="disabled"/>
<Param val="code" valType="code" updates="None" name="name"/>
</CodeComponent>
</Routine>
</Routines>
<Flow>
<Routine name="setup"/>
<Routine name="sync"/>
<LoopInitiator loopType="TrialHandler" name="trials">
<Param name="Selected rows" updates="None" val="" valType="str"/>
<Param name="conditions" updates="None" val="None" valType="str"/>
<Param name="conditionsFile" updates="None" val="" valType="file"/>
<Param name="endPoints" updates="None" val="[0, 1]" valType="num"/>
<Param name="isTrials" updates="None" val="True" valType="bool"/>
<Param name="loopType" updates="None" val="sequential" valType="str"/>
<Param name="nReps" updates="None" val="2904" valType="num"/>
<Param name="name" updates="None" val="trials" valType="code"/>
<Param name="random seed" updates="None" val="" valType="code"/>
</LoopInitiator>
<Routine name="play_tone"/>
<LoopTerminator name="trials"/>
</Flow>
</PsychoPy2experiment>