Welcome! Log In Create A New Profile

Advanced

Sound cards in MonkeyLogic

Posted by monkeybusiness 
Sound cards in MonkeyLogic
October 09, 2020 09:58AM
Hello!
I would like to send different sounds to different speakers. Is it possible to play different sounds from different speakers through monkeylogic with one sound card that is embedded in the desktop? If not, how many sound cards will I need: one for every speaker?
Thank you!
Re: Sound cards in MonkeyLogic
October 09, 2020 11:48PM
You can play different sounds from different speakers. You need only one sound card.

The number of speakers you can add is dependent on the sound card. If your card supports 5.1 channels, then you can add up to 6 speakers and, if it is a 7.1 channel one, up to 8.

To send different sounds, just fill each channel with different sounds. For example, the following code will play a noise only from the left speaker.

fs = 48000;
y = rand(fs,2);
y(:,2) = 0;   % y(:,1) = 0, to play from the right speaker
sound(y,fs);  % This is for demonstration. Do not use this function in your script.
Re: Sound cards in MonkeyLogic
October 15, 2020 10:29AM
Thank you for your reply! This is extremely helpful!!
Re: Sound cards in MonkeyLogic
June 04, 2022 02:34AM
Hi,
Is it possible to do this for sounds that are defined as task objects as well?
What I mean is that in the task object - snd(https://monkeylogic.nimh.nih.gov/docs_TaskObjects.html), is there a way to specify the speaker also? It seems like this is not possible. Then what are the alternatives?
Thank you
Re: Sound cards in MonkeyLogic
June 04, 2022 12:17PM
You do not specify a single speaker. Look at the above example carefully. You use all speakers at the same time and play silence in all the channels but one.

Mapping sound channels to speakers has nothing to do with NIMH ML. It is what you should do in the control panel or with the sound card manufacturer's software.

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.