Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Audio Create music from manipulated spectrum data?

Discussion in 'Audio & Video' started by Seeyasia, Jun 8, 2018.

  1. Seeyasia

    Seeyasia

    Joined:
    May 20, 2018
    Posts:
    2
    Hello!

    I have a working music visualizer, but I'm looking for a way to manipulate the music file before playing it in real time(ish).

    I'm looking to extract the spectrum data from a song but NOT play it (at least loud for the player to hear), collect the spectrum data and in real time feed that data back out as music. So, if we didn't manipulate the spectrum data at all, it would simply play the music. But if we wanted to, we could turn specific hertz off completely or alter their amplitude before outputting it.

    So for example, the song is playing, but if you hold space bar, 50-80hz will turn off but the rest of the music would play normal.

    I suppose it's kind of like a synthesizer through C#. Or is there a better way of doing what I'm trying to do?

    Thanks!
    Sia
     
  2. wheatgrinder

    wheatgrinder

    Joined:
    Mar 20, 2015
    Posts:
    21
    what you described is an equalizer. Cutting and boosting specific bands of frequencies is easy. You can do it right in the editor by adding an effect to the mixer group.

    I imagine your ideas is not that simple though. Probably you will want keep the spectrum data to do something interesting, visualizer etc.. but then have a equalizer setup to cut and boost those same frequency bands. If you EQ - BEFORE the spectrum work then the spectrum will reflect the cut\boosted frequencies, do it after, then the sound might change but the spectrum data wont, and any visualization will not be affected.

    I dont see any reason to do the read of the sound in advanced, eq'ing is trivial compared to the compute power needed to do the FFT's for the spectrum data.