# Difficult - Help - Sequential stimuli within the same duration

**URL:** <https://discourse.psychopy.org/t/difficult-help-sequential-stimuli-within-the-same-duration/48038>\
**Category:** Coding\
**Created:** [October 1, 2026, 1:15pm UTC](https://discourse.psychopy.org/t/difficult-help-sequential-stimuli-within-the-same-duration/48038 "2026-10-01T13:15:44Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![geokal](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@geokal](https://discourse.psychopy.org/u/geokal)\
**Post date:** [October 1, 2026, 1:15pm UTC](https://discourse.psychopy.org/t/difficult-help-sequential-stimuli-within-the-same-duration/48038/1 "2026-10-01T13:15:44Z")

</div>

Be careful with lengths and durations! I want to create a routine in which there will be 5 presentations of a 4cm line and 5 presentations of a 10cm line in a random order. For the 4cm line, there will be 2,3,4 or 5 smaller lines with random lengths to make up 4cm all together for each trial. There will also be inter-line intervals. The presentation of each smaller line and inter-line interval will be between 400ms and 1100ms with the total duration of each sequence (trial) being between 1.2s and 4s. The same holds for the 10cm line but with random lengths to make up 10cm all together for each trial. How can I create this one in Psychopy?

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [October 1, 2026, 2:01pm UTC](https://discourse.psychopy.org/t/difficult-help-sequential-stimuli-within-the-same-duration/48038/2 "2026-10-01T14:01:48Z")

</div>

I would create it in Builder with six polygon components, assuming that’s the maximum number of lines that can be seen on screen at once. How are the smaller lines arranged?

You could specify all the lengths in a spreadsheet with lengths being 0 for absent lines.

What is the task? Is it local only? If so, you could use cm units if you set up your monitor.

---

<div class="post-metadata">

**Author:** ![geokal](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@geokal](https://discourse.psychopy.org/u/geokal)\
**Post date:** [October 1, 2026, 2:30pm UTC](https://discourse.psychopy.org/t/difficult-help-sequential-stimuli-within-the-same-duration/48038/3 "2026-10-01T14:30:16Z")

</div>

Hi Wake Carter, thank you for your reply.

The smaller lines can be 2,3,4 or 5 in a trial. For example, a 4cm trial of 3 lines can be 5s cross, empty interval, line (1.2cm), empty interval, line (2cm), empty interval, line (0.8cm).

The length of the lines in each trial is random but their total in each trial must be 4cm or 10cm.

The task is local yes and I use cm as units.

Moreover, concerning the durations, the presentation duration of each line and the inter-line interval are chosen between 400 and 1100ms, with a total duration for the sequence being between 1.2s and 4s.

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [October 1, 2026, 3:57pm UTC](https://discourse.psychopy.org/t/difficult-help-sequential-stimuli-within-the-same-duration/48038/4 "2026-10-01T15:57:00Z")

</div>

That sounds like you only need one polygon (or maybe two if the reference line is also displayed), because the smaller lines are only presented one at a time. The easiest way to accomplish this would be to have concentric loops where the spreadsheet for the outer loop specifies the number of trials in the inner loop (along with their lengths and durations).

What does the participant need to do?

---

<div class="post-metadata">

**Author:** ![stanley1O1](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@stanley1O1](https://discourse.psychopy.org/u/stanley1O1)\
**Post date:** [October 1, 2026, 5:26pm UTC](https://discourse.psychopy.org/t/difficult-help-sequential-stimuli-within-the-same-duration/48038/5 "2026-10-01T17:26:29Z")

</div>

I think it’s important to set a limit in terms of how precise the smaller lines can be measured, and how much variance you want. I think wakecarter’s solution of just having a spreadsheet with the lengths pre-determined is going to be the easiest, and most experimentally valid. Using any kind of random function/python code to randomize the lengths of the smaller lines without any type of constraints is going to be messy. I would suggest you think about how precise you want want measurements to be, any minimum or maximum values (for example 0.1cm, 0.1cm, 3.8cm I imagine is not necessarily a useful variation), and the “step size” or increment value for your values (e.g. using values that are multiples of 0.1cm, 0.2cm, or 0.5cm).

Issac

---

<div class="post-metadata">

**Author:** ![geokal](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@geokal](https://discourse.psychopy.org/u/geokal)\
**Post date:** [October 7, 2026, 12:15pm UTC](https://discourse.psychopy.org/t/difficult-help-sequential-stimuli-within-the-same-duration/48038/6 "2026-10-07T12:15:39Z")

</div>

Hi to both of you and thank you for your reply.

I am really confused about this experiment. Please read all the instructions to understand it.

The practice should have

- Each trial should begin with a 5s cross and a 5s blank interval.
- 5 presentations/trials of the 4cm line and 5 presentations/trials of the 10cm line in a random order.
- Each of these 10 presentations/trials should have either 2, 3, 4 or 5 small lines (combinations) chosen randomly. The length of each one of them should be an integer number and each of these four combinations should add up to either 4cm or 10cm.
- Moreover, there should be an interline interval between each line. The duration of each interline interval and of each line should be from 400ms up to 1100ms with a total duration for the sequence being between 1.2s and 4s.
- During this practice, participants should only see these 10 presentations without doing anything else.

In the experiment after the practice:

- There are 7 probe stimuli (4, 5, 6, 7, 8, 9 and 10).
- Each trial start with a 5s cross, then a 5s blank interval and then one of these stimuli. For example for stimulus 6, there were 6 small lines, the length of each small line was an integer number and the total length of stimulus 6 was 6cm. The duration of each small line was an integer number and the total duration of stimulus 6 was 6s. The same holds for the other stimuli. After the presentation of the stimulus, there is a question “Was the length closer to the short or long standard?” Press d if it was closer to the short standard and k if it was closer to the long standard.
- Moreover, each stimulus was presented with and without clicks. With clicks, the clicks started in the beginning of the 5s blank interval and lasted until the end of each stimulus. Without clicks, there was no sound.
- The intertrial interval was randomly chosen between 1 and 3s.
- There were 14 trials in each of the 8 blocks.

Regards

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [October 7, 2026, 2:09pm UTC](https://discourse.psychopy.org/t/difficult-help-sequential-stimuli-within-the-same-duration/48038/7 "2026-10-07T14:09:15Z")

</div>

> [@geokal](#):
>
> - For example for stimulus 6, there were 6 small lines, the length of each small line was an integer number and the total length of stimulus 6 was 6cm. The duration of each small line was an integer number and the total duration of stimulus 6 was 6s.

I doubt you mean this, since it can only be solved if all 6 lines are 1cm long and presented for 1 second each.

---

<div class="post-metadata">

**Author:** ![geokal](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@geokal](https://discourse.psychopy.org/u/geokal)\
**Post date:** [October 7, 2026, 2:34pm UTC](https://discourse.psychopy.org/t/difficult-help-sequential-stimuli-within-the-same-duration/48038/8 "2026-10-07T14:34:28Z")

</div>

Hi Wake,

The paper does not specify it and I assumed that this might be the structure. I just sent an e-mail to the author to clarify the information.

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [October 7, 2026, 2:42pm UTC](https://discourse.psychopy.org/t/difficult-help-sequential-stimuli-within-the-same-duration/48038/9 "2026-10-07T14:42:34Z")

</div>

If you would like the Open Science Tools team to build the experiment for you from the brief, you can request it via [Consultancy Services — PsychoPy®](https://psychopy.org/consultancy)

However, if the original author used PsychoPy, you might be able to use their experiment as a starting point.

---

<div class="post-metadata">

**Author:** ![stanley1O1](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@stanley1O1](https://discourse.psychopy.org/u/stanley1O1)\
**Post date:** [October 14, 2026, 5:16pm UTC](https://discourse.psychopy.org/t/difficult-help-sequential-stimuli-within-the-same-duration/48038/10 "2026-10-14T17:16:18Z")

</div>

Not only that but:

“Each of these 10 presentations/trials should have either 2, 3, 4 or 5 small lines (combinations) chosen randomly. The length of each one of them should be an integer number and each of these four combinations should add up to either 4cm or 10cm.”

You cannot have 5 lines that are integers that equal 4cm.

Also @geokal, what is the “short or long standard”? I think you do not mean to say “practice trials” but “training trials”.

If I understand it correctly, the “training” phase provides some random line lengths for “short standard” (4cm), and “long standard” (10cm). However you have 4 line combinations spread across 5 presentations, meaning presentation is skewed always, and of course an invalid trial type (5 lines, 4 cm).

The probe display is “n lines of n length for n seconds” meaning every line is 1cm. The probe then asks either (I am unsure of which by the wording but I assume the latter) “was the **individual/total** line length closer to 4cm or 10cm seen during training”.

Overall, I think it’s a very… “odd” line bisection task presentation with multi-sensory integration, and is very difficult to responsibly replicate if all the information to go off of is listed already.

Issac

---

<div class="post-metadata">

**Author:** ![geokal](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@geokal](https://discourse.psychopy.org/u/geokal)\
**Post date:** [October 15, 2026, 9:31am UTC](https://discourse.psychopy.org/t/difficult-help-sequential-stimuli-within-the-same-duration/48038/11 "2026-10-15T09:31:08Z")

</div>

Thank you, everyone, for your comments. I have understood the task, and I am working on finishing it off.

Have a good one!
