Custom audio object and a mixer4 - gain issues

dimitre

Well-known member
I'm working on this project with a custom object.
It is basically a recorder / looper. I've added 3 instances of this object and the line in instrument connected to a mixer4.

I've noticed if I use
Code:
audio_block_t *block = receiveWritable();
it work OK but the audio output gain is very low after passing through the mixer.

and if I use
Code:
audio_block_t *block = receiveReadOnly();
it plays back with the original level, but stop mixing with the original instrument source.

code here
https://github.com/dimitre/Slicer/tree/main/src

Thanks for any help or recommendations
 
receiveWritable() receives a copy of the data block to which you can manipulate the data. This is the first thing that happens in the mixer object to "create" a datablock that can be sent to the output after all port data are "mixed"
receiveReadOnly() is just to receive the additional input port data.
 
In fact I don't need to manipulate the data itself because one time I'll be recording (reading) and other time I'll be playing back, so maybe even a empty audio_block_t *block pointer could do for playback.
I've noticed things happens differently when I pass through the mixer4 object. If I connect my object direct from output it seems to work fine.
 
Hi,

I'm not sure I fully understand what you are trying to do but a couple of points that might help.

if you are mixing 4 signals together you would normally have the gains set <1.0
- if they were 4 coherent signals then set the gains at 0.25
- if you are wanting to keep the volume constant then adjust the gain depending on how many slicer objects are running

Cheers, Paul
 
Just fixed what was happening, I'll explain here so hopefully it can help others.
my recorder object was passing audio through when not recording or playing back, so mixer4 was summing 4 times the gain.
muting the object output when recording and not playing back solved. I've commented out the function transmit.
Thanks
 
Back
Top