Hi Mark,
I am using ‘043’ for now
Note that my answers apply to 0.4.4 or later. I don’t know if or how things differ in “0.4.3”.
The drifting grating takes XML params/properties e.g ‘size’ and ‘width’. If you specify a string with the name of another variable, changing the other variable’s value changes the stim size or width. It also takes parameters ‘std_dev’ and ‘mean’ when mask is ‘gaussian’. If you specify the name of a variable, changing the value does not change the stimulus. Specifying numeric values in the XML does change it. Can you explain how this works?
It’s a question of how the GaussianMask class is implemented. The constructor dereferences the std_dev and mean variables and stores their then-current values as C floats. After that, the class never checks the variables’ values again, so it never sees changes you make.
It seems like the code should be changed so that std_dev and mean can be modified on the fly. I’ll open an issue and look into it.
Some example experiments have an xml drifting grating property ‘contrast’. I couldn’t find this in the C++. Correct that it is not a real param?
Correct. I don’t know why it’s in the examples. but I’ll remove it.
Both images and the grating have an alpha_multiplier property. Can this be bound to a variable? This did not seem to work. This would solve my problems.
I don’t know why it doesn’t work with the drifting grating, but I just verified that it works with images. Can you send me an example where it doesn’t?
I am using ‘043’ for now, we are testing 044. But the drifting grating plugin looks unchanged.
There were some changes. In particular, the performance of the plugin was drastically improved.
However, the “modern” dynamic stimulus infrastructure is not in 0.4.4. For that, you’ll need to look on git or in the nightly build. That should be your reference when developing new dynamic stimulus plugins, not 0.4.4.
It looks like variables can be type float in the XML. Is this treated any different from integer? Can the client variables window set floats? Or should I just make everything an int?
I’m not sure if/how floats are handled differently than integers internally. My recommendation is that you use the most appropriate data type: If a variable assumes only integer values, declare it an integer. Otherwise, make it a float.
Yes, the client variables window can set floats.
Finally, do you see any other way to dynamically vary stimulus contrast from trial to trial?
I think the right approach is to set alpha_multiplier
to a variable name and vary the variable’s value. Note that such changes don’t affect the stimulus while it’s queued. In order to see the results of the change, you need either to change the variable before you queue the stimulus, or change the variable then dequeue and re-queue the stimulus.
Chris