HISE Logo Forum
    • Categories
    • Register
    • Login

    Spectral Analyser / Ever made one?

    Scheduled Pinned Locked Moved Scripting
    21 Posts 5 Posters 573 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.
    • ChazroxC
      Chazrox @ustk
      last edited by

      @ustk Do you have a basic example of this you can share? I dont think im aiming for "real time" in a sense that these values have to be calculated during playback. Im guessing I want to use Scriptnode to build some chain but this is new territory for me so im not sure what modules are needed. I can guess that I probably need an audio file drop window that feeds it to an audio player, but thats as far as I can see at the moment. I can explain the logic, but Im unfamiliar with the implementation.

      HiseSnippet 1825.3oc0XstaaaCEVJIJcwsaXcnXX+ZfHXXPoKyUJNIKEAEMWcavZR7hcS6+Jnkns3hDolHUb8F5+2azdM1iReC1NjTxVt0MKyqs.yAHw7bg76b34FSqLd.QH3YV105LLkXYeKm1CYxn8ivTl0QGXY+0Nm18mIARzwXFMMOFKobFpUFNPRCHV6MLEKDjPKa64ejRG6kVvR+40ObObLlAxLhjk04bPomPSnxwTasyORiiahCIcnIUjd8cNJfy1mGyyA7MuimUJN3BbexIXkXy4X8XrHxx9tNqsVufs771pQiM7v3FgX759jF2mzaydAa3ceuvta3A+rok8hGFRk7r1RrjHrrWXOd3v1Q7ALyAbNUP6FSTK7sZCmrgbSdbnxDUTs1OhFG1pzwIrrrcZM1MNuwMdGmiogzQzG6N+bMCzXMp5.smaR3M+DvyuJ77p.uo.I6JPZACjtsS6fLZpbLGEdtoyQLIIqG9MtKMxZM2e33rOGjfIqmfufzLCVLRC2M87VEA+ZksqU6d2CseFA.NBi5l2qGICMfJifUBBbOFhhIr9xnZv2ERzk3LTWzCP6okrdfVS20W22yqd410CBKPTIJO0rSBdBAkgYg7Djf1mgiQeORNfCKXDjX.gjJP.aifLNUPpkQ5C5Kg.K3vfsdaMkPRrDaH3CmUOdlq.QYntqT62psj.3bLVFUG1WWix.h.xemRiMP28M4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2J6B80Qw2srugw2KzN4Wz6k9V6FGyGnRpoEQovcflVKd7vzHNiFnHYjnDo6lnlQnDtvn8cvzXUXc6bnnMK7TVaPX86Irm+bnAmdiugCL5TcvPl6DdHvZwlvCS3YCagUkEtsipdFDbpFwbTP5DXsZbh4gESvVsqkOAw33.TmnKUAO.wd9J02Lgn54C.llC5Hw4JtP2CqyUg.J6Qum5DpQ8pgE6w4Wjf091YpJZ0zyOyv7lNsAKW+dNsc+k50nmgujfdjYVOdl+U7Dt+759Dtzq8S3NMPBGeGXtXQJWLwF2ljP6.sADUI9TA7lCxublJNpJ8843rox50OrIXjSUm1XYtY91xXsJkIm+pdY36LibxNFUjeJEvV3C0yDW35US8peE6+C5RNQKfkJwXappz8grKIwPRhFieAjUzCmGKKoNYP9wbFurJz3HfyHPIz98IYUw9TMnckRX16wTtyNmQhI3pQyeyNOAhBwYGqKJMS9B++0sCm580W4XfKRkYh9ubu8QML6JmzY9q0jNu2w6rO0y6Gn7wnW+GiyHAGjweQfYDIUr7mno.1MS2.dImiUqQ9VWZ5YN9NNApJ9hffI2p2Rw0lUEaLqJt9rp3FyphaNqJ9Cypha8Oqnpo0t4RdhIk0x53VGpGkw117uRRmcX82PtAWoA
      

      The analyser shows the signals that @Christoph-Hart baked into it, how do I feed my own information into this script?

      Screenshot 2025-08-14 at 11.59.15β€―AM.png

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

        @Chazrox Scriptnode is not necessary if you don't go real time, so Chris's example has already (almost) what you need.
        Ok you want to display an FFT, but from what source? sampler? internal AF? user drag/drop AF?
        You must start here, then it'll only be a matter of getting a reference of that AF and feed the buffer.

        Here's a starting point

        inline function onButton1Control(component, value)
        {
        	if (value)
        	{
        		FileSystem.browse(FileSystem.Desktop, false, "", function(result)
        		{
        			arrayOfBuffers = result.loadAsAudioFile();
        			
        			// do fft with this array of buffers
        		});
        	}
        };
        
        Content.getComponent("Button1").setControlCallback(onButton1Control);
        

        Hise made me an F5 dude, browser just suffers...

        ChazroxC 1 Reply Last reply Reply Quote 2
        • ChazroxC
          Chazrox @ustk
          last edited by Chazrox

          @ustk Thank You πŸ™

          Im going to script a custom drop panel that will feed an audio file into an audio player. Atleast thats what I think I should do? Then run your script either in a button or inline my DROP script to run automatically. Am I right so far with using an AudioPlayer for that?..because I know we can just read the file AND load the audio file for auditioning at the same time, right?

          Christoph HartC ustkU 2 Replies Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart @Chazrox
            last edited by

            @Chazrox no need for a audio player for a simple playback you can just use Engine.playBuffer()

            ChazroxC 1 Reply Last reply Reply Quote 1
            • ustkU
              ustk @Chazrox
              last edited by

              @Chazrox Yeah AFs in Hise can be fetched from anywhere, AudioPlayer, Scriptnode, Sampler, etc...
              The methods can differ but I imagine there are some examples in the doc and the snippet browser

              Hise made me an F5 dude, browser just suffers...

              1 Reply Last reply Reply Quote 0
              • ChazroxC
                Chazrox @Christoph Hart
                last edited by Chazrox

                @Christoph-Hart hmm! I def have some reading to do. This is exciting. Anything you can recommend I read in documentation?

                @ustk speaking of 'methods' im investigating and got these...

                  {
                    "normalise": Method,
                    "toCharString": Method,
                    "detectPitch": Method,
                    "indexOfPeak": Method,
                    "toBase64": Method,
                    "fromBase64": Method,
                    "getMagnitude": Method,
                    "getRMSLevel": Method,
                    "trim": Method,
                    "getPeakRange": Method
                  }
                
                

                All new to me but looks promising! πŸ™

                I have no idea what "Method" is referring to tho. Never seen this before.

                Christoph HartC 1 Reply Last reply Reply Quote 0
                • Christoph HartC
                  Christoph Hart @Chazrox
                  last edited by

                  @Chazrox start from here:

                  Link Preview Image
                  HISE | Scripting | Buffer

                  A buffer of floating point data

                  favicon

                  (docs.hise.audio)

                  ChazroxC 1 Reply Last reply Reply Quote 0
                  • ChazroxC
                    Chazrox @Christoph Hart
                    last edited by

                    @Christoph-Hart Thanks! Reading that now.

                    1 Reply Last reply Reply Quote 0
                    • resonantR
                      resonant
                      last edited by resonant

                      Sorry if this is an irrelevant question, but how can we use this with online processing?

                      For example, online pitch detection?

                      ChazroxC 2 Replies Last reply Reply Quote 1
                      • ChazroxC
                        Chazrox @resonant
                        last edited by

                        @resonant i'd like to know that too haha.

                        1 Reply Last reply Reply Quote 0
                        • ChazroxC
                          Chazrox @resonant
                          last edited by

                          @resonant do you already know how to do offline analyzing?

                          resonantR 1 Reply Last reply Reply Quote 0
                          • resonantR
                            resonant @Chazrox
                            last edited by

                            @Chazrox said in Spectral Analyser / Ever made one?:

                            @resonant do you already know how to do offline analyzing?

                            No I don’t know how to do that. But I’d really like to know real time spectral processing with Hise.

                            griffinboyG 1 Reply Last reply Reply Quote 0
                            • griffinboyG
                              griffinboy @resonant
                              last edited by

                              @resonant

                              C++ nodes can do it.

                              C++ nodes into c++ graphics.

                              ChazroxC 1 Reply Last reply Reply Quote 2
                              • ChazroxC
                                Chazrox @griffinboy
                                last edited by

                                @griffinboy Can you suggest any reading material on DSP/C++ coding? I'd like to start studying that as well! πŸ™

                                griffinboyG 1 Reply Last reply Reply Quote 0
                                • griffinboyG
                                  griffinboy @Chazrox
                                  last edited by griffinboy

                                  @Chazrox

                                  Honestly I've never read any! I learnt by jumping in the deep end.

                                  Snex is almost c++
                                  I recommend looking at the waveshaper snex nodes on the forum and asking chat gpt to explain what's happening in the code until you understand it.
                                  That's how I got my start.

                                  That, or you could watch my old not-that-great Hise c++ video, if you want to jump right into hise c++ dsp.
                                  (Windows only sorry, I do plan on doing a series on this at somepoint for both platforms)

                                  Link Preview Image
                                  [Tutorial] How to create a c++ custom node

                                  How to create a custom node, as promised. I apologise in advance for the awful quality video (quite dry and boring)! But the good news is that I have some ni...

                                  favicon

                                  Forum (forum.hise.audio)

                                  For general reading material, I've never read any. I jumped straight into reading the latest papers on the area I was interested in, circuit modelling.

                                  No matter your area of interest, I recommend making waveshaper distortions for starters. It's a simple dsp concept and it'll get you to grips with almost every aspect of making dsp as you progress to the more advanced shapers that contain filters etc.

                                  ChazroxC 1 Reply Last reply Reply Quote 3
                                  • ChazroxC
                                    Chazrox @griffinboy
                                    last edited by

                                    @griffinboy Sick! I was just gonna ask if somebody has ever made a video about this! πŸ™ This looks like fun. Thanks!

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

                                    24

                                    Online

                                    1.9k

                                    Users

                                    12.4k

                                    Topics

                                    108.2k

                                    Posts