Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Question A possible invention for audio.

Discussion in 'Audio & Video' started by mikelowefedex, Nov 7, 2020.

  1. mikelowefedex

    mikelowefedex

    Joined:
    Sep 29, 2020
    Posts:
    139
    Hello,
    I discovered that when I added the audio echo filter to an audio source and changed the delay to a low number and made the decay ratio close to 1.0, it sounded as if my audio turned into a pitch. I wanted to make certain pitches, but noticed that the decay was 'limited' to integer values, so my pitches were 'limited'.

    Because I figured out how the echo filter worked, I was able to write my own c# script that got the output data from an audio source and put the data into samples. I was able to take those samples and set the data on a separate blank audio clip that played and looped. As it played and looped, the data that got set on that audio clip seemed to 'duplicate' the data that was from the audio source of a different game object that had a volume set to 0. Then, I took those samples and sent them through a function that 'reproduced' the audio echo filter effect in a way where I could 'float' the pitch instead (since the audio echo filter delay could only take integer values), and had the audio clip playing the data that got produced.

    I am able to get various pitches and it makes it turn regular talking, into singing because of a mathematical formula I put in the function. The only problem is, that since everything gets processed in samples (instead of a filter), there is 'tapping' in my audio every second. Wouldn't it be great if the developers could tweak the audio effect filter delay to take in floating values, so we could invent a way to convert regular voices into singing and music?
     
  2. aihodge

    aihodge

    Joined:
    Nov 23, 2014
    Posts:
    163
    Sounds like you're doing something akin to Karplus-Strong synthesis which involves modulating a delay line to achieve synthesis of various timbres. One thing you could try doing is applying different windowing functions to the frames of audio samples to reduce the "tapping" sound you're hearing, which is likely due to audio aliasing i.e. the last sample in a frame is at a different value than the first sample of the next frame.