Search Unity

Audio Synthesize - Unity modular synth

Discussion in 'Audio & Video' started by _MGB_, Jul 19, 2018.

  1. _MGB_

    _MGB_

    Joined:
    Apr 24, 2010
    Posts:
    74
    Hey all,

    I was designing a game that needed procedural audio, but got somewhat carried away and ended up designing a modular synth instead of the game ;)

    (please excuse my noob vid - it's my first time :eek:)


    It uses OnAudioFilterRead and is totally interactive at runtime for procedural audio, music or sfx.
    Is something like this of interest to many people here?

    Features (so far):
    - It's effectively a modular synth in Unity to program for your game!
    - Create unique ever-changing interactive audio for virtually zero space cost.
    - Ideal for procedural generation.
    - Totally flexible signal & modulation routing.
    - Sample manipulation, including freq & modulation.
    - Numerous generators, fx & util modules.
    - Extendible/custom nodes.
    - Runtime creation and modification of graphs.

    Cheers!
     
    Last edited: Jul 20, 2018
  2. Marald

    Marald

    Joined:
    Jan 16, 2015
    Posts:
    42
    HI _MGB_, this is looking really nice!

    Are you creating an unity assetstore package? I like the xNode integration. Can you share the audio DSP / Audio CPU footprint of running the modular synth?

    Keep up the good work!
     
  3. Docaroo

    Docaroo

    Joined:
    Nov 7, 2017
    Posts:
    82
    Incredibly interesting! I'd love to look at the code for that work!! Nicely done!
     
  4. _MGB_

    _MGB_

    Joined:
    Apr 24, 2010
    Posts:
    74
    Cheers people!

    @Marald I'll probably look at doing an asset if there's much interest -- not sure how well OnAudioFilterRead is supported platform-wise (I know Android support is patchy!)

    According to the stats window the synth in the video takes 10-15% dsp load (windows, oldish i7 cpu).
    The DSP load figure is rather flaky though - it changes by as much as 100% depending on which gameObject is selected in the hierarchy?! Have tried to contact Unity for some help with that but no joy.

    I'm currently looking into reducing the load via more multithreading, using native code (only getting about a 5-10% improvement with that) and maybe try integrating via the Unity Audio SDK (mixer etc).
    I suspect maybe the OnAudioFilterRead method is being sidelined -- seems to be a high DSP load for not doing very much work. If only we had some standard like Apple's Accelerate api :rolleyes:
     
  5. _MGB_

    _MGB_

    Joined:
    Apr 24, 2010
    Posts:
    74
    @Docaroo it's taken me quite a while to get it all into working order! There's lots of DSP code on the web (musicdsp.org helped at the start, also Signal Processing Stack Exchange) but for the more in-depth stuff I've been reading lots of DSP books :eek:
     
  6. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,305
    it is supported as far as support goes - i.e. no restrictions per platform

    yes, measure it in a build, not in editor - you'd have to do it yourself though (there are more methods - own timers, or you can use builtin profile sampling)

    it depends how much work it is doing relative to the rest of the audio subsystem - at least that's what I think 0
    so in case of synthesis it might look rather expensive from audio point of view
    real CPU time should be neglecting on desktops

    I have no immediate use for it, but good job otherwise D
     
    _MGB_ likes this.
  7. _MGB_

    _MGB_

    Joined:
    Apr 24, 2010
    Posts:
    74
    Marald likes this.
  8. Marald

    Marald

    Joined:
    Jan 16, 2015
    Posts:
    42
    Thanks @_MGB_
    I never received a message from the forum you replied, so happy to have logged in since a while.

    I'm going to have a look at it. Very curious what you managed to build.

    If you are interested in joining my Audio Unity adventure and try out some stuff I'm doing in Unity & VR, you are welcome on my discord : https://discord.gg/zQ7zcprs4N