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

    Posts

    Recent Best Controversial
    • RE: Completely flummoxed over panel value...

      @ustk apparently it has to do with transferring an array reference. I tried this

      local newValue = scribeData.clone();
      

      instead of this

      local newValue = scribeData;
      

      And now it works (the old value is properly being retrieved)...
      But I am not quite sure why as I am lost in the puzzle of how the array references operate in this case.

      posted in Scripting
      VirtualVirginV
      VirtualVirgin
    • Completely flummoxed over panel value...

      I have been scratching my head for a couple of hours on this, and I just don't understand!

      I am trying to use the panel with the undo system, and here I am getting the old panel value before setting the new panel value, but my old value is always identical to the new value!!!!

      Screenshot 2025-08-04 at 2.30.26 PM.png

      The line below the Console prints is

      NotationPanel.setPanelValueWithUndo(oldValue, newValue , "set");
      

      This line is the only place in the entire project that is setting the panel value.
      There are no other calls to .setPanelValueWithUndo or .setValue.

      How is it at all possible that NotationPanel.getValue is always returning the new value before it is ever even set?

      posted in Scripting
      VirtualVirginV
      VirtualVirgin
    • RE: Any ideas on why .charAt() would suddenly stop working?

      @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

      posted in Scripting
      VirtualVirginV
      VirtualVirgin
    • RE: Any ideas on why .charAt() would suddenly stop working?

      @d-healey I think this project is a bit too involved to make a snippet. Maybe I can try later. Here is the variable in question a little earlier in the chain, and it is also perplexing:

      Screenshot 2025-08-02 at 6.49.01 PM.png

      The variable "MPN" is being set here from a ternary and the print just before that clearly shows that noteObject.y[0] has a value: "F5"
      And it shows that the direction is "up".

      Then again, it goes on to print a value that it says is "undefined".
      A bit perplexing... seems contradictory.

      posted in Scripting
      VirtualVirginV
      VirtualVirgin
    • RE: Any ideas on why .charAt() would suddenly stop working?

      And now it is printing the result while still saying that the function doesn't exist!!!

      Screenshot 2025-08-02 at 6.07.22 PM.png

      posted in Scripting
      VirtualVirginV
      VirtualVirgin
    • RE: Any ideas on why .charAt() would suddenly stop working?

      What is going on???

      Screenshot 2025-08-02 at 6.04.41 PM.png

      posted in Scripting
      VirtualVirginV
      VirtualVirgin
    • Any ideas on why .charAt() would suddenly stop working?

      This function has been doing the job contently for some time,
      but now it doesn't...

      Screenshot 2025-08-02 at 5.52.08 PM.png

      Logically, this should be getting the "B" from "B6".
      How would this not work?

      posted in Scripting
      VirtualVirginV
      VirtualVirgin
    • RE: Turn a unit on/off

      @bendurso Thanks!

      posted in General Questions
      VirtualVirginV
      VirtualVirgin
    • RE: Turn a unit on/off

      @bendurso Ah! I've never doe that before. How do I "get" the container reference?

      const TestContainer = ???
      
      posted in General Questions
      VirtualVirginV
      VirtualVirgin
    • RE: Turn a unit on/off

      @ulrik Is that supposed to work with any container?

      I just tried a test and I get this:

      Screenshot 2025-07-30 at 10.36.17 AM.png

      posted in General Questions
      VirtualVirginV
      VirtualVirgin
    • RE: Pushing Array Values || Its me again...

      @Chazrox said in Pushing Array Values || Its me again...:

        for (i = 0; i < NumSliders.length; i++)
        {
        	Slider2Values.push(SliderPack2.getSliderValueAt(i));
        	output += "\r";
        	
        }
      

      You need to do some Console.prints to check any variables.

      // if the loop has no length, 
      // no code will be executed
      Console.print("NumSliders.length: " + NumSliders.length);
      // make sure the component is available here
      Console.print("SliderPack2: " + SliderPack2); 
      
      for (i = 0; i < NumSliders.length; i++)
      {
              // make sure there are values to be pushed
              Console.print("SliderPack2 sliderValue " + i + ":" + SliderPack2.getSliderValueAt(i));
      	Slider2Values.push(SliderPack2.getSliderValueAt(i));
      	output += "\r"; 			
      }
      
      posted in Scripting
      VirtualVirginV
      VirtualVirgin
    • RE: Is there a way to search all included .js files?

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

      posted in General Questions
      VirtualVirginV
      VirtualVirgin
    • Is there a way to search all included .js files?

      I seem to be using a lot of .js files and so I'm just checking to see if there is a way to search terms in all of them at once, rather than switching tabs and performing the same search on each one.

      posted in General Questions
      VirtualVirginV
      VirtualVirgin
    • RE: Is there a guide for the SVG to path converter?

      @d-healey Thanks, I think the

      ScriptPanel.setMouseCursor(var pathIcon, var colour, var hitPoint)
      

      only accepts paths though.

      That is the only reason I am converting the SVG glyphs to paths.

      posted in Scripting
      VirtualVirginV
      VirtualVirgin
    • RE: How can I efficiently remove a key from an object?

      So this works but it's just a little clunky:

      var testObject = {"testKey1": "testValue1", "testKey2": "testValue2"};
      
      // removes a key from an object, but just be aware that it does not edit the object in place
      // you must use the new object made here to replace the original
      inline function objectRemoveKey(obj, keyToRemove)
      {
          local newObj = {};
      
          for (key in obj)
          {
              if (key != keyToRemove)
              {
                  newObj[key] = obj[key];
              }
          }
          
          return newObj;
      }
      
      var testRemove = objectRemoveKey(testObject, "testKey1");
      
      Console.print(trace(testRemove));
      
      posted in Scripting
      VirtualVirginV
      VirtualVirgin
    • RE: Is there a guide for the SVG to path converter?

      @d-healey Oop! Sorry I forgot to add this image:Screenshot 2025-06-23 at 6.41.19 PM.png

      Under the question "What are these different path options?".
      They are the path options for the SVG to path converter.

      posted in Scripting
      VirtualVirginV
      VirtualVirgin
    • How can I efficiently remove a key from an object?

      "delete" does not work as expected:

      Screenshot 2025-06-23 at 6.34.14 PM.png

      There are some methods to iterate over the keys in the object and remove one and return a copy of the original, but that seems a little excessive and painful for that task at hand. Is there something simple like "delete"?

      posted in Scripting
      VirtualVirginV
      VirtualVirgin
    • Is there a guide for the SVG to path converter?

      I can't seem to find much info in the documentation.

      I did find this on David Healey's Youtube but it using a method with JUCE instead of the one in HISE: https://www.youtube.com/watch?v=OHqAijNUabU&t=65s

      I am pretty sure there is a newer video, but I don't find it when searching either "svg" or "path" when searching the channel.

      Anyway, I am looking to convert a lot of glyphs in SVG format to path as I need to use some of them for the

      ScriptPanel.setMouseCursor(var pathIcon, var colour, var hitPoint)
      

      What are these different path options?
      Should I be using "HiseScript Path number array" format if I am just using the paths in HISE?

      posted in Scripting
      VirtualVirginV
      VirtualVirgin
    • RE: How do I send 'noteOff' messages from UI Button?

      @Chazrox use timeStampSamples = 0

      There is also another method depending on how you need to handle noteOn and noteOff.

      If you use

      Synth.addNoteOn(int channel, int noteNumber, int velocity, int timeStampSamples)
      

      to add your notes I believe it returns the eventId.

      With that you can use

      Synth.noteOffByEventId(int eventId) 
      

      to match notes you made with the first method.

      So for example:

      local  eventId = Synth.addNoteOn(1, 60, 127,0);
      

      Then you can supply that eventId to make the matching noteOff.

      posted in Scripting
      VirtualVirginV
      VirtualVirgin
    • RE: Adding JSON properties to a component via script?

      @ericchesek What is it you are trying to achieve? When you are creating the sliders in a loop, are you appending the index number to each in the name?
      Here are some examples of indexing for the ID:

      // a loop to create sliders
      inline function createSliders(stringName, numOfSliders)
      {
      	local sliders = [];
      
      	for (i = 0; i < numOfSliders; i++)
      	{
      		// this appends the index to the slider name: "stringName + i"
      		local slider = Content.addKnob(stringName + i, 50 + i * 125, 50);
      		// this stores the component object inside an array
      		sliders[i] = slider;
      		slider.set("style", "vertical");
      	}
      	return sliders;
      }
      
      // call the function to create the sliders
      const mySliders = createSliders("MySlider", 4);
      // a separate array for the names ("Id")
      const mySlidersIdArray = mySliders.map(function(element){return element.getId();});
      
      Console.print("mySlidersIdArray: " + trace(mySlidersIdArray));
      
      

      So there are multiple ways to use an index as ID to associate with a component.

      posted in Scripting
      VirtualVirginV
      VirtualVirgin