Psychophysics Toolbox

for Mac OS 9

Note: This is the web site for Version 2 of the Psychtoolbox. Version 2 is no longer under development and this site is not actively maintained. See http://psyctoolbox.org for the web site for Psychtoolbox Version 3.

OS9: Psychtoolbox
Links
Mac OS X: Classic
Classic doesn't synch to blanking
Matlab bugs
Student Matlab bugs
Free upgrade to Matlab 5.2.1
Version numbers

Backwards incompatibilities
Graphics driver updates & bugs

Psychtoolbox bugs
History of changes
Credits

August 2003 UPDATE: All development efforts are focused on the imminent release of the Psychtoolbox for Mac OS X. This effort will be maintained until that release stabilizes, reaching the same level of reliability and polish as the Mac OS 9 version, which is practically bug-free. The Windows version has known bugs and limitations that we don't have the resources to address. The new Mac OS X release is built partly on OpenGL, a graphics library available for Mac, Windows, Linux and many other operating systems. We plan to port the new release to Windows but that will occur only after it reaches a polished state on Mac OS X. This is our attempt to give the maximum research-enabling benefit to the greatest number of users, since the user community for Psychtoolbox is still more than half Mac users.

-Allen Ingling, David Brainard, and Denis Pelli.


The new Psychtoolbox function LoadClut provides transparent support for all graphics cards, including those with more-than-8-bit DACs. We recommend the ATI Radeon 8500 card, which has 10-bit DACs, CopyBits 180 MB/s, and costs $300.


Psychophysics Toolbox for Mac OS 9

The Mac version is stable and polished, and more or less bug-free. Hundreds of scientists are using it. See intro for an overview, MovieDemo.m for an example, or history for the latest changes. Or read the very short list of known bugs.

We suggest all Mac OS 9 users upgrade to the latest Psychtoolbox, which requires Matlab 5.2.1, the latest and greatest. It would be possible to use the current Mac Psychtoolbox with Matlab 5.0, 5.1, or 5.2, with minor incompatibilities that you could overcome, but there's no reason to. We suggest that all Mac OS 9 users upgrade to Matlab 5.2.1.

A present the Mac Psychtoolbox requires Mac OS 8 or 9, or Classic. We will support Mac OS X Matlab in the next major release; see future plans.


Links

How to write portable scripts, compatible with both Mac and Win
Win vs. Mac differences
G4 floating point twice as fast as G3
Compatible with G3, G4, and Mac OS 9
Future plans



Mac OS 9

Matlab and the Psychophysics Toolbox run very well on the PowerMac PowerPC and G3 and G4 computers with Mac OS 8 and 9, including the latest, 9.2.2. The G4 has significantly improved floating point performance, so Matlab flies!


Mac OS X Classic

The Mac OS X "Classic" environment emulates Mac OS 9. In our limited testing, Matlab 5.2.1 runs fine in the Classic environment. Although much of the OS 9 Psychtoolbox will run in this mode, the Classic environment does not provide a mechanism to synchronize to the display's vertical blanking (see below). Without this ability, running the toolbox under Classic/Matlab 5.2.1 is not viable for serious work.

An Apple Knowledge Base article notes that Mac OS X 10.2 Classic limits the amount of Temporary memory (shared among all running Classic applications) to less than 128 MB. (Thanks to Frans Cornelissen who culled this from www.macintouch.com.)

Our floating point benchmark, reported by DescribeComputer, shows that FFT2, the only computation in Pelli's lab that observers need to wait for, runs at the same rate under Classic and under Mac OS 9.2.1. Matlab's built-in benchmarks provided by BENCH test a wider range of tasks, with results shown in the figure below.

The green bars show the basic result. The gray bars show what one gets by tweaking, using the unix command "renice" to assign the highest possible priority (-20) to the Classic process. The vertical scale is speed, running under Mac OS X Classic, relative to speed under Mac OS 9.2.1. The name of each test is provided along the horizontal axis. The first test is ours (in DescribeComputer) for Matlab's FFT2 command. The rest are from Matlab's BENCH command.

HELP BENCH says that "LU" is mostly floating point (Matlab's "LINPACK"), and LU agrees with FFT2 in showing nearly the same (96%) speed under Classic. Increasing the priority brings the LU speed up to 100%. The biggest effect in the BENCH results is the 3-D test ("Surf plot of 'peaks', 3-D polygonal fill graphics") which runs at 71% speed under Classic (standard priority) or 91% (max priority). Even that difference seems too small to matter to most users. We conclude that Matlab does run slightly more slowly under Classic than under Mac OS 9, but the difference is negligible.

Classic doesn't synch to blanking!

All the PsychDemos and PsychTests run fine under Classic, but several (FlickerTest, PeekBlankingTest) indicate irregular timing of the graphics driver blanking interrupt. It appears that the "blanking" interrupt is simulated, occurring at a nominally regular interval of arbitrary phase, not actually tied to the video card's blanking signal. Furthermore the interrupt is often randomly delayed by milliseconds, apparently as a result of interruptions by other Mac OS X processes. The poor synchronization produces visible artifacts, which FlickerTest reveals clearly. This won't matter at all for experiments that only need to present static stimuli, but is a concern for presentation of movies.

In the past, since Mac OS 6, the blanking interrupt has generally been reliable. [Only one exception was reported, on a particular PowerBook model. As here, it appeared that the interrupt was simulated, not locked to the screen blanking.] However, whenever possible, we have always preferred to rely on SetClut's common side effect of waiting for blanking. If one manipulates all of the latest driver controls documented by Apple, most graphics drivers offer the feature of having SetClut (i.e. cscSetEntries and cscDirectSetEntries) wait for blanking before returning. Alas, this is not true of the two drivers (for built-in screen and the external graphics port) provided by Classic on the PowerBook G4/500 that we tested.

However, there is still cause for hope. OpenGL offers synchronization, which we haven't explored yet.

Synchronizing one's program to the display has always been one of the hardest things to achieve across the whole gamut of video drivers. Each new generation of Macs and graphics cards seems to bring new issues. Each new driver requires testing, and many require special tricks. Screen.mex, in the Psychtoolbox, has always tried to take care of this for the user, so that the user can simply write Screen 'WaitBlanking' and rely on Screen to do the right thing to get the desired behavior out of whatever driver is in use. (However, we do suggest running ScreenTest, and now FlickerTest, to make sure it succeeds.) Currently, Screen uses the SetClut side effect, if available, or waits for the blanking interrupt. It appears that success under Classic will require developing a third solution, based on OpenGL. We'll keep you posted.

In the meantime, we believe that Psychtoolbox and Matlab under Classic are fine for static stimuli, and we hope users will write to the forum, confirming or disconfirming this impression.

An Apple Knowledge Base article notes that Mac OS X 10.2 Classic limits the amount of Temporary memory (shared among all running Classic applications) to less than 128 MB. (Thanks to Frans Cornelissen who culled this from www.macintouch.com.)


Mac: Bugs in Matlab 5.2.1

There are very few bugs in Matlab 5.2.1. Over the years, we have faithfully reported Matlab bugs to Mathworks as we discovered them, and were very pleased to discover that nearly all were fixed in 5.2.1, released July 31, 1998. Here are the few remaining bugs that we know of, mostly discovered since 5.2.1 was released. The M files documenting these bugs reside in the PsychMatlabTests subdirectory of the Psychtoolbox. (See download page to upgrade from MATLAB 5.2 to 5.2.1)

Case ID M file Bug
84454 ConcatenationBug Square and curly braces sometimes can't embrace multiple lines.
201530 fprintfBug FPRINTF may interpret the first argument as a filename.
297266 fprintfEmpty FPRINTF terminates when it gets an empty matrix [].
319124 fprintfLeak FPRINTF leaks memory (uses up the Temp memory heap).
41758 helpLinelength HELP terminates if a line exceeds 131 characters.
187040 iminfoBuglet IMINFO gives misleading error message.
230201 SpuriousDebuggerError Matlab debugger works, but gives a spurious error message.
230202 StaleDirectoryCacheBug Matlab's directory cache is not updated when you add files to /toolbox/.
297565 ylabelBug YLABEL command (in Matlab plots) bug and work around. NOTE: Jon Jacobs's "TextEnd" patch fixes this bug. Download Jon Jacob's TextEnd patch (28 KB).
OpenDLGCloseTest INPUTDLG and QUESTDLG fail to correctly restore the current port.

If you find a bug in Matlab, please report it to Mathworks: bugs@mathworks.com. You can help your friends by sending a copy (cc: psychtoolbox@yahoogroups.com) to the Psychtoolbox forum.



Mac: Bugs in Student Matlab 5.0

Student Matlab is a very inexpensive way to buy Matlab to try it out, costing less than $100. It includes the Signal Processing Toolbox.

Version 2.35 of the Psychtoolbox was fully compatible with Matlab 5.0 (regular andStudent edition) or better. It's still available. Subsequent versions of the Psychtoolbox have only been tested with Matlab 5.2.1, and some incompatibilities with version 5.0 have crept in. A few programs run afoul of the Student edition's maximum array size, but they could easily be fixed to respect it. We suppose that all these minor incompatibilities could easily be worked around if someone really wanted to run 5.0, but 5.0 (regular and Student editions) is so buggy that this scenario seems unlikely.

Buying it:

  1. Student Matlab 5 costs less than $100. It's published by Prentice Hall as a book with an enclosed CD-ROM containing the software. Make sure you get version 5 (or better), published in 1997, not the obsolete version 4, published in 1992.

Student Matlab 5.0 Limitations:

  1. Its only difference from the regular edition is a limit on the maximum array size to be no more than 2^14 elements, eg the largest square matrix is 128x128. To make your programs compatible with both Student and regular editions of Matlab, you may want to use the built-in function COMPUTER to determine the current upper limit on array size:

    [c,maxElements]=computer

  2. The most recent version of Student Matlab is 5.0, issued in December 1996, whereas regular Matlab 5.2.1 was issued in July 1998.

Matlab 5.0 Bugs (common to regular and Student editions), fixed in later versions:

  1. Matlab 5.0 has a file-caching bug, so if you run an M file or script, edit it, and then hit Command-E, Matlab runs the old version (but, to really confuse you, error messages display text from the new version). Typing "clear all" (to flush the cache) before hitting Command-E works ok.
  2. Matlab 5.0 makes a spurious call to the Mac OS GetMenuBar before each call to any MEX, which wastes 0.4 ms every time, and leaks 64 bytes of memory. You can use the Psychtoolbox PatchTrap to substitute a dummy routine for GetMenuBar, eliminating the bug. See LeakTest.m and PatchTrap.mex.



Mac: Mathworks's free patch upgrades Matlab 5.2 to 5.2.1



Version numbers



Backwards incompatibilities


Mac: Graphics driver updates & bugs

10-bit-accurate cards    
ATI Radeon 7000 CopyBits 13 to 80 MB/s $130
ATI Radeon 8500 CopyBits 180 MB/s $300
ATI Radeon 9000 Pro CopyBits 300 MB/s Apple

We recommend the ATI Radeon 7000, 8500, and 9000 Pro, which have 10-bit DACs with driver support. The 9000 Pro is only available through Apple. Each of these three cards can drive two displays, independently, at once. Each requires an AGP slot. They are the only Mac graphics cards on the market that have passed all our tests for 10-bit accuracy. To attain 10-bit accuracy on the 7000 you must use the free ROM updater from ATI. The CopyBits speed of the 7000 is remarkably slow and depends on odd details (see long table below). ATI has acknowledged the problem but hasn't committed to fixing it.

Many users are reporting trouble synching to blanking when running Matlab in the Mac OS X Classic environment. Classic seems to be fine in most ways, but at the moment there is no way to synch to blanking under Classic. We can only suggest that you use static stimuli or return to Mac OS 9. Read our report.

An Apple Knowledge Base article notes that Mac OS X 10.2 Classic limits the amount of Temporary memory (shared among all running Classic applications) to less than 128 MB. (Thanks to Frans Cornelissen who culled this from www.macintouch.com.)

12/02. ATI has posted on their web site a ROM updater for the ATI Radeon 7000 that fixes the CLUT problems, attaining full 10-bit-accuracy. Yay!

ATI Rage 128 and Rage Mobility 128. Driver updates from ATI. Updates from Apple: 120113. A popular 8-bit-DAC graphics card built-into many PowerMacs. Runs very well ever since Bob Dougherty discovered, in 1999, the priority dipping trick to get SetClut to synch with blanking. ClutTimeTest passes the ATI Rage Mobility 128 built into Denis Pelli's G4/500 PowerBook, but fails the same chip in David Jones's G3 iBook/600. The built-in ATI Rage Mobility 128 (AGP 2x) "ATY,RageM3p29s" (.Display_Rage128 version 1.0f95) takes only 0.3 ms to do SetClut if cscSetClutBehavior is 0, but takes two frames (at 60 Hz) to do SetClut if cscSetClutBehavior is 1. However, it's quick and waits for blanking if we use the priority dipping trick, explained below.

ATI Radeon card: 9200 (PCI). Steve Engel writes (11 July 2006), "We have the ATI Radeon 9200 (PCI) in a G4 running OS 9 with the latest driver downloaded from ATI's support page. According to ScreenTest, ClutTest, and LoadClutTest the card has 10-bit DACs, but TwoBitFlickerTest and our own photometric measurements indicate that the last 2 bits are not actually affecting the displayed color."

ATI Radeon cards: 7000, 7200, 7500, 7500 Mobility, 8500, 9000, 9000 Mobility, and 9000 Pro. There are many models of the Radeon. Some are fast (CopyBits 180 MB/s), others are slow (13 MB/s). All have 10-bit DACs, but only some have drivers that allow you to achieve 10-bit accuracy. We recommend 10-bit DACs, because they increase resolution by a factor of 4, which, at least for some experiments, allows direct presentation of threshold contrasts on CRT monitors, without having to resort to tricks. At present the ATI Radeon 7000, 8500, and 9000 Pro are the only Mac graphics cards on the market that have passed all our tests for 10-bit accuracy. We anticipate that the rest of the ATI retail products (Radeon 7200, 9000) will soon follow suit, achieving 10-bit accuracy. We do not expect Mac OS 9 updates of ATI's OEM products (Radeon 7500, 7500 mobility, 9000 mobility, 9000 Pro).

Many of the ATI cards are (or were) only available as built-in options in certain Apple computers. ATI currently (1/03) sells the Radeon 7000 (for PCI slot) for $130 and the 8500 (for AGP slot) for $300. buy.com sells the 9000 (for AGP slot) for $155.

Hoping for fixes of ATI products. This depends crucially on whether the product is sold retail by ATI, or ATI is merely the OEM (orginal equipment manufacturer) and it's actually sold by Apple. ATI has been very responsive to bug reports for their retail products (see table below), and we anticipate that nearly all bugs will be fixed by the end of 2002. Unfortunately, the situation is very different for their OEM products. In that case it is necessary for us to convince Apple that there is a bug and that it matters. Then Apple may request that ATI fix the bug, and, again, it is up to Apple to decide whether to subsequently distribute the fix (e.g. as a loose software update, or folded into the next OS release). No one expects Apple to release updates for Mac OS 9 software, so the existing bugs in ATI OEM graphics under Mac OS 9 will remain forever. That includes all ATI graphics in PowerBooks and iBooks. The ATI retail cards are: Radeon 7000 and 8500, which are still sold, and the 7200 pci and agp (aka RADEON pci and agp), which are no longer sold. The Radeon 7500, mobility 7500, and 9000 are all OEM.

Wait for blanking. Doug Taylor has spent some time figuring out the SetClut behavior of the ATI drivers. They respond to the cscSetClutBehavior call, which specifies whether the SetClut should be performed immediately or postponed until blanking. When that is set to zero, the ATI cards immediately load the CLUT and return. When cscSetClutBehavior is set to 1, and you ask the driver to set the CLUT, the driver waits until blanking, sets the CLUT, and then returns. We like that wait because it provides an easy way to synchronize our programs to blanking.

Priority dipping. Graphics drivers are designed to run at priority zero, but we find it useful to run them at raised priority (up to 7) to minimize interrupts. Some drivers are unaffected by this, but the current ATI drivers have trouble operating at raised priority. Fortunately Bob Dougherty's priority dipping trick allows us to get the behavior we need. We call the driver at raised priority (>1) and, when the driver returns, momentarily drop the priority (to 0 or 1), before taking it back up. (3 July 2002)

Testing CopyBits speed (MB/s). Today, visual psychophysics experiments are usually movies, with an arbitrary new image on each frame. How big a movie you can show depends on the pixelSize, the frame rate, and how fast CopyBits can transfer from your offscreen window to your screen. This is measured and reported by ScreenTest.

Testing accuracy (bits). We have taken two approaches: GetClut and luminance tests. GetClut (if it works correctly) tells us what numbers have been loaded into the CLUT, to be sent to the DAC. The luminance tests confirm that the final stimulus is what we expect. When available, GetClut has nearly always turned out to be right. (The only exception is the Radeon 7500 Mobility, which GetClut reports as 8-bit but seems to actually deliver 10-bits through each DAC.) ScreenTest, ClutTest, and LoadClutTest all do thorough GetClut tests, and give a passing grade in 10-bit mode only to the Radeon 8500. (These tests have been made more rigorous in release 2.52.) Doug Taylor and Keith Schneider have confirmed 10-bit performance of the Radeon 7000 and 8500 using visual and photometric tests. It would be difficult for their tests to detect the small errors of the 7000. Doug Taylor's visual and photometric tests confirm that with its current driver, his Radeon 7500 attains only 8-bit performance, which the GetClut tests had indicated, but he hasn't yet tried the latest Apple driver. Chris Chase has performed the same tests on his Radeon 7500 Mobility (built-into his PowerBook) and finds that it passes both visual and photometric tests, though it fails the tests based on GetClut.

Also see: Ben Singer's ATI Radeon page has technical info about the 10-bit DACs. Driver updates from ATI. Updates from Apple: 120113. Here is a newsgroup link for the ATI drivers.
http://bbs.xlr8yourmac.com/ubb/Forum24/HTML/000205.html

ATI Radeon 9200 PCI card.

13 July 2006. engel at psych.ucla.edu

Driver .Display_DualHead version 1.0.1f58 8-bit accuracy. Comments. Works fine if you're satisfied with 8-bit accuracy. All software tests suggest 10-bit DAC support, but measurements and visual observation of luminance indicate only 8-bit DAC support.

CopyWindow (ie CopyBits) 86 88 88 MB/s
CopyWindow (ie CopyBits) VRAM 1539 1520 1524 MB/s

Power Mac G4/400, Mac OS 9.2.2 ************************************
G4, 400 MHz, memory bus 100 MHz, 63.542 Mflop/s
*** Screen 0 *************************************************************
"ATY,Bugsy_A" (.Display_DualHead version 1.0.1f58) in slot SLOT-C
10 bit dacs. 1152x870 75 Hz. (56,60,65,67,70,72,73,75,76,85,90,100,120,150,160,200 Hz avail)

ATI Radeon 7000 PCI card (Mac Edition). This is an ATI retail product.

Driver .Display_DualHead 10-bit accuracy.

Comments.

We recommend this card for applications where speed is not a concern.

12/02. ATI has posted a free ROM updater on their web site that fixes the CLUT problems, attaining full 10-bit-accurate performance with the Radeon 7000. Yay! (Thanks to Doug Taylor.)

As suggested by the driver name, "DualHead", it can drive two monitors at once, dividing the graphics memory between them.

Needs priority dipping to wait for blanking at high priority.

The CopyBits speed of the 7000 is remarkably slow and depends on odd details. ATI has acknowledged the problem but hasn't committed to fixing it. The CopyBits rate, measured by ScreenTest, ranges from 13 to 80 MB/s. Experiments by Doug Taylor and Denis Pelli, including some suggested by Vladimir Velenta (engineer at ATI), show that, with one card installed, the CopyBits rate was reasonable (45 MB/s on Denis's G3/300, 80 MB/s on Doug's QuickSilver G4/800) with the November 2001 ATI software. Beyond that, things get complicated. Doug attains the same CopyBits rate with the July 2002 update provided he uses the July 2002's "ATI" menu to turn off "Graphics acceleration". Denis gets a much lower rate (25 MB/s on G3/300) with the July 2002 update, with or without "acceleration". With the July 2002 update, Doug gets 82 MB/s without "acceleration", and 18 MB/s with "acceleration" on his G4/800. Doug notes that turning off graphics acceleration helped CopyBits, but "things like window dragging and scrolling are really slow now." The slowdown is not due the the driver itself. You can use the "ATI ROM Xtender" file from the July update to use the latest driver (version 1.0f31) with the November 2001 inits, retaining full CopyBits speed.

For correct gamma-table lookup, set lower 8 bits of SetClut values to duplicate the upper 8 bits.

ATI CD-ROM installed in Mac OS 9.2.2 (Nov. 2001) version 1.0f24   Ok. CopyBits 45 MB/s on G3/300; 80 MB/s on G4/800. With two identical cards installed, CopyBits 18 MB/s in PowerMac G4/800.
March 2002 Update
Driver updates from ATI.
version 1.0f26   Fair.
June 2002 Update
Driver updates from ATI.
version 1.0f28   Fair. With two identical cards installed, CopyBits 13 MB/s in one, and 32 MB/s in the other. (PowerMac G4/800)
July 2002 Update
Driver updates from ATI.
version 1.0f31  

Fair. Use the ATI menu to turn off "Graphics acceleration" to greatly increase CopyBits speed.

ATI Radeon 7200 PCI card (Mac Edition) aka "Radeon Mac Edition (PCI)". This is an ATI retail product, so a clut fix is likely. Driver 8-bit accuracy.

Comments. Needs priority dipping to synch at high priority.

Tony Jack reports: cursor occasionally leaves behind a small block in the wrong background color, and that the problem was unaffected by upgrading driver and ROM.

Mac OS 9.1 .Display_Rage128 version 1.0b25   Poor. CopyBits 20 MB/s. Does not support 10-bit DAC.
ATI Radeon Driver 1.1.1 (Jan 2001)
ATI Radeon ROM Update (Sep 2001)
.Display_RADEON version 1.0f52  

Fair. CopyBits 83 MB/s. Supports 10-bit DACs, but driver bugs (errors of up to 3) limit accuracy to 8 bits. Reported by Zing Lee. Forum 1509.

July 2002 Retail Update
Driver updates from ATI.
.Display_RADEON version 1.0f59   Fair. CopyBits 36 MB/s. Supports 10-bit DACs, but driver bugs (errors of up to 3) limit accuracy to 8 bits.
ATI Radeon 7500. This is an ATI OEM product, so Mac OS 9 fixes are extremely unlikely. Driver .Display_DualHead 8-bit accuracy. Comments. Doug Taylor, "I tried a few things to see if the 7500 was really giving 10-bit resolution and it failed all the visual tests I tried. (They worked on the 8500.)" Forum.
ATI Radeon 7500 Mobility. This is an ATI OEM product, so Mac OS 9 fixes are extremely unlikely. Driver .Display_DualHead 8 or 10? bit accuracy. Comments. Built into PowerBook G4/800. Wait for blanking is immune to priority.
July 2002 Retail Update
Driver updates from ATI.
version 1.0b76   10 bits?. Bob Dougherty and Chris Chase report that the driver supports 10-bit DACs. It fails tests (ScreenTest, ClutTest, etc.) based on GetClut, but it passes simple visual and photometric tests for 10-bit resolution. In 10-bit mode, in the value returned by GetClut, the upper 8 bits are right, and the low 2 bits are a copy of the top 2 bits. CopyBits 186 MB/s. Forum. Like the 9000 Mobility, it may in fact output the correct 10-bit voltages, but we won't know for sure until more thorough tests are made, ie reading every output voltage of each DAC.
ATI Radeon 8500 AGP card (Mac Edition). This is an ATI retail product, and its former clut problems have already been fixed. Driver .Display_DualHead 10-bit accuracy. Excellent!  We recommend this card.
July 2002 Retail Update
Driver updates from ATI.
version 1.0f72  

Excellent! Doug Taylor reports: passes ClutTest in 10-bit mode with no errors. CopyBits 183 MB/s. Needs priority dipping to synch at high priority.

ATI Radeon 9000 (Mobility), built-into Apple's 2002 and 2003 Powerbooks. This is an ATI OEM product, so Mac OS 9 fixes are extremely unlikely.   8 or 10? bit accuracy. 10 bits? If memory serves, Doug Taylor reported that this passes our 8-bit tests, and fails our 10-bit clut-reading tests. Like the 7500 Mobility, it may in fact output the correct 10-bit voltages, but we won't know for sure until more thorough tests are made, ie reading every output voltage of each DAC.
ATI Radeon 9000 (AGP card). This is an ATI retail product, so Mac OS 9 fixes are likely, if needed.   ? $155 (list price $169) from buy.com. Has anyone tested it?
ATI Radeon 9000 Pro (AGP card). This is an ATI OEM product, so Mac OS 9 fixes are extremely unlikely. We are very happy with it so far.   10-bit accuracy. Excellent! We recommend this card. Apple announced (8/13/02) that the new line of PowerMac G4's will ship with this card (or the NVIDIA GeForce4 MX or Ti). Passes our 10 bit tests! (No GetClut in 32-bit pixel mode, but that's not an important limitation.) CopyBits 300 MB/s. SetClut synchs well at all priorities.

Cambridge Research Systems Ltd new graphics card adapter BITS++ has 14-bit DACs. Mac and Win compatible.

DOME high-resolution grayscale graphics cards have 10-bit DACs. However, our contact at DOME says, "Unfortunately we have discontinued support for the Mac OS quite some time ago. ... our boards stopped working [in Macs] in the later model DOME G4's."

Doug Taylor has spent some time figuring out the SetClut behavior of the NVIDIA cards. They respond to the cscSetClutBehavior call, which specifies whether the SetClut should be performed immediately or postponed until blanking. When that is set to zero, the NVIDIA cards immediately load the CLUT and return, as they should. When cscSetClutBehavior is set to 1, the NVIDIA driver returns immediately, and the card itself loads the CLUT at blanking time. Thus there is no way to ask the NVIDIA driver to wait for blanking. Graphics drivers are designed to run at priority zero, but we find it useful to run them at raised priority (up to 7) to minimize interrupts. Some drivers are unaffected by this, but the current NVIDIA drivers have trouble operating at raised priority. At raised priority, the NVIDIA drivers with version <3.0 return immediately and never load the CLUT. "I tested this by drifting a grating by rotating the CLUT using a C program written with the VideoToolBox. On the NVIDIA card, the grating does not drift at priority > 1." At raised priority, the 3.0 NVIDIA driver waits 0.5 s, then loads the CLUT and returns. Apparently it notices that there's a problem, waits for the problem to clear up, and finally, after 0.5 s, times out, loads the CLUT, and returns. This results in a 2 Hz iteration rate. (3 July 2002)

NVIDIA GeForce Driver .Display_NV Comments
Update 1.1.1
From Apple 75115.
version 1.0 Bad. Using the NVIDIA GeForce graphics card built into their PowerMac G4/733 computers, two users report (6/01 and 2/02) that the computers hang if one tries to SetClut while priority is raised. So ScreenTest never ends. Paolo Martini; Emily Grossman. See forum 485, 867, 872.  
Update 2.1.1
From Apple 120038.
version ?  

Update 2.3
Mac OS 9.2.1 includes the NVIDIA 2.3 drivers.

version 1.1

Use Finder Get Info on "NVIDIA Driver" to get update version.

 

Update 2.4
Mac OS 9.2.2 includes the NVIDIA 2.4 driver files, which are dated Nov. 15, 2001. [Fearless users can follow Doug's example, and use TomeViewer to extract those files from the Mac OS 9.2.2 update. Doug adds, "If you want to do 3D stuff you must also extract the latest OpenGL drivers."]

version 1.1

Use Finder Get Info on "NVIDIA Driver" to get update version.

Good. Doug Taylor notes "Upgrading from NVIDIA 2.3 to 2.4 increased CopyBits (CopyWindows) speed from about 250 to 320 MB/s on a GeForce 2MX and 4MX. Also, VRam GWorlds were finally supported on NVIDIA hardware with 2.4." [Screen OpenOffscreenWindow now supports VRAM and AGP, as new options.]

We've received three ScreenTest reports on this driver. For Doug Taylor and Fei Fei Li, SetClut did wait for blanking with prioritySequence 0/0. For David Brainard, SetClut did not wait for blanking in any mode tested by ScreenTest. We're still investigating. Perhaps there's an init conflict. Further ScreenTest reports would be welcome. psychtoolbox@yahoogroups.com

Update 3.0
From Apple: 120110

version 1.1

Use Finder Get Info on "NVIDIA Driver" to get update version.

Bad. Doug Taylor says, "A warning to NVIDIA users. I upgraded to the 3.0 drivers and now SetClut at high priority bogs down to 2 Hz. It ran fine with NVIDIA 2.4 drivers." Forum 986, 987, 1017.

Ben Singer reports (forum) that all the NVIDIA GeForce 4 cards have 10-bit DACs. All three flavors of this card (Ti, MX, and GO) have "Dual, 350 MHz, 10 bit RAMDACs". Apparently this is part of NVIDIA's "nView" feature. However, Doug Taylor reports (forum) that "We have a GeForce4 MX that I tested with TimeVideo, ScreenTest, and Ben's new TestGamma. They all reported 8 bit DACs in Mac OS 9.2.2 and 10.1.3 classic mode. It seems that NVIDIA hasn't yet incorporated 10-bit support in their drivers." Friendly letters to NVIDIA developer relations might help convince them that their customers need 10-bit support. Please cc the forum. Currently (6/11/02) the only way to get a GeForce 4 for a Mac is as a build-to-order option when buying a Mac from Apple.

On the no-longer-sold Village Tronic MacPicasso 540 or 850 graphics card running at 160 Hz, the driver seems to wait for blanking when loading 256 elements to the CLUT, but not when loading 32 or less. This seems to be a disconcerting feature of the MacPicasso driver. ScreenTest has been enhanced to test for and document this odd behavior. (6/11/02) Setting the new Screen Preference MinimumEntriesForSetClutToWaitForBlanking to 256 should bring this driver into the fold, resulting in standard synching behavior. Reported by Matteo Carrandini.


OS9: Bugs in the Psychophysics Toolbox

If you find a bug, please report it to the forum. If possible, please include a minimal-length program that evokes the undesired behavior, and a report from ScreenTest to document your computing environment.

The OS9 version of the Psychophysics Toolbox is more or less bug-free. We think we've fixed all but a few obscure bugs that arise under only unusual machine configurations. Here's a complete list of known bugs, followed by notes of nonobvious limitations. When bugs are fixed they are removed from this list and added to History.


OS9: History of changes

Version 2.55, 12 March 2005, available for download.

  1. Incorporated Frans Cornelissen's fix for a bug in AssertMex, described here.
  2. Deleted Gestalt.m from OS9 Psychtoolbox since it is superfluous to Matlab 5's GESTALT, yet would interfere if the path places the Psychtoolbox ahead of Matlab's toolbox, as reported by Frans Cornelissen.
  3. Updated help text in Snd.
  4. Throughout the whole Psychtoolbox, now consistently refer to this version as "OS9". We used to refer to it as the "Mac" version, which has become ambiguous.

Version 2.54, 6 March 2005, available for download.

  1. Incorporated Jochen Laubrock's fix for a bug in NearestResolution described here.
  2. Improved Ask.m as suggested by Paul Thiem: added an example (and better argument checking) to make it clear that replyFun must be supplied as a string and rectAlign1 as a value.
  3. Improved GetEchoString: Added defaults for all arguments.
  4. Enhanced SCREEN DrawText to optionally accept a transformation matrix to be applied to the text by Adobe Type Manager (ATM). This allows drawing rotated and skewed text. You can download this pre-release version of Screen.mex now. The enhancement does not affect calls without the new extra argument, so your old Matlab programs will not be affected by this change.
  5. Enhanced the Quest threshold estimation package, making it yet more robust, adding more help text, and providing a simple procedure for estimating beta. Quest works on any computer that runs MATLAB 5 or better. You can download it here as a stuffit or zip archive.
  6. Updated various routines so that they use old (version 1) or new (version 2) optimization toolbox calls depending on what is installed. This shouldn't affect OS 9 operation (where only version 1 exists), but makes the code compatible with OS X.
  7. Moved several calibration scripts into PsychCal. The main two are CalibrateMonSpd (does basic calibration) and DumpMondCalSpd (tells what is in a calibration file).

Version 2.53, 2 August 2003, available for download.

  1. Updated PrepareScreen.m and DescribeScreen.m to support the NVIDIA GeForce 4MX, which needs MaxSetClutPriority=1, and the ATI Radeon 9000, which runs perfectly with standard settings.
  2. Three users reported that Screen.mex was giving them a fatal error message "GetDisplayModes error -50". We have enhanced Screen.mex to cope more gracefully with errors from the cscGetNextResolution call, simply providing the shorter list of resolutions that it gets from the Display Manager. We also enhanced Screen 'Preference' 'DriverFlags' to report whether cscGetNextResolution is supported, and DescribeScreenPrefs.m to report this, e.g. in the ScreenTest report. Thanks to Keith Schneider, John Jacobson, and Chris Taylor. Forum 1673.
  3. Enhanced Screen Computer by adding a new field, "runningOnClassic". This is used by PrepareScreen to detect that it's running in the Classic compatibility box (ie emulation of Mac OS 9). In that case, it configures all graphics drivers to have SetClut wait for the blanking interrupt. In our tests so far, none of the new drivers supplied by Apple as part of Classic will wait for blanking as part of SetClut. The new, prerelease Screen.mex is available.
  4. We corrected the help text in LoadClut: "SPEED: LoadClut and SetClut are typically called from within a display loop, so it's important that they be fast. You typically call one or the other once per frame. Frame rate is typically in the range 60 to 120 Hz, so the frame period, from blanking to blanking, will typically be 8 to 17 ms. You'd like the time used by by SetClut/LoadClut to be a negligible fraction of that. LoadClut needs to initialize some tables the first time it's called, and has to recompute those tables whenever pixelSize or bits or fixATIRadeon7000 has changed. The rest of the time, LoadClut is fast. This is confirmed by ClutTimeTest. When SetClut waits for blanking, nearly all the time is spent waiting, whether you call SetClut or LoadClut. When SetClut is set not to wait, then SetClut is typically very quick. Depending on your driver, it may take roughly 0.3 ms and iterate at 3 kHz. 0.3 ms is a negligible fraction of the frame period. Under the same conditions (bits==8 on PowerMac G4/500), LoadClut iterates at nearly 1 kHz, taking a bit more than 1 ms per iteration. This is not quite negligible, but should be tolerable in most applications. We haven't yet timed LoadClut when bits==10." Thanks to David Jones for noting errors in the old text. The new, prerelease LoadClut.mex is available.
  5. Fixed minor bug in Screen OpenOffscreenWindow that caused ScreenTest to fail when running in the Classic environment of Mac OS X. (An unsuccessful attempt to allocate VRAM or AGP memory was misreported as being out of regular memory.) Bug reported by Keith Schneider. The new, prerelease Screen.mex is available.
  6. Fixed crash of Screen OpenOffscreenWindow with screen -1. Reported by Keith Schneider. The new, prerelease Screen.mex is available.
  7. Screen.mex now does a device validity check whenever it gets or sets the current screen device. If the device is invalid, the check will print diagnostic information. We hope this will allow us to track down and eliminate the elusive NQDColor2Index crashing bug. The new, prerelease Screen.mex is available.
  8. Fixed bug in PrepareScreen.m that resulted in wrong setting of the SetClutDuplicates8Bits flag. The new, prerelease PrepareScreen.mex is available.
  9. Enhanced GetChar.mex to also return the address (a small integer) of the input device. Useful when you have multiple keyboards connected at once. Thanks to Tom Busey for donating the C code. Forum 1510. The new, prerelease GetChar.mex is available.
  10. Fixed bug in CopyImage.mex. Grayscale images (MxN) were being interpreted with a color colorTable. Now fixed. Forum 1514. The new, prerelease CopyImage.mex is available.
  11. Enhancements to PsychSerial to include OpenRaw and ReadRaw functions.
  12. Included routines for talking to Bits++ and CRS Colorimenter.
  13. Enhancements to colorimetric calculations and data sets.


Version 2.52, 12 August 2002, available for download.

  1. Enhanced Screen OpenOffscreenWindow to allow the option of storing the offscreen window in VRAM or AGP memory, associated with your graphics card, instead of ordinary computer memory. There is only a limited amount of VRAM and AGP memory available, but, depending on your graphics card, this option can result in very high CopyBits speed to the screen. ScreenTest has been enhanced to measure and report those speeds if AGP or VRAM is available. Be warned that this new feature is still relatively untested and may not yet be ready for your publication-quality experiments. It's provided for evaluation, to see whether it's going to be useful.
  2. PrepareScreen is becoming more and more important. It's called automatically by Screen.mex when you open your first window on a screen, but you may want to call PrepareScreen sooner, so that the screen is prepared while you get ready to open a window. It's ok to call it multiple times, as it sets an internal flag once your screen is prepped and returns immediately on subsequent calls. If in doubt, call PrepareScreen. PrepareScreen now does runtime testing to set BlankingDuration, UseHighGammaBits, and SetClutDuplicates8Bits optimally for each screen. For some (older) drivers it's important to set BlankingDuration long (3 ms) in order to avoid racing when SetClut is used in a tight loop. For some new drivers it's important to set it short (0 ms) in order to avoid delaying the SetClut so much that it introduces tearing in CLUT animations. The new runtime tests make the best setting for each driver. Made many small changes to PrepareScreen and DescribeScreen to detect, identify, and configure the latest ATI graphic card drivers. This enhances 10-bit support.
  3. Added TwoBitFlickerTest.m to visually test the functions of the two least significant bits of any graphics card, but especially those with 10-bit DACs. Inspired by prior efforts of Jack Nachmias, Ben Singer, David Brainard, Bob Dougherty, and Doug Taylor.
  4. Added ClutTimeTest.m to measure and report how long SetClut and LoadClut take in the several different ways you might use them. Based on TimeClut.m by David Jones.
  5. Fixed bug in SCREEN 'VideoCard' that was corrupting the cardName if you probed more than one card. The bug was in VideoToolbox routine CardName1 in GDVideo.c.
  6. Enhanced SCREEN 'SetClut' and 'Gamma' to respond to the SetClutCallsWaitBlanking flag in a more useful way. Previously SCREEN waited after doing the SetClut. Now it waits before doing the SetClut. By Apple convention, set Gamma does an implicit SetClut if pixelSize>8. All flags that affect SetClut now also affect the implicit SetClut in the same way.
  7. Fixed minor bugs in LoadClut, ClutTest, SetGammaWaitTest, SetClutWaitTest. This enhances 10-bit support.
  8. Enhanced LoadClutTest and the LoadClut test in ScreenTest to be more rigorous, using random numbers and testing all bits. This enhances 10-bit support.
  9. Fixed a minor bug. SCREEN(whichScreen,'FrameRate',nan) correctly forces the FrameRate to be remeasured. However, it was also causing reevaluation of several parameters that are set up in PrepareScreen, resulting in unexpected side effects. Now fixed, no side effects, except that the remeasurement may change the contents of the CLUT.
  10. At the suggestion of Frans Cornelissen, enhanced PsychSerial to return all NULL characters read from the serial port. Previously PsychSerial filtered out NULL characters.
  11. Merged into PsychSerial Dan Shima's enhancement to accept the optional argument named "expirationSecs" passed with the 'Read' command. ExpirationSecs is a period which PsychSerial waits before returning control to the calling environment. PsychSerial still accepts the optional "timeOutSecs" argument. TimeOutSecs specifies the period that PsychSerial waits only if there is no data available to be read from the port, whereas ExpirationSecs specifies the period that PsychSerial waits regardless of whether there is data to be read. ExpirationSecs is useful when the serial port is read during an animation loop, where the duration of each call to PsychSerial must be limited to less than the frame period.

Version 2.51, 5 July 2002, available for download.

  1. Several users found that the new ScreenTest in release 2.5 produced MATLAB errors on their systems. ScreenTest.m itself seems to be ok, but we have enhanced several related files to better cope with unusual conditions, hopefully curing all the reported errors. Forum
    SetClutWaitTest.m, DescribeScreenPrefs.m, IsPopCharProInstalled.m, Screen.mex, OpenScreen.m, CloseScreen.m, LoadClut.m.
  2. In response to Chris Chase's bug report, we've enhancedClutTest.m to be compatible with Mac OS X Classic. Indeed it has revealed a bug in a Classic driver. Forum
  3. Added new function PsychtoolboxRoot that returns the path to the Psychtoolbox folder, even if it's been renamed. Also updated all other Psychtoolbox functions to use it. Requested by David Jones: "I am in the habit of installing software with a name that reflects the current version. This helps me keep track of the various versions of software on the many computers we have around the lab. So I installed the new update under the name 'Psychtoolbox 2.50'." The Psychtoolbox now copes with that change, but don't rename internal folders as some of those names are still needed. Forum
  4. Fixed IsPopCharProInstalled to check version of MATLAB and avoid using GESTALT unless we have MATLAB 5.2.1, since earlier versions of GESTALT exit if they do not find what they're looking for. David Jones reported that this bug caused ScreenTest to fail in MATLAB 5.2. As always, we recommend that everyone upgrade to MATLAB 5.2.1. Forum
  5. Enhanced Screen 'VideoCard' to return its values as a struct, including the unadorned card name, to allow DescribeScreen to identify the card by matching its list of known cards, and enhance its print out by including the common commercial name.
  6. Fixed WaitBlankingTest bug reported by Chris Chase, and enhanced handling of the Screen Preference values SetClutWaitsForBlanking and WaitBlankingAlwaysCallsSetClut. Now WaitBlankingAlwaysCallsSetClut will automatically be zeroed anytime SetClutWaitsForBlanking is zeroed. Forum
  7. By popular demand, avoid name conflict by renaming OpenScreen and CloseScreen to PrepareScreen and RestoreScreen, which better describe their functions. Updated all the functions that call them to use the new names. Forum
  8. Fixed HideCursor.mex and Screen.mex to reliably restore visibility of the cursor when they are flushed (or when Screen closes its last window). Instead of calling ShowCursor 256 times, they now call InitCursor. The 255 upper limit on the number-of-times-hidden seems to have been true only of an earlier version of the Mac OS, and not true of Mac OS 9.2.2. Thanks to Thomas Jerde for reporting the bug. Forum.
  9. WrapString breaks long lines of text to fit within a specified line length.

Version 2.5, 25 June 2002, available for download.

  1. Screen now calls OpenScreen.m when the first window is opened on a particular screen, and calls CloseScreen.m when the last window (among all screens) is closed. We have moved all our graphics-driver-specific code to this file, from the C code for Screen.mex and Matlab code formerly residing in various M files. This allows quick writing of Matlab code for driver-specific configuration, by anyone, instead of writing in C, slowly, by the Psychtoolbox development team. We anticipate that this will facilitate the testing and customization necessary to cope with the idiosyncrasies of new drivers, and quickly extend the consistent synchronization and clut control that we presently have across currently available graphics cards.
  2. Screen now has a Preference for each graphics driver property that we deal with: DipPriorityAfterSetClut, MaximumSetClutPriority, MinimumSetClutPriority, MinimumEntriesForSetClutToWaitForBlanking, DacBits, UseHighGammaBits, SetClutDuplicates8Bits, BlankingDuration. OpenScreen sets all of them appropriately for known drivers, and may do pretty well for unknown drivers. The three priority-related prefs affect the priority at which SetClut (and the implicit SetClut triggered by SetGamma when pixelSize>8) runs. DacBits is merely retained by Screen; it doesn't affect any operation. UseHighGammaBits causes data to be shifted up before SetGamma and shifted back down after GetGamma. SetClutDuplicates8Bits tells SetClut to copy the upper 8 bits to the lower 8 bits in each color spec entry.
  3. LoadClut is an all-in-one replacement for Screen SetClut and Gamma, with full support for all graphics cards, including those with 8-or-more-bit DACs, e.g. ATI Radeon, Radius ThunderPower, and (soon) CRS Ltd. BITS++. This gives greatly improved resolution over that offered by 8-bit DACs. LoadClut is the significantly enhanced release version of the "TenBitInterface" beta software. Thanks to Ben Singer for providing key parts of the original code, Doug Taylor for several helpful tips, and Rhea Eskew for help in testing.
  4. Enhanced ScreenTest to time SetClut in every known mode (pixelSize, priority sequence, number of CLUT entries), to discover what it takes to get your video driver to wait for blanking. The results are reported in a new, shorter, more readable report. The old warnings, which too often were false alarms, are gone. forum 1069
  5. Added SpriteDemo.m (formerly "TargetDemo"), which animates a moving sprite. It conserves memory.
  6. ActiveWire.mex added to PsychHardware to control the ActiveWire parallel I/O device.
  7. Joystick.mex added to PsychHardware to read game controllers.
  8. Attenuator.mex (formerly called "CLUT.mex") added to PsychBeta to support the Pelli-Zhang video attenuator. This is one way to improve the resolution offered by 8-bit DACs.
  9. Screen GetGammaList uses low-level calls to the graphics driver to retrieve all its predefined gamma tables. This may help in figuring out what gamma-table resolutions the driver will accept.
  10. Enhanced Screen.mex with a new driver-compatibility control MaximumSetClutPriority, accessible as a Screen Preference for each screen. This value was previously always assumed to be 7, but can now be set to lower values (e.g. 1) to accommodate odd drivers, like the NVIDIA "NVDA,Display-B" (.Display_NV version 1.1) that do SetClut extremely slowly (2 Hz) at high priority. (Thanks to Doug Taylor and Fei Fei Li for providing ScreenTests to the forum.)
  11. Enhanced Screen.mex with a new driver-compatibility control MinimumEntriesForSetClutToWaitForBlanking, accessible as a Screen Preference for each screen. This value was previously always assumed to be 1, but can now be set to higher values (e.g. 256) to accommodate odd drivers, like the Village Tronic MacPicasso, that, at least at high frame rates, only wait if the whole CLUT is loaded.
  12. Thanks to help from an engineer at ATI, we now get near-perfect performance of the $130 ATI Radeon 7000 PCI card, which has 10-bit DACs with full driver support. Enhanced Screen.mex, adding a new driver-compatibility control SetClutDuplicates8Bits, which tells SetClut to copy the top 8 bits of each Colorspec to the lower 8 bits.
  13. Enhanced Screen.mex so that the old driver-compatibility controls MinimumSetClutPriority and DipPriorityAfterSetClut, which formerly affected only SetClut, now apply to SetGamma as well, when pixelSize>8. (When pixelSize>8 the SetGamma call effectively does an implicit SetClut, which seems to have the same synching side effects as an explicit call to SetClut.) This helps LoadClut perform consistently across all pixelSizes. See Screen Preference MinimumSetClutPriority and DipPriorityAfterSetClut.
  14. Enhanced Screen.mex to treat the ATI Radeon (aka "DualHead") graphics driver with 10-bit DACs as a special case, like the Radius Thunder. We don't use the Apple-recommended shortcut of supplying a NULL pointer with cscSetGamma to request an identity gamma table. Instead we always provide a complete table. This works around a bug in the driver. Problem reported by Rhea Eskew; solution suggested by Doug Taylor.
  15. Enhanced Screen 'WaitBlanking' to use priority dipping to work around the ATI Rage 128 and Radeon (aka "DualHead") video driver idiosyncrasy, and expanded the synopsis to better explain the returned value.
  16. Enhanced Screen.mex so that all functions that accept a copyMode (CopyWindow, PutImage, and TextMode) now accept 'transparent'. Furthermore, copyMode may be an integer, instead of a string, allowing access to all of Apple's copy modes, which are documented in Inside Mac. Suggested by Keith Schneider.
  17. Screen 'ResolutionQuickly', for experts only, is like 'Resolution' but is implemented as direct calls to the graphics driver, and thus is effectively instantaneous. It's also dangerous, because the Mac OS has no idea that you've done this. This may be useful for synchronizing two displays, by running for a bit at different frame rates to bring the blankings of the two graphics cards into phase.
  18. Sabina Wolfson noted (2/02, forum 876) that the shareware program SwitchRes offered more resolutions than Screen 'Resolutions' and ResolutionTest did. We wrote to Stéphane Madrau, the author of SwitchRes, to ask how he does it. Screen was obtaining the list of available resolutions from the Mac OS Display Manager. Stéphane suggested supplementing this list by using cscGetNextResolution to call the video driver directly, to get a list that includes ALL resolutions. We took his advice and enhanced Screen.mex to now offer all these resolutions to the user's program. Please be careful: some of the extra modes don't work.
  19. Enhanced SetResolution and NearestResolution to accept a res structure instead of a list of parameters.
  20. Enhanced NearestResolution to work with the latest LCD screens. Reported by Frans Cornelissen. Forum. NearestResolution now will ignore frame rate when frame rate information is lacking (ie NaN), which is common for LCD screens (e.g. G4 PowerBook, iBook, etc.). [The underlying problem is that at least some built-in LCD screen drivers (iBook, G4 PowerBook, and probably others) report the frame rate as NaN Hz for all video modes. (I haven't gone back to check Apple's rules; this may qualify as a driver bug.) This value is, in turn, reported by Screen 'Resolution' and 'Resolutions'. You can always get the actual frame rate for the current mode by calling FrameRate, which provides the result of an accurate measurement rather than asking the driver. However, with these drivers there is no way to find out what frame rate a non-current mode would run at, except for switching to that mode and measuring it, eg by calling FrameRate. It is tempting to simply assume that the actual rate is 60 Hz whenever the returned value is NaN, but I can't think of any reason that this should always be true.]
  21. Fixed offscreen color bug in Screen.mex. In October 2000, Erin Harley reported a bug: forum 266, 881, 887. Drawing to offscreen windows referenced to screen 1 was often wrongly colored. This affected Screen drawing operations like DrawLine, DrawText, and FrameRect, but did not affect Screen PutImage or CopyWindow. The new DrawTest.m assesses accuracy of colors produced by most of the drawing functions. [The problem stemmed from the fact that Apple's QuickDraw operations use the color table of the current DEVICE (not the current port). This raised no issues if you were using any onscreen window, or an offscreen window associated with screen 0, which is usually the current device, but became an issue when you used an offscreen window associated with another screen. We've now enhanced a humble C routine called SetWindow to also make the offscreen window's device the current device. That fixed the bug.]
  22. New PeekBlankingTest and FlickerTest and enhanced WaitBlankingTest better assess Screen timing. We are using these to characterize timing problems running in the Mac OS X Classic environment.
  23. Enhanced Screen to work around a bug in Matlab's INPUTDLG and QUESTDLG commands. Reported by Charles Collin. Forum. [There appears to be a bug in Matlab's INPUTDLG and QUESTDLG commands (and probably others). If they are issued while a Screen window is open they make Screen's window the current port when they close. This causes a problem later, when the user's program tries to close Screen's window, because it's against Apple's rules to close the window that is the current port: "??? GDOpenWindow.c 530: GDDisposeWindow can't dispose of window while it's the current port." Screen has been enhanced to work around Matlab's bug. It now checks the current port, saving it when it's good, and restoring it from the last good value when it's bad. This seems to solve the problem with no side effects. Try running OpenDLGCloseTest.]
  24. Added new subfunction: Screen 'FillArc', written by Frans Cornelissen.
  25. Screen TextFont now does nothing if the requested font is not available. Formerly in this case it would set the font to 0, the default system font, which is typically Charcoal.
  26. All Screen functions now accept a one-string list, e.g. {'Helvetica'}, as equivalent to the string itself, e.g. 'Helvetica'. This automatic conversion is convenient and matches the behavior of most Matlab functions.
  27. Rewrote interface to PR650 spectrophotometer to now use the universal SERIAL.mex rather than the old now-obsolete CMETER.mex. Improved logic for setting/checking the PR650's synchronization feature. Added ability to read serial port name from a file. Tested in a limited manner on the Mac, not on Windows.
  28. Added routines XYZToLjg and LjgToXYZ to PsychColorimetric. These convert back and forth between the OSA UCS Ljg coordinates and XYZ (10 degree).
  29. PsychCal: Various changes and improvements to the calibration routines, many of them in an attempt to make them more generally compatible across different graphics cards and platforms. This effort will be ongoing.
  30. Implement a PsychCalLocalData folder that lives outside of toolbox folder. Calibration routines read from and write to this folder if it exists. This makes it easier to update the toolbox without wiping out your calibration files. The folder in the toolbox, PsychCalData, has been renamed PsychCalDemoData.
  31. Enhanced Serial('Write',...) to optionally accept a vector of ascii values as doubles in place of a string. With strings, there was no way to send ASCII 0 (the null character), because it was used to mark the end of the string.
  32. DriftDemo shows a drifting grating. LineDemo shows how to draw anti-aliased lines (no jaggies). DriftDemo.m available now from forum.
  33. GetChar.mex now has a second, optional, output argument that returns the time of the keypress (in ticks, 60.15 Hz) and the state of all the modifier keys then: shift, control, command, option, and mouseButton. Suggested by Daniel Shima.
  34. GetChar.mex now reliably quits whenever it receives a Command-Period keypress. It had been passing the Command-Period as a period ".". The fix was to VideoToolbox routine GetNextEventOrQuit in CommandPeriod.c, so it affects all MEX files that call it, including GetClicks and Screen 'WaitBlanking' .
  35. GetMouse.mex is now specified to return a "buttons" vector with one element per mouse button. Your Mac mouse probably still has only one button, but you may want your programs to run on both Mac and Win computers, and Win mice have several buttons. It's easy to cope with the general case, as shown here.
  36. GetMouse.mex no longer supports this obsolete usage: xy = GetMouse([windowPtrOrScreenNumber])
    where xy is a 1x2 vector containing the x, y coordinates.
  37. Snd('DefaultRate') returns the default sampling rate in Hz in both Mac and Win versions. This value is platform-dependent, so to make your programs portable, you should either get it in this way and take it into account, or always explicitly set the rate.
  38. MaxPriority('Snd') now works again. Fixed by Harriet Allen. Forum.
  39. MaxPriority now allows high priority 'WaitBlanking' if SetClutDriverWaitsForBlanking.
  40. GetSecsTick returns an estimate of the step size of the GetSecs timebase, as an aid to writing platform-independent code.
  41. FitWeibTAFC and related functions have better initialization of parameter alpha (when it's not passed explicitly), which should improve convergence of the numerical search routines. Thanks to Duje Tadin for pointing out the need.
  42. FitCumNormYN: Fixed bug that caused execution failures for certain data sets. Thanks to Keith Schneider for identifying the bug and the fix. Forum
  43. Enhanced Screen 'Computer' to recognize the processor type "G4 altivec" in the latest 2002 Macs. This enhances the DescribeComputer report at the beginning of the ScreenTest report. (The change is implemented in the VideoToolbox routine IdentifyProcessor in Identify.c.)
  44. QT.mex, which creates and shows QuickTime movies, has been renamed Showtime.mex, at the request of A.B.Watson. For a transitional period, calls to "QT" will be redirected to Showtime, so old programs won't break.
  45. Fixed help text in Rect functions to indicate that one should type "help PsychRects" for more information.
  46. PasteImage.mex and CopyImage.mex have been rewritten to be compatible with Screen PutImage and GetImage. They are still called in the same way, but they now accept and return MxNx3 arrays for RGB images, and pixels values are in the range [0 255] instead of the former [0 1].
  47. According to our records, on 1 August 2000, Geoff Loftus reported a problem with PasteImage, but he now can't recall making the report, and neither he nor we can now replicate it, so it seems inaccurate to call it a bug. Just in case, though, we'll retain it here. Work around: PasteImage fails with some, but not all, images copied to the clipboard from Adobe Photoshop. Copying the image from the clipboard into another application (e.g. Microsoft Word) and then from that application to the clipboard seems to fix the problem.
  48. Jon Jacobs's "TextEnd" patch fixes the "yLabel" bug in Matlab 5.2.1.

Version 2.44, 7 August 2000, available for download.

  1. IccProfile.mex reads any International Color Consortium (ICC) or ColorSync profile, returning all the useful monitor-calibration information as a single Matlab struct for use in your color-and-gamma-correction software. This allows you to calibrate your monitor by using any of the many commercial software & colorimeter packages that save their results as an ICC Profile.
  2. Fixed bug in Screen.mex. In version 2.43, Screen(-1,'OpenOffscreenWindow'); gave garbage GWorld size, e.g. 26700 x 2524. (No problem unless screenNumber was -1, ie no device.) Reported by Steven Dakin.
  3. Enhanced all Screen Preference functions to ignore an empty argument.

Version 2.43, 10 July 2000, available for download.

  1. Fixed HideMenuBarVT.c in VideoToolbox (used by Screen OpenWindow) to use Apple's new HideMenuBar routine only if Mac OS 9 or later is present, as MenuBarTest.m revealed problems using Apple's routine to hide the menu bar in Mac OS 8.6. Added Screen Preference UseNewHideMenuBar to allow user to override the default. This is primarily for testing in Classic mode in Mac OS X.
  2. Enhanced Screen Preference AskSetClutDriverToWaitForBlanking to also try the new cscSetClutBehavior and cscGetClutBehavior driver calls defined in Video.h 3.3.2. Formerly it only tried the cscSetTimeDelays driver call, which is supported only by the PowerMac 7300/7500/7600/8500/8600 built-in driver. The new call allows us to get the driver to wait for blanking on more computers.
  3. Enhanced Screen to work with mirrored displays (i.e. displays that occupy the same region of the desktop and thus always display the same thing). You can use the Monitors control panel to "mirror" two displays by dragging one display onto the other. Added Screen Preference MirroringIsOn and AllowMirroring to detect the presence of mirroring, and to allow you to turn it off, since writing to mirrored displays is very slow, unsuitable for most experiments. Reported by Keith Schneider.
  4. Added Screen Preference Process and NextProcess to allow access to the Mac OS Processor Manager information. DescribeComputer (used by ScreenTest) uses this to detect and warn you of the bad old version (1.2) of the Keyspan Digital Media Remote mapper daemon, which slows down computers by 30%. (The new version, 2 beta, is fine.)
  5. SERIAL.mex is now compatible with older versions of Mac OS. (In Version 2.42 it required Mac OS 9.) It now copes with absence of serial port arbitration, instead of suggesting that you upgrade the Mac OS. Changed SERIAL.mex to no longer implicitly append an EOL (end of line) character on write. So now you should write something like this
         SERIAL('Write',port,['Hello world.' char(10)])
    or
         SERIAL('Write',port,['Hello world.' char(13)])
    depending on whether the hardware you are talking to wants a linefeed (ASCII 10) or a carriage return (ASCII 13) as its EOL character.
  6. Screen DrawText synopsis now explains non-obvious consequences of text smoothing.

Version 2.42, 7 March 2000, available for download.

  1. Fixed: MaxPriority('GetSecs') returns 7 but should return 1 on PowerMacs running Mac OS older than 8.6. This causes many spurious warnings in ScreenTest.
  2. Fixed bug in SERIAL.mex; you can now open and close ports in any order. SERIAL Ports returns the names of all available serial ports. SERIAL Params allows getting and setting communication parameters. Added new baud rates 115K and 230K.
  3. Extend application of "priority dip" fix in Screen.mex to all versions of the ATI Rage 128 video driver, for compatibility with all G3 and G4's. Expand NewGWorld -108 error message to explain that there wasn't enough (Matlab or Temp) memory for new offscreen window. Updated the algorithm used by MaxPriority for GetSecs; the change will only affect users of old Macs (e.g. 6100) or old versions of Mac OS (before 8.6).
  4. Screen OpenWindow now accepts a "res" in place of "pixelSize" (suggested by Keith Schneider). Added suggestion to Screen Resolution synopsis to avoid use while windows are open (thanks to Keith Schneider).
  5. Updated the algorithm used by MaxPriority for GetSecs; the change will only affect users of old Macs (e.g. 6100) or old versions of Mac OS (before 8.6). As of Mac OS 8.6, all PowerMacs support UpTime.

Version 2.41, 30 January 2000, available for download.

  1. Fixed minor bugs in Screen.mex, GetSecs.mex, GetChar.mex, and GetClicks.mex that affected compatibility with some computers and versions of the Mac OS older than 8.6. (On some computers, after using HideCursor.mex, calling GetChar.mex or GetClicks.mex caused the cursor to reappear.) Expanded help text for Screen Resolution and Resolutions. Added SetResolution.m (by Sabina Wolfson) and NearestResolution.m.
  2. Cosmetic improvements to DescribeComputer.m, which is used by ScreenTest.
  3. Fixed minor bugs. In Screen.mex (and other mex files) now weak-link InterfaceLib to allow (impaired) use on versions of Mac OS older than 8.6. Timing will be impaired because it will rely on the interrupt-based Microseconds trap instead of the PowerPC-chip-based UpTime trap. Rebuilt GetSecs.mex with the latest VideoToolbox files to fix minor incompatibility with PowerMac 6100. Rewrote GetChar.mex and GetClicks.mex to get events solely through WaitNextEvent, for better compatibility, eliminating the undesired side effect (on some computers) of causing a hidden cursor to reappear.

Version 2.4, 24 January 2000, available for download.
(This list of changes may include some duplicates.)

  1. Snd.mex now plays sampled sounds using 16 bits per sample, instead of 8 bits. This eliminates a faintly audible hiss due to the coarse 8-bit quantization. Suggested by Lu Lesmes.
  2. Added QT.mex [subsequently renamed "Showtime.mex"] to create and show QuickTime movies. This is the Matlab version of the Showtime package created by Beau Watson, Cesar Ramirez, James Hu, and Denis Pelli. Give QT a multidimensional array representing pixel values in multiple frames, and QT converts it to a QuickTime movie that you can show with full control over timing and color lookup table. You can also email your movie to colleagues, put it on the web, or include it in PowerPoint presentations. QuickTime movies are portable; the same file works on Mac and Windows 95/98/NT. Try QTDem.m and QTTest.m. (The QuickTime movie at right was compressed by the Sorenson codec to 15 frames/s, at "high" quality, producing a file of only 13 KB.) If the movie isn't playing, you may need to download QuickTime: .
  3. Compatible with PowerMac G3 and G4 and Mac OS 9 . Screen.mex now automatically detects the Rage128 video driver built into the G4 and blue G3 PowerMacs and activates new code that works around that driver's slow-SetClut bug, yielding excellent performance. Enhanced ScreenTest.m to test the driver at low and high priority, to document the poor behavior of the Rage 128 driver in the blue G3 at low priority reported by Bob Dougherty. [Screen automatically detects the presence of that driver and sets the two new preferences appropriately, but they can also be set explicitly by the user. The bug is that, at priority 0 or 1, this driver takes longer than a frame period to perform SetClut (i.e. cscSetEntries or cscDirectSetEntries), making it impossible to load a new clut on every frame. Bob Dougherty diagnosed the problem and discovered the workaround that Screen now uses. We have reported the bug to Apple, and they have accepted it as such, forwarding the report to ATI, who wrote the driver. Here's the relevant part of the printout from "Screen Preference?" MinimumSetClutPriority forces the priority up, during the call to SetClut, to the specified level. Has no effect if the priority is already at or above the specified level. The default is 0 (which does nothing), unless you're using the buggy Rage128 video driver that's built into the blue G3 PowerMacs, in which case the default is 2. DipPriorityAfterSetClut, if true, momentarily forces the priority down to 1 after each call to SetClut. The default is 0 (false), unless you're using the buggy Rage128 video driver that's built into the blue G3 PowerMacs, in which case the default is 1 (true). The consequence is that users will get excellent behavior out of that driver without having to even be aware of the problem, since Screen will automatically set things up appropriately. However, this is still optional, in that you can override the default setting of the new Preferences to obtain the original behavior, if that's what you want.]
  4. Enhanced Screen.mex and ScreenSaver.mex to be compatible with most screen savers, including Apple's Energy Saver and St. Clair's Sleeper version 3.2.1 or better. (Please upgrade if you're using an older version of Sleeper.) Enhanced Screen.mex, while it has any onscreen window open, to automatically disable screen savers and to pretend to be an active screen saver (i.e. sets the "asleep" and "enabled" bits in the 'SAVR' Gestalt selector) to discourage other processes from writing to the screen. Enhanced ScreenSaverTest. Enhanced Screen.mex to better identify the new Macs, e.g. iMac, iBook, blue G3, and G4, and some nonstandard video cards, like the old but still popular Radius PowerThunder.
  5. Replaced AfterDark.m (which called the obsolete AD.mex) by the new self-contained ScreenSaver.mex. AfterDark has been moved to PsychObsolete, and eventually will be deleted. ScreenSaver is an exact replacement for AfterDark, but because of the enhancement to Screen.mex, above, most users can simply delete all their calls to AfterDark. Also see ScreenSaverTest.m.
  6. Added new functions 'Resolution' and 'Resolutions' to Screen.mex to control the screen's width and height (in pixels) and frame rate (in Hz). Try ResolutionTest.m. Enhanced DescribeScreen, and thus ScreenTest, to report a list of all available frame rates.
  7. Added new function 'SaveAsEps' to Screen.mex to save an 8-bit window to disk as a grayscale EPS file, with a PICT preview. This is handy for creating illustrations for papers.
  8. Added RectCenter.m and CenterRectOnPoint.m to PsychRects. Contributed by Allen Ingling.
  9. Added GrayIndex.m that interpolates between black (0) and white (1).
  10. Changed Rands to RandSample to avoid name conflict with a Mathworks-supplied function in the neural nets toolbox.
  11. Avoided: Screen may crash when you use it to change the pixelSize while Backgrounding is enabled. (This happens in both Mac OS 8.1 and 8.6, and probably in all versions.) Try running PixelSizeTest.m. Turning off Matlab's Backgrounding solves the problem, which is what we've always advised for several other reasons. (We suspect the problem is in Apple's SetDepth routine, but it's not clear why Backgrounding should affect it.) In version 2.4, Screen.mex now automatically turns off Backgrounding when you open your first window, so you won't hit this bug unless you explicitly turn Backgrounding back on, and we can't think of any reason to do that.
  12. Avoided: PixelSizeTest.m and ColorGratingTest.m both crash on a PowerMac 6100 with a full set of INITs, yet work fine with just Mac OS 8.1. They also run fine on other Macs. This seems to be an INIT conflict with the code that changes pixelSize.
  13. Enhanced Screen 'Computer' to identify the G4 processor. When Screen opens a window under Mac OS 8.5 or later, it now uses the new Apple routine called HideMenuBar instead of the older VideoToolbox code. Apple says this is more robust, though the old code worked well. All three changes were in the VideoToolbox files.
  14. Modified handling of meter timeout code in MeasSpd.
  15. Fixed long standing bugs in UpdateAmbient. It could not have been working previously.
  16. Added some calibration measurement functions to PsychCal.
  17. Fixed data error in file den_lens_ws.
  18. Added RectCenter.m and CenterRectOnPoint.m to PsychRects. Contributed by Allen Ingling.
  19. Recompiled all MEX files with the just-released CodeWarrior Pro 5.2. Heeding a warning in the release notes, changed the C/C++ Settings of all MEX projects to conform more closely to those of the default MSL libraries that we link with. Cursory testing indicates that this change has no effect, i.e. we've achieved compatibility with both Matlab and the MSL libraries. See the new "C/C++ Settings in CW" document in PsychSource. Also expanded the "Install the source" document in PsychSource.
  20. Enhanced ScreenTest.m to test the driver at low and high priority, to document the poor behavior of the Rage 128 driver in the blue G3 at low priority reported by Bob Dougherty. To implement this, the old FrameRate.m has been split into two files, a now-trivial FrameRate.m that simply returns the frame rate, and a new DriverTest.m that returns a struct with lots of information gleaned from elaborate testing. Also added SetClutTest.m which reports even more driver test results.
  21. Added GrayIndex.m that interpolates between black (0) and white (1).
  22. Set "Import Weak" flag on InterfaceLib in Screen.mex and BitBlitImage.mex for compatibility with PowerMac 6100.
  23. Enhanced Screen.mex. When Screen opens an onscreen window, it now pretends be a screen saver that is "asleep" (i.e. sets the "asleep" and "enabled" bits in the 'SAVR' Gestalt selector), so that other processes with system-wide floating windows (e.g. Drop Drawers) will hide their windows and let us have full control of all the screens. As usual, Screen restores the original state when it closes the last onscreen window. (Most of the implementation is in the VideoToolbox file ScreenSaver.c.) The consequence for the user is that Psychtoolbox will happily run with an even wider range of Mac OS extenders, like Drop Drawers. Also see ScreenSaverTest.m.
  24. Replaced AfterDark.m (which called the obsolete AD.mex) by the new self-contained ScreenSaver.mex. AfterDark has been moved to PsychObsolete, and eventually will be deleted. ScreenSaver is an exact replacement for AfterDark, but because of the enhancement to Screen.mex, below, most users can simply delete all their calls to AfterDark. Also see ScreenSaverTest.m. The obsolete AD.mex has been removed.
  25. Enhanced Screen.mex. Screen now temporarily disables any AfterDark-compatible screen saver, if one is running, while it has onscreen windows. (The implementation is in the VideoToolbox files GDOpenWindow.c and ScreenSaver.c.) The consequence for the user is that it is no longer necessary to explicitly disable your screen saver before running your experiment, so you can probably remove all your calls to AfterDark or ScreenSaver (above). Also see ScreenSaverTest.m.
  26. Added new Preference SetClutSAI to Screen.mex to select which flavor of the Mac OS call PBControl is used by SetClut: Sync, Async, or Immed. (Changes were made to GDVideo.c in VideoToolbox to support this.) This was added for testing purposes to answer questions from an Apple engineer in Developer Tech Support, but it appears that this control serves no other useful function.
  27. Recompiled Screen.mex with latest VideoToolbox (Identify.c and GDVideo.c) to better identify the new Macs, e.g. iMac, iBook, blue G3, and G4, and some nonstandard video cards, like the old but still popular Radius PowerThunder.
  28. Abbreviated the suggested citation.
  29. To help people debug their homemade serial cables, now mention the Tips web site information on serial ports in our Questions page and in the help for SERIAL.mex.
  30. Removed references to obsolete MouseClicks from demos.

Version 2.36, 13 July 1999, available for download.
Requires Matlab (Student or regular edition) version 5.0 or better.

  1. Purged PsychObsolete of many functions. See "help PsychObsolete" for a list of what's gone and what you should use instead.
  2. By popular demand, we enhanced GratingDemo.m to display a gabor patch at arbitrary orientation.
  3. LOG10NW is a slightly modified "No Warning" version of the original Matlab LOG10 that temporarily turns off warnings while it runs, to suppress the unhelpful "log of zero" warning.
  4. Fixed minor incompatibilities with PowerMac 6100 (probably same for all the NuBus PowerMacs: 7100, 8100, etc.); Screen('PeekBlanking') was always returning a time of NaN.
  5. Enhanced Screen.mex to automatically turn off the Backgrounding option the first time it's called, instead of just warning the user. Screen may crash when you use it to change the pixelSize while Backgrounding is enabled. Try running PixelSizeTest.m. Turning off Matlab's Backgrounding solves the problem, which is what we've always advised for several other reasons. (We suspect the problem is in Apple's SetDepth routine, but it's not clear why Backgrounding should affect it.)
  6. Greatly expanded the help text for GetSecs and Screen Preference SecondsMultiplier to explain the Mac's three independent timebases.
  7. Added LoadLMCones routine to PsychColorimetric. Still under development but may be of use.
  8. Removed CTRON.mex from PsychHardware. It never worked very well. Added StringToSpectrumPR650 for converting the raw strings returned by the instrument into Matlab data. This is useful if you've stored spectra on the memory card and used the low-level CMETER send command function to get them off.
  9. Added macular pigment density data to PsychColorimetricData.
  10. Mac OS X. Updated our Carbon Compatibility Report. Some key low-level functions (Device Manager and Vertical Retrace Manager) are not currently supported, but Apple claims to be committed to providing them in the forthcoming IOKit for Mac OS X. (We also need UpTime, for which we're hoping to soon convince Apple to resume support.) Unfortunately Next and now Apple have been promising the IOKit for years now, but they have yet to release even draft documentation, let alone code. Good news is that Apple has folded its Game Sprockets software into Mac OS 8.6 and will support DrawSprocket and InputSprocket in Mac OS X. These functions provide functions equivalent to the functions that we currently use that are missing from Carbon (e.g. cscSetEntries and VBL interrupts). However, the bad news is that the current Matlab 5.2.1 application is definitely not Carbon compatible, though it appears that it might be easy for Mathworks to update it and make it compatible, if it chose to.
  11. Fixed VisualGammaDemo to force 8-bit mode, which it requires. Bug reported by Isabelle Mareschal.
  12. Fixed minor incompatibilities with PowerMac 6100 (probably same for all the NuBus PowerMacs: 7100, 8100, etc.). Screen('PeekBlanking') was always returning a time of NaN. This was fixed by a change to the VideoToolbox Seconds.c to check the psychTable->priority instead of the current processor priority against MaxPriority('GetSecs') since it's ok to use GetSecs when called by a high-priority interrupt service routine, because a brief interrupt won't cause the time base to overflow. (Unlike most PowerMacs, the 6100 lacks the UpTime routine, so MaxPriority('GetSecs') is 0.5 instead of 7.) Relaxed the criteria in FrameRate.m and BlankingRate.m to avoid spurious warnings on the PowerMac 6100.
  13. Minor bug fix of AppleVersion.m so DescribeComputer and ScreenTest will correctly report when QuickTime is absent.
  14. Minor enhancement of FrameRate.m to eliminate spurious warnings, usually seen only when you run ScreenTest.
  15. Enhanced the Screen('Computer') "fpu" output argument to correctly identify the PowerFPU init.
  16. Enhanced Screen FrameRate to allow the user to force a remeasurement by supplying a value of [] or NaN. Expanded help for this and FrameRate.m explains that the measurement is normally made only when the first window is opened on that screen.
  17. Corrected the Screen Preference? synopsis to note that the five general preferences are persistent (until you quit Matlab), while the screen-specific preferences are volatile (flushed when last window is closed). Thanks to Allen Ingling for asking the questions that spurred this.
  18. Purged PsychObsolete of many functions. See "help PsychObsolete" for a list of what's gone and what you should use instead.

Version 2.35, 7 April 1999, available for download.
Requires Matlab (Student or regular edition) version 5.0 or better.

  1. Fixed in version 2.35: 6/4/98: Ben Singer reports that "ScreenTest.m (Psychtoolbox 2.30, Matlab 5.2) freezes while using the MacPicasso 523, and under Psychtoolbox 2.11 while Rushing WaitBlanking at priorityLevel 1 he gets a 'GetSecs not working' error. TimeVideo works, however."
  2. Screen Preference SecondsMultiplier controls the rate of the Seconds() timebase, which affects GetSecs, WaitSecs, Screen PeekBlanking, etc. All user-written MEX files that include Seconds.c should be recompiled with the new version.
  3. All our MEX files are now compatible with Student Matlab 5.0. (Alas, Student Matlab has bugs).
  4. ScreenTest.m has been steadily enhanced. It prints in the Command Window a compact summary of how well your computer and video driver can show dynamic visual stimuli. Try running ScreenTest. When reporting bugs please include a printout from ScreenTest.m, especially if the bug is screen- or timing-related.
  5. An overhaul of the frame synchronization and timing code in Screen.mex makes it both more flexible and more robust, coping gracefully with the enormous variety of video drivers and processor speeds that people use for experiments, while providing extremely accurate frame synchronization and timing. Some of the changes are exposed through new Screen Preferences, but most users can ignore them and simply benefit from the enhanced reliability and portability. We suppressed most of the warnings associated with setting up a screen, since the information is available through the Preferences, e.g. SetClutDriverWaitsForBlanking.
  6. Screen('Gamma') is fixed; it used to crash with certain drivers.
  7. Screen(w,'WindowKind') now accepts an array "w" of windowPtrs.
  8. oldBoolean=Screen('Preference','Backgrounding',[boolean]) enhanced to run fast (no disk access) and accept an optional boolean argument indicating the desired setting (0 or 1). The documentation of Screen Preference Backgrounding now gives much more information about Matlab's backgrounding, and why you usually want it off.
  9. Rush.mex and MaxPriority.m have many subtle enhancements to make them smarter and safer. (They now cope gracefully with Backgrounding, VM, interrupts of floating point calculations, and blanking interrupts being on or off.) You can now supply a cell array of strings (see example below, 17 July 1998), which makes your programs more readable.
  10. New KbName function converts keycodes to names. Contributed by Allen Ingling.
  11. Some additional colorimetric calculations provided (pigment self-screening, pupil size as a function of luminance).
  12. Made the test in FrameRate.m for setClutDriverAwaitsBlanking more robust, to eliminate false alarms on fast G3 processors. Bug reported by Cassandra Moore.
  13. Compatibility of all MEX files has been extended backwards to include Matlab 5.0 and Student Matlab 5.0. This requires three tricks: we use a mxVers.r resource identifying it as a 5.0 MEX file, weak-link with the Matlab.xcoff library for version 5.2, and check at runtime for the presence of mexFunctionName, which appeared after 5.0, before using it. Added notes about Student Matlab availability and bugs.
  14. Enhanced Screen('Preference','Backgrounding',[boolean]) to accept an optional boolean argument indicating the desired setting (0 or 1). This does nothing if Matlab's backgrounding already conforms to the desired setting. If it needs to be changed, Screen uses the new undocumented system_dependent('backgrounding') function in Matlab 5.2.1 to change it, or, if running an older Matlab, Screen aborts with an error message that asks the user to manually change the Matlab preference (and mentions the URL for the free upgrade to 5.2.1). The documentation of Screen Preference Backgrounding now gives much more information about Matlab's backgrounding, and why you usually want it off.
  15. Changes to the underlying VideoToolbox code implement the suggestion of a new Apple Tech Note 1158 to save and restore certain PowerMac floating point registers in interrupt service routines that do floating point calculations. This affects Screen.mex, because its interrupt-driven frame counter saves the time as floating point, and Rush.mex, because it runs the rushed code at interrupt time. In principle an interrupt service routine on a PowerMac that did floating point without saving and restoring these registers might have caused an interrupted calculation to give an erroneous result, but we never experienced that. Not taking any chances, we've implemented Apple's suggestion anyway.
  16. Rush.mex now uses the new system_dependent('backgrounding') function, if available, to turn off backgrounding while Rushing, and then restores it.
  17. Updated KbDemo.m to use KbName. Updated explanation of backgrounding in GetChar.m, CharAvail.m, and EventAvail.m.
  18. Updated our method for checking whether Matlab Backgrounding is enabled. Formerly we examined the Matlab prefs file. Now, if possible, we use the new system_dependent('backgrounding') function, which appeared in Matlab 5.2.1, at our request. Our update is needed because the user may use that new function to dynamically turn backgrounding on and off, which isn't tracked by the prefs file. This affects the Screen Preference Backgrounding and several functions, e.g. Rush and Screen, that warn if Backgrounding is enabled. (Thanks to Steve Daken for reporting the bug.)
  19. MaxPriority.m now returns priority 0 if Virtual Memory is being used, because any memory access (e.g. to a Matlab array) may result in a disk access. This enhances portability, allowing programs using MaxPriority and Rush to run unmodified on computers using VM, without hanging.
  20. Added externally-settable calibration factor to VideoToolbox Seconds.c to allow users to improve accuracy of timing by calibrating Seconds(). The calibration factor is accessed as Screen Preference SecondsMultiplier. It affects all MEX file, e.g. GetSecs, WaitSecs, Screen, etc., that call Seconds(). GetSecsTest.m calibrates GetSecs against GetTicks, improving the rate accuracy of GetSecs from about 10^-2 to 10^-4. Note that the timebase is still the counter inside the PowerPC chip, which is extremely stable. This improvement overcomes Apple's use of a slightly inaccurate nominal clock rate in converting the count to a time. (Thanks to David Ferster for pointing out the problem.)
  21. Added note to Screen synopses for OpenWindow and OpenOffscreenWindow explaining that Matlab is unaware of Screen's windows. (Thanks to Melanie Palomares for noting the potential confusion.)
  22. Enhanced Screen(w,'WindowKind') to accept an array of windowPtrs, returning an array with the same dimensions as "w". Also changed its handling of [] (empty matrix) to simply pass through the empty matrix instead of replacing it with the default window.
  23. Fixed long-standing bug in Screen('Gamma') that caused a crash if size of new gamma table was bigger than size of old table. Thanks to Bob Dougherty and Bill Press for tracking down the locus of the bug, and Steve Engel for alerting us to it initially. This fix should eliminate the need for the earlier workaround of calling Screen('GetClut') before calling Screen('Gamma').
  24. Moved obsolete InitQuest function to PsychObsolete. Changed name to InitQUESTMEX. Changed variable name from "function" to "func" for Matlab 5.2 compatibility. Thanks to Chen-Chung Chen for pointing out the problem.
  25. Added KbName function, which converts keycodes to names. Contributed by Allen Ingling.

Version 2.34, 1 February 1999, available for download.
Requires Matlab 5.1 or better.

  1. Fixed: Oops. We forgot to weak-link DriverLib in at least one MEX file. The symptom is that Matlab gives a fatal error message whenever you try to load the affected MEX file: "GetDiskFragment error -42 accessing: KbWait.mex". You can test for problems loading MEX files by running MexTest.m, which exercises every MEX file in the Psychtoolbox.
  2. New SERIAL.mex for general serial port i/o.
  3. New PsychOptics folder with some computations for human eye MTF and PSF.
  4. I had to enable "Far data" in Screen.µ for the Screen.68K target. Hasn't yet been tested on a 68K computer.
  5. Add PsychOptics folder with some computations for human eye MTF and PSF.
  6. Screen 'PutImage' and 'CopyWindow' have substantially enhanced synopses and error diagnostics. The features and restrictions of the copyModes 'addOverQuickly', etc., are now specified. PutImage and CopyWindow formerly silently ignored errors, skipping the requested action; now they give a detailed fatal error message, to help you get your program working.
  7. In order to accommodate the extra synopsis text, I had to enable "Far string constants" in Screen.µ, for the Screen.68K target, to eliminate error messages about near data exceeding 64 KB. The resulting Screen.mex runs fine on my PPC, but hasn't yet been tested on a 68K computer.
  8. Delete Sinc() function, as it is superseded by built-in sinc() function. Changed calls internal to Psychtoolbox to use sinc() rather than Sinc().
  9. Added SERIAL.mex file for general serial port i/o.
  10. Fix in Quest routines to handle case where range is not an integer multiple of grain.
  11. Fix bug in scaling by SplineSpd, introduced summer 1998.

Version 2.33, 12 August 1998.
Requires Matlab 5.1 or better.

  1. Screen.mex does smarter assessment of 'SetClutDriverWaitsForBlanking', coping with G3 processors, ATI drivers, and the MacPicasso.
  2. New function hz=Screen(w,'FrameRate') instantly returns the frame rate, in Hz, measured when the screen was first used. Users can continue to use FrameRate.m which calls the new function when asked to provide just the frame rate.
  3. Version 14 of the PsychTable in Psychtoolbox.h. All MEX functions that use Psychtoolbox.h must be recompiled. (The version is checked at runtime.) Recompiled all MEX files with CodeWarrior Pro 3.1, including the latest compiler and Metrowerks Standard Library (MSL) updates.
  4. 68K Limitation: Version 2.33 does not seem to work with the Quadra 950. This may represent something specific to the 950 or be a general problem with 68k machines, although early versions of 2.33 worked fine on Mac IIci's. We do not intend to try to track this down, as we no longer have convenient access to any 68k machines. Version 2.11 is still available if you find that 2.33 does not work with your older machines.

Version 2.32, 1 August 1998.
Requires Matlab 5.1 or better.

  1. MaxPriority.m does smarter assessment of 'PeekBlanking', taking into account whether you also mention 'SetClut' or 'WaitBlanking'. A new optional argument, 'BlankingInterrupt' allows you to insist that you need the blanking interrupt.
  2. BlankingInterruptRate.m now always returns the blanking interrupt rate (ignoring SetClut), as advertised.
  3. PsychtoolboxDate returns the release date, as a string, e.g. '1 August 1998'. This distinguishes the multiple releases that have the same version number, which is reported by PsychtoolboxVersion. DescribeComputer now reports both the version number and date.

Version 2.31, 25 July 1998.
Requires Matlab 5.1 or better.

  1. Fixed: Snd('Play','Sosumi') works, but occasionally gives the error message, "SndPlay1.c 372: DisposeHandle error -99". PowerMac 6100, Mac OS 8.1.
  2. Fixed: To get proper synchronization with vertical blanking on G3 PowerMacs, you had to issue the calls Screen(screenNumberOrWindowPtr,'Preference','SetClutCallsWaitBlanking',1) and Screen(screenNumberOrWindowPtr,'Preference','WaitBlankingUsesInterrupt',1).
  3. New DescribeScreen.m and DescribeComputer.m provide compact printouts of your set up.
  4. Hitting command-period now works, canceling all our MEX functions.
  5. Snd.mex is fixed. No more crashes. [Formerly Snd('Play') called about 44 times without a Snd('Close') caused a Matlab freeze.]
  6. A new feature of Screen SetClut is that if SetClutDriverWaitsForBlanking or SetClutCallsWaitBlanking is true, then the code tries to make this a reliable property of SetClut. For purposes of synchronization, we usually care only about the beginning of the about-one-millisecond blanking period. But most video drivers that wait for blanking are happy to do the cscSetEntries any time blanking is true. Some fast Macs (e.g. a G3/250) can call cscSetEntries a hundred times within a single blanking interval. This isn't what you want, so, if SetClutDriverWaitsForBlanking or SetClutCallsWaitBlanking, then SetClut now waits until at least BlankingDuration has elapsed from the end of the last recorded blanking before calling cscSetEntries. Thus a tight loop of SetClut won't race; it'll do one frame per iteration. [This replaces a similar, but inferior, change originally posted on 19 July.]
  7. Many video drivers briefly suppress interrupts while they perform SetClut (cscSetEntries or cscDirectSetEntries). This has meant that our frame counter (accessed by PeekBlanking) occasionally missed a frame when you called SetClut. This problem is now solved, provided SetClutDriverWaitsForBlanking, which is true for most drivers. We now treat the end-of-SetClut as a potential blanking event, just like a blanking interrupt. Whenever we have a potential blanking event we check the time of the last recorded blanking. If the current time exceeds that time by at least BlankingDuration (typically 3 ms, but user-settable), then we "punch the blanking clock" by incrementing the frame counter and recording the current time (which you can inspect by calling PeekBlanking). We discard potential events that fall inside the BlankingDuration window to prevent double-counting of the same blanking, which can occur because some video cards spuriously issue multiple interrupts and because the same blanking may now be signaled by both an interrupt and an end-of-SetClut. Two new preferences, SetClutPunchesBlankingClock and InterruptPunchesBlankingClock, allow enabling and disabling of each puncher of the blanking clock, but normally you'll just want the default settings, which enable both unless the SetClut driver doesn't wait for blanking. You probably won't notice this change, though it represents a great improvement in the reliability of our frame counter. NOTE: It is possible that calling SetClut on one screen will still cause other screens to miss interrupts. We haven't tested for that, and it's doubtful that anything could be done about it.
  8. Deleted obsolete Screen Preference: SetClutSimulatesBlankingInterrupts.
  9. Replaced Screen Preference WaitBlankingUsesInterrupt by WaitBlankingAlwaysCallsSetClut. The new name is clearer. The effect is unchanged except that it's now the opposite value (true vs false).
  10. No one reported it, but the command "Screen", with no arguments, was crashing, because the text to be printed exceeded the 4096 byte buffer used internally by Matlab's mexPrintf command. We now print in smaller chunks, avoiding overflow. Fixed.
  11. As new safety feature, Rush.mex now issues an error if Matlab's Backgrounding is enabled. If Rush allowed Backgrounding, Matlab might yield time to another process while processor priority is raised, and that process might access the disk, which would hang the computer since the raised priority will block the interrupt forever. As always, we suggest that you turn off Matlab's Backgrounding option in its Preferences window.
  12. Steve Engel reported that ScreenTest hung up halfway through if he ran it first after starting Matlab. It ran fine if he ran other Screen-related programs first. We found and fixed the error: A subroutine within FrameRate.m wasn't loading all Rushed functions into memory before calling Rush. This would result in a hang if Matlab had to load the function from disk while Rushing at raised priority. We have scanned the entire Psychophysics Toolbox and fixed all uses of Rush, to always load all Rushed functions. Fixed.
  13. GammaTest.m, ScreenTest.m, and BlankingInterruptRate.m were polished to work smoothly with all video devices that we've tried. Several video drivers completely suppress frame interrupts during successive calls to SetClut. This was producing a somewhat confusing and repetitious warning from BlankingInterruptRate, which is called by ScreenTest.m. The testing algorithm was improved and the information is now presented as a line the results table, specifying the fraction of the frame duration during which interrupts are suppressed.
  14. Added GammaIdentity.m which returns an identity gamma table appropriate to the screen's dacSize.
  15. Screen 'Gamma' now optionally returns a third output argument that specifies the error codes returned by cscGetGamma and cscSetGamma. Asking for this gammaError argument suppresses the corresponding warnings.
  16. When SetClutDriverWaitsForBlanking then each call to SetClut (by user or WaitBlanking) waits, if necessary, for enough time to elapse (few ms) since the end of the last SetClut, for that blanking to have ended before making the new cscSetEntries call. The delay interval is Screen Preference BlankingDelay. The consequence is that even back-to-back calls to SetClut or WaitBlanking will each wait for a new blanking (i.e. frame).
  17. The boolean parameter Screen Preference SetClutDriverWaitsForBlanking can now be overridden by the user. A separate Preference AskSetClutDriverToWaitForBlanking is provided to make a request to the driver. This gives users more control, but don't use it unless you need it. The standard behavior will usually be best.
  18. New in PsychTests: SndTest.m shows that the Snd bug is gone. PixelSizeTest.m demonstrates a weird crashing bug that seems to only affect 6100 PowerMac with extra INITs. Does it crash for anyone else? GammaTest.m tests setting and getting of the gamma table, which is important for video cards with more-than-8-bit DACs. We'd be glad to get results from anyone who has one of these cards.
  19. GetSecs.mex now returns NaN if the priority is too high for reliable values. All priorities are ok on PCI PowerMacs, so the change only affects non-PCI PowerMacs (6100, 7100, 8100) and 68K Macs. Change is in VideoToolbox Seconds.c.
  20. New in PsychOneliners, DescribeComputer.m and DescribeScreen.m print out the important characteristics of the environment your program is running in. This code was pulled out of ScreenTest.m to allow use by other programs as well.
  21. Command-Period wasn't being detected by any MEX files, due to a bug in VideoToolbox CommandPeriod.c. Reported by Robert Sekuler. Fixed.
  22. Snd.mex bug fixed. Since January, Snd has failed (with an error message) after playing the 44th sound. This turned out to be due to a mistake in the way that the VideoToolbox routine PlaySnd1.c called Apple's NewSndChannel (specifying qLength larger than allocated). Apple helped us find the bug. Fixed.
  23. After the fact, it is now apparent that many of the recent changes were provoked by the increased speed of the new G3 processors. We had not anticipated any G3 incompatibility, since they run the same instructions as the older processors. We expected only the perennial problem of new video drivers that come with each computer and video card. Screen.mex works intimately with the driver and every driver change requires some sort of compensation in Screen.mex to maintain computer-independent performance. However, it turns out that the high speed of the new computers broke once-reliable algorithms for characterizing video driver performance. A G3/250 can call SetClut a hundred times in the brief one millisecond duration of blanking. This led to writing new algorithms for characterizing the driver. Some of the changes were included in the 2.30 release, but weren't complete until now. Unfortunately the 2.30 code uses a reliable test of SetClut that leads it to rely on an unreliable bit of code that uses SetClut to wait for blanking, resulting in warnings if you run ScreenTest. The solution is simply to upgrade to the 2.31 release, which has reliable code in both sections.
  24. Enhanced Screen WaitBlanking (and some of the screen-configuration tests) to cope with faster processors. SetClut generally waits for blanking, but blanking lasts for about a millisecond, and faster processors, like the G3/250 can call SetClut a hundred times in that interval. WaitBlanking now waits until the end of the last blanking before initiating a wait for the next one. This uses a new Preference: BlankingDuration. These changes should eliminate ScreenTest warnings about "WaitBlanking not waiting" on newer (ie fast) Macs that were first reported by Steve Engel.
  25. Enhanced ScreenTest.m now tests all pixelSizes, and prints out a summary table reminiscent of the VideoToolbox's TimeVideo. Highly recommend that everyone run this, to find out about any video problems before they bite bite you. Please include the ScreenTest print out when you report any screen or timing bugs.
  26. Rush.mex can now accept an array or cell array of strings, which it concatenates into one string. This allows for a prettier program layout:
        loop={
            'for i=1:100;'
                'Screen(window,''WaitBlanking'');'
                'Screen(''CopyWindow'',w(i),window);'
            'end;'
        };
        Screen('Screens'); % make sure all Rushed functions are in memory
        priorityLevel=MaxPriority(window,'WaitBlanking');
        Rush(loop,priorityLevel);
    Most of the programs in the Psychtoolbox that use Rush have been updated to use the new syntax.
  27. Updated the descriptions of Screen Preferences.

Version 2.3, 15 July 1998
Requires Matlab 5.1 or better.

Version 2.3 has been tested fairly thoroughly and seems to be quite stable, except as noted in the bugs section. If you downloaded a prerelease version of 2.3, we suggest you upgrade to the 15 July final version.

  1. Dated notes, below, indicate changes made without bumping the official version number 2.30. Downloading always gets you the latest, including all changes.
  2. July 15, 1998: Rewrite of FrameRate.m now optionally does thorough testing and reporting of the video timing. Old programs are unaffected. The new algorithms developed for FrameRate.m have now been incorporated into Screen.mex for more reliable characterization of the video driver.
  3. July 15, 1998: Screen 'WindowScreenNumber has been enhanced to accept a windowPtrOrScreenNumber instead of just a windowPtr. This is handy in a subroutine where you don't know what you've been passed and you just want an easy way of converting it, whatever it is, into a screenNumber
  4. July 15, 1998: Screen 'WindowScreenNumber' has been enhanced to accept a windowPtrOrScreenNumber instead of just a windowPtr. This is handy in a subroutine where you don't know what you've been passed and you just want an easy way of converting it, whatever it is, into a screenNumber
  5. July 15, 1998: Enhanced algorithm used by Screen.mex (when first window is opened on a screen) to determine whether SetClutDriverWaitsForBlanking is true. This enhancement clears up past problems with several video drivers, in which a wrong reading of that key fact led to erroneous setting of SetClutCallsWaitBlanking, which user programs then had to explicitly override by setting the Screen 'Preference'. The values set up automatically should now be correct.
  6. July 15, 1998: Enhanced Screen.mex and ScreenTest.m for compatibility with new computers, including PowerBook G3 Series.
  7. July 10, 1998: If you find that 'SetClut' doesn't wait for vertical blanking, try setting to 1 the Screen Preferences SetClutCallsWaitBlanking and WaitBlankingUsesInterrupt, although our July 15 fix, above, should solve this problem.
  8. The names of new Macs are now correctly reported by 'Computer', e.g. try ScreenTest.
  9. June 30, 1998: Version 2.30 is incompatible with Matlab 5.0 (and earlier). We recommend Matlab 5.2, which is much more stable than its predecessors.
  10. May 7, 1998: Changed the way that SplineSpd renormalizes total power after splining functions of wavelength. The old renormalization was based on the ratio of wavelength sampling increment. The new way actually forces the integrated power to be identical.
  11. May 2, 1998: Obsolete SoundPlay/PlayBeep changed to make it behave synchronously, as in its original implementation. This avoids the Snd bug (see bugs), which we hope to fix soon.
  12. Replaced SndPlay.mex by Snd.mex. (Most of the relevant code is in VideoToolbox.) SndPlay still works as an M file that calls Snd. The new interface provides more control of timing by separating opening and closing of the sound channel from the actual playing of the sound. Updated PlayBeep to call through Snd rather than SndPlay but moved it to the obsolete folder. Added MakeBeep, so that what PlayBeep used to do, MakeBeep and Snd can now do.
  13. New "Psychtoolbox Installer" based on industry-standard Installer VISE. Easy foolproof installation.
  14. April 30, 1998: We're still tweaking the installer. If you had trouble with it, please try it again. The latest change was to make the registration screen fit on 640x480 monitors and the printed page, and tell users that they can use the installer to just register, without reinstalling.
  15. Registering. The installer offers the option of registering. If you decline, and want to register later, just run the installer again. It will notice that you've already installed and take you quickly to the Registration form. However, it's all very informal. You can accomplish the same thing by writing to psychtoolbox@psych.nyu.edu.
  16. April 30, 1998: The Psychtoolbox section of the printout produced by typing VERSION in Matlab was ugly; it's now pretty.
  17. 4/25/98: Renamed obsolete QUEST.mex to QUESTMEX.mex, to avoid name-space collision with the new Quest.m. The new Quest.m doesn't do much other than point you toward the M-file implementation. See help PsychQuest.
  18. No longer compatible with Matlab 4.
  19. Renamed NChooseK to ChooseKFromN. Matlab 5 has its own nchoosek which does something else.
  20. Removed DLOG and TIMER, which have been in the PsychObsolete folder for some time. You'll now get an error message explaining what to use instead.
  21. Enhanced KbCheck to return key code. (Thanks to Allen Ingling who did it.)
  22. GetKey is gone; use GetChar instead. BBEdit has a nice global change facility, which you could use to update your programs.
  23. Added functions WhiteIndex and BlackIndex, which return the appropriate "color" value for the current pixelSize. This makes it easy to write self-documenting code that works at any pixelSize.
  24. Enhanced demo and test M files to run on any screen, at any pixelSize, and with Student Matlab as well as regular Matlab.
  25. Added MovieDemo2 and ColorTest.
  26. Enhanced ScreenTest to do more thorough testing, on the widest range of devices, and provide more information, more clearly, in less space. (But it still doesn't send flowers on a bad day.)
  27. Discovered and fixed bug in our interrupt-driven frame counter. (The relevant code is in VideoToolbox.) The main symptom was screwy timing and hangs if QuickTime 3 was installed. Now fixed. (Apple helped us track down the problem. QuickTime 3 is ok, an innocent bystander.)
  28. Added Screen 'PixelSizes', which returns a list of allowed values for PixelSize on this window or screen. 'PixelSizes' and 'Screens' make it easy to create test and demo programs that cycle through all your screens at all pixelSizes. See GratingDemo.m. (Briefly, during early testing, this was called 'PossiblePixelSizes'.)
  29. Changed the default behavior of Screen to leave the pixelSize alone unless the user explicitly requests a particular pixelSize. We used to change it to 8 bit. For an experiment that you want to run at a particular pixelSize, you should set it explicitly. For demos that you want to run on a wide range of computers, it's usually better to leave it alone.
  30. Fixed small bug that sometimes caused failure to restore pixelSize after closing Screen.
  31. Enhanced all Screen functions that accept a "color" argument ('Openxxx', 'FrameRect', 'FillRect', 'Drawxxx', etc.) to work well in 16/32 bit mode. You can now pass an [r g b] triplet to these routines, when in 16/32 bit mode. Passing a scalar k expands to [k k k] in 16/32 bit mode. The "color" argument to these functions is now optional and defaults to black for strokes (text, lines) and white for fills.
  32. Enhanced Screen 'PutImage' and 'GetImage' to accept and return MxNx3 arrays when in 16/32 bit mode. 'PutColorImage' and 'GetColorImage' still work, but will become obsolete soon. We suggest that users switch to the new PutImage and GetImage.
  33. Screen 'PutImage' and 'PutColorImage' now accept both double and uint8 data types.
  34. Screen 'GetImage' now returns the image array as uint8, instead of double. This saves a lot of space (a factor of 8), but Matlab will complain if you try to do arithmetic directly on the uint8 image data. In that case, just convert to double format by passing the array through the double() function.
  35. Screen 'OpenWindow' and 'OpenOffscreenWindow' now behave slightly differently when the user supplies a windowPtr. As before, if the user supplies a screenNumber then "rect" is in screen coordinates and defaults to the whole screen. What's new is that if the user supplies a windowPtr then "rect" is in window coordinates and defaults to the whole window. This change only affects existing programs that use onscreen windows that are not aligned with the upper left of the physical screen.
  36. Screen now hides/restores Apple's Control Strip when opening/closing an onscreen window.
  37. Screen 'CopyWindow' now clips the request by the portRect of the source and destination windows, so it will never access pixels outside the windows. (This reflects an enhancement of the VideoToolbox CopyWindows.c.)
  38. Rush now stops and returns after the first error. And the error message is slightly enhanced. (Rush used to print but ignore the errors, continuing merrily on. It was a bug in Matlab, which we're now working around.)
  39. Added MaxPriority, which returns the maximum priorityLevel that will allow normal operation of any specified list of functions. Use this before calling Rush, to select the highest priorityLevel that's compatible with all the functions that you're rushing.
  40. Slight change to the way Rush interprets its priority input. This allows direct passing of the output of MaxPriority. Rush no longer accepts a priority of "-1"; use 0.5 instead. Or, better, use MaxPriority.
  41. All names that included the acronym "VBL" now include the word "Blanking" instead. All the old commands that you know still work. (Suggested by Norma Graham.)
  42. All mentions of the effect of priority on blanking interrupts now refer to the dynamic parameter Screen 'MaxPriorityForBlankingInterrupt' instead of the constant "1". It's often 1, but may take on a lower value, if necessary, to gracefully cope with problematic video drivers.
  43. Screen 'WaitBlanking' (formerly 'WaitVBL') now error exits if you ask it to do the impossible. If the WaitBlankingUsesInterrupt Preference is false or if the priority is above MaxPriorityForBlankingInterrupt then any call to WaitBlanking is asking it to use a call to the SetClut driver to wait for blanking. In that case, if SetClutDriverWaitsForBlanking is false then WaitBlanking issues an explanatory error message. (Formerly WaitBlanking simply assumed that the driver would wait. This is why Rush made things worse on some computers: WaitBlanking didn't wait when the priority was raised.)
  44. Fixed a sneaky bug in WaitBlanking. It worked fine for short waits, but would hang on certain video devices if you asked for a long wait at a raised priority. Now the C code shares time with the Mac OS, by calling WaitNextEvent, ONLY if priority is 0. At raised priority the tick counter doesn't run so the Mac OS would wait forever for a single tick. And even if it doesn't wait for a tick it might give time to some other process that doesn't cope well with raised priority. Fixed.
  45. Enhanced Screen's detection of and compensation for unusual blanking synchronization behavior of video drivers, so that user programs can assume a standard environment.
  46. Many Screen 'Preference' functions have changed name to be more self explanatory. We consider the preferences gravy, special access to our guts, so the names change as the guts change to cope with the changing environment (e.g. video drivers that don't wait for blanking, and Rush's high priority). A major feature of Screen is that it automatically detects and compensates for nonstandard machine environments (especially video drivers), so your program can safely assume a standard environment. However, we're sufficiently realistic to know that there will be times when you want to override Screen's idea of what's good for you, to attain the ultimate performance of your particular machine. The 'Preference' settings allow you (dare we say it?) to control everything. But, if you do, recognize that programs that fiddle with these internals may need tweaking for each new release of the Psychophysics Toolbox. The old names still work, for the preferences that have merely been renamed. Type "screen preference?" at the Matlab prompt for documentation.
  47. Renamed Screen 'Preference' 'SetClutWaitVBL' to 'SetClutCallsWaitBlanking'. (The old name still works, but will go away eventually.)
  48. Added Screen Preference SetClutDriverWaitsForBlanking, replacing SetClutDontWait. The new preference reports, based on empirical measurement by Screen.mex, whether the driver does wait, and, if the driver allows it, lets you to turn this on and off.
  49. Changed the default setting of Screen's 'Preference' 'IgnoreCase' to true.
  50. The "driverVersion" return argument from Screen 'VideoCard' has changed from being a number to being a string. Users must change their print statements accordingly.
  51. Enhanced the error message about incompatible versions of the psychTable. It now tells you which two mex files are conflicting and prints the necessary web command to open a browser to the website. However, if the error message is printed by an old MEX file, then you'll get the old (not so helpful) error message.
  52. Renamed SetGamma to SetGammaMethod. The old calling form still works. Also changed names of some of the calibration structure fields. This latter change is not visible to application programs unless they were accessing fields directly.
  53. Renamed MaxGmtCon to MaximizeGamutContrast and LiteralUnderscr to LiteralUnderscore. The old names still works as call-throughs to the new names. This change is possible because Matlab 5 can deal with longer functions names.
  54. Prepend Toolbox subfolder names with Psych (e.g. PsychBasic) to minimize chance of namespace collisions with other toolboxes. Created folder PsychOneliners for little utilities that aren't really core and moved some stuff out of PsychBasic into PsychOneliners. Not all oneliners have just one line.
  55. Screen 'Computer' can now tell you whether you're running in PPC or 68K mode.
  56. Calibration structure changed from our Stuff routines to use structures (requires Matlab 5).
  57. The backgrounding-enabled check looks for the prefs file first in the System Preferences folder, and then in the Matlab folder, as specified by Mathworks. This allows it to work properly if you have several copies of Matlab, and keep each Matlab's preferences file with the Matlab application in its Matlab folder.
  58. The unconditional warnings about SetDepth have been eliminated, but if the user attempts to use SetDepth on Systems older than 7.6.1 we suggest upgrading the System to 7.6.1 or better. Repeatedly changing depth crashes Mac OS versions prior to 7.6. (This particular bug is fixed in 7.6, but 7.6.1 fixs many other bugs and is a better version to install, if you're going to upgrade. But Mac OS 8.1 is even better.)
  59. Add ClutMovie to Screen synopsis. It had been omitted in previous versions.
  60. Fix Addon example template to work properly under Version 2.
  61. Changes to SerialLib.c for more robust behavior of functions using serial ports. The hope is that these will fix the flakey behavior sometimes exhibited by CMETER.
  62. Changed name of header files from PsychLibSourcesXXX to PsychtoolboxXXX.
  63. Upgrade to CW Pro 2 compiler, drop support for THINK C. (CW Pro can compile both 68K and PPC MEX files for Matlab 5.) Bumped PsychTable version number in C source. Addon MEX files need to be recompiled with new library sources, although you need not update the compiler to do so.
  64. Fixed in version 2.3: The CMETER routine (to talk to PR-650) sometimes gets into a funny state. Clearing the mex files ("clear mex") and reinitializing seems to fix it. This problem occurs on some Macs and not on others.

Version 2.11, 21 August 1997, available for download.
Requires Matlab 4 or 5 or Student Matlab 5, or better. 68K or PowerPC.

Version 2.11 is the last release of the Psychophysics Toolbox that works with both Matlab 4 and 5. Subsequent releases only support Matlab 5. It is also the last release that was tested on 68K.

  1. New EventAvail MEX function allows checking of event queue (for mouse clicks, etc.)
  2. Minor enhancements to some demos/tests.
  3. Minor enhancements to documentation.
  4. Fixed in version 2.11: Screen('Gamma') generates a warning message and returns [] on the 68K for the Apple 8-24 card. Screen('SetClut',....) does not process non-zero values of startEntry correctly for the Apple 8-24 card. This is due to a known limitation of the underlying VideoToolbox SetEntriesQuickly.c code. It could be fixed by anyone who wants to put in the time to figure out how the card works. Fixed in version 2.11, which no longer uses SetEntriesQuickly.c, since Apple's latest 8-24-card driver seems to work ok.
  5. Fixed in version 2.11: Funny things happen if you start a program with your monitor in 24-bit mode (millions of colors) and use offscreen worlds. The contents of the offscreen world are either written incorrectly or copied incorrectly. This problem can be demonstrated by running MovieDemo with the monitor initially in 24-bit mode.

Version 2.1, 14 August 1997
Requires Matlab 4 or 5 or Student Matlab 5, or better. 68K or PowerPC.

  1. Added Rush.mex. Many small bug fixes and enhancements to Version 2.
  2. All calls to Screen(deviceOrWindow,'OpenWindow',...) must have an explicit device or window. Previously, the device argument was optional
  3. Calls to Screen(device,'OpenOffscreenWindow',...) are only allowed after a call to Screen(device,'OpenWindow',....) for the same device. Screen now detects failures to comply with this convention and exits with an informative warning. This enforcement also applies to the obsolete Screen('OpenWindow',color,device,...), which you should eliminate anyway.
  4. Addon MEX-files must be recompiled with the new sources. No changes to your source are necessary, but you will probably need to add VideoToolbox:SetPriority.c to your projects. See the current Addon template for a complete list of required files.
  5. Screen('BlitBitImage') has been replaced by the stand-alone BlitBitImage.mex. BlitBitImage takes the same arguments but requires an explicit window pointer or device number. On PPC machines, we now find that the functionality of BlitBitImage is better handled by Screen 'CopyWindow' in a Matlab loop, especially if you use the Rush facility (see MovieDemo). On 68K machines, BlitBitImage may still be useful.
  6. We are moving towards enforcing the convention that all calls to Screen functions that write to a window require a window pointer or device number. We have been recommending this but have continued to support the old convention of allowing argument omission when only one window is open. A future release is likely to require that you always pass an explicit window or device.
  7. Update CopyText to work with Matlab 5 on 68K.
  8. Update CMETER to work with Matlab 5.
  9. Update Screen('Gamma', ...) to allow specification of DAC depth. Should allow it to work with 10-bit Radius cards.
  10. Change name of GetKey -> GetChar, KbHit -> CharAvail. The old names still work.
  11. Rush.mex allows you to run a bit of Matlab code (passed as a string) with little or no interruption. Rush is the happy result of lots of work trying to improve performance in real time loops. Also added Priority and PatchTrap, but they are not recommended. Priority was an earlier attempt to minimize interrupts, but it's dangerous, and may freeze your computer. See help for Rush, and try running MovieDemo, ScreenTimeDemo, LoopTest, and RushTest.
  12. Added BitPlaneDemo, VisualGammaDemo, RenderDemo, ZonePlateDemo, MouseTraceDemo and many tests.
  13. Fixed problem with incompatible color tables in on- and offscreen windows. To make the program logic easier, Screen imposes some new requirements.

Version 2, June 1996 - April 1997
Requires Matlab 4 or 5 or Student Matlab 5, or better. 68K or PowerPC.

Many editions of "version 2" were issued, distinguished solely by date of release. The changes below refer to the date of release.

  1. Fixed in version 2: When Screen('ClutMovie', ...) is called multiple times in a loop with the check abort features enabled, something funny happens. It works fine when called once or when called with check abort disabled.
  2. Fixed in version 2: If you are using two screens and they are not both preset to 256 colors, the open of the second screen affects appearance of the first.
  3. Obsolete in version 2: The interface to BlitBitimage.m is ugly. When a movie is precomputed, the movie is hardware dependent and may not play properly on other machines with different video hardware. Also, things can get screwy on multiple screen systems if movies are made when the main screen is not set to 8-bits, even if the display screen is. [As of version 2, offscreen windows offer a much more flexible way of showing movies. BlitBitimage has been moved to the PsychObsolete folder.]
  1. First find all instances of DrawText and change the argument order to the new convention (type Screen('DrawText?') to get the current usage.
  2. Find all cases where a rect is set directly and change the order from [top left bottom right] to [left top bottom right]. Even better, call SetRect(left,top,bottom,right).
  3. Find all cases where entries of a rect are indexed directly (e.g. left = theRect(2)) and change to new indexing (e.g. left = theRect(1) or even better left = theRect(RectLeft)).
  4. Find all calls to FS or FileShare and update for new status returns. Type "help FileShare" for a synopsis of the new recommended usage.
  5. Enter Screen('UsageWarnings',Inf) at the command prompt. Run your program and make note of all the usage warnings. Find and fix these.
  1. The interface to FS and FileShare was changed. The new interface allows for user prompt and also handles more gracefully cases where filesharing is shutting down or starting up. Type "help FileShare" for a synopsis of the new recommended usage.
  2. Screen('DrawText',...) has a new argument order. If you use the old order Screen will complain and print out the new usage.
  3. A number of functions have been replaced by functions with new names that work almost the same but have a more rational argument ordering. If you use the old functions, you will get a warning message but things will generally work. The function Screen('UsageWarnings',....) will allow you to control how many warnings you see in a seesion or let you supress them altogether. It is recommended that you update your code to eliminate the usage warnings. In the future we will pull the old interfaces out.
  4. The internal format of a Matlab rect has changed, so that the entries are now [left top right bottom] rather than [top left bottom right]. If your code uses RectLeft, RectRight, RectTop, RectBottom accessors or the SetRect function, it will work unchanged. But if you set rects explicitly, you will need to change the ordering. The symptom of this problem is likely to be things appearing at the wrong place on your screen or perhaps not appearing at all (because they are out side the screen's rect). The best way to code rects is to use SetRect to initialize rects and use the indexing functions RectLeft, etc. to pull out individual coordinates.
  5. The M-file version of SoundPlay does not accept a third ('dontscale') argument. The data are never scaled. Remove this argument from the calling location to get it to run.
  6. Screen image display routines now respect CopyBits behavior for rectangles. Previously the bottom right of the rectangle was ignored. This means if you were not setting those values properly, your display code may now do funny things. Make the rectangle the same size as the image unless you are interested in expansion/contraction of the image you are moving.
  7. Renamed BlitImage255 to PutImage and GetImage255 to GetImage. Old calling styles are still there but generate a message telling you to use the new style.
  8. Fixed Screen('OpenScreen',...) to return a 1 by 4 rect instead of a 4 by 1. This is consistent with the rect definition and usage elsewhere in the code. This fix should have no effect on your code unless you were actually checking rect dimensions somwhere.
  9. Added warning messages to Screen('BlitImage',...) and InsertBitImage that the routines are obsolete and should be replaced by calls to Screen('BlitImage255',...) and InsertBitImage255. These messages print out on each call to the routines. This reflects a decision that the user should explicitly do any quantization that is going to be done.
  10. Moved Shuffle from BasicPsycho to Probability. Folded in Pelli modifications that preserve the size of passed array and generalize to work on matrices. This might break existing code if it counted in some way on the change of array size that the old routine produced. But it is a little difficult to imagine this happening in practice.
  11. GetClicks added as a MEX-file, MouseClick converted to an M-file that calls through GetClicks. MouseClick is likely to go away in the future, so try to change to GetClicks now.
  12. GetMouse usage updated to allow [x,y] = GetMouse. This breaks any code that used the undocumented fact that GetMouse used to provide the state of the button as a second return value. This information is still available as a third return value as in [x,y,button] = GetMouse. In addition, I recommend changing usage [xy] = GetMouse to [x,y] = GetMouse for general consistency with the style of the other routines and the examples.
  13. Usage of OffsetRect(rect,v,h) changed to OffsetRect(rect,x,y). This breaks code that uses OffsetRect but makes the horizontal/vertical argument order consistent throughout the toolbox.

Version 1, 19 April 1997

  1. Fixed bug in ScreenDemo. It was calling function var(), which only exists in the statistics toolbox. Now it calls std().^2, which is standard.

Version 1, 2 April 1997

  1. All the MEX functions now error-exit if they detect typing of Command-Period. In addition, we now close all Screen windows anytime any of our MEX files error-exits. The latter change required a number of modifications that allow the MEX files to work together. They do this through a common "PsychTable" that is allocated in the System heap by a call to Gestalt. A consequence of this is that you must upgrade all of the MEX files in the Psychophysics Toolbox together. (Each MEX file checks that it is compatible with the current PsychTable and complains if not.)

Version 1, 20 March 1997

  1. Fixed FS and FileShare to handle cases where sharing is starting up or shutting down. This introduced a backwards incompatibility. Type "help FileShare" for recommended usage.
  2. Numerous small bug fixes, mostly in timing and handling of cmd-period.
  3. Lots of small edits to the documentation.

Version 1, 13 March 1997

  1. Added colorimetric and calibration folders.
  2. Included support for PhotoResearch PR-650.
  3. Limited support for full color imaging.
  4. Better timing. Can also use a raw call to get keyboard state and timestamp when a key was pressed down. See TIMER. This also allows one to check for a keypress in a tight Matlab loop without giving the OS control.
  5. Much more comprehensive support for text, dialogs, and i/o.
  6. Comprehensive support for offscreen windows and fast blitting between off and on screen windows. Support for multiple screens on the same Mac is also much improved.
  7. Internal rewrite of all MEX files to comply with Matlab version 5 API. This was a major re-write, although it didn't change the code much from the user's point of view. The current version 2 MEX and M files work with both Matlab 4 and Matlab 5.
  8. Folded in colorimetric and calibration code. The calibration interface is still under development, but is better than it was.
  9. Added Files folder, split out folder structure of toolbox some more.
  10. Changed Screen's default behavior on opening screens as far as bit-depth goes. The rules are a little complicated. There will be no effect if your monitor is set in 8-bit (256 color) mode. It still sets the monitor to this mode if more than 256 colors are set on the control panel, but leaves it alone if fewer are set. The hope is that this will allow the code to run smoothly on machines with less than 8-bit hardware. This behavior is not yet fixed and may change again.
  11. Some improvements to GetSecs for machines with UpTime call available. Code provided by Pelli.
  12. Folded in Pelli's SndPlay MEX file. Re-wrote SoundPlay as an M-file to call through SndPlay. SndPlay is generally to be preferred, as it allows asynchronous sound. The M-file version of SoundPlay does not accept a third ('dontscale') argument. The data are never scaled.
  13. Added control over copyMode to various functions. Allow specification of both penWidth and penHeight for Screen's DrawLine function.
  14. Folded in Denis Pelli's Matlab version of Quest. This is to be preferred over the old QUEST.mex.
  15. Renamed BlitImage255 to PutImage and GetImage255 to GetImage. Old calling styles are still there but generate a message telling you to use the new style.
  16. Screen now actually uses the windowInfo information if passed. Thus Screen can handle multiple screens. Screen1 deleted. Old calling style still works if you only open one screen or window.
  17. GetMouse flushes mouse button events when button state is returned.
  18. Debugger accepts string arguments which are passed to the debugger.
  19. Added Signal subfolder to Psychophysics toolboxes. Folded in Pelli fftunshift and bandpass2 routines.
  20. Fixed Screen('OpenScreen',...) to return a 1 by 4 rect instead of a 4 by 1. This is consistent with the rect definition and usage elsewhere in the code. This fix should have no effect on your code unless you were actually checking rect dimensions somwhere.
  21. Added warning messages to Screen('BlitImage',...) and InsertBitImage that the routines are obsolete and should be replaced by calls to Screen('BlitImage255',...) and InsertBitImage255. These messages print out on each call to the routines. This reflects a decision that the user should explicitly do any quantization that is going to be done.
  22. Modified Screen('BlitImage255',....) to use CopyWindows and to call through CopyBits rather than through CopyBitsQuickly. Also modified Screen('BlitBitImage',...) to call through CopyBits rather than CopyBitsQuickly. These changes cause the routines to respect the clipping region and to inherit CopyBits behavior with respect to expanding into rects. Added an extra arg to BlitImage that allows control of copy mode used by CopyWindows.
  23. Moved Shuffle from BasicPsycho to Probability. Folded in Pelli modifications that preserve the size of passed array and generalize to work on matrices. This might break existing code if it counted in some way on the change of array size that the old routine produced. But it is a little difficult to imagine this happening in practice.
  24. Folded in Pelli's fixes to DLOG to make it handle floats and a user cancel. Updated DLOG help to indicate its status as a kluge.
  25. Folded Pelli's Stuff, UnStuff, and WhoStuff into MiscPsycho. These routines help manage primitive data structures in Matlab.
  26. Made separate Rects subfolder in toolbox. Folded in Pelli's ArrangeRects, ExpandRect, and other Rect routines. Also folded his Expand.m into the MiscPsycho folder.
  27. Folded in Pelli's ChiSquarePDF routine.
  28. GetClicks added as a MEX-file, MouseClick converted to an M-file that calls through GetClicks.
  29. GetMouse usage updated to allow [x,y] = GetMouse. This breaks any code that used the undocumented fact that GetMouse used to provide the state of the button as a second return value. This information is still available as a third return value as in [x,y,button] = GetMouse.
  30. Usage of OffsetRect(rect,v,h) changed to OffsetRect(rect,x,y). This breaks code that uses OffsetRect but makes the horizontal/vertical argument order consistent throughout the toolbox. The order of variables inside a rect is still vertical/horizontal, but you can isolate yourself from this by indexing with RectTop, etc.

Version 1, May 1996

  1. Got rid of separate SCRFunctionName help files. Typing "help Screen" gets an abbreviated help, typing "help Screen1" gets a longer list. I am still trying to figure out the best way to arrange the help information. Suggestions welcome.
  2. Added Pelli's RectTop etc. routines as well as his GetClicks.m.
  3. Source archive contains template (Addon) for creating stand-alone MEX files that work together with Screen.
  4. Contents.m file added, written by Denis Pelli and David Brainard.
  5. Added GetSecs MEX file which returns number of seconds since system boot to 20 us precision. Code provided by Denis Pelli.
  6. Documentation provided on web page and no longer in the README file.
  7. Split distribution into more managable chunks. The attempt is to make it less daunting to get something simple going. As part of this I restructured the toolbox organization and pulled out the Calibration_Toolbox and Color_Toolbox as separate distributions. Merged 68K and PPC versions into single FAT toolbox.
  8. Fix GetImage255 for non-square regions.
  9. Change handling of which window to open when requested device isn't there. The routine now tries to find a device to open, whereas previously it just exited with an error message.
  10. Screen('OpenScreen',...) returns a windowInfo pointer and other Screen calls accept this pointer as an optional first argument. This does nothing at the moment but will allow improved handling of multiple screens in the future.
  11. Eliminated SCRTEXT function and folded its functionality into Screen. Denis Pelli added additional text functionality, making it easier to deal with multiple fonts. This change will break existing source programs that use SCRTEXT. The fix is to replace SCRTEXT with Screen. The actual functions, although expanded, are backwards compatible.

Version 1, April 1996

  1. Fat versions of most toolboxes installed on a test machine.
  2. Moved test scripts into their own folder
  3. Updated to CW 8 for most projects (what a pain).

Version 1, February 1996

  1. Filesharing control routine (FS) can now turn filesharing on as well as off.
  2. Set pixel size to 8 bits if it isn't set that way already. Restore it on exit. This can cause some extra flashing of your screen at the beginning and end your program if the screen is not already in 8 bit mode (256 colors).
  3. Restore CLUT on exit.
  4. Explicitly require System 7 or later.

Version 1, December 1995

  1. FS routine turns file sharing off.
  2. Added 'GetImage255' function to Screen.
  3. Can control clipping region with Screen.
  4. A few more interfaces to QD routines from Screen.
  5. Added GetNumber routine for keyboard input when Screen is running. Modified Screen help facility. Typing "help Screen' gets a list of Screen functions. Typing "help SCRFunctionName" gets more information about particular functions.

Version 1, July 1995

  1. Added SoundPlay MEX file to replace playsound distributed with 4.2c
  2. Fixed AD to work on PPC too.

Version 1, June 1995

  1. Changed the names of the toolboxes. You should get rid of your old ones before installing these, otherwise you may not execute the correct version.
  2. Added routines for showing frame buffer movies. The first implementation was written by Geoff Boynton of Stanford University. The current version is essentially his with a little cleaning.
  3. Ported routines to the PPC architecture. Again, thanks to Geoff Boynton who helped substantially with this.
  4. More example programs and better write-ups of the old ones.
  5. Created AD MEX-file to turn AfterDark screen saver on and off at will.
  6. Everything into a single archive rather than separating toolboxes and source.



Credits

The original routines for image display and raw image saving were written by Andy Beall and David Brainard in the fall of 1991 with support from a University of California instructional development grant. Andy Beall also drafted the early PICT and clipboard routines. David Brainard re-wrote the early routines and developed the interface to the VideoToolbox. It is this interface that provides support for psychophysics.
 
In June 1996 Denis Pelli began to work on further developments of the toolbox. The present version (version 2 and later) is co-authored by David Brainard and Denis Pelli. Screen was enhanced to support windows, offscreen windows, and multiple screens, building on (and enhancing) facilities offered by VideoToolbox. The offscreen windows allow very fast copying, making it easy to show movies. Snd was added, to play sounds asynchronously (mostly VideoToolbox code).

Contributed MEX files

Showtime.mex creates and shows QuickTime movies. This is the Matlab version of the ShowTime package created by Beau Watson, Cesar Ramirez, James Hu, and Denis Pelli.

Malcom Slaney of Apple Computer wrote SoundPlay.mex and made it publicly available. We included it for a while as a replacement for the Matlab playsound routine. Version 2.3 of the Psychophysics Toolbox uses Snd.mex, written by Denis Pelli. Some of the Snd code is based on Slaney's SoundPlay.

FileType.mex was written by Erik A. Johnson, with some suggestions from us. It's publically available on the Mathworks ftp site, with the C source.
 
Allen Ingling significantly enhanced KbCheck.mex to return the keycode, allowing fast monitoring of keypresses.

Version 2, 1996 - present, David Brainard and Denis Pelli

Scott French and Stephanie Van Hooser of Mathworks provided invaluable help in overcoming unexpected limitations of Matlab, always helping us get fixs or find work arounds. Thanks to their help, we never got stuck.
 
Apple Engineer extraordinaire Nano Urbino has more than once made the impossible, possible. For details, see "Customized 7300/7500/7600/8500/8600 Graphics Driver" on the VideoToolbox download page.
 
Apple Engineer b3b Johnson, in Developer Technical Support, introduced us to the magic of deferred tasks and the powerful spell that we call "priority 0.5", which runs important tasks with minimal interruption (used by Rush, whose implementation is mostly in the VideoToolbox).
 
Michael Marcotty, at Metrowerks, overnight, night after night, fixed all the bugs we found in the CodeWarrior C serial library. 12/98

Version 1, 1991 - 1996, David Brainard

David would like to acknowledge help from Lenny Kontsevich and Richard Miller of Smith-Kettlewell Eye Research Institute. They let us to examine the source for their GrayPlot MEX files so that we could try to straighten out some issues related to returning control to Matlab while leaving a window on the screen. Getting this working was critical for some of the psychophysics routines. In 1992, the GrayPlot MEX files provide routines to display matrices as images and are more polished than David's ShowImage and were available for a small fee. We don't know the current status. For more info contact: Lenny Kontsevich, Smith-Kettlewell Eye Research Institute, 2232 Webster Street, San Francisco, CA 94115.

David also received help from Kirk Swenson at UC Berkeley, whose MEX files for psychophysics solved some problems with blanking synchronization (VBL) that had David stumped. Kirk sent David his source, some of which was incorporated into early versions of the psychophysics toolbox. In version 2 we adopted the VideoToolbox blanking routines instead.

Jerry Tietz helped with various stages of the code development in version 1. In particular, he figured out how to handle hardware interrupts from inside a 68K code resource and made some of the additions to Screen.

The BlitBitImage framebuffer movie code was originally written by Geoff Boynton. He also helped with the port to the PPC platform.

John Philbeck helped write many of the instructional handouts and some of the example programs.

Jim Boyles, John Higgens, and Scott French of The Mathworks provided technical support for Matlab which helped David to build the interface.

Support for development of version 1 came in part from an NSF ILI grant awarded to David Brainard.



23757 visitors between 20 March 2000 and October 4, 2006.

David Brainard, Denis Pelli & Allen Ingling.
psychtoolbox@yahoogroups.com
Updated