# Beads - Add timeout when an audio ends

**URL:** https://discourse.processing.org/t/beads-add-timeout-when-an-audio-ends/36717
**Category:** Libraries
**Created:** [May 4, 2022, 3:44pm UTC](https://discourse.processing.org/t/beads-add-timeout-when-an-audio-ends/36717 "2022-05-04T15:44:27Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Alumno51](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@Alumno51](https://discourse.processing.org/u/Alumno51)
#### Post date: [May 4, 2022, 3:44pm UTC](https://discourse.processing.org/t/beads-add-timeout-when-an-audio-ends/36717/1 "2022-05-04T15:44:27Z")

</div>

Hello everyone,

**I want the audio to be reproduced in loop, but between loops, I need a timeout.**

I tried coding “delay(1000);” but it influences the rest of the code.

_In case anyone is wondering what I want to do: I want a bass drum sound in a loop (bum bum bum bum…), but with the possibility of adding time between loops (bum bum bum bum). The idea is to be able to make music. I’ll connect it all with potentiometers. I’m lost._

A thousand thanks,

Derrik

---

<div class="post-metadata">

### Author: ![robertesler](https://avatars.discourse-cdn.com/v4/letter/r/ec9cab/32.png) [@robertesler](https://discourse.processing.org/u/robertesler)
#### Post date: [May 10, 2022, 8:58pm UTC](https://discourse.processing.org/t/beads-add-timeout-when-an-audio-ends/36717/2 "2022-05-10T20:58:27Z")

</div>

Hi @Alumno51.  
If you’re using the exact method

```auto
delay(1000);

```

That is not from the Beads library, it comes from the Processing code base. So it most definitely will effect the rest of your code.  
Beads has different ways of doing what you’re trying to do. It comes with an example that possibly may be what you’re looking for. Look at this:  
[beads/Lesson07\_Music.pde](https://github.com/orsjb/beads/blob/master/packages/Processing/examples/Lesson07_Music/Lesson07_Music.pde)  
Good luck!
