# In running online, just the first sound of many sounds is presented

**URL:** <https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868>\
**Category:** Online experiments\
**Created:** [September 28, 2020, 9:09pm UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868 "2020-09-28T21:09:24Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zhaleh](https://avatars.discourse-cdn.com/v4/letter/z/5fc32e/32.png) [@Zhaleh](https://discourse.psychopy.org/u/Zhaleh)\
**Post date:** [September 28, 2020, 9:09pm UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868/1 "2020-09-28T21:09:24Z")

</div>

URL of experiment: [https://pavlovia.org/Zhaleh/seq\_audi](https://pavlovia.org/Zhaleh/seq_audi)

Description of the problem: In my experiment, I’ve included two code components to present audio stimuli. They are supposed to be rhythmic auditory patterns but while running in Pavlovia, just the first sound is played, and then nothing happens (even not an error message).  
I’m wondering why Pavlovia doesn’t present my whole experiment and if something is wrong why it doesn’t show an error message. Where can we see errors in running experiments in Pavlovia?  
I’m a beginner to psychopy and Pavlovia and any detailed response is much appreciated.

---

<div class="post-metadata">

**Author:** ![sotiri](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sotiri](https://discourse.psychopy.org/u/sotiri)\
**Post date:** [September 29, 2020, 7:18am UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868/2 "2020-09-29T07:18:54Z")

</div>

Hey @Zhaleh, sorry to hear your online study is acting weird! Would it be possible to upload your .psyexp here? I was unable to access the repo you link to. Here to help, thanks, s.

---

<div class="post-metadata">

**Author:** ![Zhaleh](https://avatars.discourse-cdn.com/v4/letter/z/5fc32e/32.png) [@Zhaleh](https://discourse.psychopy.org/u/Zhaleh)\
**Post date:** [September 29, 2020, 12:55pm UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868/3 "2020-09-29T12:55:48Z")

</div>

Hi,  
Thank you for your attention.  
Yes, of course. I upload my file here.  
[Seq\_auditory.psyexp](https://discourse.psychopy.org/uploads/short-url/aRawF0zArNmFeJbviInSYcXzpRR.psyexp) (24.4 KB)

---

<div class="post-metadata">

**Author:** ![sotiri](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sotiri](https://discourse.psychopy.org/u/sotiri)\
**Post date:** [September 29, 2020, 1:06pm UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868/4 "2020-09-29T13:06:56Z")

</div>

No worries, let me take a look and I’ll get back to you, thanks, s.

---

<div class="post-metadata">

**Author:** ![sotiri](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sotiri](https://discourse.psychopy.org/u/sotiri)\
**Post date:** [September 29, 2020, 9:35pm UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868/5 "2020-09-29T21:35:17Z")

</div>

![Brenda 2020-09-29 at 22.31.19](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/a/0/a070cb457abbed09e6cba31caf7e4c74d1d05db6.png)

Hey @Zhaleh, that ‘stop(ran)’ function call inside the duration field in your ‘sound\_1’ stimulus is the culprit I believe. Could you remove that before exporting for HTML? That should do it I believe, x

---

<div class="post-metadata">

**Author:** ![Zhaleh](https://avatars.discourse-cdn.com/v4/letter/z/5fc32e/32.png) [@Zhaleh](https://discourse.psychopy.org/u/Zhaleh)\
**Post date:** [September 29, 2020, 10:12pm UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868/6 "2020-09-29T22:12:31Z")

</div>

Hi. Thank you so much. I think you are right. Do you mean I remove it totally?! Because it does what I want to my experiment which is producing sounds in the duration I want. So I can’t understand how can I remove it!  
I put the function “stop(ran)” into a variable called “stopvar” but I keep getting the reference error: stopvar is not defined.  
I’m a beginner at programming and working with psychopy and pavlovia so any detailed response is very much appreciated.  
The other thing I don’t understand is that when I change my code in psychopy, export html and then sync it, I don’t see the changes in js file in pavlovia. Why is that?  
Thanks again.  
Zhaleh

---

<div class="post-metadata">

**Author:** ![sotiri](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sotiri](https://discourse.psychopy.org/u/sotiri)\
**Post date:** [September 30, 2020, 9:30am UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868/7 "2020-09-30T09:30:34Z")

</div>

No worries, please allow me some time to consult with the rest of our team on the best way to handle dynamically choosing sound duration.

As to JS edits not reflecting on Pavlovia, it could be git related, but I would need more information to know for sure. I created a project on Pavlovia using the .psyexp you sent me, made a few cosmetic changes and was able to re-sync as normal, so it’s hard for me to tell where the problem lies.

Would it be OK to turn your project public for a minute for me to investigate a bit more? Thanks, s.

---

<div class="post-metadata">

**Author:** ![Zhaleh](https://avatars.discourse-cdn.com/v4/letter/z/5fc32e/32.png) [@Zhaleh](https://discourse.psychopy.org/u/Zhaleh)\
**Post date:** [September 30, 2020, 2:27pm UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868/8 "2020-09-30T14:27:53Z")

</div>

Hi @sotiri, Thank you so much. Yes of course. I made it public now. However, if you look at it now I’ve also made some changes in the js file manually. At the moment it still produces the first sound of many sounds that are supposed to be played.

---

<div class="post-metadata">

**Author:** ![sotiri](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sotiri](https://discourse.psychopy.org/u/sotiri)\
**Post date:** [September 30, 2020, 2:55pm UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868/9 "2020-09-30T14:55:37Z")

</div>

OK great, let me take a look, is the syncing through PsychoPy working as expected then?

---

<div class="post-metadata">

**Author:** ![Zhaleh](https://avatars.discourse-cdn.com/v4/letter/z/5fc32e/32.png) [@Zhaleh](https://discourse.psychopy.org/u/Zhaleh)\
**Post date:** [September 30, 2020, 3:10pm UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868/10 "2020-09-30T15:10:16Z")

</div>

I found that while exporting to html I have some errors in the console.  
As for syncing, when I hit the sync button and look at the js file in pavlovia, I don’t see my changes there.

---

<div class="post-metadata">

**Author:** ![sotiri](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sotiri](https://discourse.psychopy.org/u/sotiri)\
**Post date:** [September 30, 2020, 5:30pm UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868/11 "2020-09-30T17:30:29Z")

</div>

Alright thanks, just to be sure, the list below is incomplete? I need to do some more digging, but I’m thinking if you have errors in the console, it could be they are preventing the syncing from going through somehow?

> **[Commits · master · Zhaleh Mohammad Alipour / seq\_audi](https://gitlab.pavlovia.org/Zhaleh/seq_audi/commits/master)**
>
> Sign In/Register

---

<div class="post-metadata">

**Author:** ![Zhaleh](https://avatars.discourse-cdn.com/v4/letter/z/5fc32e/32.png) [@Zhaleh](https://discourse.psychopy.org/u/Zhaleh)\
**Post date:** [September 30, 2020, 5:53pm UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868/12 "2020-09-30T17:53:54Z")

</div>

Hi @sotiri, I think this is complete, I mean I made the latest changes around 17 hours ago. So it seems to be complete.

---

<div class="post-metadata">

**Author:** ![sotiri](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sotiri](https://discourse.psychopy.org/u/sotiri)\
**Post date:** [September 30, 2020, 6:01pm UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868/13 "2020-09-30T18:01:41Z")

</div>

Alright, cool, let me first try to tackle choosing the sound durations dynamically then. Many thanks for your patience while I look for a solution, s.

---

<div class="post-metadata">

**Author:** ![Zhaleh](https://avatars.discourse-cdn.com/v4/letter/z/5fc32e/32.png) [@Zhaleh](https://discourse.psychopy.org/u/Zhaleh)\
**Post date:** [September 30, 2020, 6:07pm UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868/14 "2020-09-30T18:07:24Z")

</div>

I’m the person who should thank you. Your help is very much appreciated.

---

<div class="post-metadata">

**Author:** ![sotiri](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sotiri](https://discourse.psychopy.org/u/sotiri)\
**Post date:** [September 30, 2020, 6:09pm UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868/15 "2020-09-30T18:09:29Z")

</div>

Please, no trouble at all 😊

---

<div class="post-metadata">

**Author:** ![sotiri](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sotiri](https://discourse.psychopy.org/u/sotiri)\
**Post date:** [October 1, 2020, 1:40pm UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868/16 "2020-10-01T13:40:24Z")

</div>

Hi @Zhaleh, as it happens PsychoPy requires a dollar sign ( **$** ) prefix for [variable parameters](https://psychopy.org/builder/startStop.html#startstop) like ‘start’ and ‘duration’. I was able to get the experiment to run and export to HTML by changing `durationvar[c]` to [`$durationvar[c]`](https://gitlab.pavlovia.org/thewhodidthis/seq_audi/blob/master/Seq_auditory.psyexp#L46) and `list[a][b][c]*0.250` to [`$list[a][b][c]*0.250`](https://gitlab.pavlovia.org/thewhodidthis/seq_audi/blob/master/Seq_auditory.psyexp#L48). You can preview the result below:

> **[Seq\_auditory \[PsychoPy\]](https://run.pavlovia.org/thewhodidthis/seq_audi/html/)**

Hope that makes sense, please let me know if it fails to address the problem. Here to help, s.

---

<div class="post-metadata">

**Author:** ![Zhaleh](https://avatars.discourse-cdn.com/v4/letter/z/5fc32e/32.png) [@Zhaleh](https://discourse.psychopy.org/u/Zhaleh)\
**Post date:** [October 1, 2020, 6:43pm UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868/17 "2020-10-01T18:43:39Z")

</div>

Hi @sotiri, Thanks for your time. I run the experiment via link you sent me but it again just play one single sound and then I just have a gray screen!

---

<div class="post-metadata">

**Author:** ![sotiri](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sotiri](https://discourse.psychopy.org/u/sotiri)\
**Post date:** [October 1, 2020, 6:53pm UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868/18 "2020-10-01T18:53:10Z")

</div>

Alright, OK, but at least we have something that will export without errors! I believe now it’s mostly a matter of getting the durations right, non? s.

---

<div class="post-metadata">

**Author:** ![Zhaleh](https://avatars.discourse-cdn.com/v4/letter/z/5fc32e/32.png) [@Zhaleh](https://discourse.psychopy.org/u/Zhaleh)\
**Post date:** [October 1, 2020, 7:42pm UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868/19 "2020-10-01T19:42:26Z")

</div>

Yes, we at least have something presented. That’s cool.  
But you know, in my experiment, I’m supposed to have three rhythmic sequences and in each sequence 6 or 7 sounds should be played in a rhythmic manner. Then participants should judge which one is different from others. And then the next three sequence and so on.

---

<div class="post-metadata">

**Author:** ![sotiri](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sotiri](https://discourse.psychopy.org/u/sotiri)\
**Post date:** [October 1, 2020, 8:38pm UTC](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868/20 "2020-10-01T20:38:05Z")

</div>

Yes OK I understand. However, it’s not immediately clear to me just by looking at those code components how exactly e.g., ‘list[a][b][c]’ is meant to work. In any case, please rest assured I’m committed to helping you implement the design you have in mind in PsychoPy and online. Please allow me some time to see if I can come up with a result that comes closer to your description, thanks, s.

[Next page](https://discourse.psychopy.org/t/in-running-online-just-the-first-sound-of-many-sounds-is-presented/16868.md?page=2)
