Millisecond Forums

Staircase using rotation/orientation

https://forums.millisecond.com/Topic30212.aspx

By yjung541 - 11/19/2020

Hi!

I want to run a study to measure orientation sensitivity, and I'm currently trying to trig the staircase demo to make this study.
The demo used color as a feature and update the color information like the below:

<shape target>
/ shape = triangle
/ color = (0, 135, 10)
/ size = (30%*2/4, 30%)
/ position = (70%, 50%)
/ rotation = 0
</shape>
...
<trial staircase_down>
/ontrialbegin = [
    values.staircase = 1;
    if (values.direction_down == 1) {
        values.targetvalue_down -= values.change_down;
    } else {
        values.targetvalue_down += values.change_down;
    };
    shape.target.colorred = values.targetvalue_down;
]

But when I changed it to the rotation like the below;
shape.target.rotation = values.targetvalue_down;

The rotation of the shape doesn't change even though the targetvalue_down value itself is changing every trial.
I tried a similar twig using the width, then it is working fine - width changes accordingly every trial. Any ideas on what is happening here?
I can also post the entire script if it is helpful.

Thank you!
Yaelan
By Dave - 11/19/2020

yjung541 - 11/19/2020
Hi!

I want to run a study to measure orientation sensitivity, and I'm currently trying to trig the staircase demo to make this study.
The demo used color as a feature and update the color information like the below:

<shape target>
/ shape = triangle
/ color = (0, 135, 10)
/ size = (30%*2/4, 30%)
/ position = (70%, 50%)
/ rotation = 0
</shape>
...
<trial staircase_down>
/ontrialbegin = [
    values.staircase = 1;
    if (values.direction_down == 1) {
        values.targetvalue_down -= values.change_down;
    } else {
        values.targetvalue_down += values.change_down;
    };
    shape.target.colorred = values.targetvalue_down;
]

But when I changed it to the rotation like the below;
shape.target.rotation = values.targetvalue_down;

The rotation of the shape doesn't change even though the targetvalue_down value itself is changing every trial.
I tried a similar twig using the width, then it is working fine - width changes accordingly every trial. Any ideas on what is happening here?
I can also post the entire script if it is helpful.

Thank you!
Yaelan

If you already have runnable code, even if it doesn't do what you want it to do, please provide the actual script. It's error prone to try and guess and then replicate whatever other adjustments you may have made, such as the value of parameters.step. Thank you.

Here, however, is a simple indepented example:


<parameters>
/ step_deg = 2
</parameters>

<values>
/ r = 0
</values>

<block example>
/ trials = [1= example]
</block>

<trial example>
/ stimulusframes = [1=clearscreen, t, instr]
/ validresponse = (203, 205)
/ ontrialend = [
    if (trial.example.response == 203) {
        values.r -= parameters.step_deg;
    } else if (trial.example.response == 205){
        values.r += parameters.step_deg;
    }
]
/ branch = [
    trial.example;
]
</trial>

<shape t>
/ shape = triangle
/ color = blue
/ erase = false
/ size = (200px, 200px)
/ position = (50%, 50%)
/ rotation = values.r
</shape>

<text instr>
/ items = ("Left arrow key to rotate left, right arrow key to rotate right. CTRL+Q to quit.")
/ position = (50%, 10%)
/ erase = false
</text>

By yjung541 - 11/19/2020

Dave - 11/19/2020
yjung541 - 11/19/2020
Hi!

I want to run a study to measure orientation sensitivity, and I'm currently trying to trig the staircase demo to make this study.
The demo used color as a feature and update the color information like the below:

<shape target>
/ shape = triangle
/ color = (0, 135, 10)
/ size = (30%*2/4, 30%)
/ position = (70%, 50%)
/ rotation = 0
</shape>
...
<trial staircase_down>
/ontrialbegin = [
    values.staircase = 1;
    if (values.direction_down == 1) {
        values.targetvalue_down -= values.change_down;
    } else {
        values.targetvalue_down += values.change_down;
    };
    shape.target.colorred = values.targetvalue_down;
]

But when I changed it to the rotation like the below;
shape.target.rotation = values.targetvalue_down;

The rotation of the shape doesn't change even though the targetvalue_down value itself is changing every trial.
I tried a similar twig using the width, then it is working fine - width changes accordingly every trial. Any ideas on what is happening here?
I can also post the entire script if it is helpful.

Thank you!
Yaelan

If you already have runnable code, even if it doesn't do what you want it to do, please provide the actual script. It's error prone to try and guess and then replicate whatever other adjustments you may have made, such as the value of parameters.step. Thank you.

Here, however, is a simple indepented example:


<parameters>
/ step_deg = 2
</parameters>

<values>
/ r = 0
</values>

<block example>
/ trials = [1= example]
</block>

<trial example>
/ stimulusframes = [1=clearscreen, t, instr]
/ validresponse = (203, 205)
/ ontrialend = [
    if (trial.example.response == 203) {
        values.r -= parameters.step_deg;
    } else if (trial.example.response == 205){
        values.r += parameters.step_deg;
    }
]
/ branch = [
    trial.example;
]
</trial>

<shape t>
/ shape = triangle
/ color = blue
/ erase = false
/ size = (200px, 200px)
/ position = (50%, 50%)
/ rotation = values.r
</shape>

<text instr>
/ items = ("Left arrow key to rotate left, right arrow key to rotate right. CTRL+Q to quit.")
/ position = (50%, 10%)
/ erase = false
</text>


Thank you!
Here's the code - the instruction part might be wonky (e.g. key-change pair) because I wasn't changing it properly yet.

By Dave - 11/19/2020

yjung541 - 11/19/2020
Dave - 11/19/2020
yjung541 - 11/19/2020
Hi!

I want to run a study to measure orientation sensitivity, and I'm currently trying to trig the staircase demo to make this study.
The demo used color as a feature and update the color information like the below:

<shape target>
/ shape = triangle
/ color = (0, 135, 10)
/ size = (30%*2/4, 30%)
/ position = (70%, 50%)
/ rotation = 0
</shape>
...
<trial staircase_down>
/ontrialbegin = [
    values.staircase = 1;
    if (values.direction_down == 1) {
        values.targetvalue_down -= values.change_down;
    } else {
        values.targetvalue_down += values.change_down;
    };
    shape.target.colorred = values.targetvalue_down;
]

But when I changed it to the rotation like the below;
shape.target.rotation = values.targetvalue_down;

The rotation of the shape doesn't change even though the targetvalue_down value itself is changing every trial.
I tried a similar twig using the width, then it is working fine - width changes accordingly every trial. Any ideas on what is happening here?
I can also post the entire script if it is helpful.

Thank you!
Yaelan

If you already have runnable code, even if it doesn't do what you want it to do, please provide the actual script. It's error prone to try and guess and then replicate whatever other adjustments you may have made, such as the value of parameters.step. Thank you.

Here, however, is a simple indepented example:


<parameters>
/ step_deg = 2
</parameters>

<values>
/ r = 0
</values>

<block example>
/ trials = [1= example]
</block>

<trial example>
/ stimulusframes = [1=clearscreen, t, instr]
/ validresponse = (203, 205)
/ ontrialend = [
    if (trial.example.response == 203) {
        values.r -= parameters.step_deg;
    } else if (trial.example.response == 205){
        values.r += parameters.step_deg;
    }
]
/ branch = [
    trial.example;
]
</trial>

<shape t>
/ shape = triangle
/ color = blue
/ erase = false
/ size = (200px, 200px)
/ position = (50%, 50%)
/ rotation = values.r
</shape>

<text instr>
/ items = ("Left arrow key to rotate left, right arrow key to rotate right. CTRL+Q to quit.")
/ position = (50%, 10%)
/ erase = false
</text>


Thank you!
Here's the code - the instruction part might be wonky (e.g. key-change pair) because I wasn't changing it properly yet.


Do you still need assistance -- if so, with what -- or is the example I gave sufficient?
By yjung541 - 11/19/2020

Dave - 11/19/2020
yjung541 - 11/19/2020
Dave - 11/19/2020
yjung541 - 11/19/2020
Hi!

I want to run a study to measure orientation sensitivity, and I'm currently trying to trig the staircase demo to make this study.
The demo used color as a feature and update the color information like the below:

<shape target>
/ shape = triangle
/ color = (0, 135, 10)
/ size = (30%*2/4, 30%)
/ position = (70%, 50%)
/ rotation = 0
</shape>
...
<trial staircase_down>
/ontrialbegin = [
    values.staircase = 1;
    if (values.direction_down == 1) {
        values.targetvalue_down -= values.change_down;
    } else {
        values.targetvalue_down += values.change_down;
    };
    shape.target.colorred = values.targetvalue_down;
]

But when I changed it to the rotation like the below;
shape.target.rotation = values.targetvalue_down;

The rotation of the shape doesn't change even though the targetvalue_down value itself is changing every trial.
I tried a similar twig using the width, then it is working fine - width changes accordingly every trial. Any ideas on what is happening here?
I can also post the entire script if it is helpful.

Thank you!
Yaelan

If you already have runnable code, even if it doesn't do what you want it to do, please provide the actual script. It's error prone to try and guess and then replicate whatever other adjustments you may have made, such as the value of parameters.step. Thank you.

Here, however, is a simple indepented example:


<parameters>
/ step_deg = 2
</parameters>

<values>
/ r = 0
</values>

<block example>
/ trials = [1= example]
</block>

<trial example>
/ stimulusframes = [1=clearscreen, t, instr]
/ validresponse = (203, 205)
/ ontrialend = [
    if (trial.example.response == 203) {
        values.r -= parameters.step_deg;
    } else if (trial.example.response == 205){
        values.r += parameters.step_deg;
    }
]
/ branch = [
    trial.example;
]
</trial>

<shape t>
/ shape = triangle
/ color = blue
/ erase = false
/ size = (200px, 200px)
/ position = (50%, 50%)
/ rotation = values.r
</shape>

<text instr>
/ items = ("Left arrow key to rotate left, right arrow key to rotate right. CTRL+Q to quit.")
/ position = (50%, 10%)
/ erase = false
</text>


Thank you!
Here's the code - the instruction part might be wonky (e.g. key-change pair) because I wasn't changing it properly yet.


Do you still need assistance -- if so, with what -- or is the example I gave sufficient?

Sorry! For some reason, I only saw the first chunk of your answer and thought you would want me to upload my code to see what's happening.
I think I can start editing the code using your example. Thank you so much!
By yjung541 - 11/19/2020

yjung541 - 11/19/2020
Dave - 11/19/2020
yjung541 - 11/19/2020
Dave - 11/19/2020
yjung541 - 11/19/2020
Hi!

I want to run a study to measure orientation sensitivity, and I'm currently trying to trig the staircase demo to make this study.
The demo used color as a feature and update the color information like the below:

<shape target>
/ shape = triangle
/ color = (0, 135, 10)
/ size = (30%*2/4, 30%)
/ position = (70%, 50%)
/ rotation = 0
</shape>
...
<trial staircase_down>
/ontrialbegin = [
    values.staircase = 1;
    if (values.direction_down == 1) {
        values.targetvalue_down -= values.change_down;
    } else {
        values.targetvalue_down += values.change_down;
    };
    shape.target.colorred = values.targetvalue_down;
]

But when I changed it to the rotation like the below;
shape.target.rotation = values.targetvalue_down;

The rotation of the shape doesn't change even though the targetvalue_down value itself is changing every trial.
I tried a similar twig using the width, then it is working fine - width changes accordingly every trial. Any ideas on what is happening here?
I can also post the entire script if it is helpful.

Thank you!
Yaelan

If you already have runnable code, even if it doesn't do what you want it to do, please provide the actual script. It's error prone to try and guess and then replicate whatever other adjustments you may have made, such as the value of parameters.step. Thank you.

Here, however, is a simple indepented example:


<parameters>
/ step_deg = 2
</parameters>

<values>
/ r = 0
</values>

<block example>
/ trials = [1= example]
</block>

<trial example>
/ stimulusframes = [1=clearscreen, t, instr]
/ validresponse = (203, 205)
/ ontrialend = [
    if (trial.example.response == 203) {
        values.r -= parameters.step_deg;
    } else if (trial.example.response == 205){
        values.r += parameters.step_deg;
    }
]
/ branch = [
    trial.example;
]
</trial>

<shape t>
/ shape = triangle
/ color = blue
/ erase = false
/ size = (200px, 200px)
/ position = (50%, 50%)
/ rotation = values.r
</shape>

<text instr>
/ items = ("Left arrow key to rotate left, right arrow key to rotate right. CTRL+Q to quit.")
/ position = (50%, 10%)
/ erase = false
</text>


Thank you!
Here's the code - the instruction part might be wonky (e.g. key-change pair) because I wasn't changing it properly yet.


Do you still need assistance -- if so, with what -- or is the example I gave sufficient?

Sorry! For some reason, I only saw the first chunk of your answer and thought you would want me to upload my code to see what's happening.
I think I can start editing the code using your example. Thank you so much!

And, it is working! thank you! :)