Looking for oscilllator and envelope (like in P5.js) for sound production from integer numbers?

Hi everybody,

I hope you’re doing all fine! :slight_smile:

I’m looking to use a sine-based oscillator in oF, much like this one that can be used in P5.js. Can anybody recommend a library or is there something akin to this builtin?

Similarly, I’m also looking for an alternative to p5.Envelope.

What I’m trying to do is basically turn integer numbers into sound. The oscillator would be used to give the sound quality and frequency, if that makes sense, and the envelope would wrap around it and create sounds like playing notes on a synthesizer.

Hi, you can simply use the sin function. as shown in the example in examples/sound/audioOutputExample.
As for the envelope generator, there are several audio synthesis addons for OF that have it. I recommend you ofxPDSP, allthough it might be a bit overkill.
Yet, the envelope generator is a very simple class so you might want to code it yourself.
Also, try looking at ofxaddons.com for more addons.
cheers

1 Like

I have found the ofMaxim addon really handy and easy to use https://github.com/micknoise/Maximilian/tree/master/cpp/openFrameworks

hey @diff-arch, not as powerful sound engines like ofxPDSP or ofMaxim suggested above, …
but I have some classes with an implemented A(D)SR envelope if you are interested (useful if you use other core OF stuff instead of audio libs…): [sorry is not ADSR, just basic envelope :(]