Skip to content
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

Open
wants to merge 34 commits into
base: master
Choose a base branch
from

Conversation

eddyfortier
Copy link

Still in development, this is a first iteration. This PR also contains the stimuli's .wav files

@pbellec
Copy link

pbellec commented Oct 7, 2021

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 data. You can use OSF to publish the datalad dataset, check this tutorial: http://docs.datalad.org/projects/osf/en/latest/tutorial/exportdatacode.html You will also need to give a list of authors and a license for these data, when you create the datalad dataset.

@eddyfortier
Copy link
Author

Just removed the wav files' folder and replaced it with a datalad dataset.

Copy link
Contributor

@bpinsard bpinsard left a 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.

return filename


def stimulus_presentation():
Copy link
Contributor

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.

playsound(to_play)
i = i + 1
print(f"Waiting for {ISI} second(s)")
time.sleep(ISI)
Copy link
Contributor

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.

time.sleep(ISI)


stimulus_presentation()
Copy link
Contributor

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.

@eddyfortier
Copy link
Author

Replacing playsound with psychopy seems to have created a distortion problem when reading the wav files but I can't find its origin.

@bpinsard
Copy link
Contributor

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....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants