AudExpCreator: A GUI-based Matlab tool for designing and creating auditory experiments with the Psychophysics Toolbox

We present AudExpCreator, a GUI-based Matlab tool for designing and creating auditory experiments. AudExpCreator allows users to generate auditory experiments that run on Matlab's Psychophysics Toolbox without having to write any code; rather, users simply follow instructions in GUIs to specify desired design parameters. The software comprises five auditory study types, including behavioral studies and integration with EEG and physiological response collection systems. Advanced features permit more complicated experimental designs as well as maintenance and update of previously created experiments. AudExpCreator alleviates programming barriers while providing a free, open-source alternative to commercial experimental design software.

resources for building such experimental programs, and several software contributions have been developed around this toolbox [2,3,4]. Even so, to program experiments that integrate automated stimulus presentation and response acquisition can quickly become overly complex in a script-based Matlab environment. Alternative commercial options for neuroscience, cognitive, and behavioral research include Neurobehavioral Systems Presentation 2 and Psychology Software Tools, Inc. ePrime. 3 While these systems offer greater ease of use through experimenter interfaces, they can be costly and still require basic programming knowledge.
Matlab, though itself a commercial software product, is often already in use for data analysis. Therefore, extending its utility to the experimental study itself at no added cost may be appealing for many. Integrating experimental design, data collection, and data analysis completely within Matlab may also mitigate issues and potential data loss related to exporting and importing data of different formats across disparate software packages. Even so, all of the above options require at least basic knowledge of programming. This fact can be daunting for many, and may act as a technical barrier for prospective researchers wanting to enter the field.
With these factors in mind, we were motivated to create AudExpCreator, a tool that enables researchers to design and create a variety of auditory experiments that run on Matlab's Psychophysics Toolbox, without needing to code a single line. Instead, the user specifies the experimental and response collection parameters by means of a Graphical User Interface (GUI), and the software automatically translates these specifications into the necessary Psychophysics Toolbox scripts to run the auditory experiment.
The AudExpCreator tool software package is available for download from the Stanford Digital Repository [5], 4 and is published under a CC0 license. 5 The software package contains the following items: This software package started out as a collection of programming templates using the Psychophysics Toolbox to design the music cognition studies of the Music Engagement Research Initiative at Stanford University. 6 To date, the underlying functionalities of the Continuous Behavioral Rating Study, EEG Study, and Neurophysiological Study types have been used in completed research [6,7,8]. As other research groups have expressed interest in using the full collection of templates, the initial goal of releasing this software was simply to aggregate the templates into a toolbox to be published and shared freely with the research community. However, after further consideration of the very real issue of programming as a technical barrier-which was evident even within our own research group-we decided not only to aggregate the templates, but also to develop the AudExpCreator GUI to facilitate creation and design of auditory experiments without the need to code at all. Thus, the now completed AudExpCreator tool makes the functionalities of the Psychophysics Toolbox accessible to researchers from a variety of disciplines, whether or not they have programming experience. Because our research group specializes in music cognition studies, AudExpCreator focuses on auditory stimulus presentation.
We hope that in addition to facilitating audio research, this tool will also ease users into the world of programming and encourage them to learn more about it. AudExpCreator is accompanied by an extensive User Guide, which explains the underlying functionalities of the toolbox. Therefore, should users ever want to begin working directly with the code themselves, the code can be modified in various ways (e.g., to create automated experiments with visual stimuli as well).

Software Structure
The structure of AudExpCreator ( Fig. 1) centers around a set of core GUIs: experimenterInterface, getBasicParameters, getStructuralParameters, and-depending on the type of study users had determined to make-the study-specific GUI. In each of these core GUIs, users are able to gradually design and specify the "look and feel" of the auditory experiment, from screen resolution, to background and font color, to the specified stimulus array which defines the presentation ordering of auditory stimuli. Throughout the process of specifying these parameters, AudExpCreator also includes many built-in checks that help ensure that the input parameters and specifications are feasible and will work. Therefore, the only necessary external requirement that the AudExpCreator tool asks of users in the creation of their auditory experiment is the collection of auditory stimuli in .wav format. The process of uploading and organizing these auditory stimuli is facilitated by feature GUIs within the AudExpCreator; however, experimental manipulations of the stimuli themselves are beyond the scope of AudExpCreator and are expected to be completed by users prior to upload. Once users have filled out the specifications from the core GUI, finishing with the study-specific GUI, AudExpCreator will generate the auditory experiment. It will create essential experimental scripts, a "README-FIRST" file customized for the present experiment, and an additional "check + sup" add-on tool that will help users maintain the working integrity of their experiment and assist with small updates to the experiment.
Additionally, to simplify the navigation of AudExpCreator, the function navi was created to help navigate and guide users throughout the process of creating and designing their auditory experiment. Typing "navi" into the Matlab console will help them initiate new experimental designs. In addition, should users leave an experimental design unfinished, they can simply return at a later date and type "navi" to pick up where they last left off.
To be clear, AudExpCreator does not itself depend on the Psychophysics Toolbox to function. It is completely independent and will function with Matlab version 7.14 (R2012a) or higher. However, the auditory experiments that AudExpCreator generates for users do require the Psychophysics Toolbox in order to run.

Software Functionalities
AudExpCreator contains a variety of features and functionalities. Its primary purpose, however, is to help users generate a fully automated auditory experiment that presents stimuli (with event timing if necessary) plus any questions for subjects to answer; and to collect the subject responses and output those data in .mat format for analysis. The five different types of experimental study types offered by the software package are as follows.
The Behavioral Rating Study is the simplest of the five available studies. Its function is to simply present subjects with auditory stimuli and subsequent behavioral rating questions. The main functions of this experiment type are to automate the following: 1. Presentation of an auditory stimulus or set of stimuli; 2. Presentation of user-specified questions to be answered with behavioral ratings; 3. An interface enabling the subject to answer those questions; 4. Collection and compilation of responses and response times; 5. Looping through steps 1-4 as needed for each stimulus or stimulus set; 6. Termination of the experimental session and data output in .mat format.
The Comparison Behavioral Rating Study focuses on presenting subjects with pairs of auditory stimuli, then allowing the subject to compare between the stimuli in the pair. The main functions of this experiment type are to automate the following: 1. Successive presentation of two auditory stimuli with proper labelling display; 2. Presentation of one or more user-specified comparison questions; 3. An interface enabling the subject to answer those questions; 4. Collection and compilation of responses and response times; 5. Looping through steps 1-4 as needed for all auditory stimulus pairs; 6. Termination of the experimental session and data output in .mat format.
While the first two study types enable retrospective responses, which are delivered after stimuli have finished playing, the Continuous Behavioral Rating Study acquires continuous responses from subjects while an auditory stimulus plays. The main functions of this type of auditory study experiment are to automate the following: 1. Presentation of instructions regarding the user-specified continuous behavioral task; 2. Presentation of one or more auditory stimuli with simultaneous subject interfacing (onscreen analog slider with mouse control) for continuous response acquisition; 3. Acquisition of the continuous response at a sampling rate of approximately 20 Hz; 4. Optional presentation of one or more behavioral rating questions following presentation of auditory stimuli; 5. Compilation of continuous responses and optional behavioral rating responses and response times; 6. Looping through steps 1-5 as needed for each stimulus or stimulus set; 7. Termination of experimental session data output in .mat format.
As part of our own focus on music cognition research, we also work with acquisition of EEG and physiological responses during stimulus presentation. Therefore, the last two studies enable integration of auditory experiments with an external neurophysiogical response acquisition system, specifically the Electrical Geodesics, Inc. (EGI) system.
The EEG Study includes all of the integral components of the Behavioral Rating Study while additionally communicating with the EEG acquisition system through two different methods, TTL or TCP/IP, to deliver the triggers (event labels) of auditory stimuli at their onsets. This is so that the EEG data frame is properly annotated with time stamps and triggers. The main functions of this type of experiment are to automate the following: 1. Initiating the communication device or opening the communication channel with the EEG acquisition system; 2. Presentation of auditory stimuli or stimulus sets with simultaneous trigger delivery to the EEG acquisition system; 3. Optional presentation of user-specified behavioral rating questions; 4. Subject interfacing to answer those questions, with responses also sent as triggers to the EEG acquisition system; 5. Optional collection and compilation of responses and response times; 6. Looping through steps 1-5 as needed for each stimulus or stimulus set; 7. Termination of the experimental session and optional output of response data in .mat format.
Finally, the Neurophysiological Study mirrors that of the EEG Study with an additional functionality to accommodate baseline recordings recommended when recording neurophysiological responses such as EKG, EMG, respiratory inductive plethysmography, etc. from EGI's Polygraph Input Box (PIB). It allows and mediates the presentation of a baseline auditory stimulus before experimental stimuli, so that readings of neurophysiological responses can be acquired while the subject is at rest. Like the EEG Study, all triggers pertaining to stimulus onsets or behavioral ratings are delivered via TTL or TCP/PI, and additional .mat response data can also be output if desired. Therefore, its main functions are to automate the following: 1. Initiating the communication device or opening the communication channel with the EEG and PIB acquisition system; 2. Presentation of a baseline auditory stimulus before each experimental stimulus or stimulus set with simultaneous onset trigger delivery to the EEG acquisition system; 3. Optional presentation of user-specified behavioral rating questions; 4. Subject interfacing to answer those questions with response triggers also sent to the EEG acquisition system; 5. Optional collection and compilation of responses and response times; 6. Looping through steps 1-5 as needed for each stimulus or stimulus set; 7. Termination of the experimental session and optional output of response data in .mat format.
Within these five study types, AudExpCreator offers several customization options including stimulus organization, labeling, and grouping; stimulus array construction with shuffling, randomization, probability selection, etc.; basic update and maintenance in the form of an add-on GUI; and finally, advanced updates for extreme overhaul of already built experiments. Detailed information on the five studies and their functionalities, as well as these additional features, can be found in the accompanying User Guide.

Creating a Behavioral Rating Study
We will now walk through the process of creating a Behavioral Rating Study experiment, which we will call demoBRS. Note that the AudExpCreator source download page includes a file called stim.zip. This file contains the 12 auditory stimuli (.wav format) used in the creation of this demo. These stimuli were obtained from an open data repository [9]. The example experiment that is described below is also available on the AudExpCreator source download page, in the file demoBRS.zip. Note that in order to run the completed demo, the Psychophysics Toolbox must be properly installed and the check GUI must be run to update the necessary paths. See the User Guide on the download page (AudExpCreator User Manual.pdf) for more information on the check GUI.
First, to begin the process of creating the demoBRS auditory experiment, users should open Matlab and change the directory to the AudExpCreator folder. Next, in the Matlab Command Window, type "navi" and, following the instructions, type "yes" to allow navi to initiate a new study. The AudExpCreator logo will appear, shortly followed by the first core GUI, the experimenterInterface GUI as shown in Fig. 2.
From here, begin by filling in "demoBRS" for Study name; select "Behavioral Rating Study" from the pop-up menu for Study type; fill in the Study description as shown in Fig. 3; and supply detailed parameters as shown in Fig. 3 for the sequence of GUIs that follows. Because the parameters for this demo call for a customized randomization based on stimulus condition, while filling out the features GUI (getStimInfo), users should provide stimulus information as shown in Table 1. In order to create the stimulus array for this customized randomization, users should provide the option selections of feature GUIs as shown in Fig. 4.
Finally, when AudExpCreator finishes creating the experiment, it will generate the remaining necessary essential folders and functions for the experiment, a personalized "README-FIRST" file containing instructions geared toward the parameters of demoBRS, and an additional "check GUI + sup" add-on tool. Fig. 5 shows the content in the demoBRS experimental folder necessary to run the demo. This concludes the walkthrough of experiment creation a simple Behavioral Rating Study. To run the study, users should read the "README-FIRST" file, as it contains instructions on how to run the study with Matlab. Fig. 6 shows the presentation sequence of demoBR during its run.

Impact and Conclusions
AudExpCreator is designed to impact the fields of auditory research, facilitating behavioral and neuroscience research in this community. With AudExpCreator the capability to design and create automated auditory ex- periments is enhanced and greatly simplified. Researchers can quickly generate new auditory experiments in a fraction of the time it takes to program and code experiments themselves. For more advanced programmers, AudExpCreator is a helpful tool expedite experiment creation, leaving more time for heavy-duty data analysis. As AudExpCreator also creates accessible scripts, the expert programmer can use utilize this software simply as a template and subsequently modify the output scripts as needed.
For researchers with no programming background, AudExpCreator acts as a powerful tool to lower the barrier to entry with programming and working with Matlab. As shown in Sec. 3, creating a simple Behavioral Rating Study requires no programming with AudExpCreator. For these researchers, all that is needed to initiate an auditory experiment is to use AudExpCreator following its GUI sequence, and fill out their desired experimental parameters. By simplifying the process, it is hoped that AudExpCreator will encour-age new types of scholars in the fields of music cognition, auditory research, and neuroscience (e.g., music theorists, composers, medical practitioners, etc.) to conduct experimental research by making experiment creation-and programming-more accessible, allowing these fields to expand and grow into new types of research endeavors.
Finally, as AudExpCreator is Matlab based and the auditory experiments it generates themselves use the Psychophysics Toolbox and Matlab, the need for users to acquire additional third-party software for experiment creation is reduced. Consequently, AudExpCreator helps to streamline experimental design, stimulus presentation, data collection, and data analysis completely within Matlab.
As previously mentioned, early forms of the AudExpCreator have already been employed to generate various auditory experiments for research studies. At the moment, AudExpCreator offers many functionalities and features and is fully operational in its current form. We plan to continue improving and updating the software as we receive more feedback and feature requests from users. Ultimately, as an open-source tool, we hope that AudExpCreator will be adopted by other researchers and perhaps developed further with additional experimental templates and response acquisition integrations. Though it was created with the fields of music cognition, auditory research, and neuroscience in mind, the future of this tool may find unanticipated utility with researchers from other fields who end up adopting it for their own purposes.