Why the hubub, Bub?
Trainers like Dual N-Back Lite have become popular lately because the research of Susanne Jaeggi and Martin Buschkuehl indicated a link between a working memory training task (the dual n-back exercise) and fluid intelligence, as measured by a German IQ test. The hope is that training with such exercises as dual n-back serves to produce a temporary increase in the cognitive capabilities of the trainee. (Note that though most people in the cognitive sciences believe the team's research is of importance, they caution more research is needed to corroborate the results.)
What is working memory?
Working memory is the active "storage space" we use when working on a problem, allowing us to manipulate the information while we work towards a solution. Working memory is used, for example, when we recall something from long-term memoryit gets stored in working memory, ready for us to use. Short term memory on the other hand is considered by some as a subset of working memoryworking memory includes not only the memory storage of short term memory but also information processing features.
Why did you write this program?
A lot of evidence suggests that cognitive, not just physical, exercise is good for us. This project resulted from my wanting to see more (free!) choices out there in cognitive training tasks (and it doesn't hurt a resume). The dual n-back trainers I've seen have had drawbacks I didn't like so I wrote this one (what can I sayI'm picky).
But it's so simple, so plain looking.
I could have glammed it up but I didn't. I wanted to keep the design basic, to provide a lean, distraction-free trainer like the one used in the study.
- Designed for Windows (ready-to-run with no dependencies, unless you want to self-compile) and Linux (compilation needed)
- The trainer's audio has been graced by voice artist Melba Sibrel who has provided the letter voicings (if you're accustomed to synthesized letter sounds, you're in for a treat!)
- Designed to be rugged, written in C++ and using only SDL, Dual N-Back Lite relies on few dependencies
- Thorough documentation to get you started
- Simple, no distractions training interface
- Designed to follow the simple trainer used by Jaeggi in "Improving Fluid Intelligence With Training on Working Memory"1
- The training sets feature intentionally placed distractor targets (for example a 2-back target in a 3-back session), following the design outlined in the study
- The Linux version has no dependencies other than plain SDL (and a compiler is needed to compile); it also features an automated sound manager, with hands-off fall-through methods to get your sound running
| The start screen
| Training without keypress feedback
|| Training with right/wrong keypress feedback
The trainer can be downloaded from its home at SourceForge: Dual N-Back Lite.
Basis for Dual N-Back Lite and instructions:
Dual N-Back Lite attempts to mimic the trainer used in the paper: "Improving fluid intelligence with training on working memory"1 by Susanne Jaeggi et al. The interface has been kept simple and allows removing any keypress or right/wrong feedback (see screenshots) from the training screen for fewer distractions (see below for instructions on this feature).
The object is to correctly identify targets, both visual and audio, which occurred n steps back in the sequence in which you see and hear them.
dual 2-back example:
In training, if you see a visual target, press "a"; while for an audio target, press "l", before the next targets appear/are spoken (this choice of which-keys-to-press is somewhat unfortunate for English speakers as one would like "a" to represent an "a"udio target but I'm keeping to the paper).
Blocks, sessions and n-levels:
- Your n-level is shown in the lower right corner of the screen.
- The n-level refers to how many steps "back" you need to remember the spoken letter and visual square position in order to compare it to the current letter or square. If the letter or square MATCH what you heard or saw n steps ago, this counts as a "target" and you should press the appropriate key ("a" for a spoken letter match and "l" for a visual square match).
- Your block number is shown in the lower left corner of the screen.
- A BLOCK consists of a sequence of 20+n spoken letters and visual targets.
- Each block has 6 visual and 6 audio targets.
- In each block, there are exactly 2 "simultaneous" targets where BOTH a spoken letter will match the letter spoken n steps ago AND a visual square position will match that of a visual square n steps ago.
- The session length defaults to 20 blocks (this is the number used in the study cited in the paper, but this can be adjusted in the (o)ptions screen).
Scoring follows the description in the paper:
- if a user either presses a target key when there is no target or doesn't press a key when there is one, it is counted as a MISTAKE
- if the user makes less than 3 mistakes in EACH mode (audio AND visual), then the n-level increases by one
- if the user makes more than 5 mistakes in EITHER mode (audio OR visual), then the n-level decreases by one (note: there is some ambiguity about whether more than 5 mistakes were required in only ONE mode or BOTH modes to decrease the n-levelI have chosen the more restrictive version).
- in all other cases, the n-level stays the same
Keypress and right/wrong feedback:
- The default is for no feedback.
- In the (o)ptions screen, you can turn on keypress feedback (white markers appear at the bottom of the display window whenever an "a" or "l" key is pressed) and you can turn on right/wrong feedback (a red "x" appears for a mistake while a green check appears when you correctly press a key for a target match). Note that both the white markers and the "x"/check-marks cannot be turned on simultaneously.
- The (esc) key will stop any training session, returning you to the start screen.
What you need to run Dual N-Back Lite:
Once you have the executable, either launch from the command line or, most desktop managers let you double-click on the icon of an executable to launch it. (NOTE: the Dual N-Back Lite window must be ACTIVE to receive keyboard input; if it's not already active, a mouse click on the window will make it active)
- for Windows: nothing extra is needed, other than,
- ensuring the executable is in the same directory as the "data" folder
- the included SDL.dll and SDL_Mixer.dll libraries are either in the same folder as the executable OR the SDL.dll and SDL_Mixer.dll libraries are in your windows/system directory
- for Linux: you'll need to compile* it (see below for detailsa g++ specific makefile is given, to make the process easy and g++ can be downloaded if you don't have it) and you'll need to have SDL installed (just the basic SDL packageno additional add-ons like the SDL mixer (the mixer is only used in the Windows version), etc...) and, as with Windows, you'll need to ensure the "data" folder is in the same directory as your executable
(*a note on Linux and compiling: why do I need to compile it? (you may ask)different flavors of Linux are often different enough to require compiling the code in the particular Linux OS (vs. simply distributing an executable file as is often possible with Windows))
Compiling on Your Own (for beginners):
To install under Linux, you can use the included makefile if you have g++ (if not, g++ is an easy download). You'll also need to download SDL (you'll need BOTH the SDL-develop package to compile and the SDL package to run the program) if you don't already have them. Then, extract the source archive called src_linux (this can be done, for example, from the GNOME or KDE desktop). Open a shell (Applications>System Tools>Terminal, for example, in GNOME) and navigate to the (extracted) directory labeled "src_linux". Once there, type in the command "make" at the shell prompt. After the compiler is done (you may get several "linker input file unused because linking not done" messages during the compileignore them), an executable file called "DualNBack" should appear in the "src" directory's PARENT directory. Ensure the exracted Data folder is in the same folder as the "DualNBack" executable and then, while in that directory in the shell, type: "./DualNBack" (adding any audio command line switches if desired) and play.
What's a make file?
This is the conductor (as in orchestra) to get everything compiled easily (you COULD, for example with g++, type in a (really) long line at the command prompt to get things to compile; the make file just reduces the workload). The "make" utility is smart in that it will automatically look for a file called "Makefile" (with one or two variations) in the directory from which it's run and execute the instructions it finds in this file (there is an option, though, to specifiy which counductor-file to use for the "make" utilityeg "$make -f [filename]").
Why won't it compile under Linux?
So you've run "make" and you don't get a successful compile? I can say at least, it compiles on a (normal?) version of Fedora Core 8 (as mentioned, you need to have g++ and SDL installed for the included makefile to work). Beyond that, it's probably up to Google to find out why it won't compile. (Every effort has been made to reduce peripheral libraries and to keep the code to platform independent C/C++ standards. However, I'm told that what compiles on one machine may need some tweaking to compile on another.)
If you want to (or need to) compile the code on your own, you can use VC++, adding all files in the extracted "src" directory into a VC++ project (just add them in one big group into a new VC++ console application). If you haven't already done so, you'll need to download the SDL developer libraries (be sure to get the mixer library and include files too) from the SDL site and inform Visual C++ about SDL (there are several good resources online for how to get VC++ to compile with SDL (for example this tutorial)BRIEFLY, it involves
- telling VC++'s "include directories list" about the "include" folder in the SDL developer downloads
- telling VC++'s "lib directories list" about the "lib" folder in the extracted download*
- setting VC++ to "multithreaded DLL" in the C++ code generation menu (this is important since the SDL.dll itself has been compiled with this option "selected" and mixing and matching compiled code with different threading options can create problems)
- putting the SDL.dll and SDL_mixer.dll in a spot where your compiled program can find it (either in the same directory as your executable or in your Windows/System folder)
- also, building the RELEASE version seemed to work better than building the DEBUG version.
( *NOTE: at least in Windows 98, it seemed necessary, in addition to the above, to add (Project>Add to Project) the SDLmain.lib and SDL.lib files to the project itself (so they appear with all the other source and header files in the project); not adding the SDL_mixer.lib didn't seem to produce problems)
In more DETAIL, here are the steps I used on an older version of VC++ (6.0) and a Windows 98 machine
- download SDL, being sure to get the developer files too
- open VC++ and create a new console applicationWin32 console app (NOTE: the PROJECT NAME becomes the name of the FOLDER in which Debug and Release folders exist AND the default name of the final executable generated by the Build option)
- under Build>Set Active Configuration, set to RELEASE
- under Tools>Options>Directories, add the folders: sdl\lib and sdl\include that you downloaded from SDL
- in Project>Settings>Link, ADD SDL.lib SDLmain.lib and SDL_mixer.lib
- in Project>Settings>C++>Code Generation set it to Multithreaded DLL (release version, not debug)
- using Project>Add to Project>Files (this step may or may not be necessary on all PC's) add the sdl.lib, sdlmain.lib and sdl_mixer.lib to the project (these do not actually get put in the project folder, only tells VC++ about them)on my PC, they are in C:\Program Files\SDL\lib
- in the IE file browser (OUTSIDE of VC++), in the created project folder, add the .dll files (sdl.dll and sdl_mixer.dll) (this step is not needed if they're in the Windows/System folder already)
- add all the files in src_windows from the SourceForge download into the created project folder and then Project>Add to Project all the files from src_windows
- Build>Build [project name].exe
Problems on Windows
I don't have access to many Windows machines so I can't give much information about that environment. Of four different Windows machines tried,
- a Windows 98 machine failed on all SDL video applications (gave a general protection fault on SDL_Init for video)
- a Windows 98 machine ran video; sound worked but was low quality
- a Windows XP laptop ran Dual N-Back Lite successfully
- a Windows XP desktop ran Dual N-Back Lite successfully
Audio (and/or the program freezes when it tries audio in Windows)
(Note: Dual N-Back Lite will try to default to single n-back (visual targets only) if audio doesn't work.)
- Windows: if your audio is not working in Windows, it appears compiling an SDL application in Windows makes the audio default to DirectX audio, so DirectX audio must be working properlyyou can try running "dxdiag" at a DOS prompt ensure DirectX audio works OK and troubleshoot it if need be (though you also might have some luck with the command "set SDL_AUDIODRIVER=waveout" at the DOS command prompt just before running the executable from the same promptno promises on latency however...); also, if the program freezes any time before showing the actual splash screen, the audio may be the culpritrun with the switch "-s NONE" to at least get the graphics portion of Dual N-Back Lite running (in single n-back mode)
- Linux: if your audio is not working in Linux, you can try running Dual N-Back Lite from the command line, using the switches to manually tell SDL which audio system to try. See below for switch syntax.
(NOTE: for Linux, audio was designed to be robust; it was designed with the novice Linux user in mind; its default mode is to run an auto-find search (by trying different SDL_AUDIODRIVER variablesit tries the SDL "default" audio setting, then the "alsa" system and finally the "dsp" device, all channeled through SDL) to get sound workingthe auto-find search though is not exhaustive and/or might not grab the audio application you want it to useyou may still get audio results and/or can set it using the correct device name in the command line switch)
- switch syntax
list of SDL supported audio systems (used for the -d switch argument; case sensitive)
- -s [server name] the possibilities are: "NONE" and "SDL"
- -d [device name] for SDL, the 'devices' are simply the SDL_AUDIODRIVER environment variable listed below
- example of command line launchnavigate to the game's directory then: [@shell prompt]./DualNBack -s SDL -d dsp
- example to turn audio OFF, run from the command line with the "-s NONE" switch (sets audio server to NONE): that is, once in the game's directory, type: [@shell prompt]./DualNBack -s NONE
[a user familiar with SDL might realize these to simply be the SDL_AUDIODRIVER environment variable options; this IS what they are; the game will try to set and unset the SDL_AUDIODRIVER environment variable in the program's audio routines (note: if it does make a change, it is not 'exported' and it is designed to restore the environment variable back to its original value on program exit)]
- openbsd (OpenBSD)
- dsp (OSS /dev/dsp: Linux, Solaris, BSD etc)
- alsa (Linux)
- audio (Unix style /dev/audio: SunOS, Solaris etc)
- AL (Irix)
- artsc (ARTS audio daemon)
- esd (esound audio daemon)
- nas (NAS audio daemon)
- dma (OSS /dev/dsp, using DMA)
- dsound (Win32 DirectX)
- waveout (Win32 WaveOut)
- baudio (BeOS)
- sndmgr (MacOS SoundManager)
- paud (AIX)
- AHI (Amiga)
- disk (all; output to file)
You can help improve this projectone of the difficulties in creating cross-platform applications is having little idea about the success or failure of the program on systems the developer doesn't have access to for testing. For example, if you took the time and trouble to download Dual N-Back Lite and it doesn't work right on your system, you can let me know here...
You can also e-mail comments. Contact firstname.lastname@example.org.