psychopy.org | Reference | Downloads | Github

Sound when tapping on a specific key

OS (e.g. Win10): Mac OS 10.12.6
PsychoPy version (e.g. 1.84.x): 1.85.4
Standard Standalone? y If not then what?:
What are you trying to achieve?: I have a tapping experiment for two people tapping together. Subject one is tapping on the “left” key which should create a short tone in the left audio channel and the subject two is tapping on the “right” key which should create a tone in the right audio channel.

What did you try to make it work?: I tried to make a input/feedback loop for each tap.

What specifically went wrong when you tried that?: It will not work properly since they will tap almost simultaneously, the task is to tap a rhythm together.

Please show us exactly what you did. Also describe the wider situation, i.e. the experimental procedure/design. e.g. how long does this task last? Are there multiple trials? etc.

Thank you for your reply Michel. My design is to have two people separated in two adjacent rooms, communicating through tapping on a keyboard or mouse. They have one monitor, loudspeaker and keyboard/mouse each.
There are written instructions for person 1 to tap a rhythm, person 2 hears the sound of the tapping and taps along.

I can only create a sound from a tap/keystroke that ends the routine, see the image attached. I need to hear and register all taps taking place (from two separate keyboards) during a 1 min long TapRhythm routine.


Thanks, Lykke

Hi,
I don’t think the keyboard component in Builder will give you the flexibility to do this properly, so the keyboard checking would better be done in code rather than using a keyboard component.

But before proceeding, you should probably state your precision requirements. Code in Builder code components runs only once every screen refresh, i.e. on a 60 Hz screen there will be an interval of 16.66 between successive keyboard checks. This might (or might not) be too crude for the sorts of effects you are looking for. Checking can be done more quickly, but that requires working in Coder rather than Builder.

It’s difficult for us to advise on the technical route to take to implement your task, without knowing what would be “good enough” to detect the sorts of effect sizes that might be required. You’ll have a much better idea of that, from your reading of the related literature, discussions with colleagues and mentors, and so on.

Come back to us then. If 60 Hz checking is sufficient, then the route ahead is straightforward. If a faster rate is required, this might simply be achieved by using a faster display (e.g. some LCDs these days apparently even go to 240 Hz), with a powerful enough computer and graphics card to keep up with it. Otherwise, a software solution would mean writing the experiment in Coder, to decouple the the checking from the screen refresh rate, if the visual stimuli permit.

Best wishes