I have an Audio project using the mixer object and an Analyze object (that I created myself). I declared these object in my Sketch and the Sketch is the mediator between objects as in the examples. The Analyze object obtains information from the audio stream that I then use to set the gain of the mixer in realtime. So, the sketch reads data from the Anaalyze object then uses that to compute the mixer gain and sends that to the mixer with mixer1.gain(0,value). This works except that the process takes longer than I need.
So, what I'd like to do is have the Analyze object make the calculation of gain (value) and send it directly to mixer1 using mixer1.gain(0,value). Since the Mixer object is positioned well after the Analyze object in the connection path, I reason that the changes in gain determined by the Analyze object will have immediate effect on the mixer gain. I tried this and the compiler complains that ""mixer1" was not declared in this scope. BTW I also, need the Sketch to communicate with the same mixer and analyze object for other purposes. This is likely a basic C++ lack of understanding on my part. I have tried reading on approaches to making the Analyze object aware of the mixer object with no success and could use some advise. Thanks, Brillo
Later .... Appears I have found the solution. added "extern AudioMixer4 mixer1; " to my Analyze object file and no compiler complaints.
So, what I'd like to do is have the Analyze object make the calculation of gain (value) and send it directly to mixer1 using mixer1.gain(0,value). Since the Mixer object is positioned well after the Analyze object in the connection path, I reason that the changes in gain determined by the Analyze object will have immediate effect on the mixer gain. I tried this and the compiler complains that ""mixer1" was not declared in this scope. BTW I also, need the Sketch to communicate with the same mixer and analyze object for other purposes. This is likely a basic C++ lack of understanding on my part. I have tried reading on approaches to making the Analyze object aware of the mixer object with no success and could use some advise. Thanks, Brillo
Later .... Appears I have found the solution. added "extern AudioMixer4 mixer1; " to my Analyze object file and no compiler complaints.
Last edited: