HISE Logo Forum
    • Categories
    • Register
    • Login

    Reference External C++ Node as Audio Sample script - is it possible?

    Scheduled Pinned Locked Moved Unsolved Feature Requests
    11 Posts 3 Posters 111 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.
    • HISEnbergH
      HISEnberg
      last edited by

      Just as the title says, is it possible to reference or copy the buffer from my C++ node (similar to the Audio Loop Player for example)?

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

        @Christoph-Hart do you know if this is possible with the current C++ template?

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

          @HISEnberg sure, just set static constexpr int NumAudioFiles=0 to 1.

          griffinboyG 1 Reply Last reply Reply Quote 1
          • griffinboyG
            griffinboy @Christoph Hart
            last edited by griffinboy

            @Christoph-Hart

            Can you push to that buffer from inside the c++ node though?

            I think @HISEnberg is wanting to generate an audio file in c++, then push it out to the Hise script?

            I might be wrong.

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

              @griffinboy ah ok, I think you can use a global cable's data callback for that. The buffer will be copied though so it's not the fastest way (and definitely not realtime compatible).

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

                @Christoph-Hart

                yeah that was my thinking.
                But I'm not certain whether that's the case @HISEnberg was asking about or not!

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

                  @griffinboy Yup this is exactly what I am aiming for.

                  I more or less assumed it would not be real-time compatible. My goal is to have this functioning with a custom built Ring-Buffer but I'm still hazy about how I could possibly render/copy a buffer.

                  I'll attempt dealing with the rendering time afterwards (my buffer can currently go up to 60 seconds which, at higher sampling rates, could be a huge amount of data to render). I'll start small and try the global cable's first and report back shortly!

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

                    @HISEnberg what's the high level concept that you're trying to implement? Maybe there's another route.

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

                      @Christoph-Hart Essentially we are working towards a live audio-looper with overdubbing. Enso by Audio Damage is the inspiration behind it.

                      The idea is that once the user is happy with their loop they can render it to an audio file and drag it into a DAW (just .wav file format to start). This is where I imagine inheriting for the AudioSampleProcessor (and AudioFile API) can come in handy, though I am not sure how to make that "jump" happen since it is expecting a pre-rendered/non-changing audio buffer.

                      Personally I don't see the big fuss since a user can just record the output in their DAW but this is the requested feature. For that reason I don't think real-time compatibility is completely necessary--I just need a way to access the buffer and/or render it to disk (i.e. pause audio processing and export the buffer).

                      The other consideration is this is part of a modular/dynamic FX system, so it will be possible to move the looper around. That means I need to set up a way of storing the buffer and copying it over to it's new location (but this is long term, I may just end up clearing it and initiating a new instance of the looper).

                      Your Global cable idea is interesting but now I am wondering what the overhead will be since the buffer is continuously recording and overwriting, I'd also need to make sure the data transmitted over the cable is aware when the buffer is full and overwriting. I also see a lot of concerns with 60-seconds of stereo buffers at something like 96kHz being well over 10MB of data....

                      I'll start simple with static constexpr int NumAudioFiles=1. If I follow this will give me access to the MultiChannelAudioBuffer, which stores the full audio data (not just the visual representation)? From there I could access it from HISEScript and use methods like toBase64String() for serialization and direct file export? I'm just glossing over the HISE source code so correct me where I am going wrong!

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

                        @HISEnberg what's wrong with the recorder node?

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

                          @Christoph-Hart I'll try it again but last time I tried it failed to compile. The recorder node is more or less what I am after though. There's a number of features my node possesses that aren't featured here like playback speed, reversing, etc. But I should study this node and see if I can't replicate it.

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

                          14

                          Online

                          2.0k

                          Users

                          12.7k

                          Topics

                          110.1k

                          Posts