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

Thread: SGTL5000: Influence setting lineOutLevel() the output signal level?

  1. #1
    Senior Member
    Join Date
    May 2018
    Posts
    121

    SGTL5000: Does setting lineOutLevel() influence the output signal level?

    Hi @ll,

    I have the problem that my audio code currently produces a low-level signal. Yes: I can try to multiply the signal before sending out. But how about the lineOutLevel()-method for the SGTL5000? Normal value is 29 for 1.29V p-p. If I set this to 13 (=3.16V p-p)? Would this act like an amplifier (of course, perhaps with more noise)?

    Regards, Holger
    Last edited by C0d3man; 06-05-2020 at 10:35 AM.

  2. #2
    Senior Member
    Join Date
    Aug 2016
    Location
    Australia
    Posts
    165
    Yes, you can do that, but better to get the volume levels right in code - to maximise the number of bits available, and therefore noise and distortion.

    The Headphone output also has a maximum gain of 12dB (Av = 4).

    Otherwise there's the Mixer and Amp objects that can provide gain. Just patch them (AudioConnections) into your signal chain.

  3. #3
    Senior Member
    Join Date
    May 2018
    Posts
    121
    Quote Originally Posted by palmerr View Post
    Yes, you can do that, but better to get the volume levels right in code - to maximise the number of bits available, and therefore noise and distortion.

    The Headphone output also has a maximum gain of 12dB (Av = 4).

    Otherwise there's the Mixer and Amp objects that can provide gain. Just patch them (AudioConnections) into your signal chain.
    I have found out that I am probably beoeating a compressor in some way. It's a pity that there is no finished object in the audio library for this yet.

    Thanks, Holger

  4. #4
    Senior Member
    Join Date
    Aug 2016
    Location
    Australia
    Posts
    165
    A compressor would be a worthy addition to the audio library.

    I have working code for a soft/hard limiting compressor if you would like a place to start. The existing project uses a gain cell to compress analog audio directly, rather than processing a buffer of samples, but the core code should directly apply.

    Richard

  5. #5
    Senior Member
    Join Date
    May 2018
    Posts
    121
    Hi Richard,

    Quote Originally Posted by palmerr View Post
    A compressor would be a worthy addition to the audio library.

    I have working code for a soft/hard limiting compressor if you would like a place to start. The existing project uses a gain cell to compress analog audio directly, rather than processing a buffer of samples, but the core code should directly apply.

    Richard
    That sounds very interesting. I'd like to try that. I have already built some "effects" in the design of the audio library (chorus, mono-stereo-panning, stereo-mono). Would you also put the code under GPL3?

    Regards, Holger

  6. #6
    Senior Member houtson's Avatar
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    124
    Hi Holger, I don't want to hijack your thread but could I ask about you stereo > mono effect - are you just summing the channels like the mixer or something else? thank Paul

    PS I agree a compressor object would be very useful - I been looking at this Reason JSFX compressor here and thinking about converting it for the audio lib.

  7. #7
    Senior Member
    Join Date
    May 2018
    Posts
    121
    Hi Paul,

    Quote Originally Posted by houtson View Post
    Hi Holger, I don't want to hijack your thread but could I ask about you stereo > mono effect - are you just summing the channels like the mixer or something else? thank Paul

    PS I agree a compressor object would be very useful - I been looking at this Reason JSFX compressor here and thinking about converting it for the audio lib.
    Thanks for the link to the different compression variants. Looks interesting. Perhaps this can help to write such an effect. I scanned the forum for already existing code and found some projects. Maybe just testing them before writing a new one?

    My stereo2mono effect is a simple mixer for two inputs. Code can be found here:
    effect_stereo_mono.h
    effect_stereo_mono.cpp

    Regards, Holger

Posting Permissions

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