INSTRUCTIONS FOR STIM_UPLOAD.PHP 1) (on iTunes computer) IMPORTANT: First make sure that your iTunes preferences are set to not automatically organize your iTunes music! You can do this by going to iTunes Preferences->Advanced. Uncheck "Keep iTunes Music folder organized" and also uncheck "copy files to iTunes Music folder when adding to the library". 2) (on iTunes computer) Export your downloaded playlists in itunes by going to File->Export Song List. Save them as XML files. 3) (on iTunes computer) Create a "tarball" of all of your mp3 files. Currently, the store_sampler applescript is saving all of the downloaded mp3s to a folder called "Audio Hijack" in your Music folder (instead of the iTunes folder). Go to "/Users/yourusername/Music/" in xterm and type "tar -cf somename.tar.gz Audio\ Hijack --gzip" where "yourusername" is your user name and "somename" is a file name you designate. Note the backslash in "Audio Hijack" to escape the space in the directory name. 4) (on iTunes computer) Copy the xml files and the tarball to a directory on atonal. It's probably best to just use your home directory. The files will be deleted after you have finished the upload. The copy can be done from groove by using the scp command: a) scp somename.tar.gz yourusername@atonal: b) scp myplaylist.xml yourusername@atonal: If you do not specify a directory name after the colon, the files will be copied directly to your home directory. If you wish, you may also specify a directory name (either relative to your home directory (without a beginning slash, e.g. :data) or an absolute directory name (starting with a slash, e.g. :/data1). Repeat 3b for each playlist you want to copy, or if you want to copy all xml files in a directory, use *.xml for the filename. You will be asked for your password on atonal each time you issue this command. 5) (on the Ensemble server) Extract your tarball by going to the directory where you copied it (e.g. your home directory): tar -xf somename.tar.gz --gzip You should hopefully now have a directory called "Audio Hijack" in /tmp with all of your artist folders, album folders, and mp3 files in it. If not, something went wrong. 6) (on the Ensemble server) Open the script stim_upload_itunes.php in /var/www/html/ensemble/stimuli/stim_upload. There are three variables you will need to change at the top of the script: $xml_files is an array of your xml files. Make sure to include a path in the filename. Paths are relative to where you are when you run the script or you can give an absolute path. $sfpath is the directory where your mp3 files are located (i.e. /tmp/Audio Hijack). Make sure that this is the directory where all of the artist folders are located. $database_experiment_admin refers to the database you wish to upload to (e.g. 'ensemble_main' or 'ensemble_tarp') 7) (on the Ensemble server) run the script. Go to /var/www/html/ensemble/stimuli/stim_upload and type: php -f stim_upload_itunes.php 8) (on the Ensemble server) An error log will be generated called stim_upload_errors.log. It's a really good idea to take a look at this so that you can be fairly certain nothing went wrong. The log contains all of the files that were not successfully uploaded. During the upload process, the upload script checks if each song is already in Ensemble. If any songs that you tried to upload were already in Ensemble, the upload script will not have uploaded them, in order to avoid duplicate stimuli. These stims will be reported here so that you can find the stimulus IDs associated with them. 9) Inspect your new records in phpMyAdmin to see if your new records are there.Also, try and play them through the Ensemble stim player (https://atonal.ucdavis.edu/ensemble/stimuli/audio/play_audio_stim.php) If it looks like everything went OK, delete your tarball, xml files and Audio Hijack directory from /tmp.