Forum
    • Categories
    • Register
    • Login
    1. Home
    2. iamlamprey
    • Profile
    • Following 0
    • Followers 1
    • Topics 27
    • Posts 120
    • Groups 0

    iamlamprey

    @iamlamprey

    57
    Reputation
    37
    Profile views
    120
    Posts
    1
    Followers
    0
    Following
    Joined
    Last Online

    iamlamprey Unfollow Follow

    Best posts made by iamlamprey

    • Introducing Altar (and looking for Windows testers)

      Hello friends.

      For the past few months I have been quietly working on a new guitar amp VST plugin, "Altar". The goal was to create something state-of-the-art, with a feature-set you'd only find in a $200 product.

      ...and make it completely free and open source:

      b1ba8de7-228e-4489-9ec8-11487fb865c7-{A8BFC142-DFC7-4939-9629-3C92829A3D6B}.png

      I am currently in need of testers and feedback for the Windows version (MacOS and hopefully standalone later). Please try to break the plugin, drag the modules around, create and load presets, make use of the Cab Designer and NAM models if you have them, and report any and all issues back here.

      DSP feedback is also appreciated, I'm not necessarily 100% happy with the sound of each module yet and will be tweaking them more over the next few weeks.

      (There's currently 3 cab IR's and no presets, the full release will have all of that included.)

      Download (Windows): https://iamlamprey.com/altar

      Features:

      • Full suite of high quality DSP modules, which can be re-ordered by dragging.
      • NAM support (writeup on this soon).
      • Cab-Designer to create your own impulse responses.
      • Realtime transpose and sub-octave layer with Rubberband.
      • Multiple modes per modules, like Reverse Delay, Glitch and Circuit-Bending.
      • In built utilities like Tuner and Click, Pre and Postprocess and output Limiter.

      I look forward to hearing back from everyone, thanks! 🥳

      posted in General Questions
      iamlampreyI
      iamlamprey
    • [Tutorial] Real-Time Pitch Shifting with Rubberband

      Hello my old friends.

      Here's how to get realtime Pitch-Shifting working with the Rubberband Library.

      First, your project either needs to be GPL (open-source), or you need to pay the developers of Rubberband for a license (and Christoph!). Also this is just for Windows, I don't use or own a Mac so YMMV.

      First, there's some dependancy conflicts between JUCE and Rubberband. To fix, we have to open the file:

      HISE/hi_tools/simple_css/Renderer.h

      And replace EVERY instance of the Rectangle class with juce::Rectangle instead. I've tried the preprocessor flags and it didn't fix the problem, so I just ended up replacing everything manually. Don't use Find & Replace, there's some other "Rectangle" variables that you don't want to override, just go through manually and replace every Rectangle with the strictly type juce variant.

      I also replaced the copy variable in the Positioner class to rectangleCopy because I think this will also cause problems on Windows. Lines 333 and 336.

      Next, in your Projucer, add the preprocessor flag HI_ENABLE_CUSTOM_NODES=1.

      Okay, now we can build HISE. When it's done, open a project and hit Tools -> Create C++ Third Party Node Template. Name it anything.

      We'll also need to tell HISE where our Custom Nodes are stored, open HISE Settings -> Development -> Custom Node Path and point it to {*YourProjectName*}\DspNetworks\ThirdParty. Click "Save".

      We just created our Third Party node, but it won't do much good without the Rubberband Library.

      Navigate to that same folder in a File Browser, there should be a src folder, if there isn't, create it. Clone the Rubberband Repository into that folder.

      Open your custom node in any editor. Let's start with the includes, which go AFTER the JUCE one:

      // Original Code:
      #pragma once
      #include <JuceHeader.h>
      
      // What we're adding:
      #include "src/rubberband/single/RubberBandSingle.cpp"
      #include "src/rubberband/rubberband/RubberBandStretcher.h"
      

      Inside the primary node struct, declare a unique pointer to hold our RubberBandStretcher:

      // Original Code:
      static constexpr int NumTables = 0;
      static constexpr int NumSliderPacks = 0;
      static constexpr int NumAudioFiles = 0;
      static constexpr int NumFilters = 0;
      static constexpr int NumDisplayBuffers = 0;
      
      // What we're adding:
      std::unique_ptr<RubberBand::RubberBandStretcher> rb;
      

      In the Prepare method, assign the RubberBandStretcher with the OptionProcessRealTime Option:

      void prepare(PrepareSpecs specs)
      {   
        rb = std::make_unique<RubberBand::RubberBandStretcher> (specs.sampleRate, specs.numChannels, RubberBand::RubberBandStretcher::Option::OptionProcessRealTime);
        rb->reset(); // not sure if this is necessary, but I don't think it hurts   
      }
      

      RubberBand uses Block-Based processing, not per-sample. So we'll use the process method, not the processFrame one:

      template <typename T> void process(T& data)
      {
        if (!rb) return; // safety check in case the rb object isn't constructed yet
      
        // "data" is given to us by HISE, it has multiple channels of audio values as Floats, as well as some utility functions:
        
        int numSamples = data.getNumSamples(); // the number of audio samples in the block
        auto ptrs = data.getRawDataPointers(); // RB expects Pointers, not just values
      
        rb->process(ptrs, numSamples, false); // This is the Pitch-Shifting Part
      
        // the "false" is just telling RB if we're using the last audio buffer, which we're not if it's realtime
      
        int available = rb->available(); // Checks to see if there is repitched audio available to return
      
        if (available >= numSamples)
        {
          // We have enough output, retrieve the repitched audio
          rb->retrieve(ptrs, numSamples);
        }     
      }
      

      Okay, we're almost there. We just need to tell the Pitch Shifter how much we want to shift the signal by. It uses a Frequency Ratio, so:

      1.0 = None
      0.5 = - Octave
      2.0 = + Octave
      

      If you'd prefer to have a Semitones-based control, I recommend using the conversion function in the ControlCallback of your UI element instead. It looks like this:

      // In the GUI Slider Control Callback
      // This assumes the Slider goes from -12 to +12, with a stepSize of 1.0
      
      inline function onknbPitchControl(component, value)
      {
        // bypass if semitones = 0 (save CPU & reduce latency)
        if (value == 0)
          pitchShifterFixed.setBypassed(true);
        else
          pitchShifterFixed.setBypassed(false);   
        
        // Calculate the FreqRatio from Semitone Values 
        local newPitch = Math.pow(2.0, value / 12.0);       
        pitchShifterFixed.setAttribute(pitchShifterFixed.FreqRatio, newPitch);
      };
      
      

      Either way, we need to connect our Custom Node's only Parameter to our RubberBand Object.

      In the createParameters method:

      void createParameters(ParameterDataList& data)
      {
        {
          // Create a parameter like this
          parameter::data p("FreqRatio", { 0.5, 2.0 }); // Between -1 Octave and +1 Octave
          // The template parameter (<0>) will be forwarded to setParameter<P>()
          registerCallback<0>(p);
          p.setDefaultValue(1.0);
          data.add(std::move(p));
        }
      }
      

      And finally, we connect the Parameter in the setParameters method:

      template <int P> void setParameter(double v)
      {
        if (P == 0) // This is our first paramater, if you add more, increment the index.
        {
          rb->setPitchScale(v); // passes the parameter value "v" to our pitch-shifter
        }
      }
      

      Okay, that's all the code we need.

      Now hit Export -> Compile DSP networks as dll.

      Assuming everything worked, you can now add a HardcodedMasterFX and load your pitch-shifter.

      Notes / Thoughts:

      1. I haven't tested this extensively, there might be other Includes that cause problems depending on your HISE installation.
      2. There's about 30-50ms Latency which is effectively unavoidable, the Pitch Shifter needs a window of a certain size in order to perform calculations.
      3. There might be other RubberBand::RubberBandStretcher::Option values that make it sound better for transients etc, I haven't tested them yet.
      4. Make sure your Parameter doesn't go to 0, as the Library uses it for dividing somewhere.

      Here's the full node, if you copy-paste it, make sure you rename it to whatever your node was or HISE won't find it:

      // ==================================| Third Party Node Template |==================================
      
      /*
      
      Don't forget, you have to replace every instance of Rectangle in HISE/hi_tools/simple_css/Renderer.h to juce::Rectangle
      
      And replace both "copy" variables in that same file with copyRectangle
      
      Then build HISE with HI_ENABLE_CUSTOM_NODES=1 preprocessor
      
      */
      
      #pragma once
      #include <JuceHeader.h>
      
      #include "src/rubberband/single/RubberBandSingle.cpp"
      #include "src/rubberband/rubberband/RubberBandStretcher.h"
      
      namespace project
      {
      using namespace juce;
      using namespace hise;
      using namespace scriptnode;
      
      // ==========================| The node class with all required callbacks |==========================
      
      template <int NV> struct rubberband: public data::base
      {
        // Metadata Definitions ------------------------------------------------------------------------
        
        SNEX_NODE(rubberband);
        
        struct MetadataClass
        {
          SN_NODE_ID("rubberband");
        };
        
        // set to true if you want this node to have a modulation dragger
        static constexpr bool isModNode() { return false; };
        static constexpr bool isPolyphonic() { return NV > 1; };
        // set to true if your node produces a tail
        static constexpr bool hasTail() { return false; };
        // set to true if your doesn't generate sound from silence and can be suspended when the input signal is silent
        static constexpr bool isSuspendedOnSilence() { return false; };
        // Undefine this method if you want a dynamic channel count
        static constexpr int getFixChannelAmount() { return 2; };
        
        // Define the amount and types of external data slots you want to use
        static constexpr int NumTables = 0;
        static constexpr int NumSliderPacks = 0;
        static constexpr int NumAudioFiles = 0;
        static constexpr int NumFilters = 0;
        static constexpr int NumDisplayBuffers = 0;
      
        // declare a unique_ptr to store our shifter
        std::unique_ptr<RubberBand::RubberBandStretcher> rb;
        
        // Scriptnode Callbacks ------------------------------------------------------------------------
        
        void prepare(PrepareSpecs specs)
        {   
          // assign the shifter to our pointer
          rb = std::make_unique<RubberBand::RubberBandStretcher> (specs.sampleRate, specs.numChannels, RubberBand::RubberBandStretcher::Option::OptionProcessRealTime);
          rb->reset(); // not sure if this is necessary, but I don't think it hurts   
        }
        
        void reset(){}    
        void handleHiseEvent(HiseEvent& e){}  
        
        template <typename T> void process(T& data)
        {
          if (!rb) return; // safety check in case the rb object isn't constructed yet
          
          int numSamples = data.getNumSamples();
          auto ptrs = data.getRawDataPointers(); // RB needs pointers
      
          rb->process(ptrs, numSamples, false); // 
      
          int available = rb->available();
      
          if (available >= numSamples)
          {
            // We have enough output, retrieve it directly
            rb->retrieve(ptrs, numSamples);
          }     
        }
        
        template <typename T> void processFrame(T& data){}
        
        int handleModulation(double& value)
        { 
          return 0;   
        }
        
        void setExternalData(const ExternalData& data, int index)
        {
          
        }
        // Parameter Functions -------------------------------------------------------------------------
        
        template <int P> void setParameter(double v)
        {
          if (P == 0)
          {
            if (!rb) return; // Safety check in case the Parameter is triggered before the rb object is constructed
            rb->setPitchScale(v); 
          }
          
        }
        
        void createParameters(ParameterDataList& data)
        {
          {
            // Create a parameter like this
            parameter::data p("FreqRatio", { 0.5, 2.0 });
            // The template parameter (<0>) will be forwarded to setParameter<P>()
            registerCallback<0>(p);
            p.setDefaultValue(1.0);
            data.add(std::move(p));
          }
        }
      };
      }
      
      posted in Blog Entries
      iamlampreyI
      iamlamprey
    • RE: So close to Rubberband-ing

      https://www.youtube.com/watch?v=ekapsMx8vR8

      (laughs in thall)

      Writeup soon 🙂

      posted in General Questions
      iamlampreyI
      iamlamprey
    • RE: Introducing Altar (and looking for Windows testers)

      Now with a fancy landing page & video:

      https://iamlamprey.com/altar

      https://www.youtube.com/watch?v=xOqfnTtuwT8

      (use this link for the latest version, the drive link is outdated)

      posted in General Questions
      iamlampreyI
      iamlamprey
    • RE: drawAnalyserPath but only some of it

      @d-healey No there's a duplicate of the chain purely for the FFT display (otherwise the output would be playing the dirac-delta sample)

      posted in Scripting
      iamlampreyI
      iamlamprey
    • RE: Checking the HISE Source with AI?

      HISE is a big codebase with a variety of dependencies, I think the risk of hallucination & context-rot is a lot bigger than your average JUCE plugin.

      There's also a lot of templated functions, specific versions of things like JUCE and the C++ version HISE uses which LLMs usually don't "keep in mind".

      Also GLM4.7 has noticeably outperformed Claude & GPT 5.2, at least in my own tests 🙂

      I'm sure Christoph uses some of these tools occasionally, but I think if he started depending on them for the short-term benefit we'd probably end up with a lot more bugs in the long term

      posted in General Questions
      iamlampreyI
      iamlamprey
    • RE: So close to Rubberband-ing

      @d-healey The actual DSP in the third-party node is pretty simple, the main stuff was getting all of the includes to work together (and using the right class in RB that doesn't need 2 separate buffers)

      The RB time-stretching stuff might also be possible using this third-party node and just swapping a few things out, I don't want to give out false hope just yet but

      posted in General Questions
      iamlampreyI
      iamlamprey
    • RE: So close to Rubberband-ing

      Progress! I have it compiling and "working" in Ableton, as long as I stick to ASIO and not MME (which means I can't record any clips just yet).

      MME / Windows Audio crashes instantly.

      posted in General Questions
      iamlampreyI
      iamlamprey
    • So close to Rubberband-ing

      Hello old friends.

      I have a real-time pitch-shifter working completely in HISE using Rubberband, but unfortunately it's throwing all kinds of strange errors when it comes time to export the .VST:

      0e5f6c96-61bf-4f36-9d6f-a2ec0a6bd182-image.png

      ChatGPT seems to think it has something to do with the Rubberband library using #include windows.h> before the JUCE stuff, which is causing clashes.

      Christoph also mentioned:

      @Christoph-Hart said in Connecting Rubberband Library for use in HISE:

      Just looked at their repo and it seems that they have a single .cpp file that you can add. Just include that in your node file and you should be good (you might have to adapt some Rubberband compiler flags to enable a single translation unit build).

      If anyone can help me finish this one, I'll post the full writeup for it on the forum 🙂

      posted in General Questions
      iamlampreyI
      iamlamprey
    • RE: Modeling an Analog EQ in HISE

      @andrei-s Either a complex transfer function (lots of maths) or a neural model like Wavenet or some of the stuff Christian Steinmetz was doing (also lots of math)

      posted in Scripting
      iamlampreyI
      iamlamprey

    Latest posts made by iamlamprey

    • (ScriptNode) Smeary Reverb / Washy Cymbals?

      I'm noodling at physically modeled drums, specifically cymbals and I need an efficient way to "smear" the excitation impulse

      I know the typical route is to use allpass filters in the delay line, but I find I have to use a math.mul at 0.5 just to keep the audio from blowing up.

      I currently have 5 delays with different fractional delay times and I'm also passing a long noise tail into it but it just sounds like a noisy sawtooth buzz rather than a nice chorusy wash.

      Not sure how to proceed towards that metallic ringing without overloading the delay lines or the CPU

      posted in ScriptNode
      iamlampreyI
      iamlamprey
    • RE: Checking the HISE Source with AI?

      HISE is a big codebase with a variety of dependencies, I think the risk of hallucination & context-rot is a lot bigger than your average JUCE plugin.

      There's also a lot of templated functions, specific versions of things like JUCE and the C++ version HISE uses which LLMs usually don't "keep in mind".

      Also GLM4.7 has noticeably outperformed Claude & GPT 5.2, at least in my own tests 🙂

      I'm sure Christoph uses some of these tools occasionally, but I think if he started depending on them for the short-term benefit we'd probably end up with a lot more bugs in the long term

      posted in General Questions
      iamlampreyI
      iamlamprey
    • RE: Apple is ridiculous

      @David-Healey said in Apple is ridiculous:

      Usually below that text you quoted there is a tiny link that says something like Continue on Web.

      yeh there's nothing, I've clicked every link on the page, I even tried signing out and clicking Subscribe and logging back in and it just flops

      I've opened a ticket but I assume the answer will be "use our 1.5 stars app"

      posted in General Questions
      iamlampreyI
      iamlamprey
    • Apple is ridiculous

      I'm trying to renew my apple developer subscription, instead of a "Renew" button, I'm greeted with this:

      a40e80bd-be73-4c7c-b2fb-a5fb32cd71ff-{6C058A2A-9B97-48B9-8122-E8588375F14D}.png

      I can't download the app from the app store (VM is using an older version of MacOS), and every support article, web link, even the emails they sent me with manual renew links, all just go straight back to the main account home page.

      Has anyone had to deal with this crap recently and found a solution? All of my other devices are PC so I can't download the Developer app at all

      posted in General Questions
      iamlampreyI
      iamlamprey
    • RE: Building a replication of a piece of gear I have (.NAM)

      @Orvillain I believe David made one into a pull request, one was from the forum (I think it was also David's, so it's probably a PR as well). the others were specific to the Rubberband library, but I'm no longer using it in Altar anyway, they were just namespace conflicts with using namespace juce

      posted in General Questions
      iamlampreyI
      iamlamprey
    • RE: Building a replication of a piece of gear I have (.NAM)

      @cemeterychips You can clone/download it or just copy the stuff you need from the amp.h file, you'll also have to get the dependencies like RTNeural and RTNeural-NAM

      If you don't know C++ concepts like pointers and classes/structs then it will be quite a struggle, and you'll also need to connect the NAM stuff to the interface if you want to dynamically load/swap models at runtime.

      Also I highly recommend David's course if you're new to HISE, before jumping into any C++ stuff:

      https://audiodevschool.com/courses/hise-bootcamp/

      posted in General Questions
      iamlampreyI
      iamlamprey
    • RE: Building a replication of a piece of gear I have (.NAM)

      @cemeterychips Altar has working NAM:

      https://github.com/nytemairqt/altar

      Check the DspNetworks/ThirdParty/amp.h file, it's using RTNeural & RTNeural-NAM

      Edit: Sorry didn't realize you were new to HISE, this is definitely a bit more advanced of an implementation, I had to go this route because I couldn't get the NAM node working

      posted in General Questions
      iamlampreyI
      iamlamprey
    • RE: So close to Rubberband-ing

      @parabuh I gave up trying and switched to Signalsmith which sounds better anyway (but has a bit more latency)

      posted in General Questions
      iamlampreyI
      iamlamprey
    • RE: Invalid use of incomplete type vSIMDType

      @David-Healey said in Invalid use of incomplete type vSIMDType:

      did you make a pull request?

      you vastly overestimate my understanding of git 😄

      posted in Bug Reports
      iamlampreyI
      iamlamprey
    • RE: C++ Version Preprocessor?

      @Christoph-Hart said in C++ Version Preprocessor?:

      everything will explode

      I am yet to experience an explosion, RTNeural-NAM is using std::span and the Linux/Mac compilers are complaining unless I switch the AutoGeneratedProject.jucer to C++20

      C++17 works fine on Windows so I'm not even sure if the span is ever actually created

      Edit: Yep it's some weird ghost function which isn't being called anywhere, might be for a specific edge-case but I can comment it out and use C++17

      posted in General Questions
      iamlampreyI
      iamlamprey