[AUDIO] Make proper frequencybars

  • Hello there,

    I'm trying to make something close to the gif I'm linking here, based on the example we can found in Construct.

    I'm trying a few stuff since a day or two now and I can't manage to make something close to what you can see in the gif I've bring here, does anyone have any clue how to make something close to that?

    My main problem being : Too many bars, not very accurate

    Thank you for your time!

    giphy.com/gifs/7OX3hQnGVdpqhtR9TX

  • If someone can manage to make that and make an example of it, I would gladly appreciate, because right now, I don't know where to look to make something close to that..

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Little bump, my demand is still active ^^

  • Hard part is understanding the floor to ceiling on the audio scale, I haven't figured that out yet, but I do

    Use slide bars for volume control.

  • Hard part is understanding the floor to ceiling on the audio scale, I haven't figured that out yet, but I do

    Use slide bars for volume control.

    I see, well, if anyone else has an idea or already made something close to that and want to share the solution, this is still active ^^

  • You mean like this?

    Download C3 file

    Download C2 File

  • is there a construct2 example too you can share?

  • totoe is there a construct2 example too you can share?

    No but it should apply to C2 also if you transfer the code to C2. Sadly has to be done manually since is not backwards compatible. I can transfer it myself if you have a bit of patience. :D

  • I have a lot of patience! Thanks

  • totoe I have a lot of patience!

    Links updated! Have fun!

    Giving the FFT size recommended for mobiles is around 64-128 and for desktops 512 -1024 but if u dont worry about the cpu utilization then u can try 2^12 = 4096 FFT size which is more responsive and smooth visual effect.

    Download C3 file

    Download C2 File

    Edited:

    Note 1):

    Keep in mind that the result of the quality of the effect is direct influenced by the Audio files MHz size or SampleRate a sample rate of 36000 MHz Or 48000 MHz is preferable for best results. However a 16000 MHz Sample Rate has pretty good visuals also.

    Note 2):

    Might not be the best result, or how it should be made, but fakes the effect pretty good the approach i took.

  • wow, thats your definition of patience ;)

    Thanks for sharing!

  • totoe wow, thats your definition of patience ;)

    Thanks for sharing!

    Yea lol... No problem man. I also opened a blog adding all the tutorials and examples i make in the forum in there. Can be found here

  • > totoe wow, thats your definition of patience ;)

    > Thanks for sharing!

    Yea lol... No problem man. I also opened a blog adding all the tutorials and examples i make in the forum in there. Can be found here

    Man that's absolutely great, glad to see that in my own code, I wasn't that far from your solution, I just had some issues with the FFT making my own bars (which aren't tiled background type but sprite type) accurate.

    I made my own sprite of frequency bars, will definitely try that out, thank your very much for your time and help! Appreciate it a lot man ;)

  • I made my own sprite of frequency bars, will definitely try that out, thank your very much for your time and help! Appreciate it a lot man ;)

    No problem, i made a quick update in the C3 file so the bars increases when beat hits instead of shrinking, everything else is the same, for those that have the C2 file you might want to change the

    from

    10+abs((Audio.AnalyserFreqBinAt("music",0,Self.binNR)*Gain))

    to

    250+((Audio.AnalyserFreqBinAt("music",0,Self.binNR)*Gain))

    it will react a bit better.

    Those that have C3 version just redownload the file.

    If you don't want the big gaps between bars you can change the condition on Line 5 from > to >= and that will make all bars dance all time while still react a bit better but isn't a big difference at that point from the default Construct Audio analyser template.

  • > I made my own sprite of frequency bars, will definitely try that out, thank your very much for your time and help! Appreciate it a lot man ;)

    No problem, i made a quick update in the C3 file so the bars increases when beat hits instead of shrinking, everything else is the same, for those that have the C2 file you might want to change the

    from

    10+abs((Audio.AnalyserFreqBinAt("music",0,Self.binNR)*Gain))

    to

    250+((Audio.AnalyserFreqBinAt("music",0,Self.binNR)*Gain))

    it will react a bit better.

    Those that have C3 version just redownload the file.

    If you don't want the big gaps between bars you can change the condition on Line 5 from > to >= and that will make all bars dance all time while still react a bit better but isn't a big difference at that point from the default Construct Audio analyser template.

    Indeed, that makes the difference! I changed a bit of your formula, and it's working fine! I've linked a gif of what I'm getting in my WIP game thanks to your help!

    Cheers man!

    giphy.com/gifs/cA3VBmcNidt9fqC2wR

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)