# Low frequency oscillator

**URL:** https://discourse.processing.org/t/low-frequency-oscillator/33711
**Category:** Beginners
**Created:** [November 24, 2021, 11:15am UTC](https://discourse.processing.org/t/low-frequency-oscillator/33711 "2021-11-24T11:15:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![moutcast](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@moutcast](https://discourse.processing.org/u/moutcast)
#### Post date: [November 24, 2021, 11:15am UTC](https://discourse.processing.org/t/low-frequency-oscillator/33711/1 "2021-11-24T11:15:10Z")

</div>

hi,

beginner here. how can i create a low frequency oscillator with adjustable frequency?  
i am trying soundloop but i cant figure out how to adjust the tempo from a function with a slider.  
other examples very welcome? maybe with pulse and amplitude?

thanks a lot for any help

---

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [November 24, 2021, 12:42pm UTC](https://discourse.processing.org/t/low-frequency-oscillator/33711/2 "2021-11-24T12:42:24Z")

</div>

Hi

Sound library included frequency examples

---

<div class="post-metadata">

### Author: ![moutcast](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@moutcast](https://discourse.processing.org/u/moutcast)
#### Post date: [November 24, 2021, 1:43pm UTC](https://discourse.processing.org/t/low-frequency-oscillator/33711/3 "2021-11-24T13:43:06Z")

</div>

yes, thanks, i cant find it there. how can i change the soundloop interval from a function or change the bpm from a function?

osc = new p5.Oscillator(‘sine’);  
osc.start();

soundLoop = new p5.SoundLoop(strt, interv);

soundLoop.start();

env = new p5.Envelope(0.1, 0.1, 0.1, 0.1);

}  
function draw() {  
background(220);

}  
function strt() {  
let r = random([1, 2, 4]);  
let soundLoopinterv = r;  
???  
env.setADSR(0.1, 0.1, 0.1, 0.1,);  
env.play(osc);  
}
