Gated trigger from MWorks to STG

Hello MWorks,

I am designing a transcranial direct current stimulation (tDCS) experiment in MWorks using xBI. I need to send a gated trigger from MWorks to a device called STG (STG4004-1.6mA | www.multichannelsystems.com). What would be the best possible way to send information like current intensity & pulse duration? Would you recommend me to use ‘Pulse variable’? If so, which variable should I use so that I can send a rectangular pulse to STG? Any advice is greatly appreciated. Looking forward to your response!

Regards,
Vighnesh.

Hi Vighnesh,

MWorks’ Pulse Variable action does nothing other than set a specified variable to 1 for a duration then reset it to 0. Whether it would be appropriate for controlling your stimulation hardware depends entirely on the interface (hardware and software) used to connect MWorks to the device.

If you’re using an XBI system, then I presume you’ll be making use of its general-purpose I/O capabilities. If so, I recommend seeking the advice of someone familiar with the MWorks XBI interface. (The XBI interface is not a standard part of MWorks, and I have no knowledge of or experience with it.)

Regards,
Chris Stawarz

Hi Chris,

Thank you very much for your prompt response. I will contact our xBI expert Ralf Brockhausen.

I have another question, I train my animals on auditory tasks using xBI. To present auditory stimuli in xBI, I generate them on Matlab & save them as .wav files. During the experiment, MWorks loads .wav files & plays them during a trial. As a result, there is a latency of 16 milliseconds. I was wondering if you know a way to work around this issue. If not, do you plan to make any new plugins in the future that would let me define the sound frequency in a given trial & then MWorks presents the pre-defined tone without any time lag? Looking forward to your response!

Regards,
Vighnesh.

Hi Vighnesh,

I don’t know the source of the 16ms latency you’re experiencing.

MWorks’ current audio playback capabilities are very limited. At some point, I would love to rework things so that audio stimuli are comparable to visual stimuli, in terms of both flexibility of stimulus definition and accuracy in presentation timing. However, I don’t think I’ll be able to take on such a project in the immediate future (i.e. the next 3-4 months).

If you’re interested in attempting to develop a new audio plugin yourself, it looks like AVAudioEngine is Apple’s currently-recommended interface for low-latency audio playback.

Cheers,
Chris

Hi Chris,

Thanks again for your response. I load my Matlab-generated wav files on MWorks in the ‘Sounds’ directory & then use the built-in function ‘Play sound’ to play a sound in a given trial. Please let me know if this is the right way to do it. To look for latency issues, I used a click train & found that if the first click starts after 16 or 20 ms from the click train onset (please see the figure) then I can hear all the 3 clicks when played on MWorks.

It would be great if MWorks can present audio stimuli to the level of visual stimuli. I will look into AVAudioEngine.

Regards,
Vighnesh.

Attachment: Screenshot_2021-01-04_at_1.07.01_PM.png (26.3 KB)

Hi Vighnesh,

I recently completed major revisions to MWorks’ audio support. If this is still of interest to you, please see this discussion for more information.

Cheers,
Chris

Hi Chris,

Thanks for the invitation. I will take a look & get back if I have any queries.

Cheers,
Vighnesh