mmmlab / cogsp-lab-code

Code for Cognition (830:306) and Sensation & Perception (830:302) Lab Exercises at Rutgers
1 stars 0 forks source link

Issues involved in running Tone Discrimination #1

Open jiesparklin opened 3 years ago

jiesparklin commented 3 years ago

I have no problem running the code, but here are some small issues I observed in the output Excel data file:

  1. The generated comparison values are not integers. I fixed this by modifying line 31 and line 32 as the following: maxComparison = expInfo['Standard Frequency (Hz)']+expInfo['Comparison Interval'](numFrequencies//2) minComparison = expInfo['Standard Frequency (Hz)']-expInfo['Comparison Interval'](numFrequencies//2)

  2. The trial numbers in the data file are not accumulating from 1. For example, when running a block of 70 trials, the trials numbers in the data file are displayed as (2 - 71) instead of (1 -70). I fixed this by modifying line 243 as the following: ws.cell(irow, 1).value = currentTrial

Some of the students in my class are having trouble starting the experiment after inputing the parameters. The error reported is the following:

"Exception: failed to open PortAudio audio device due to unsupported combination of audio parameters."

I think this may be related to the incompatibility between the audioLibrary preference in PsychoPy and the external audio device the student is using (see this: https://discourse.psychopy.org/t/failed-to-open-portaudio-audio-device/15242), but I don't know an exact solution for this error.

Jie

melchimm commented 3 years ago

Jie,

I'm not sure that #1 is really a problem, but I've nonetheless added and pushed both of your suggested changes to the repo.

Regarding the PortAudio problem: This might be fixed by commenting the psychopy.prefs line (i.e., line 3). I've edited the preference list in the code to remove the pyo audio library, which seems to be problematic in certain cases, but it's hard to do any more without knowing more specifics.

Do you know what OS those students experiencing issues are using? Are they attempting to run the experiment remotely?

jiesparklin commented 3 years ago

Jie,

I'm not sure that #1 is really a problem, but I've nonetheless added and pushed both of your suggested changes to the repo.

Regarding the PortAudio problem: This might be fixed by commenting the psychopy.prefs line (i.e., line 3). I've edited the preference list in the code to remove the pyo audio library, which seems to be problematic in certain cases, but it's hard to do any more without knowing more specifics.

Do you know what OS those students experiencing issues are using? Are they attempting to run the experiment remotely?

Melchi,

Thank you for the update! The #1 would cause problem when students are attempting to do data analysis because some comparison values are rounded (incorrectly) and others are not. for example, if the standard is 1000 Hz and the comparison interval is set to 2 Hz, then the program should generate 7 comparison values as [994, 996, 998, 1000, 1002, 1004, 1006]. However, the output min/max comparison values are 993 and 1007 instead with no decimal points after, other values come with decimal points and consequently would affect sorting the data and plotting the psychometric function in Excel.

PortAudio problem: They are using Windows 10 and encountered the problem when running the experiment during the Zoom meeting. I asked them to run the code again off the meeting but haven't heard back from anyone yet. Others have no problem running the experiment during the meeting (including Window users).