Please be advised that due to scheduled infrastructure maintenance, we anticipate downtimes for the Native Instruments websites and Native Access on February 28, 2024 starting at 06:00 CET. For more details, click here.

How could I use system info CPU meter to limit voices? (Voice stealing)

Michael O'Hagan
Michael O'Hagan Member Posts: 92 Helper

I'm trying to find a way to use the system info CPU meter output to limit the number of active voice's to prevent a cpu overload on a very cpu hungry synth.


I keep thinking that there must be a way to say, at %50 cpu or higher, stop adding new voices and start replacing old voices.


Like I'm playing voices 1-4, and I'm at %60 cpu load, now when I trigger the next note don't use voice 5, but re-route and steal voice 1 and replace it with the new note.


Some synths over the years have had voice stealing options, but I've never seen it in reaktor, and I'm struggling to think of a way to make this work.


Does anyone know of an example of voice stealing in reaktor or have any ideas on how I might go about setting this up?

Comments

  • colB
    colB Member Posts: 754 Guru
    edited June 2023

    Some synths over the years have had voice stealing options, but I've never seen it in reaktor, and I'm struggling to think of a way to make this work.

    The built in voice stealing seems like the ideal compromise to me - the user sets a fixed maximum voice count that they can tune in combination with their audio buffer size until they don't get dropouts.

    EDIT: what about the built in 'Automatic Voice Reduction' ?

    I understand that you want this to be automatic, so the user doesn't need to make choice. That's an attractive idea for sure. But it has the potential to make the instrument less predictable in use. You might hit a cpu spike and lose the bass, or the melody note, or some other important note for the harmony, and with an 'automatic' approach, the user has no control, At least with a fixed voice count, they can experiment and find a voice count/ latency combination where they never have problems.

    There is also the potential problem of the cpu meter being reactive, so what might happen (and this could vary per system too) is that any time there is a cpu spike, you still get dropout glitches before you get the change in cpu load%, and then afterwards, a couple of voices drop out... then come back in, then more glitches etc. Not sure if you can ever guarantee to drop voice quickly enough. If that's the case, then you would have to set the threshold pretty low, so why not just have a fixed max voice count from the built in system? Needs lots of testing for sure.

    If you had a few synths working this way, you could get some interesting results - one synth overloads the cpu, but if they are all running on the same cpu core, they would all react and drop their voice count, then cpu load would go very low, so then they would all push up their voice count.. and you would get an instant overload... You could maybe at least partially account for this by having a shared event table and some (complex) logic so all synths using your 'system' can talk to each other asbout who gets to increase vocie when there is spare cpu... but you would probably need a slow release on the throttling to prevent oscillations. It depends on the latency of the cpu load reporting.

    I suppose if you go for a lower maximum like 30% or 40% it might work, but even then you could still get spikes and glitches that overload the cpu.

    You would need hysteresis too, otherwise you would get situations where the cpu load is fluctuation around the threshold, and some noticeable voice is constantly switching on and off...

  • Quietschboy
    Quietschboy Member Posts: 45 Helper

    On the technical side, it is not possible to set the Instrument´s voices from structure. If you change the voice number manually in the side pane, this causes a re-init with all it´s possible drawbacks like clicks and dropouts.

    Building a polyphonic structure yourself (with advanced voice management) in a monophonic Instrument, seems to be a big disadvantage to me, as it is much more CPU expensive than using the build in Reaktor polyphony.

  • colB
    colB Member Posts: 754 Guru

    It should be possible to set up a clock gating system, but managing the voices will be pretty tricky.

    so lets say you have 20 voices, and the throttling says only 5 should be active, how do you tell which of the 20 are the most recent 5 voices - they could be any 5 arbitrary voice indices. So some means of tracking them would be necessary.

  • Quietschboy
    Quietschboy Member Posts: 45 Helper

    Hey Colin, i am absolutely with you. And to be honest, building such a self made voice management seems very complicated to me. I just wanted to note to Michael that multiplying a voice (means it´s structure, like PCBs in a real analog Synth) in a monophonic Reaktor Instrument is much more expensive than just using Reaktor´s build in polyphonic mode, which hugely optimizes CPU costs.

    😉

Back To Top