ofxPDSP what does amp.in_mod mean? and how do I use it?

kinda of a long shot, but im trying to learn how to use ofxPDSP and I cant figure out what amp.in_mod means?

context:
gate_ctrl.out_trig() >> env;
env >> amp.in_mod();

In this example an env is patching into the amp? Perhaps I just dont know what amp means…

Hey this addon has a really awesome webpage for documentation here: ofxPDSP: ofxPDSP. And the github page has lots of example projects too: GitHub - npisanti/ofxPDSP: openFrameworks addon for audio synthesis and generative music.

If I were to guess, I’d say that the context code involves a gate function, which triggers envelope, which in turn is modulating the amplitude (volume or strength) of a signal.

1 Like

Do you know what in_mod() means in this context?

I’ve worked with SuperCollider quite a bit, but not ofxPDSP, so I’d be guessing again. But, .in_mod() is a function (or a message) that is being applied to the object amp. And, if you type in_mod into the search box of the documentation (which is one of several reasons why its so amazing!), you’ll get this page that describes pdsp::Amp and its class functions, including the function pdsp::Amp::in_mod(): ofxPDSP: pdsp::Amp Class Reference.

It looks to me that ofxPDSP might have a class structure with a lot of inheritance, and that pdsp::Amp inherits from pdsp::Unit. So presumably a pdsp::Amp object can also use the class functions of pdsp::Unit. Alternatively, a class function in pdsp::Unit can be redefined by pdsp::Amp to better suit how it would specifically apply to an object of pdsp::Amp.

1 Like

@npisanti

sorry for the late response:

pdsp::Amp multiply the in_signal() input (that is default for patching so you avoid calling it), for the in_mod() input. Usually the signals goes to the first and modulations like anvelopes, lfo or other means of control to the second, the second inut is checked first and in case of a modulation being constant at a value of 0 all the signal path is not calculated.

@skywalkerwin n the code you posted a trigger control is patched to control an envelope, and that envelope is patched to control the amp modulation, probably another signal (like oscillator, samplers, etc) is patched into that amp somewhere else in the code, so the envelope controls the volume of those sources