Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: Custom audio object and a mixer4 - gain issues

  1. #1
    Member dimitre's Avatar
    Join Date
    Aug 2016
    Location
    São Paulo
    Posts
    95

    Custom audio object and a mixer4 - gain issues

    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

  2. #2
    Senior Member manicksan's Avatar
    Join Date
    Jun 2020
    Location
    Sweden
    Posts
    606
    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.

  3. #3
    Member dimitre's Avatar
    Join Date
    Aug 2016
    Location
    São Paulo
    Posts
    95
    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.

  4. #4
    Senior Member houtson's Avatar
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    230
    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

  5. #5
    Member dimitre's Avatar
    Join Date
    Aug 2016
    Location
    São Paulo
    Posts
    95
    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

  6. #6
    Senior Member
    Join Date
    Jun 2018
    Location
    USA
    Posts
    242
    dimitre,

    I know you are creating a looper. This just popped up and might be of interest to you.
    https://forum.pjrc.com/threads/69362...titrack-Looper

    Jay

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •