HISE Logo Forum
    • Categories
    • Register
    • Login
    1. HISE
    2. VirtualVirgin
    3. Topics
    • Profile
    • Following 1
    • Followers 0
    • Topics 140
    • Posts 530
    • Groups 0

    Topics

    • VirtualVirginV

      Coding in VS Code and HISE

      Watching Ignoring Scheduled Pinned Locked Moved Scripting
      16
      0 Votes
      16 Posts
      169 Views
      OrvillainO

      @Christoph-Hart said in Coding in VS Code and HISE:

      If that is a popular request I can add a "external code editor mode" that can be enabled in the HISE compiler settings and will create file watchers with automatic file reload & recompilation.

      Let's talk pitfalls before I do that so we don't end up with something that trashes your code files:

      should we make external files read only in the HISE code editor if this mode is enabled? Since the "source of truth" will switch in this mode to the actual file content it would be easy to create conflicts if the files are modifiable from both ends, especially if a file is included in more than one script. how should we indicate that this mode is active? do we need a customizable interval for file checks or would a sensible default (eg. 3 seconds) be enough?

      No need for read only in the HISE code editor IMO. Hise should just poll the file(s) for changes, maybe each time the window is accessed?? I quite often make major changes in VS Code, and then come into HISE, wait a few seconds and then compile, spot an error, and then quickly fix it directly in HISE. VS Code picks up the changes instantly.

      A customizable interval shouldn't really be needed, again IMO. It should just be as quick and transparent as possible. Like with Notepad++, VS Code, and other text editors.

    • VirtualVirginV

      Looking into the hise_documentation on GitHub- any reason why a majority of the markdown files are empty for the Scripting API?

      Watching Ignoring Scheduled Pinned Locked Moved Documentation
      12
      0 Votes
      12 Posts
      165 Views
      VirtualVirginV

      @Christoph-Hart said in Looking into the hise_documentation on GitHub- any reason why a majority of the markdown files are empty for the Scripting API?:

      Aw poor @VirtualVirgin that was half an hour that you'll never get back

      "Aw poor @VirtualVirgin that was half an hour that you'll never get back"

      No worries! Was learning how to generate markdown files from text.
      I made text files of all of the classes in the API, then ran a python script to transform it to markdown. Just a learning experience. I then went on the generate JSON for the API with the following schema:

      { "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Scripting API Method", "type": "object", "properties": { "class": { "type": "string", "description": "The class this method belongs to." }, "method": { "type": "string", "description": "The method name." }, "description": { "type": "string", "description": "A description of what the method does." }, "syntax": { "type": "string", "description": "The usage syntax string for the method." }, "parameters": { "type": "array", "description": "List of method parameters.", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "The parameter name." }, "type": { "type": "string", "description": "The parameter type." }, "optional": { "type": "boolean", "description": "Whether the parameter is optional." }, "description": { "type": "string", "description": "A description of the parameter." } }, "required": ["name", "type", "optional", "description"], "additionalProperties": false } }, "returns": { "type": "string", "description": "The return type of the method." }, "examples": { "type": "array", "description": "Code examples demonstrating usage.", "items": { "type": "string" } } }, "required": [ "class", "method", "description", "syntax", "parameters", "returns" ], "additionalProperties": false }

      Which makes this for example:

      [ { "class": "Array", "method": "clear", "description": "Clears the array.", "syntax": "Array.clear()", "parameters": [], "returns": "", "examples": [ "const var arr = []; // Declare an array\n\n// preallocate 10 elements, do this if you\n// know how many elements you are about to insert\narr.reserve(10); \n\nfor(i = 0; i < 10; i++)\n{\n\t// Add an element to the end of the array\n\tarr.push(Math.randInt(0, 1000));\n}\n\nConsole.print(trace(arr)); // [ 523, 5, 76, 345, 765, 45, 977, 223, 44, 54]\n\narr.clear();\n\nConsole.print(trace(arr)); // []" ] }, { "class": "Array", "method": "clone", "description": "Creates a deep copy of the array.", "syntax": "Array.clone()", "parameters": [], "returns": "A deep copy of the array.", "examples": [ "const arr1 = [0, 1];\n\nvar arr2 = arr1;\n\n// Changing any element in arr2 will also change it in arr1\narr2[0] = 22;\nConsole.print(trace(arr1)); // [22, 1]\n\n// Reset the element 0 back to 0\narr1[0] = 0;\n\n// Cloning the array creates a new dataset in memory, separate from the original array\narr2 = arr1.clone();\nConsole.print(trace(arr1));\narr2[0] = 22;\nConsole.print(trace(arr2));" ] },

      I'm sure this is all elementary for you and David, but I'm just learning how to do some these data formats and transformations with parsers etc.

    • VirtualVirginV

      Is there a way to capture HISE console logs externally?

      Watching Ignoring Scheduled Pinned Locked Moved General Questions
      2
      0 Votes
      2 Posts
      556 Views
      d.healeyD

      @VirtualVirgin There's Debug Mode

      639036a8-eead-4095-90a5-51213ad283d9-image.png

      I don't think this write the output of Console.print though, so you'd need to handle that yourself.

    • VirtualVirginV

      Selecting a whole block of code

      Watching Ignoring Scheduled Pinned Locked Moved General Questions
      3
      0 Votes
      3 Posts
      541 Views
      dannytaurusD

      @VirtualVirgin The editor drives me batty. It functions so differently to what I'm used to that I'm constantly making subtle typos that fail to compile.

      I'm looking into coding in my familiar code editor and hopping back to HISE just to hit F5. Thinking about it, there might even be a way to automate it. Set up a file watcher and every time a script file int he HISE project is saved, tell HISE to compile. 🤔

    • VirtualVirginV

      Set font style?

      Watching Ignoring Scheduled Pinned Locked Moved Scripting
      16
      0 Votes
      16 Posts
      689 Views
      d.healeyD

      @VirtualVirgin might work, try it in the compiled plugin and let us know

    • VirtualVirginV

      Is there a way to change the double-click delta time threshold?

      Watching Ignoring Scheduled Pinned Locked Moved General Questions
      1
      0 Votes
      1 Posts
      54 Views
      No one has replied
    • VirtualVirginV

      Trouble with Array.contains()

      Watching Ignoring Scheduled Pinned Locked Moved Scripting
      3
      0 Votes
      3 Posts
      111 Views
      VirtualVirginV

      @d-healey Right on both counts of course!!

    • VirtualVirginV

      Completely flummoxed over panel value...

      Watching Ignoring Scheduled Pinned Locked Moved Scripting
      4
      0 Votes
      4 Posts
      129 Views
      ustkU

      @VirtualVirgin hard to tell without knowing what scribeData is

    • VirtualVirginV

      Any ideas on why .charAt() would suddenly stop working?

      Watching Ignoring Scheduled Pinned Locked Moved Scripting
      7
      0 Votes
      7 Posts
      170 Views
      VirtualVirginV

      @d-healey Actually, I think I just found the error:

      local MPN = direction == "up" ? noteObject.y[0] : noteobject.y[noteObject.y.length -1];

      vs.

      local MPN = direction == "up" ? noteObject.y[0] : noteObject.y[noteObject.y.length -1];

      I forgot the camelCase on noteObject for the false branch :P

    • VirtualVirginV

      Is there a way to search all included .js files?

      Watching Ignoring Scheduled Pinned Locked Moved General Questions
      3
      0 Votes
      3 Posts
      109 Views
      VirtualVirginV

      @aaronventure Thanks!
      This is great! What a useful feature.

    • VirtualVirginV

      How can I efficiently remove a key from an object?

      Watching Ignoring Scheduled Pinned Locked Moved Scripting
      7
      0 Votes
      7 Posts
      291 Views
      Christoph HartC

      @d-healey yeah something like JSON.delete(obj, key) is the easiest way, the delete syntax would require a real brain-twister with the current parser.

    • VirtualVirginV

      Is there a guide for the SVG to path converter?

      Watching Ignoring Scheduled Pinned Locked Moved Scripting
      7
      0 Votes
      7 Posts
      390 Views
      C

      @d-healey They are now in the docs: https://docs.hise.audio/scripting/scripting-api/scriptpanel/index.html#setmousecursor

    • VirtualVirginV

      Just wondering about how this logic condition evaluates

      Watching Ignoring Scheduled Pinned Locked Moved Scripting
      6
      0 Votes
      6 Posts
      251 Views
      VirtualVirginV

      @d-healey said in Just wondering about how this logic condition evaluates:

      @VirtualVirgin said in Just wondering about how this logic condition evaluates:

      Yes! That is the solution :)

      You can probably also get rid of the ternary operator at the end - ? true : false because the statement itself should return true or false.

      Yes, that makes sense. It is just evaluating to that anyway, so no need to make it redundant.

    • VirtualVirginV

      Any particular reason that eval() does not work here?

      Watching Ignoring Scheduled Pinned Locked Moved Scripting
      8
      0 Votes
      8 Posts
      269 Views
      d.healeyD

      @VirtualVirgin parseInt and trace

      I think I made a video about undocumented functions (if I didn't I should).

    • VirtualVirginV

      Out of curiosity, why are external .js files not allowed inside a namespace?

      Watching Ignoring Scheduled Pinned Locked Moved Scripting
      6
      1 Votes
      6 Posts
      502 Views
      Christoph HartC

      I think the reason is just that the JS parser can‘t build namespaces across multiple files, but I don’t think there‘s a valid reason for touching that part of the codebase…

    • VirtualVirginV

      LAF to draw text input of a slider?

      Watching Ignoring Scheduled Pinned Locked Moved Scripting
      10
      0 Votes
      10 Posts
      1k Views
      ChazroxC

      I just found this on the forum compliments to @HISEnberg ! 🙏

      https://forum.hise.audio//post/100409

      Content.makeFrontInterface(200, 50); const var Label1 = Content.getComponent("Label1"); const var lblCss = Content.createLocalLookAndFeel(); Label1.set("text", "CSS Label"); // Email/Key Label Laf lblCss.setInlineStyleSheet(" * { letter-spacing: 2px; font-weight: regular; } /** Render the default appearance. */ label { background-color: var(--bgColour); color: var(--textColour); border-radius: 5px; padding-left: 50px; padding-right: 20px; text-shadow: 2px 2px 5px rgba(0,0,0,0.3); } /** If you edit the text, it will use this selector. */ input { text-align: left; padding-top: 0.5px; padding-left: 50px; padding-right: 20px; caret-color: white; font-weight: bold; } /** Style the text selection with this selector. */ ::selection { background: #50FFFFFF; color: white; } "); Label1.setLocalLookAndFeel(lblCss);
    • VirtualVirginV

      Very strange behaviour with Engine.getUptime()?

      Watching Ignoring Scheduled Pinned Locked Moved Scripting
      8
      0 Votes
      8 Posts
      845 Views
      VirtualVirginV

      @d-healey There isn't a particular standardization spec for MIDI 1.0 timestamps that I am aware of so I was thinking the HISE timestamp would be related to an internal clock. I would expect the output to be in samples, milliseconds or maybe PPQ, but I don't see that reflected in your Console.print there.

      @Christoph-Hart
      How do the timestamps for MIDI messages work in HISE?

    • VirtualVirginV

      How do I use LAF to draw the dropdown of a comboBox?

      Watching Ignoring Scheduled Pinned Locked Moved Scripting
      5
      0 Votes
      5 Posts
      555 Views
      VirtualVirginV

      @Chazrox Thanks!!

    • VirtualVirginV

      Font not changing on comboBox. What am I doing wrong?

      Watching Ignoring Scheduled Pinned Locked Moved General Questions
      5
      0 Votes
      5 Posts
      494 Views
      ChazroxC

      @d-healey Good to know! I LAF everything so I didnt notice this was even broken.

    • VirtualVirginV

      Engine.getSamplesForMilliseconds() not working

      Watching Ignoring Scheduled Pinned Locked Moved Bug Reports
      5
      0 Votes
      5 Posts
      649 Views
      C

      @d-healey It's those kinds of catches that make you a legend, mate.