HISE Logo Forum
    • Categories
    • Register
    • Login

    FFT Analyser Path - Need help drawing the magnitude to height

    Scheduled Pinned Locked Moved Unsolved Scripting
    20 Posts 4 Posters 1.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • oskarshO
      oskarsh @ustk
      last edited by oskarsh

      @ustk @HISEnberg

      I am using a quite complex graphics but MacOS and even my cheap Windows system are working quite nicely.

      Main Light-min.png

      Not sure how to get the FFT performance up for these couple of Windows users and actually what is happening on their system. They use Win 11 Ableton 12. I also of that bug and the crashing of the DAW.

      @Christoph-Hart maybe you can help here or share some insights.

      1 Reply Last reply Reply Quote 0
      • HISEnbergH HISEnberg has marked this topic as unsolved on
      • HISEnbergH
        HISEnberg @oskarsh
        last edited by

        @oskarsh Ah very interesting you are coming across this issue as well!

        Ya I am finding that the IPP is boosting performance but isn't solving the issue for these handful of users. It's frustrating since 10% is too many user reports to ignore (maybe 5% would have been acceptable).

        I had the same exact experience as you. I booted up a 12 year old laptop that runs on Windows 8 (I thought it was dead) and ran my plugin without any problems. I also had another user who has nearly the exact same Windows setup as me (Lenovo Ideapad Slim7, Ryzen 7, AMD Radeon Graphics Card) reporting this issue.

        Maybe you will have better luck with this. I created a profiling script which records 1-5 seconds of the user interacting with the plugin. Afterwards it will just dump the snippet onto the users desktop. You can import the profiling session and get a snapshot of how the plugin is performing on the users system (time it takes for paint routines, processing on the different threads, control callbacks, etc.) No one sent me the file back but you could possibly ask one of your users to try this and get some insight into what aspect of the FFT is causing the plugin to choke.

        Christoph has actually already given me some advice here about what to do. The one thing I haven't tried which might solve this is setting your FFT script to a background task. I am still wrapping my head around how threading works in HISE (and audio plugins more generally), but I could see how an FFT which is communicating between the audio thread and the UI/Scripting threads could be unsafe if the pointers on the JUCE end aren't setup correctly. I think this is something that the Synth.deferCallbacks should be addressing but possibly not in this particular case.

        So if anyone has a snippet on how to use the background task API and can share I would really appreciate it!

        ustkU C 2 Replies Last reply Reply Quote 0
        • ustkU
          ustk @HISEnberg
          last edited by ustk

          @HISEnberg Perhaps something like this:

          HiseSnippet 1642.3ocuX0saaaCElxNJowKcnEXWLrqD5UtCot1yoosXXHt1ItKXMIFwYAcXnHiVh1hvRjZRT0wan.CX2zWgd01qQuYuA6p8BrGg9FrcHorsjkSyhQWLRaLO+wuygmyGYamPtMIJhGhLJcx3.BxXCytiYB2VtXJCs+tHiO0rc6SNaDU31DaObPHOl4bBNZHp43.bTDwAYXT7oRqMVeEj5y61oI1CyrIyDgPmxo1jmQ8ohYR6z3anddswNjSn9ordqF6ayYs3d7X.YEMqhBf8FOfbHVZVASzWiibQFetYsG8Xa7V1OX6Zjs5ssyCc1tm8irq2GW24wO.WW80sqWuNxX08bnBdXWAVPhPFqzj6LtqKeDSuAmRin87HxE0PcgcVKtM2yQlhRonVtTOmNSJYQHHJclU.KpKfeh4ATG5T4yJj2RovZlGoKfFExBuhYfWszvqZJ3s.HYjBRqngzsM6ZGRCDyzHwyGYtOSPB6igyozPQaKpveWzrEGrfIp3iGRZGBKl5Q4sqVcSK3ut6WVBrJh6QpX6QvgkAAkfCuHg0KwgVPuiNdset0WYoZspLfH1qeehsn7c.0VSzemrd1uunCyCbZBH.2Zw8C3LXQ46nUOmO61ra5cYWZTfGdbyXX2B6B8R.tysko81B7FhQNeKWMigGmXnztiIXmDixhklO8Dvn8XCnLnzDRfy0rCPkAKjtDRFXEfEtoRUs4c.gpfBezoakHhPNoD1B640ChV49wLaAkyJe2R+bo0gHVwFTcDK0V4BAyoL.UY7fv8J3OSBm.GpCX45U06z8uuUK0taIbIZbQYpu2aZHKQYdPVYMYysRBtJij3HIcfJTpLIYOAaeFG.YSYjhfJ6lVe+8psoE7CzQcuZu.9cEIXVOwgPR.LBIjUh0KsdHQDGxfrHaUoizji4wB.WyJJCTnYPk9.KyS77JqYThpLxkJHx3MP5qV5Tk87fDUuYCp3DhGoPuLk1TUOjYPB3qUQB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V+LIYc8FJIP6DScPst4Ax0V0Pub9r0m5POy1Nanx43WrrNVeYcbqk0wGrrNt8x53CWVGezk6n7+urmDK395m9ACDc1SOOarGCCupUMNh9W.KKnpjB
          

          Here it is only the path generation that is handled in the bg, not the painting. But I reckon the painting already happens in the bg as it is not in sync with the message thread (I might be wrong though...)

          Don't forget to handle the BG status and/or shouldAbort cases if needed

          Can't help pressing F5 in the forum...

          HISEnbergH 1 Reply Last reply Reply Quote 2
          • HISEnbergH
            HISEnberg @ustk
            last edited by

            @ustk Oh this is awesome, so much simpler than I anticipated! Have you used FFT displays in a panel (in a released project)? I am just wondering if @oskarsh and myself are doing something wrong here.

            ustkU 1 Reply Last reply Reply Quote 0
            • ustkU
              ustk @HISEnberg
              last edited by

              @HISEnberg Yes I do, but some very simple/small ones in a plugin and some much more complex in a standalone. None of them relying on a background task that having been said.
              But in the standalone FFT analyser I remember fighting against a lot of instabilities so I used some flags here and there. I don't remember exactly, but probably flags preventing a repaint until the new FFT path is sure to be ready (because it wasn't a simple path, it took a lot of cycles to generate...)

              Can't help pressing F5 in the forum...

              1 Reply Last reply Reply Quote 1
              • C
                Consint @HISEnberg
                last edited by

                @HISEnberg @oskarsh Has handling the FFT path in a background task solved the problem for you? A user described exactly the same problem to me with one of my plugins and I can't reproduce it. In Studio One on Windows 11, the plugin has so much lag that it is unusable for him and sometimes even crashes, whereas in Mixcraft it runs without any problems. I then installed Studio One in a Windows 10 VM for testing and the plugin runs without any problems.

                HISEnbergH 1 Reply Last reply Reply Quote 0
                • HISEnbergH
                  HISEnberg @Consint
                  last edited by

                  @Consint I kind of gave up on it and used HISE's stock FFT instead, I couldn't risk the issue coming up again. So in short I never tested moving it to a background task. I did edit my original code so that it only repaints when a new FFT path is shown and to reduce the amount of bins. According to the profiler it was more efficient than the stock FFT but this doesn't necessarily address the issue users are facing.

                  Sorry wish I could offer more help with this issue.

                  C 1 Reply Last reply Reply Quote 1
                  • C
                    Consint @HISEnberg
                    last edited by

                    @HISEnberg I tried it and it fixed the problem. It doesn't seem to have caused any other problems either. I did exactly as @ustk suggested and simply moved the path creation to a background task.

                    HISEnbergH 1 Reply Last reply Reply Quote 1
                    • HISEnbergH
                      HISEnberg @Consint
                      last edited by

                      @Consint Do you mind sharing an example snippet? I recall trying this but it didn't work in my case. Perhaps I was doing something incorrectly.

                      C 1 Reply Last reply Reply Quote 0
                      • C
                        Consint @HISEnberg
                        last edited by

                        @HISEnberg I couldn't make a better example snippet than @ustk has already done above. Maybe you can post your code and we can see if we can get it to work.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        32

                        Online

                        1.8k

                        Users

                        12.0k

                        Topics

                        104.2k

                        Posts