Should I use conditionals on the audio thread, or will that cause blocking?

Hello, I have a pretty solid background in how sound programming works. However, an app that only makes one sound is almost useless. For a practical app, I want the audio block to update with the regard to the user interaction. Can I use conditionals in the audio thread to reflect the incoming parameters updating?

Yes. I suggest you start with the plugin tutorials
https://docs.juce.com/master/tutorial_create_projucer_basic_plugin.html

I figured it out and built a little toy that can switch between noise and sine+noise. I love it. Now I want random audible frequencies but don’t know how to do it, outside of PD

What do you mean by random audible frequencies?

Do you mean that it picks a random frequency and sets a sine oscillator to that frequency?

Yeah! I built something with Unity and Pd this past fall that played with randfreq

Okay, well you already have a working sine oscillator, with frequency input, right?

1 Like

yep

So then you just have to decide how/when you want to trigger a new frequency. Then set the frequency variable to some random number.

However, be aware of clicks, because you’ll be adjusting the frequency mid phase (when the waveform is not sitting on perfect ‘0’) likely. So you probably then want to also think about how you want to change from the previous frequency to the new frequency.