• Any easy way to communicate from/to C++ and Javascript

    11
    1 Votes
    11 Posts
    3k Views
    jonhallurJ

    Just for future documentation and forum searches, this here code works in the other direction, that is calling into the Javascript from C++ from an inline function handed to C++, I image it would work for inline functions added to the Globals object as well.

    _global->setMethod({ "set_callback" }, [&](const var::NativeFunctionArgs& args) -> var { auto *obj = args.arguments->getDynamicObject(); if (obj) { if (auto p = _ref.getProcessor()) { juce::Result* res; var fVar(obj); var args[2] = { 42, 13 }; LockHelpers::SafeLock sl(getMainController(), LockHelpers::ScriptLock); p->getScriptEngine()->maximumExecutionTime = RelativeTime(3.0); p->getScriptEngine()->executeInlineFunction(fVar, args, res); } } return { 0 }; });

    Obviously this is not safe, and if you don't use an inline function, it will crash your C++ code.

    This is rougly the code from

    void ProcessorWithScriptingContent::customControlCallbackIdle(ScriptingApi::Content::ScriptComponent *component, const var& controllerValue, Result& r)
  • Can I pipe the Console output to std out

    12
    0 Votes
    12 Posts
    2k Views
    Christoph HartC

    You're right (I keep forgetting about the layers I've added to the debug handling). All Console.xxx() calls are ignored in the compiled plugin (in fact they are thrown away by the HiseScript compiler when parsing the Javascript code). This is to prevent that any residual debugging code ends up clogging the finished product.

    You can remove this by removing everything inside this preprocessing definition:

    https://github.com/christophhart/HISE/blob/2da59a219ce25c10b6d9d9ee3e1ca0da18850940/hi_scripting/scripting/engine/JavascriptEngineParser.cpp#L379

  • drawTableBackground

    6
    4 Votes
    6 Posts
    742 Views
    DanHD

    @d-healey sounds hectic!

  • Added getTrimmedBounds()

    5
    4 Votes
    5 Posts
    847 Views
    d.healeyD

    @christoph-hart Are there any downsides to including in the component class?

  • g.drawFittedText

    6
    5 Votes
    6 Posts
    790 Views
    ulrikU

    @d-healey Yeah that's my experience as well

  • Little C++ help required

    2
    0 Votes
    2 Posts
    346 Views
    ustkU

    @d-healey I think because struct isn't inside a header file it can't be included in the ScriptExpansion.cpp class

    So maybe try moving the whole struct into PresetBrowser.h and include it in ScriptExpansion.cpp, but it might be a bit more subtle...
    Also have you tried

    struct PresetHelpers PresetHelpers::importPresetFromClipboard

    Since they are in the same namespace? But I bet you I'm saying non-sense 🙃

  • Aliasing on Balance / Pan

    1
    0 Votes
    1 Posts
    235 Views
    No one has replied
  • Building develop for C++ API

    6
    0 Votes
    6 Posts
    932 Views
    Christoph HartC

    @daniel said in Building develop for C++ API:

    I'm curious which way you fixed it

    I would estimate I've added .get() in 90% of all cases and only returned / passed a ref counted pointer where the caller & callee actually takes / shares the ownership.

  • revealToUser doesn't work with spaces

    5
    0 Votes
    5 Posts
    626 Views
  • Smoothing enabled on RAW C++?

    7
    4 Votes
    7 Posts
    1k Views
    hisefiloH

    @Christoph-Hart still trying to find where it happens. I replaced many parts of the source code so... Maybe I mistaked somewhere. Will report later

  • Updating streaming_example

    5
    0 Votes
    5 Posts
    792 Views
    danielD

    Hi @Christoph-Hart

    Great, thank you for the answers and sorry for interrupting your vacation.
    Sorry for teasing, the comment is from a commit (see .gitmodules ;-) )

    I'll have a closer look at the develop branch. My questions stem from the fact that I never used the full features of HISE, and actually the clients codebase doesn't either, even though it is based on an old export.

    Maybe I will know more details next week when you are back.

    Cheers and enjoy the rest of your vacation
    Daniel

  • Develop on GNU/Linux

    4
    0 Votes
    4 Posts
    814 Views
    NatanN

    Linux Threads Be Like 🤣
    https://media.tenor.com/images/220b86608e0781337040b846a71f0ebb/tenor.gif

    alt text

  • Monophonic Aftertouch....

    12
    1 Votes
    12 Posts
    1k Views
    LindonL

    @Lindon - well it looked too good to be true - and it was...
    so I:

    forked the latest MASTER

    changed the code I thought needed changing in ControlModulator.cpp

    to this:

    const bool isAftertouch = controllerNumber == 129 && (m.isAftertouch() || m.isChannelPressure()); const bool isPitchWheel = controllerNumber == 128 && m.isPitchWheel(); if(isAftertouch || m.isControllerOfType(controllerNumber) || isPitchWheel) { if (m.isController()) { inputValue = (float)m.getControllerValue() / 127.0f; } else if (controllerNumber == 128 && m.isPitchWheel()) { inputValue = (float)m.getPitchWheelValue() / 16383.0f; } else if (m.isChannelPressure()) { inputValue = (float)m.getChannelPressureValue() / 127.0f; } else if (m.isAftertouch()) { const int noteNumber = m.getNoteNumber(); polyValues[noteNumber] = (float)m.getAfterTouchValue() / 127.0f; inputValue = FloatVectorOperations::findMaximum(polyValues, 128); jassert(inputValue != -1.0f); if (inputValue < 0.0f) inputValue = 0.0f; } else { jassertfalse; } inputValue = CONSTRAIN_TO_0_1(inputValue); float value; if(useTable) value = table->getInterpolatedValue(inputValue * (float)SAMPLE_LOOKUP_TABLE_SIZE); else value = inputValue; if(inverted) value = 1.0f - value; targetValue = value; } basically just setting the midi controller numbers to their correct values in the boolean or statements at the top...

    Sadly this makes no difference and I dont know how to get it to provide me with debugging information - the HISE debug build crashes out with errors...and even if it didnt I wouldnt know what to add in that was the same as Console.print("something") and I wouldnt know where to look even if I did...

    So anyone got any clues, or is this back to @Christoph ?

    It occurs to me that i should remove any possibility that its my hardware doing this (an Arturia KeyLab) so can anyone else please run this wildly simple snippet:

    HiseSnippet 677.3ocsUs0aSCCE1tqdhVtHFhe.Q6oVwnJE1FH1CLVufpftUQFS71jmiaq0RribbFTg3+L+CfiSxVZGYSaQh7PUOmy2mymO2xDshwiiUZDtwwKh3H7iHdKjl48lSERzn9H7SHiowFt1Iy0AKhnwwbeDFu1GsNvMpiRe986OfFPkLdgKD5Dkfw+rHTXJ7NY+OIBBFR84GKBWB816Ohoj8TApDPOqQbQQT14zY7CoVX0HH75C7EFk1yPM7X.yAJ+EdyUeWlg+DQr3r.t0nKxCNnL2ndyEA9St7tFiP35SJt4qkcyeNYrvWbk+hLvSSC3TvX4b.t1pRp9JRp6MIogp.e6AbCxCuj7pmIuMHdLsHxTDwpsGRFIghyTJj1WVVYXQ0dFlzSAHjlNgzy4C0fwULZsqq6VN6351duoIRlQnjNJ4gJC+HYq1M+YyFM+USmqGZ5zRiYeMZUP.WmEFriUA7NQZgzzZLHYnR1YF2T.7vjvyrvcdgyluaS32RQcBMHg2pc68t1Kz17nuMozRld9a4bg8DtBHjQWsjs9cqjwxxiKATIGIElih341EE0tkTTQ4EB3eecTepgZqy49.bQbsQXkCtO+BXnIqp2fzmGetQEAiM+SKAzXp7SBnlU6Vsik4Af7wJsE1RuLVXVr7X68nE1szV3Rus2Q4tAYhvvlWtdqUhdgr1+a8luP3wjASmxYlBwVmL7aUc5+dHkunRLB4rwTiV7CDl.yIdvNQFGThTxCfWDAWy1QkY6ZssYFOtzO03OvSdvtVabdvtWFDERYZ0orrIE6JmGj5AzjLcaaCXsOX6zEkN8.7HtcbQgvlvSYLap3kf1Kmyqp.mWWANaWAN6TAN6VANuoBbd6sxw9QnOjXTgYiIfiICRWifwCjTnKKsiD8Wjb0bzI

    you should see the controller number and the reported value showing up in the console...where for me it shows

    129:

  • NUM_API_FUNCTION_SLOTS

    12
    0 Votes
    12 Posts
    1k Views
    ustkU

    A while ago I've dug for a very long time with an export issue on one of my projects... Then I realized that the name of this project contained the word "system" in it so it was bugging the compiler... Scratched my head for almost a month 😆

  • Modulate each graph point on TableEnvelope. C++ API

    7
    0 Votes
    7 Posts
    858 Views
    hisefiloH

    @Christoph-Hart I'm not changing the point or moving it. Just adding a modulator to it. As AHDSR allows on Decay Time, or any other state...

    Does it makes sense??

    Asking different: It's possible to create a multi-state ADSR module? will be something like ADADADADSR ?

    Sorry this is the best I can explain with my limited knowledge

  • C++ API. Load/Save button state on presets

    3
    0 Votes
    3 Posts
    487 Views
    hisefiloH

    @Christoph-Hart thanks mate!!!!!!

    Implemented that!
    Still having a weird behaviour loading a button state from preset at the "First time I create it"
    I mean, when I create a preset and the button is "Enabled" or "1" in the preset file, it flips apparently the behaviour of the other presets doing that button to not load the correct state. If I quit or restart de plugin, it loads correctly. I guess the toggle thing makes it not to work properly.
    I just want to save if that module is Enabled or Bypassed.

    This is what I have at Raw.cpp

    addToUserPreset<raw::Data<bool>::Bypassed<true>>("VibratoOnButton", "LfoGain");

    this is the preset

    <?xml version="1.0" encoding="UTF-8"?> <Preset Version="1.0.0"> <Control id="VibratoOnButton" value="1"/>
  • Get and Set Favorite for Current Preset

    3
    0 Votes
    3 Posts
    456 Views
    Casey KolbC

    @ustk Yeah I considered this. It looks like Christoph is doing some fancy stuff with the database but I guess it wouldn't be too difficult to make my own. However, my current users will lose their favorites if I use my own system, so it'd be great to stick with the built-in HISE one.

  • Preset Browser Tagging System with Custom UI

    7
    0 Votes
    7 Posts
    1k Views
    Casey KolbC

    I figured out how to hook it up with the API system in order to get and set tags from presets, so all good!

  • Getting started building with hise and C++

    6
    0 Votes
    6 Posts
    838 Views
    ospfeigrpO

    @Christoph-Hart and @hisefilo thanks for that i'll check it out but seems to be what i am looking for.

  • Synth.addNote bug on C++

    1
    0 Votes
    1 Posts
    193 Views
    No one has replied

26

Online

2.0k

Users

12.9k

Topics

111.7k

Posts