Latency compensation module/input

Discussion in 'Feature Suggestions' started by pentrite0, Dec 30, 2014.

  1. pentrite0

    pentrite0 NI Product Owner

    Messages:
    83
    It would be great to have a new module, or a new input in an existing module, to feed with the latency created by an instrument/ensemble, in samples. This latency time calculation itself being let to the designer of the ensemble.

    For exemple, ensembles using FFT, or using delays and z-1 in the signal path like "midi humanizer" (in this case, the latency is an average of the delay times of the note-on's : this is up to the designer to make a good latency calculator...).

    I could have talked about FIR filtering and ... Upsampling and Downsampling !
    (an upsampling/downsampling couple based on 4point interpolators, around a shaper for exemple, adding 3 samples of delay)
     
    Last edited: Dec 30, 2014
  2. Jedinhopy

    Jedinhopy NI Product Owner

    Messages:
    821
    How much latency does envelope followers coupled with event smoothers add that comes from primary bandpass filters?
    More latency can be perceived when using gating on volume signals created by the envelope followers. Similar to subtractive denoising and spectral gating where low volume frequencies are completely removed. For example if a song is sent to reaktor and the first 300 samples has low volume and the spectral gating knob setting is hard in reaktor. The first 200 samples will be completely silent and the samples 200 to 300 will have a fade in.

    It can't be avoided.
    Not only FFT creates latency but the Event Rate update speed created by evelope followers and event smoothers and so on.

    Audio Rate sinewave resynthesis without FFT is impossible.
    Event Rate sinewave resynthesis can be done without using FFT but using classic primary effects instead.

    These comes to my mind:
    1. 128 instrument voices
    2. voice info module
    3. bandpass filters
    4. envelope followers
    5. event smoothers.
    6. sine wave oscillators

    Extracting the volume modulations of bandpass filters without envelope followers is impossible because the original audio signal will bleed and leak into the audio output. And to make click free volume modulations.
    Event smoothers must be used = more latency will be added.
     
    Last edited: Dec 30, 2014
  3. pentrite0

    pentrite0 NI Product Owner

    Messages:
    83
    I don't really understand your question :

    - or you are asking how to calculate latency, and this is the wrong topic
    (Note that we could talk about a whole spectrum latency, a latency at a particular frequency or an average/perceived latency. All of this could include, or not, the pre-ringing artefacts, the impulse response...)
    Just to talk about the exemple that I have given in my first post: the latency is exactly 3 samples on the whole spectrum, with a pre-ringing and a post-ringing artefacts both being of 3 samples, and an impulse response being 7 samples long, all of this whatever the scaling of the Upsampling-Downsampling couple - X2, X4, X8,... - Also, in this exemple, their will be a loss of high frequencies, due to the filtering nature of interpolation/fractional delay.

    - or you are saying that this is not possible to compensate the latency because of, precisely, pre-ringing artefacts or buffering or such, and it is precisely the role of latency compensation.
    IT IS possible to compensate a latency of a 1000 samples long FIR filter for exemple, but :
    1- OFFLINE, I mean, when the host is starting/buffering. So, not in realtime, when playing or singing thru Reaktor or anything else.
    2- you'll have a pre-ringing artefact, in this case of 500 samples.
     
    Last edited: Dec 30, 2014
  4. Jedinhopy

    Jedinhopy NI Product Owner

    Messages:
    821
    I am done.
     
  5. pentrite0

    pentrite0 NI Product Owner

    Messages:
    83
    Also, and this is precisely why I mentioned a "designer specified" latency time, one could still try different latency compensation times to find the one that is most appropriate to complexe structures/settings as the one you are talking about.
    By the way, one could still calculate/find the biggest latency that a structure could produce, set it to be the "fixed latency" of the ensemble that would be set at the opening of the ensemble (if NI implements it this way), and then, add a user adjustable delay in the signal path, for settings with shorter latencies.


    And, anticipating NI reaction to this suggestion, this should works not only for the effect Reaktor type (VSTI), but also for the instrument type (VST), because some synth structure can also create latency for many reasons, some of them being already explained like upsampling an oscillator or a shaper. It would be the problem of each designer to manage pre-ringing artefacts and such.
     
    Last edited: Dec 30, 2014
  6. pentrite0

    pentrite0 NI Product Owner

    Messages:
    83
    "I am done."

    OK, I am not a native English speaker, so perhaps there is just a little word that I haven't understood.
    Maybe you could tell me what you think about my second post...
     
  7. Jedinhopy

    Jedinhopy NI Product Owner

    Messages:
    821
    Dynamic latency can't be latency compensated correctly because it's out of sync with the song start/stop reset position from the DAW.

    For example everytime the song starts from the beginning. The latency decreases and increases randomly.
    Probably due to some block cyclers and event cyclers or other effects which is not retriggered by the host start/stop buttons.
     
  8. colB

    colB NI Product Owner

    Messages:
    3,854
    Latency compensation makes sense for buffer based processes. The latency is usually some multiple of the number of samples in the buffer.
    This is a standard feature that is missing in Reaktor. It has nothing to do with frequency dependent phase delays caused by various filter types, or problems caused by poorly designed devices that use event rate where they should be using audio rate.
     
  9. pentrite0

    pentrite0 NI Product Owner

    Messages:
    83
    @ Jedinhopy :
    What is "dynamic latency" ?
    Does "static latency" exist (is a delay of 1 second a dynamic or static latency ?)
    Why were you asking in another post for the latency of EZ FFT to be taken into account by Reaktor and it's latency compensation by the host ?
    Don't you think a 1 pole low pass filter (and an event smoother) will create a different latency at each frequencies (phase response) ?
    Don't you think an enveloppe with an attack time of 1ms, used to open a gate for exemple, will have an average latency of 0.5ms ? (Or a total latency of 1ms)
    Don't you think that all off this can be calculated ?
    And if you modulate all off this in real time, would you like the average latency to be compensated ? ( or the maximum latency, plus an internal custom delay line, to compensate shorter latency settings ?)

    What do you answer to my second post ?
    What do you think about my third post ?

    When I read your last post, it seems that you are saying that latency compensation is impossible...
    So why is there some latency compensators in hosts ?
    What is (one of) the purpose(s) of the buffer of your host and the pre-buffering at the starting of the song/project ?

    Yes this time I can say that I really don't understand you, and I could add that I'm done ! :)

    Anyway, I know a method to do it manually : create a delay of (1bar minus latency), and move forward the track to the precedent bar.
    Or you can set manually the latency compensation in the host, you just have to first find the "Reaktor inherent" latency and add this duration to the latency of your structure (EZ FFT, for exemple).
    But all off this is boring : I'm sure that there is a way to control and adjust the total latency time that Reaktor will send to the host. NI just have to give us access to this or just add a good amount of latency to Reaktor and let us choose which part of this will be used by the real latency of our structure (the one specified by user, with a default setting at "0" sample) and which part will be used by the automatic and invisible delay managed by Reaktor.
     
  10. Jedinhopy

    Jedinhopy NI Product Owner

    Messages:
    821
    @pentrite0.
    I will not say more in this thread.
     
  11. colB

    colB NI Product Owner

    Messages:
    3,854
    last word :p