AllenNeuralDynamics / dynamic-foraging-task

Bonsai/Harp workflow for Dynamic Foraging with Python GUI for visualization and control
MIT License
5 stars 4 forks source link

Update sound #509

Closed XX-Yin closed 3 weeks ago

XX-Yin commented 4 weeks ago

Pull Request instructions:

Describe changes:

Updated the bonsai workflow to load the decibel parameter from the settings_box#.csv. Previous: image

Now: image

What issues or discussions does this update address?

Set the decibel from the attenuation parameter, which is more flexible and no need to change the sound waveform.

Describe the expected change in behavior from the perspective of the experimenter

No

Describe any manual update steps for task computers

set AttenuationLeft to 0 in the settings_box#.csv. set AttenuationRight to 0 in the settings_box#.csv.

alexpiet commented 4 weeks ago

Is AttenuationLeft required? Or does the workflow have a default value?

If it doesn't have a default value, can you add it to the mandatory fields? (https://github.com/AllenNeuralDynamics/dynamic-foraging-task/pull/503)

Is the process for setting this parameter clearly documented somewhere? Does a positive number mean more attenuation?

XX-Yin commented 4 weeks ago

Is AttenuationLeft required? Or does the workflow have a default value?

If it doesn't have a default value, can you add it to the mandatory fields? (#503)

Is the process for setting this parameter clearly documented somewhere? Does a positive number mean more attenuation?

It's read by the bonsai. I assume that it's more difficult (we can achieve it but just more difficult) to set a default parameter in bonsai.

Is AttenuationLeft required? Or does the workflow have a default value?

If it doesn't have a default value, can you add it to the mandatory fields? (#503)

Is the process for setting this parameter clearly documented somewhere? Does a positive number mean more attenuation?

Yes, AttenuationLeft is required. It's read by bonsai and the bonsai is more complex to set default value.

I added it to the mandatory fields.

@hagikent was testing this. I assume that the positive number means more attenuation.

hagikent commented 4 weeks ago

@alexpiet What @XX-Yin writes are all correct, thanks @XX-Yin . (although the value seemingly not linearly- or log- correlated with decibel..)

Is the process for setting this parameter clearly documented somewhere?

For the current 447, where already quiet sound is uploaded, it should be always 0. For 446 (and future 447), where round sound is uploaded and attenuated when being played, setting this value would be basically a calibration process, which we are now working on.

alexpiet commented 4 weeks ago

Thanks @hagikent, @XX-Yin for getting this figured out and implemented!

XX-Yin commented 3 weeks ago

@hagikent @alexpiet During testing in 447, I found some rigs are using the right channel of the soundcard instead of the left channel, so I added both AttenuationLeft and AttenuationRight to separately control the left and right channels.

hagikent commented 3 weeks ago

sounds good. ideally, connections should be made identical, though! (yes, I saw connections from soundcard to amplifier were somewhat random too...)

alexpiet commented 3 weeks ago

@XX-Yin @hagikent The next step is to make sure all the rigs are calibrated correctly. Perhaps during that process we can also move all the rigs to use the left sound channel?

hagikent commented 3 weeks ago

@alexpiet sounds like a plan