-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial PR for the pure-tone presentation task #17
base: master
Are you sure you want to change the base?
Conversation
Thanks for getting this started! so one first element of feedback. wav files should not live in a git repo. It depends a bit on the size but just the sheer number of them, it would make more sense to create a datalad dataset, and expose that dataset as a submodule in |
…ad dataset in its location
Just removed the wav files' folder and replaced it with a datalad dataset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After our discussion I tried using the value/volume values of the Sound class in psychopy
https://www.psychopy.org/api/sound/playback.html#sounddevice-sound
and it seems to work well (we use SoundDevice for the other tasks, but that can be changed if needed). I think it would be cleaner/faster than using files to be loaded and then shared, unless you need some fade-in/fade-out.
See other comments about how to fit your task in the rest of the software.
Also, the task should output a bids-like events files with the conditions/onset/duration/.
Let me know if you need more information to make the changes.
src/tasks/pure_tones.py
Outdated
return filename | ||
|
||
|
||
def stimulus_presentation(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The task should be implemented as a subclass of the base Task class, and implement a _run() function where task design appears.
src/tasks/pure_tones.py
Outdated
playsound(to_play) | ||
i = i + 1 | ||
print(f"Waiting for {ISI} second(s)") | ||
time.sleep(ISI) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using time.sleep
give chances for slippage due to concurrency for CPU access. A non-slip design is preferrable. See how ThingsMemory task is implemented for an idea on how to proceed.
src/tasks/pure_tones.py
Outdated
time.sleep(ISI) | ||
|
||
|
||
stimulus_presentation() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should only describe the task and is not meant to be ran as a standalone script.
…f stimuli presentation
…rameter difinitions in tasks (ses-pure_tones.py)
… to extract the subject number in the ID (ses-pure_tones.py)
Replacing playsound with psychopy seems to have created a distortion problem when reading the wav files but I can't find its origin. |
I pushed some changes to an audiometry branch on that repo (see commit 6b032a6 ). the 250Hz does not play well either, will look into it, maybe a limitation of sound card/hardware.... |
Still in development, this is a first iteration. This PR also contains the stimuli's .wav files