HISE Logo Forum
    • Categories
    • Register
    • Login

    custom C++ module

    Scheduled Pinned Locked Moved General Questions
    17 Posts 6 Posters 783 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.
    • hisefiloH
      hisefilo
      last edited by

      Let's say I want to create a custom module (a sinewave bank). Where should I start reading? What's the procedure? Supposing some knowledge of C++

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

        Link Preview Image
        HISE C++ API

        favicon

        (hise.audio)

        and yes, knowing C++ if you want to write something in C++ might come in handy, otherwise your fight against the compiler will be very frustrating :)

        hisefiloH 1 Reply Last reply Reply Quote 3
        • hisefiloH
          hisefilo @Christoph Hart
          last edited by hisefilo

          @Christoph-Hart Cool!! let me ask. Let's say I can create a sinewave bank. Allowing 200 or more sinewaves (in a csound additive synth opcode way). Will make hise UX slow as when I add 100 or more in the traditional way?

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

            No of course not - whats slowing down the HISE UI is having thousands of modules that are all updated every 30ms.

            hisefiloH 1 Reply Last reply Reply Quote 0
            • hisefiloH
              hisefilo @Christoph Hart
              last edited by hisefilo

              @Christoph-Hart awesome!!! In the meanwhile where can I change in the source that refresh rate to see if I can use Hise today without that lag I'm facing?

              1 Reply Last reply Reply Quote 0
              • JayJ
                Jay
                last edited by Jay

                how about: custom C++ module, using HISE for the interface?

                Joansi Villalona

                hisefiloH 1 Reply Last reply Reply Quote 0
                • hisefiloH
                  hisefilo @Jay
                  last edited by hisefilo

                  @Jay I'm totally a newbie on C++. A friend of mine is helping. Anyway is harder than I thought

                  1 Reply Last reply Reply Quote 0
                  • O
                    Orvillain
                    last edited by

                    Hey, sorry for the necro bump. Has anyone had any success doing this???

                    I've gotten as far as adding some functionality to the AudioLoopPlayer class, but I don't know how to expose the data into the HISE scripting interface or UI. So I can't solidly check whether my code is actually doing the right thing.

                    A 1 Reply Last reply Reply Quote 0
                    • A
                      aaronventure @Orvillain
                      last edited by

                      @Orvillain

                      @griffinboy is your dude, other than the boss himself

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

                        @aaronventure

                        Ah I wouldn't be so sure!
                        C++ nodes are my specialty: but my efforts to create fully embedded Hise modules haven't been successful in the past, and honestly I haven't made an effort to succeed yet. I wanted to minimise the amount of fiddling I have to do with the source code every time I want to update Hise to a new version.

                        I thought that I'd ask for some extra features in the c++ nodes down the line to resolve a few of the limitations when it comes to interfacing with the rest of Hise (for things such as graphics and communication of long pieces data).

                        (If you need help creating a c++ script node synth node for additve, that's another story, that's not tricky. The hard part is efficiency using vectorized math etc)

                        O 1 Reply Last reply Reply Quote 1
                        • O
                          Orvillain @griffinboy
                          last edited by

                          @griffinboy

                          I've built a transient detector in two places, I wanted to compare for performance.

                          The first implementation is directly in Hise, straight into the Interface.js script. Just blagging it really, using:

                          const var AudioLoopPlayer1 = Synth.getAudioSampleProcessor("Audio Loop Player1");
                          const var AudioFile = AudioLoopPlayer1.getAudioFile(0);
                          const var AudioChannels = AudioFile.getContent();
                          

                          And then processing the raw sample data right there. But daaaayyyyummmm this is slow. Even if I process in blocks of 32-128, it is slow.

                          The second place is directly in the AudioLoopPlayer class. But as you rightly point out, building it there will require rebuilding HISE, and re-applying my updates each time I increment my HISE version. The only reason I was looking at this was for performance.

                          I haven't yet looked into doing a SNEX node for it, and I'm not sure if it is even possible.

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

                            @Orvillain

                            C++ scriptnode nodes exist. And you don't have to rewrite any hise source code for that (unless you need to use some external libraries that require that).

                            The performance of c++ nodes isn't too bad. I haven't compared it against doing straight c++, that would be an interesting thing to benchmark.

                            O 1 Reply Last reply Reply Quote 0
                            • O
                              Orvillain @griffinboy
                              last edited by

                              @griffinboy I guess what I don't quite get is how I would get my transient positions out of a SNEX or c++ scriptnode, and back into the scripting interface so I can draw them on the UI, or otherwise use that data for other things.

                              Which is why I've shied away from doing it that way.

                              griffinboyG A 2 Replies Last reply Reply Quote 0
                              • griffinboyG
                                griffinboy @Orvillain
                                last edited by griffinboy

                                @Orvillain

                                Yep that's to me, one of the big current limitations to nodes. There is likely a way to do it though. I'll have to ask @Christoph-Hart for his opinion

                                Currently you can communicate with Hise from a custom node using methods like global cables, external data.
                                I wonder whether we could get a slot for custom data, like for arrays, that is shared between hise UI and custom nodes...

                                Then again, there is likely an existing solution that I'm probably ignorant to.

                                1 Reply Last reply Reply Quote 1
                                • A
                                  aaronventure @Orvillain
                                  last edited by

                                  @Orvillain either a global cable which will fire a callback in your script/s every time it sends data or you have a continuous stream of data being output from snex/cpp/faust that you then pick up with the peak/peak_unscaled node, set that node's buffer to external, and then either get data from it on a timer or use a tile (which has a much better graphical performance)

                                  O 1 Reply Last reply Reply Quote 0
                                  • O
                                    Orvillain @aaronventure
                                    last edited by

                                    @aaronventure Interesting. I genuinely don't know anything about global cables and my ScriptNode understanding is also fairly limited. Guess I need to study up!

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

                                      @Orvillain

                                      Global cable only allows you to send one value.
                                      Search for my posts on the forum about c++ nodes with global cable to see.

                                      I don't think you can send an array via GC, but maybe I'm wrong

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

                                      52

                                      Online

                                      1.7k

                                      Users

                                      11.7k

                                      Topics

                                      101.8k

                                      Posts