11# CPP_PTB documentation
22
3- <!-- vscode-markdown-toc -->
3+ <!-- lint disable -->
44
5- - 1 . [ the CFG structure] ( #theCFGstructure )
6- - 2 . [ Setting up keyboards] ( #Settingupkeyboards )
7- - 3 . [ functions descriptions] ( #functionsdescriptions )
8- - 4 . [ Annexes] ( #Annexes )
9- - 4.1. [ Experiment template [ WIP ]] ( #ExperimenttemplateWIP )
10- - 4.2. [ devSandbox (stand-alone)] ( #devSandboxstand-alone )
5+ <!-- TOC -->
116
12- <!-- vscode-markdown-toc-config
13- numbering=true
14- autoSave=true
15- /vscode-markdown-toc-config -->
16- <!-- /vscode-markdown-toc -->
7+ - [ CPP_PTB documentation] ( #cpp_ptb-documentation )
8+ - [ the CFG structure] ( #the-cfg-structure )
9+ - [ Setting up keyboards] ( #setting-up-keyboards )
10+ - [ functions descriptions] ( #functions-descriptions )
11+ - [ Annexes] ( #annexes )
12+ - [ Experiment template [ WIP ]] ( #experiment-template--wip- )
13+ - [ devSandbox (stand-alone)] ( #devsandbox-stand-alone )
1714
18- ## 1. <a name =' theCFGstructure ' ></a >the CFG structure
15+ <!-- /TOC -->
16+
17+ <!-- lint enable -->
18+
19+ ## the CFG structure
1920
2021The ` cfg ` structure is where most of the information about your experiment will
2122be defined.
@@ -29,6 +30,7 @@ filled after running `setDefaultsPTB.m` and `initPTB.m`.
2930 that that do not "depend" on your system or that PTB cannot "know". For
3031 example the width of the screen in cm or the dimensions of the fixation
3132 cross you want to use...
33+
3234- ` initPTB.m ` will fill in the fields that ARE system dependent like the
3335 screen refresh rate, the reference of the window that PTB opened and where
3436 to flip stimulus to.
@@ -160,7 +162,7 @@ cfg.software.version % psychtoolbox version
160162cfg.software.runsOn % matlab or octave and version number
161163```
162164
163- ## 2. < a name = ' Settingupkeyboards ' ></ a > Setting up keyboards
165+ ## Setting up keyboards
164166
165167To select a specific keyboard to be used by the experimenter or the participant,
166168you need to know the value assigned by PTB to each keyboard device.
@@ -180,6 +182,7 @@ response box in the `cfg` structure
180182- ` cfg.keyboard.responseBox ` would be the device number of the device used by
181183 the participant to give his/her response: like the button box in the scanner
182184 or a separate keyboard for a behavioral experiment
185+
183186- ` cfg.keyboard.keyboard ` would be the device number of the keyboard on which
184187 the experimenter will type or press the keys necessary to start or abort the
185188 experiment.
@@ -190,32 +193,33 @@ same.
190193Using empty vectors (ie ` [] ` ) or a negative value for those means that you will
191194let PTB find and use the default device.
192195
193- ## 3. < a name = ' functionsdescriptions ' ></ a > functions descriptions
196+ ## functions descriptions
194197
195198The main functions of the toolbox are described
196199[ here] ( ./10-functions-description.md ) .
197200
198- ## 4. < a name = ' Annexes ' ></ a > Annexes
201+ ## Annexes
199202
200- ### 4.1. < a name = ' ExperimenttemplateWIP ' ></ a > Experiment template [ WIP ]
203+ ### Experiment template { WIP}
201204
202205Will be moved to a different repository
203206
204- ### 4.2. < a name = ' devSandboxstand-alone ' ></ a > devSandbox (stand-alone)
207+ ### devSandbox (stand-alone)
205208
206- Will be moved to a different repository
209+ Will be moved to a different repository.
207210
208211This script is a stand-alone function that can be useful as a sandbox to develop
209212the PTB audio/visual stimulation of your experiment. No input/output required.
210213
211- Here, a tutorial from https://peterscarfe.com/contrastgratingdemo.html is
214+ Here, [ a tutorial] ( https://peterscarfe.com/contrastgratingdemo.html ) is
212215provided for illustrative purpose (notice that some variable names are updated
213216to our code style). For your use, you will delete that part.
214217
215218It is composed of two parts:
216219
217220- a fixed structure that will initialize and close PTB in 'debug mode'
218221 (` PsychDebugWindowConfiguration ` , ` SkipSyncTests ` )
222+
219223- the actual sandbox where to set your dynamic variables (the stimulation
220224 parameters) and the 'playground' where to develop the stimulation code
221225
0 commit comments