Forum
    • Categories
    • Register
    • Login
    1. Home
    2. ustk
    3. Posts
    • Profile
    • Following 0
    • Followers 15
    • Topics 480
    • Posts 6,191
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Hashtag # in a string causing EOF?

      @David-Healey because I had this in the same script

      const var PATH_SEPARATOR = Engine.getOS() == "OSX" ? "/" : "\\"; // last " is escaped
      
      const var someStringWithHashtag = "#"; // the first " closes the above line, so # is in the wild...
      

      and the parser sees the second \ as an escape for the next char, which is ", hence messing the double quotes count.
      Ii is not seen as an error until the parser sees a # which instead of being taken as string, is taken as a preprocessor call.

      posted in General Questions
      ustkU
      ustk
    • RE: Hashtag # in a string causing EOF?

      @David-Healey Claude found it's a parsing issue with double backslash escape that de-sync the parsing:

      const var PATH_SEPARATOR = Engine.getOS() == "OSX" ? "/" : "\\";
      

      That "\\" is a perfectly valid HISEScript string (one escaped backslash). But HISE preprocesses every script through the SNEX preprocessor before the JS compiler sees it, and that preprocessor has a buggy string scanner (snex_jit_PreProcessor.cpp:594):

      // it only treats a backslash as an escape when the NEXT char is the quote:
      if (*start == '\\' && *(start + 1) == quoteChar) { start += 2; continue; }
      

      Walking "\\": it reads the first \, then sees the second \ sitting right before the closing " and concludes the " is an escaped quote — so it keeps scanning past the end of the string, swallowing text until the next " somewhere later. From that point on, the preprocessor's idea of "inside a string / outside a string" is inverted for the rest of the file.

      Why single quotes fix it, and why it's specific to this script:

      • Line 4's trap flips quote-phase for everything after it. Approaching line 443, the preprocessor wrongly believes it's inside a string.
      • With '#': the ' and # are just harmless characters inside that (phantom) string → no problem.
      • With "#": the first " closes the phantom string → the preprocessor is now "outside" → it sees a bare #, which it treats as a preprocessor directive marker (#define/#if/…). It grabs #" + i;, fails to match a directive, blanks the block, and the mangled leftover reaches the JS tokenizer → its JSON-based string parser hits EOF mid-string → "Unexpected EOF in string constant".
      • It's confined to this file because the preprocessor runs per-file, and this is the file that contains both the "\\" trap and a #.

      I proved it: replacing line 4's "\\" with the equivalent "\u005C" (same backslash, but no \\ right before the quote) makes the "#" version compile with zero errors.

      Fix options
      Recommended — remove the landmine. Change line 4 to a form that doesn't put \\ against the closing quote, then # works anywhere (double-quoted included):

      const var PATH_SEPARATOR = Engine.getOS() == "OSX" ? "/" : "\u005C"; // backslash; avoids preprocessor quote-desync
      
      posted in General Questions
      ustkU
      ustk
    • RE: Hashtag # in a string causing EOF?

      @David-Healey I probably did... or Claude did once or twice

      posted in General Questions
      ustkU
      ustk
    • RE: Hashtag # in a string causing EOF?

      @David-Healey Mmmm... That is very very strange. It effectively works on a new project on both mac and win but not in my current big project, and only in a specific place in code...
      This reminds me of a missing " issue I heard of around here... Investigating...

      posted in General Questions
      ustkU
      ustk
    • RE: Hashtag # in a string causing EOF?

      That's because I needed '#' instead of "#"

      posted in General Questions
      ustkU
      ustk
    • Hashtag # in a string causing EOF?

      since when having an # in a string causes compilation error? And why can't we escape it with \#

      inline function initMidiCbs()
      {
          local ccList = [];
      
          for (i=0; i<128; i++)
              ccList[i] = "#" + i; // error: Unexpected EOF in string constant
      }
      
      posted in General Questions
      ustkU
      ustk
    • RE: Check Latency broken on latest develop build?

      @dannytaurus That being said, it only matters in a parallel track mixing context (but nowadays it's still very frequent, we parallel this and that everywhere...), but you don't mind such a small latency for instruments...

      posted in Bug Reports
      ustkU
      ustk
    • RE: Check Latency broken on latest develop build?

      With an error of 3 samples at 48khz and you are already comb filtering at 16khz. Using an impulse to measure some signal chain can easily throw a result that is off by 20-30 samples, so as low as 1-2khz... that is more than a muffled sound 😸

      posted in Bug Reports
      ustkU
      ustk
    • RE: Check Latency broken on latest develop build?

      @David-Healey Keep in mind that algorithm delay changes with samplerate (so if you have adjustable oversampling nodes or fix buffer nodes it multiplies the number of different latencies by the same factor). All those cases needs to be computed and stored in the script.

      posted in Bug Reports
      ustkU
      ustk
    • RE: Check Latency broken on latest develop build?

      Don't rely on a single-sample impulse unless you're dealing with a very basic processing chain, especially if there's a non-minimum-phase EQ involved. An impulse measures both the plugin's algorithmic latency and the filter's frequency-dependent group delay. The latter isn't processing latency, it's just how the filter behaves.

      A more reliable approach is to record a sine wave (or another suitable signal, noise, etc...) and compute the cross-correlation between the bypassed and processed signals (that's what my app Align-IT is all about). It could be implemented in Hise as this would be much more reliable with noise (but not random because it obviously needs to be the same fro dry/wet buffers for a correlation to exist)

      Every time I tested the latency check in HISE (which is actually how I measured it before the feature was implemented), it failed as soon as a non-minimum-phase EQ was in the chain.

      You can reproduce this in any DAW: send both an impulse and a sine through the plugin, record the outputs, and compare the measured delay. You'll see the difference.

      Also keep in mind that with non-minimum-phase EQs, the apparent delay depends on frequency. There's no single latency value that applies to every signal. But noise is the closest we can get (in fact it would be even better with a weighted noise but that's going too far)

      posted in Bug Reports
      ustkU
      ustk
    • RE: AAX Build on MacOS

      @Lindon I might have pointed you to the wrong xcode project. you should build Libs/AAXLibrary/MacBuild/AAXLibrary.xcodeproj

      If you tried to build the SDK itself then it's probably my bad. I just updated the screenshot to the good project path so people won't get confused.

      posted in General Questions
      ustkU
      ustk
    • RE: How To Fix this problem building HISE on MacOS

      @duma As @David-Healey said, untick "Automatically manage signing"
      Since you probably just want to use Hise on the very machine you built it, you don't need to codesign. And I reckon the default Team should be Hart Instrument so you've probably done something to change this. If not in XCode, then in the Jucer file.

      posted in General Questions
      ustkU
      ustk
    • RE: AAX Build on MacOS

      @Lindon Have you tried the version I pointed you at?

      posted in General Questions
      ustkU
      ustk
    • RE: UPDATE // NEW: Online Knob Builder for HISE!! // Added: InnerShadows, Angled DropShadows, GradientOutlines.

      Since it throws us code, I can really see this as integrated Hise popup or specific tool window

      posted in Scripting
      ustkU
      ustk
    • RE: Confused about set.Bypassed() and ChildSynth vs Sampler

      @observantsound You can use both references at the same time. Just use the one that works for the bypass, and the other for your sampler job

      What I said might work, but do as @David-Healey said it's better implementation even if the reference are the same behind the scene 👍

      posted in General Questions
      ustkU
      ustk
    • RE: Rotation around center of mass is weird.

      @Chazrox It's even more obvious with 3 branches:

      modvalue.gif

      I love this one because it reminds me of the Wankel engine 😁

      6658daf57700d0e65101e98aa6b08572.gif

      posted in Scripting
      ustkU
      ustk
    • RE: Rotation around center of mass is weird.

      @Chazrox

      modvalue.gif

      HiseSnippet 1490.3ocsW0raaaDDdosYSrZSPCPO0SK7IYGIZJZKGaXDDG+iZMh+qVNAsHvHcE4RoslZWAxUwRsn.8cnuL8XN1mhh9.zC8RO2N6RJxk1JNIFM7fD2Y9lc9lY2Y4rmDK7oIIhXjUkyFOfhr9L61i4xd6ziv3n82EYce6CIIRZLNUz1iGPRRnAHKqY+Jk.q4mCoe96mrMIhv8oEhPnWHX9zCX8YxBoC15YrnnVj.5Yr9FnWcq88E7cDQhg.el01EMf3eAoK8HhB1L1nuljzCYsj8F999gqtZnWC+Uar55q0YiF9g9c771v8QAdzfNq0gR2X8Pj0mrW.SJhaKIRZBxZtsEAia2SbIO0Aufkv5DQUCZfZCdNUbKQTfJDURQ6ziEEbxjDUBBlkSJRayll19B6CYArb4EouOWq.WXgYBzZlxza1RzqgI8bMn2TnjkAklKkROvtseLafrPihOep89bX0Lj.qSlTIEKZle8N16H.DboSexEzVwvfbKptlqaML7yhaVoBrVkHwulDieFWzoA9w3IF1kJ2QzeffCCptfV6BfEkMv6FMvagxt3vwJoGPBMrxOlBosCD9jnCDhKdJOnEkFUELT6RmDp7ZJymmLTduSTUpjOxIl1kopEZMj6KYBd0EBhIWdpPRhG2NhEPiWnFNbhxt0vhN+vhU9oJX3QEEDf8fHGBv7MykFS3coYZ5SFgqm9FiW.IQRf8AsY+nBG4kdmiWBWsgiKf0C9cIrqSilKVfWLRiy8b7CwU03qaLGKhWF6Y.drFbi2Kv9pYFl9GZxoxHTSGLmucDIWBHJqz00wsT3FKONLDVa.jdNMKTIgjcT6KozAZMpX2.cANJOHeBpaNeOzbJfrnJW+ZRzPZQdWEx5EEX0WMeKuL9wFO3cN9fie9oveGc1oGePIcSvWuNFJpiwpBZ7JvvhziRtR7JmITwf6nvv00OaNELaKjYXVQ+Tvn55EoTTlyetvrcKF4Y01j02bJHUL8p0UmPj8plskpDRGRPf5+pZUpmW55zrFL2MOuVtrUJd00YUOyQMKFjuJokj4srHrrSiEC4A6Hh4z3jpMLQ1UUBm9Uipo+k3Dw51S1MlN1DHKLc0lE.KY3ImKoUMupNdedK1HZvSgveRfSiRnl.1cLeh5eVe1PkJSJ2wWaJLJ7yiEkFHU+R+Q35WYoZIcpQU97VzTR3UFddVbNeWmP3iq5EuRIvZk4.Pd.p9zKpurZIc5kRUDNkvKOA.A27SNRq7JEbX91pEqjpSNpy4RVfr2RtNq0bQGITYkDAavBtt9FOpYM7zjt3lps74lh6LFN9q9kKtrGTMiuPUJyjXeX2aLMnx72TZ3pgdQ3lGpB9QBI8XdZTB4A7UUEFNUcpJnXQTDMdppUs6DeSFVkOreGJPR8AR4.gOoWtOA62deBlsw3mVPa.Tv2myjGOfxeaM2fxNE.5oXlLVAPk5NJteVGEoepCwfFGtistLBoIbVqbu4ep9WOA8darWIi+yu429imfd996RjDUeMYzAn3.ZrjohdqcouF5pLsKm4s2klbgTL.RR48P.888NY7nhFO+tsFWLfskdemofdT0wIlRPe.txyvUuIdptx152ggSbS5HSWb2TWbuLWb.oCMR6g6Zqe2LZ9EhgK156KbwnRtnELRRGAu+k15yrvDcoeROx.JlDPFHSPgPxWc5hYO5eH7xLz2Z3sjWZFUSSuajWWuCXn2aQvP3.ixMjqt1RlBn5qTWvpNc4IL4Xyq07+VW5uuT7A1mvj98lNGmYJbTUr9QfiY2s4d16EFBGUVPv4ra8sebtHC5TwPIi28PhLlAadrOZX+1vmz8of24b36wpMIynJORG6pFqx.sgdIzC9W3ISYC0XqLkMlnD0m3GKdke5ATpaOcWsDfSb8MMmGtxKLFW9XM8Se3xbux2u7TcMC8tsFtxs0vUusF171Z3Z2VCezs0v0e2Fptq8SGJE8SKaPnCOYO8WRrr1iq5CVuaE8efZb2RJ
      
      posted in Scripting
      ustkU
      ustk
    • RE: Rotation around center of mass is weird.

      @Chazrox you need to use starBody3Star.getBounds(multiplier) as drawing area. Complex shapes manage their own area, that is dynamic so it can hold the entire shape without being distorted.
      A star doesn't fit in the same square as you rotate it. It needs to grow, shrink, and translate dynamically.
      In your code you force it to draw in a fix square, so the shape adapts...

      posted in Scripting
      ustkU
      ustk
    • RE: AI is the future

      @dannytaurus that one's nuts! 😆

      posted in AI discussion
      ustkU
      ustk
    • RE: Ellipse Masking // Mask makes shape dark.

      @Oli-Ullmann 👍 🤣

      posted in Scripting
      ustkU
      ustk