Forum
    • Categories
    • Register
    • Login

    Roadmap to HISE 5

    Scheduled Pinned Locked Moved General Questions
    140 Posts 18 Posters 41.5k 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.
    • LindonL
      Lindon @Lindon
      last edited by Lindon

      So thinking about this some more - and Im not sure if this is in(Im guessing not) or even possible in the new system: ....

      Modulation data is generated on note events (envelopes, LFO, velocity curves etc.). It would be very very useful if we had (possibly additional) modulator types that sent modulation data on channels that matched the midi channel of the note that triggered them, and "modulation receivers" (like the Global Time variant Modulators) that could be scripted to "listen" on specific channels....

      It would add to the flexibility of the modulation system enormously...

      HISE Development for hire.
      www.channelrobot.com

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

        @Christoph-Hart

        Only reason I asked about oversampling is because then you can do phase warping at runtime : )

        • you could always update the default c++ node template with some commented out examples. I've done this myself to keep track of different features and their api

        Or perhaps the hise docs could have some stuff written up for the c++ nodes? I think there is almost no detail on the docs

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

          @Christoph-Hart said in Roadmap to HISE 5:

          @Orvillain haha, I think you became victim of the worst UX in HISE, but since I crammed that feature in last minute I haven't spent too many brain cells on how to present that feature :)

          You must not set the ID of the matrix modulator to the same string (the ID must always be unique), instead, you need to enter the ID you want to use for both matrixes in the hidden and unlabeled text editor that shows up when you click on "Edit range properties" next to the button. This will be set to the ID as a default value but if you change it there, it will override the matrix target ID that is otherwise taken from the module ID as default behaviour.

          Yeah that's what I did!

          Snippet is working on Windows here anyway. I think I must've just forgot to compile when I tried it for the first time.

          Cheers!

          Musician - Instrument Designer - Sonic Architect - Creative Product Owner
          Crafting sound at every level. From strings to signal paths, samples to systems.

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

            @griffinboy yes good idea, and yes the C++ API documentation is seriously lacking, but one thing after the other.

            I've just made a small example - a C++ node that wraps a pitch_mod node and a core::oscillator and then uses the API to pickup the pitch modulation from HISE and apply it to the oscillator frequency. This shows how to pickup modulation signals from HISE and use them however you like - using the core::extra_mod class works the exact same way.

            This can be easily rewritten to a template that you can feed any sound generator type into to pickup the pitch modulation.

            template <int NV> struct osc_with_pitchmod: public data::base
            {
                // set this to false and this class will use audio rate pitch modulation instead of the downsampled resolution. 
                // This comes with a little overhead because it needs to resort to per frame processing in that case so it's disabled by default.
                static constexpr bool UseControlRate = true;
                
                // This can be any C++ oscillator class that follows the scriptnode API
                // The only requirement is that it must have a setPitchMultiplier() method
                // which will be used to set the pitch ratio accordingly.
                using OscillatorType = core::oscillator<NV>;
                
            	SNEX_NODE(osc_with_pitchmod);
            	
            	struct MetadataClass
            	{
            		SN_NODE_ID("osc_with_pitchmod");
            	};
            	
            	static constexpr bool isModNode() { return false; };
            	static constexpr bool isPolyphonic() { return NV > 1; };
            	static constexpr bool hasTail() { return true; };
            	static constexpr bool isSuspendedOnSilence() { return false; };
            	static constexpr int getFixChannelAmount() { return 2; };
            	
            	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;
            	
            	// Scriptnode Callbacks ------------------------------------------------------------------------
            	
                osc_with_pitchmod()
                {
                    // we want the pitch mod to copy the pitch modulation values
                    // to our temporary buffer so we can apply it to the oscillator
                    pitchMod.setProcessSignal(true);
                }
                
                // now we just forward all callbacks to both objects
            	void prepare(PrepareSpecs specs)
            	{
                    osc.prepare(specs);
                    
                    if(UseControlRate && specs.blockSize > 1)
                    {
                        specs.sampleRate /= HISE_CONTROL_RATE_DOWNSAMPLING_FACTOR;
                        specs.blockSize /= HISE_CONTROL_RATE_DOWNSAMPLING_FACTOR;
                    }
            
                    pitchMod.prepare(specs);
            
                    // make sure that the pitch mod buffer is initialised
                    // to the correct size
                    specs.numChannels = 1;
                    FrameConverters::increaseBuffer(pitchSignal, specs);
            	}
            	
            	void reset()
            	{
                    pitchMod.reset();
                    osc.reset();
            	}
            	
            	void handleHiseEvent(HiseEvent& e)
            	{
                    pitchMod.handleHiseEvent(e);
                    osc.handleHiseEvent(e);
            	}
            	
            	template <typename T> void process(T& data)
            	{
                    // create a ProcessData<1> object with our temp buffer
                    // as data and feed that to the pitch mod so that it
                    // copies the pitch modulation values coming from HISE
                    // into our buffer
                    float* pd[1] = { pitchSignal.begin() };
                    
                    auto numPitchSamples = data.getNumSamples();
                    
                    if constexpr (UseControlRate)
                        numPitchSamples /= HISE_CONTROL_RATE_DOWNSAMPLING_FACTOR;
                    
                    ProcessData<1> pitchData(pd, numPitchSamples, 1);
                    pitchMod.process(pitchData);
                    
                    if constexpr (UseControlRate)
                    {
                        // now we chunk the buffer into blocks of 8 (default control raster).
                        // this is essentially the same as a container::fix_block<8> container.
                        ChunkableProcessData<T, false> cd(data);
                        int pitchIndex = 0;
                        
                        while(cd)
                        {
                            auto numToSlice = jmin(cd.getNumLeft(), HISE_CONTROL_RATE_DOWNSAMPLING_FACTOR);
                            jassert(numToSlice == HISE_CONTROL_RATE_DOWNSAMPLING_FACTOR);
                            auto sd = cd.getChunk(numToSlice);
                            
                            jassert(isPositiveAndBelow(pitchIndex, numPitchSamples));
                            
                            auto pitchRatio = pd[0][pitchIndex++];
                            osc.setPitchMultiplier(pitchRatio);
                            osc.process(sd.toData());
                        }
                    }
                    else
                    {
                        // otherwise we use frame processing to iterate over each sample
                        // and before calculating the next oscillator sample we
                        // update the pitch ratio.
                        auto fd = data.template as<ProcessData<2>>().toFrameData();
                        
                        int pitchIndex = 0;
                        
                        while(fd.next())
                        {
                            auto pitchRatio = pd[0][pitchIndex++];
                            osc.setPitchMultiplier(pitchRatio);
                            osc.processFrame(fd.toSpan());
                        }
                        
                        // copy the left channel to the right one.
                        data[1] = data[0];
                    }
            	}
            	
            	template <typename T> void processFrame(T& data)
            	{
                    span<float, 1> pd;
                    pitchMod.processFrame(pd);
                    osc.setPitchMultiplier(pd[0]);
                    osc.processFrame(data);
            	}
            	
                //SN_EMPTY_HANDLE_MOD();
            //    SN_EMPTY_SET_EXTERNAL_DATA();
                
                // now this is important: you need to define this method and forward it to any
                // member that connects to a HISE modulation chain for the pitch modulation to work!
                void connectToRuntimeTarget(bool addConnection, const runtime_target::connection& c)
                {
                    pitchMod.connectToRuntimeTarget(addConnection, c);
                }
            
            	template <int P> void setParameter(double v) {}
            	void createParameters(ParameterDataList& data) {}
                
                // this is the pitch_mod node that picks up the pitch modulation from HISE
                core::pitch_mod<NV> pitchMod;
                
                // this is our oscillator. You can plugin any other class that has a
                // setPitchMultiplier method (where the pitch ratio is being applied.
                OscillatorType osc;
                
                // We'll "render" the pitch signal into a separate audio buffer
                heap<float> pitchSignal;
            };
            
            1 Reply Last reply Reply Quote 4
            • OrvillainO
              Orvillain
              last edited by

              Assigning a matrix modulator to the wavetable table index seems a little odd....

              Here's the first case:
              e29182a0-79bd-48c3-9130-4a0be4c72ffc-image.png

              Assigning it to the Table Index parameter (unipolar), no matter what ranges I set, it never seems to adjust the Table Index parameter.

              Second case. If I want unipolar control I have to setup the matrix modulator to control Table Index Bipolar, like this:
              0b6bc093-8e7f-4d3b-81cc-eca5ef3cd8ca-image.png

              If I set the input and output range to 0.0 - 1.0, then the modulator can be bipolar, going from -100% to 100% ... which in the case of a wavetable, results in half of the range basically making no audible difference when used as a static value. I guess it would make a difference if you had a bunch of stuff setup to modulate all at once.

              Anyway, I just found the setup a little odd is all.

              Musician - Instrument Designer - Sonic Architect - Creative Product Owner
              Crafting sound at every level. From strings to signal paths, samples to systems.

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

                @Orvillain you're missing the beauty of the matrix modulator: you can bypass all that weirdness and combine & set the mode of each modulation source within the matrix:

                • ignore the Table Index Bipolar chain. This is a relict from ancient times where I tried to slap the ability of using different modulation modes for a parameter (same with the Filter). They stay around for backwards compatibility, but you should never touch them in a new project.
                • Just add the matrix modulator in the TableIndex modulation chain, set the Table Index parameter to 100% so that it covers the entire range and then hack away with adding modulation connections to the matrix. The base value of the table position is then controlled by the Value parameter of the matrix modulator - that's also what you will connect the knob on your UI to.
                • Also leave the input / output ranges alone - both work perfectly fine with a 0...1 range.

                Here's an example how it works:

                HiseSnippet 1647.3oc2X0saaTDEd2jrPhoE0.ETERHMphKbZRcsSbbSTAUm3jzZQbhUraAQUU03cm0dT1cls6NabBU8Q.wE7TvSAuBUbC2xi.bORvY1wd8tNtoFSHMvJYqcNmyLmu4Lm+lstO2jDDv80zyz7DOhl9ULZbBSzoRGLkoUcKM822nFNPP7QJRadhGNHfXooqO8CjDzmaFsnme69ahcvLSx.RZZOlSMI6RcohATqW9KoNN6fsHMotIjtX4plbVEtCODvyzF407vlGhaS1CKEaJCsGhC5noeKiUWdEyhV20Z4kWc8Rl3Rj0sw11EVwpXwRqsdgUVGWbsRj7qpo+NaaQEb+FBrfDnoOylbqSZzg2koTvioAzVND4fBZM.MqHuC2wRtEkT0pzg5XUuugJPCVz5CLaSqLaW2nF0hFSef46ZQLPClQRCn9Tog2zofWgjvKeB3MBHom.Rynfz7FML8odhAbj348LpxfSSaLbNkDJJY0l5GlxnBGjfIx4hOjriOLHdFYKkO+RH3uEtWlL24NnJ9D.3HLpUnsM3hzkJ5fDc4nt3iHBL.8fLvQZf.cD1G0xF8EnMijLmYzLyVL+5kf0Rx8HfY9b4GZgCnLxfUKiM2OKUJ38PTzmiVNew0f2VbwExLWK6mPeJvpFVzIGLMPt6DI.5VJZ0qBus7vHO.2cv5ivBjnCAEP.TagBb3hXU1SWfVkfdXstbt7vpmkdaoXKzWy2FUPtilKgQnq.jNJDKWah3q5qYoM2m63P7ydyXhJ4HAz.hega1C4xiLDkEgyAlYDFvKU.m.NNHWtuWGTKhnKgDInalthbNbr0VXANaK6kPEWKedvZuD5IvOIVe5B2yNjYJnbFhy1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SccfnpZI2NCp1CWqvqA8aSUQtI4XAzbRjPfc3iM1CtDA1AjxpNA58.tRtTm6GJN2T4iBHPco5bvHCgjaD7MDe9vMibVtleTRWST+658VJSzEQqjWD5vEa5yelo5yJJi8lMhBruYQMQMGDgAiQEzNJcGPvwOzjwyLMSuTmZhKOoSbkIchEmzIt5jNwRS5Du6jNw0dyST1C3FgP5KUEPMsZ02V8wAzi+xDPv2eAp7Gy.
                

                I'm creating two wavetables programmatically so the snippet loads out of the box - no assets required.

                OrvillainO 1 Reply Last reply Reply Quote 2
                • OrvillainO
                  Orvillain @Christoph Hart
                  last edited by

                  @Christoph-Hart Ahhhhh, this was the missing key:
                  set the Table Index parameter to 100%

                  Everything else you mentioned I was already doing or already tried. I hacked the input and output ranges instead of just setting the table index to 100% as its base. doh.

                  c18bed78-f019-42e2-ae52-2ee96aabd9f7-image.png

                  My UI control was always pointing just at the matrixTargetId.

                  Musician - Instrument Designer - Sonic Architect - Creative Product Owner
                  Crafting sound at every level. From strings to signal paths, samples to systems.

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

                    My UI control was always pointing just at the matrixTargetId.

                    Ah yes, that's basically equivalent to connecting it to the Value parameter (internally it does the same thing).

                    1 Reply Last reply Reply Quote 1
                    • LindonL Lindon referenced this topic on
                    • observantsoundO
                      observantsound
                      last edited by

                      I'm a bit confused. Was this a beta branch at some point?
                      There's documentation about the modulation matrix on the website and a tutorial snippet, but it doesn't work, and I don't see matrixTargetId in my properties editor.

                      I'm using 4.10 built from source.

                      David HealeyD 1 Reply Last reply Reply Quote 0
                      • David HealeyD
                        David Healey @observantsound
                        last edited by

                        @observantsound said in Roadmap to HISE 5:

                        There's documentation about the modulation matrix on the website and a tutorial snippet, but it doesn't work,

                        Got a link?

                        Free HISE Bootcamp Full Course for beginners.
                        YouTube Channel - HISE tutorials
                        My Patreon - More HISE tutorials

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

                        13

                        Online

                        2.4k

                        Users

                        13.8k

                        Topics

                        120.4k

                        Posts