• 0 Votes
    3 Posts
    58 Views
    griffinboyG

    @Phelan-Kane

    Here's a real life example of c++ modslots.

    It's not minimal i'm afraid but it shows it in use.
    If you'd like to see the minimal example, it's just as @ustk said, have a look at this post:
    https://forum.hise.audio/topic/14270/how-do-you-set-up-external-modulation-slots-c

    // ==============================| Griffin Poly EQ Filter |=================================== // // File: Griffin_EQFilter_Poly.h // Node: Griffin_EQFilter_Poly // Package: Griffin DSP Essentials for HISE // Author: Griffinboy // HISE Forum: https://forum.hise.audio/user/griffinboy // Copyright: Copyright (c) 2026 Griffinboy // // Description: // Minimum-phase EQ filter with per-voice state and frame processing. // Designed for sample-accurate modulation in synthesis contexts. // Uses more CPU than the block-rate Griffin_EQFilter. // // Has Mod slots for frequency, Q, and gain. // // License: // GNU General Public License v3.0 or later (GPL-3.0-or-later). // // This file is part of Griffin DSP Essentials for HISE. // // This program is free software: you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software Foundation, // either version 3 of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A // PARTICULAR PURPOSE. See the GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along with this // program. If not, see <https://www.gnu.org/licenses/>. // // ================================================================================================ #pragma once #include <algorithm> #include <cmath> #include <JuceHeader.h> #include "src/griffinboy/modules/essentials/eq_filter/eq_filter.h" namespace project { using namespace juce; using namespace hise; using namespace scriptnode; template <int NV> struct Griffin_EQFilter_Poly: public data::filter_node_base { using VoiceState = griffin::modules::essentials::eq_filter::EQFilterFrameProcessor; using PlotModel = griffin::modules::essentials::eq_filter::EQPlotModel; using Defaults = griffin::modules::essentials::eq_filter::EQFilterDefaults; PolyData<VoiceState, NV> voices; PlotModel plotModel; SimpleReadWriteLock topologyLock; double plotSampleRate = 44100.0; SNEX_NODE(Griffin_EQFilter_Poly); struct MetadataClass { SN_NODE_ID("Griffin_EQFilter_Poly"); }; static constexpr bool isModNode() { return false; }; static constexpr bool isPolyphonic() { return NV > 1; }; static constexpr bool hasTail() { return true; }; static constexpr bool isSuspendedOnSilence() { return true; }; 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 = 1; static constexpr int NumDisplayBuffers = 0; void prepare(PrepareSpecs specs) { SimpleReadWriteLock::ScopedWriteLock sl(topologyLock); voices.prepare(specs); for (auto& voice : voices) voice.prepare(specs.sampleRate, specs.blockSize); plotModel.prepare(specs.sampleRate); plotSampleRate = specs.sampleRate > 0.0 ? specs.sampleRate : 44100.0; if (auto fd = dynamic_cast<FilterDataObject*>(this->externalData.obj)) fd->setSampleRate(plotSampleRate); sendCoefficientUpdateMessage(); voiceManager.prepare(specs); voiceManager.setActive(1.0); } void reset() { SimpleReadWriteLock::ScopedWriteLock sl(topologyLock); for (auto& voice : voices) voice.reset(); voiceManager.reset(); } void handleHiseEvent(HiseEvent& e) { voiceManager.handleHiseEvent(e); } template <typename T> void process(T& data) { if (auto sl = SimpleReadWriteLock::ScopedTryReadLock(topologyLock)) { static constexpr int NumChannels = getFixChannelAmount(); auto& fixData = data.template as<ProcessData<NumChannels>>(); auto& voice = voices.get(); auto fd = fixData.toFrameData(); while (fd.next()) voice.processFrame(fd.toSpan()); voiceManager.process(data); } } template <typename T> void processFrame(T& data) { if (auto sl = SimpleReadWriteLock::ScopedTryReadLock(topologyLock)) voices.get().processFrame(data); } int handleModulation(double& value) { ignoreUnused(value); return 0; } double getPlotValue(int getMagnitude, double freqNorm) override { if (getMagnitude == 0) return 0.0; const auto frequency = std::clamp(freqNorm, 0.0, 0.5) * plotSampleRate; return plotModel.getMagnitudeAtFrequency(frequency); } void setExternalData(const ExternalData& data, int index) { data::filter_node_base::setExternalData(data, index); ignoreUnused(index); if (auto fd = dynamic_cast<FilterDataObject*>(data.obj)) fd->setSampleRate(plotSampleRate); sendCoefficientUpdateMessage(); } void createExternalModulationInfo(OpaqueNode::ModulationProperties& info) { modulation::ParameterProperties::ConnectionList list; auto addParameterSlot = [&list](int parameterIndex) { modulation::ConnectionInfo slot; slot.connectedParameterIndex = parameterIndex; slot.modColour = HiseModulationColours::ColourId::FX; slot.connectionMode = modulation::ConnectionMode::Parameter; slot.modulationMode = modulation::ParameterMode::ScaleAdd; list.push_back(slot); }; addParameterSlot(2); addParameterSlot(3); addParameterSlot(4); info.fromConnectionList(list); info.setModulationBlockSize(Defaults::modulationBlockSize); } template <int P> void setParameter(double v) { if constexpr (P == 0) { SimpleReadWriteLock::ScopedWriteLock sl(topologyLock); const auto nextShape = (int)std::round(v); applyToVoices( [nextShape](VoiceState& filter) { filter.setType(nextShape); }); updatePlotFromFirstVoice( [this, nextShape] { plotModel.setType(nextShape); }); } else if constexpr (P == 1) { SimpleReadWriteLock::ScopedWriteLock sl(topologyLock); const auto nextSlope = (int)std::round(v); applyToVoices( [nextSlope](VoiceState& filter) { filter.setSlopeMode(nextSlope); }); updatePlotFromFirstVoice( [this, nextSlope] { plotModel.setSlopeMode(nextSlope); }); } else if constexpr (P == 2) { const auto value = (float)v; applyToVoices( [value](VoiceState& filter) { filter.setFrequencyHz(value); }); updatePlotFromFirstVoice( [this, value] { plotModel.setFrequencyHz(value); }); } else if constexpr (P == 3) { const auto value = (float)v; applyToVoices( [value](VoiceState& filter) { filter.setQ(value); }); updatePlotFromFirstVoice( [this, value] { plotModel.setQ(value); }); } else if constexpr (P == 4) { const auto value = (float)v; applyToVoices( [value](VoiceState& filter) { filter.setGainDb(value); }); updatePlotFromFirstVoice( [this, value] { plotModel.setGainDb(value); }); } } void createParameters(ParameterDataList& data) { { parameter::data p("Shape", { 0.0, 6.0, 1.0 }); StringArray names; addTypeLabels(names); p.setParameterValueNames(names); registerCallback<0>(p); p.setDefaultValue((double)Defaults::type); data.add(std::move(p)); } { parameter::data p("Slope", { 0.0, 3.0, 1.0 }); StringArray names; addSlopeLabels(names); p.setParameterValueNames(names); registerCallback<1>(p); p.setDefaultValue((double)Defaults::slopeMode); data.add(std::move(p)); } { parameter::data p("Frequency", { 20.0, 20000.0, 0.01 }); p.setSkewForCentre(1000.0); p.info.textConverter = parameter::pod::TextValueConverters::Frequency; registerCallback<2>(p); p.setDefaultValue(Defaults::frequencyHz); data.add(std::move(p)); } { parameter::data p("Q", { 0.025, 25.0, 0.001 }); p.setSkewForCentre(0.70710678); registerCallback<3>(p); p.setDefaultValue(Defaults::q); data.add(std::move(p)); } { parameter::data p("Gain", { -30.0, 30.0, 0.01 }); p.info.textConverter = parameter::pod::TextValueConverters::Decibel; registerCallback<4>(p); p.setDefaultValue(Defaults::gainDb); data.add(std::move(p)); } } private: static constexpr int getNumTypes() noexcept { return griffin::modules::essentials::eq_filter::EQFilterDesign::getNumTypes(); } template <typename Function> void applyToVoices(Function&& function) { // PolyData iteration follows HISE's poly callback. // Each active voice receives the parameter update in its own DSP state. for (auto& voice : voices) function(voice); } template <typename Function> void updatePlotFromFirstVoice(Function&& function) { // The plot is shared UI state. The first HISE voice owns graph updates // so voices do not compete for the displayed response. if (! voices.isVoiceRenderingActive() || voices.isFirst()) { function(); sendCoefficientUpdateMessage(); } } static void addTypeLabels(StringArray& names) { names.add("Lowpass"); names.add("Highpass"); names.add("Bandpass"); names.add("Notch"); names.add("Bell"); names.add("Low Shelf"); names.add("High Shelf"); } static void addSlopeLabels(StringArray& names) { names.add("12 dB/oct"); names.add("24 dB/oct"); names.add("48 dB/oct"); names.add("96 dB/oct"); } envelope::silent_killer<NV> voiceManager; }; } // namespace project
  • Testers Needed for Rhapsody v3

    General Questions
    30
    1 Votes
    30 Posts
    636 Views
    David HealeyD

    Anyone else with FL Studio able to give it a try?

  • Animated modulation

    General Questions
    23
    0 Votes
    23 Posts
    236 Views
    ustkU

    @dannytaurus Yeah, keeping the colours tidy in your code is easier in the end. Then you can set the component colours from script when needed and everything updates automatically if you adjust something instead of copy/paste in all components...

    I tend to to everything I can in paint routines, the less components in the tree, the happier I am!
    That being said... In order to reduce CPU load, I still tend to keep fixed drawing (bg, mask, etc...) in separate panels so the LAF function job is only constrained to what is really necessary. I also keep all the math constants externally, unlike the example...

    Other issue with the "multiple panel masking technique" is that when you want to move it, it can be very annoying, unless adding them all in an holder panel, which is one more component... 😬

  • Trading DSP's!

    Scripting
    10
    1 Votes
    10 Posts
    152 Views
    C

    @Chazrox Have got a Glitch FX and a Granular Pitch Delay. Would be interested in the pitch and varispeed!

  • The Legato between samplers

    General Questions
    6
    0 Votes
    6 Posts
    130 Views
    David HealeyD

    @Felix-W Break it down. Make a minimal project with one sampler where notes only trigger during legato transitions. Once you get that working you can start to incorporate it into your project.

  • Get, post API Hise language.

    General Questions
    7
    0 Votes
    7 Posts
    66 Views
    Y

    @David-Healey Ok,

    Is it possible to discuss in private?

  • Stop pruning default values from XML?

    General Questions
    4
    0 Votes
    4 Posts
    100 Views
    David HealeyD

    @dannytaurus said in Stop pruning default values from XML?:

    because I'm setting some values in script that happen to be default values.

    Hmm this might be the source of an issue I was having too, I might try it.

  • One shared Script Voice Start Modulator for many Samplers?

    Scripting
    5
    0 Votes
    5 Posts
    114 Views
    observantsoundO

    @David-Healey Yes the Global Modulator Container worked beautifully for this.
    Thanks to your video I've now also understood the global modulator container better.

    Regarding the body + release in one sampler:
    That's what I've tried first, but it's bugged when using together with loop regions.
    It's what I described in this earlier post you commented on:
    https://forum.hise.audio/topic/14799/loud-click-artifact-when-using-releasestart-with-looping-enabled/14?_=1781354181861

    I haven't gotten around to testing it with 48kHz samples yet.
    But by now I've found enough use cases to split apart the sections into dedicated samplers.

  • 0 Votes
    3 Posts
    45 Views
    dannytaurusD

    @chimaera_09 Make the button show/hide a panel. Use the panel to house all your extra controls.

    const pnlSettings = Content.getComponent("pnlSettings"); const btnSettings = Content.getComponent("btnSettings"); btnSettings.setControlCallback(btnSettingsControl); inline function btnSettingsControl(component, value) { pnlSettings.showControl(value); // button shows/hides the panel }

    You can add a button in the panel to close it too:

    const btnSettingsClose = Content.getComponent("btnSettingsClose"); btnSettingsClose.setControlCallback(btnSettingsCloseControl); inline function btnSettingsCloseControl(component, value) { if (value) { pnlSettings.showControl(false); btnSettings.setValue(0); // sets the 'off' state of the button } }
  • 1 Votes
    1 Posts
    36 Views
    No one has replied
  • 0 Votes
    11 Posts
    162 Views
    ustkU

    Speaking of which...

    https://github.com/christophhart/HISE/pull/984

    I can't believe the math were wrong the whole time
    -> upDecayTime was inverted...

  • Set order of parameters as listed for automation

    General Questions
    25
    0 Votes
    25 Posts
    688 Views
    ustkU

    @dannytaurus Good job detective!
    I agree to the WTF, seems that developing new protocols of all sorts but there's still no agreement whatsoever in the way DAWs handle such a simple task... Shame...

  • 0 Votes
    8 Posts
    144 Views
    ChazroxC

    @dannytaurus said in Anyone doing factory presets only, with no Save button?:

    power-user feature

    It for sure is a power-move and not as intuitive as a user preset.

  • Linux

    General Questions
    9
    0 Votes
    9 Posts
    244 Views
    David HealeyD

    @zachhealy1005 said in Linux:

    so compiling hise on my laptop is in fact impossible.

    If you reduce the number of compile threads to 1 or 2 it might still compile.
    make CONFIG=Release -j 2

  • Logic crashes on startInternalDrag

    Scripting
    22
    0 Votes
    22 Posts
    247 Views
    Oli UllmannO

    @David-Healey
    @ustk
    @HISEnberg
    @ulrik

    I've created my own little drag-and-drop implementation. Any suggestions for improvements?

    HiseSnippet 1697.3ocuXE0aSbDD9tjbsXWPsHwOfE+P3bIXrSbRHJPaRbR.qRBVj.kHDBs4t02sMm205t0IwBgT+o0eR809T6L6dm8cN1zRDTKPw6Nyry2Ly2N6ttSrzikjHisrKe7v9LK6a5bzPgJrUHkKrZuqk8sbFDE0iJD6FSCr1YXeZRBy2x1d9mhpXWZAK8m+7m2gFQEdrwSYY8ZI2i8bdOtZ7rc15W3QQ6S8YGy6kS6la01SJZIijC.3LuScq9TuynArConZy4X8LZRnk8O5rd2UnqsZ2U7Vm0bYFk5e5pqsg+oqzXs0W4QrldT5iVsoWyMrr+l874JY7QJphkXYuvNR+gGEJuPXbvq4I7SiX3fFVGAd1L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OD.sHHWxnGVzeU++eyGf2KzQ4RLETkb2m.zSjgLCg43USmsnS.zrDPWjwTAbdZmkLyeWV+QPTEhRlWmo34BpWyPHAUYyBDGJI9Y3vGwgrOKlpqEJo7LRen4MKccJxsEv8d2b108rS5lIeZhy5.BB1aezFXo3Poh8BgqduKHiLontcmprT.DwhmpX7R0weJCcEC5cJKdI3z1Hf5loHbwwh2F0Y12FM+kk8LGSmSQonsfqdQelXVWg1J8rc3aup8tTEEuBa5bfdPERwQHXuK6b3ADlKzVxYWVxYJYeK6uczEB.XpzRuU10cQliEGtT6MbLWVz5x7uHY33As2BZtBEzzVrf+9dG3Pex3Ir9L7yx48CequZ9YkYEO+N8KpeZNq34yzOeSQ+n2il5Gy90YEOa8aacAd7+nI9i3svc05mBl2CklUjbSmwaMQu3Xm5AyWRWcG66.CB0WhHaDbaudYuD8lNMWdilaTuw5qUOmfkmPx4YaOrm+yI7WdlzyQ.bxv20QeNcZKMn2F3JSGS3aPCTpPpBglQvSsuxqBg2iJ8GDgmAm+Qp3S4SE.8JJ7xP7gdvsZTCy+T+uXub8+JDusSGtxKb5XbtofQnixWCLl9d+a4rW2tLO0X.tfy9u4qyi6sLuZI3.pJlir3CGz6Hf.5w.uKvyIQV6bXWUy35YD7iXBe8f+F9jJrAN1NUXiLgV8ndwx26YNg.+EEtgdF.SB8u9RImCvwjFV5SMxmm6w84u2yq3RcECW95Z3JWWCadcMb0qqgqccMb8qqgO5e2P72eZ6AJYOy1FKqC5rm9HWa68D3CNzrUq+AfuNwBB
  • 0 Votes
    23 Posts
    337 Views
    LindonL

    @David-Healey well done...for now I might stick to my "Load Request File" based appraoch...

  • Show default preset name on first launch

    General Questions
    6
    0 Votes
    6 Posts
    70 Views
    dannytaurusD

    @ustk Good call. Claude suggested I update to this:

    UserPresetHandler.setPostCallback(function(presetFile) { // On first launch the default preset loads with no file (frontend leaves // currentlyLoadedFile empty), so getCurrentUserPresetName() is "". Fall back // to the default preset name. (Editor returns the real name, so it's unaffected.) var name = Engine.getCurrentUserPresetName(); btnShowPresetBrowser.set("text", name != "" ? name : "00 INIT"); });

    I'll try it and make sure it works on first launch, and doesn't interfere with reloading DAW sessions.

  • 0 Votes
    4 Posts
    127 Views
    A

    There is a detailed comparison of various pitch algorithms.
    Rubberband performs really well and it's not too difficult to integrate into Hise.
    I think there's even a detailed post somewhere here on the forum about this topic.

  • New A2 NAM standard

    ScriptNode
    2
    0 Votes
    2 Posts
    83 Views
    resonantR

    @pgroslou Even the Lite models of the previous version, which consume less CPU, don't work; only the standard models work.

    Hopefully, the A2 NAM (which has two versions depending on CPU usage) will be integrated without any problems.

  • Matrix modulation connection is broken in exported plugin

    Bug Reports
    54
    0 Votes
    54 Posts
    3k Views
    ustkU

    @DanH said in Matrix modulation connection is broken in exported plugin:

    He can drop that
    addModuleStateToUserPreset call unless he needs the container's own chain
    state in presets.

    Yep I need it, so I can't remove it, then 2 MatrixData blocks it is and will be...

    Two root-level blocks means two live ScriptModulationMatrix instances at save
    time. Unlike most Engine.createX calls there's no caching — each call to
    Engine.createModulationMatrix() constructs a fresh object and registers a
    fresh state manager, even for the same container ID. So ustk should search his
    scripts for a second call (a second script processor, an included file, or a
    call inside a function that runs more than once). Restore-side it's mostly
    benign (each manager restores from the first MatrixData child via
    getChildWithName), but it's the smoking gun that two matrix objects are alive
    — and two objects both performing remove-all/re-add restores on the same tree
    is exactly the kind of thing that could leave the runtime side confused.

    Nope, no smoking gun here.

    The signal path goes stale if:

    the container's child modulators get rebuilt after the matrix restore
    (remember MatrixData restores last, but postPresetLoad, sample preloading →
    prepareToPlay, or anything his preset postCallback does runs after that),

    something worth investigating, especially prepareToPlay that has been modified recently to fix another matrix bug...

    Practical suggestions for ustk

    Grep the project for createModulationMatrix — ensure exactly one call, in
    onInit, stored in one const var. If duplicates persist in fresh saves after
    that, an old instance is being kept alive.

    Always had only one here

    Drop addModuleStateToUserPreset("Global Modulator Container").

    Nope, need it for what it does. And anyway I tried without and it doesn't seem related to the issue.

    Check whether the broken targets' source modulators are bypassed/disabled
    at the moment the preset finishes loading (the active-list trap above).

    Nothing's bypassed

    Note whether broken targets are MatrixModulators in mod chains vs.
    script-slider parameter targets — they use different listener paths
    (MatrixModulator::onMatrixChange vs MatrixCableConnection), which would narrow
    it to one code path for a proper bug report to Christoph.

    Only MatrixModulators in mod chains here, not direct parameter modulation