HISE Logo Forum
    • Categories
    • Register
    • Login
    1. HISE
    2. Chazrox
    • Profile
    • Following 5
    • Followers 3
    • Topics 123
    • Posts 1,050
    • Groups 0

    Chazrox

    @Chazrox

    Music Producer based in Los Angeles. Learning HISE everyday.

    272
    Reputation
    106
    Profile views
    1.1k
    Posts
    3
    Followers
    5
    Following
    Joined
    Last Online
    Age 41
    Location Los Angeles, CA.

    Chazrox Unfollow Follow

    Best posts made by Chazrox

    • RE: More Positive Posts?

      Good Morning! I agree. Here's something I've been doing. Aside from working on my personal plugins, I've been wanting to show my appreciation to the community by designing a set of 3d assets / filmstrips that people can use on their projects.

      There are quite a few regulars in here that always get me going when im stuck. I Love it here!

      This is just a mockup of one of the kits im working on. All of these assets should be available for anyone to use soon. Dont quote me on "soon". Im sure everyone in here has 10 things going at once lol.

      Screenshot 2025-02-02 at 9.14.44 AM.png

      Screenshot 2025-02-02 at 6.44.25 AM.png

      Im still messing around with the faceplate so the actual release might not be exact.

      Much Love to the community!
      Special Thanks to @Christoph-Hart
      and honorable mention to Mr. @d-healey who got me going on all this in the first place!
      Im soaking it all in!

      posted in General Questions
      ChazroxC
      Chazrox
    • FREE DESIGN || Upgrade Your Keyboard!

      Freebie for the community.
      Screenshot 2025-05-11 at 2.08.43 AM.png

      Here's the script:

      namespace LafRealKeyboard
      {
      	const var FloatingTile1 = Content.getComponent("FloatingTile1");
      	const var Laf_RealKeys = Content.createLocalLookAndFeel();
      	
      	//! DRAW WHITE NOTE
      	Laf_RealKeys.registerFunction("drawWhiteNote", function(g,obj)
      	{
      		var a = obj.area;
      		var WhiteUp = Laf_RealKeys.loadImage("{PROJECT_FOLDER}WHITE KEY - UP 11.png", "WHITE KEY - UP 11.png");
      		var WhiteDown = Laf_RealKeys.loadImage("{PROJECT_FOLDER}WHITE KEY - DOWN 11.png", "WHITE KEY - DOWN 11.png");
      		
      		if (obj.down)
      		{
      			g.drawImage("WHITE KEY - DOWN 11.png", a, 0, 0);
      			g.setColour(Colours.red);			
      		}
      		if (!obj.down)
      		{
      			g.drawImage("WHITE KEY - UP 11.png", a, 0, 0);	
      		}	
      	});
      	Content.getComponent("FloatingTile1").setLocalLookAndFeel(Laf_RealKeys);
      	
      	//! DRAW BLACK NOTE
      	Laf_RealKeys.registerFunction("drawBlackNote", function(g,obj)
      	{
      		var a = obj.area;
      		var BlackUp = Laf_RealKeys.loadImage("{PROJECT_FOLDER}BLACK KEY - UP 11.png", "BLACK KEY - UP 11.png");
      		var BlackDown = Laf_RealKeys.loadImage("{PROJECT_FOLDER}BLACK KEY - DOWN 11.png", "BLACK KEY - DOWN 11.png");
      		
      		if (!obj.down)
      		{
      			g.drawImage("BLACK KEY - UP 11.png", a ,0, 0);	
      		}
      		if (obj.down)
      		{	
      			g.drawImage("BLACK KEY - DOWN 11.png", [a[0], a[1], a[2], a[3] + 10] ,0, 0);
      		}
      	});
      	Content.getComponent("FloatingTile1").setLocalLookAndFeel(Laf_RealKeys);
      }
      

      Download these images and add them to your projects 'Images' folder. F5. Enjoy.
      FILES---> CUSTOM KEYBOARD IMAGES

      posted in General Questions
      ChazroxC
      Chazrox
    • CUSTOM TABLE PRESETS Sub-Menu Template || Ready-to-run!

      I've been struggling with this one for a while and finally got a solid working script! I just wanted to share with the community an easy working template.
      Table Preset Browser Working.gif

      Functions:
      Save
      Delete
      Rename
      Back
      Next
      Random
      Combobox presets with custom name save

      Hope this helps someone down the line!

      const var PresetList = Content.getComponent("PresetList"); 
      const var PresetNameToSave = Content.getComponent("PresetNameToSave");    
      const var SaveOk = Content.getComponent("SaveOk");
      const var TableEnvelope1Pro = Synth.getTableProcessor("Table Envelope1");
      
      // File path for saving/loading
      const var presetFile = FileSystem.getFolder(FileSystem.Desktop).getChildFile("myFile.json");
      
      // Declare object to hold presets
      var AttackTablePresets = {};
      var lastRandomPresetName = "";
      
      //------------------------ LOAD existing presets on init ------------------------//
      
      if (presetFile.isFile())
      {
      	AttackTablePresets = presetFile.loadAsObject();
      
      	// Manually extract keys
      	var keyList = [];
      	for (k in AttackTablePresets)
      		keyList.push(k);
      
      	PresetList.set("items", keyList.join("\n"));
      }
      
      
      //------------------------ SAVE PRESET ------------------------//
      
      inline function onSaveOkControl(component, value)
      {		
      	if (!value)
      		return;
      
      	local presetNameNOW = PresetNameToSave.get("text").trim();
      	if (presetNameNOW == "")
      		return;
      
      	local tableData0 = TableEnvelope1Pro.exportAsBase64(0);
      
      	// Add to object
      	AttackTablePresets[presetNameNOW] = tableData0;
      
      	// Save to file
      	presetFile.writeObject(AttackTablePresets);
      
      	// Update ComboBox
      	local keyList = [];
      	for (k in AttackTablePresets)
      		keyList.push(k);
      
      	PresetList.set("items", keyList.join("\n"));
      	PresetList.setValue(keyList.indexOf(presetNameNOW) + 1);
      	PresetNameToSave.set("text", "(Enter Preset Name)");
      };
      
      SaveOk.setControlCallback(onSaveOkControl);
      
      //--------------------------COMBOBOX RESTORE TABLE CONTROLS --------------------------//
      inline function onPresetListControl(component, value)
      {
          if (value <= 0)
              return;
      
          // Get the selected preset name from the ComboBox using the selected index
          local selectedPresetName = PresetList.getItemText();
      
          // Look up the table data in the preset object
          local presetData = AttackTablePresets[selectedPresetName];
      
          // Restore the table if data exists
          if (presetData)
              TableEnvelope1Pro.restoreFromBase64(0, presetData);
      };
      PresetList.setControlCallback(onPresetListControl);
      
      // ---------------------------DELETE CURRENT PRESET CONTROLS -------------------------------//
      const var DeletePresetButton = Content.getComponent("DeletePresetButton");
      
      inline function onDeletePresetButtonControl(component, value)
      {
          if (!value)
              return;
      
          local selectedIndex = PresetList.getValue();
          if (selectedIndex <= 0)
              return;
      
          // Get preset name
          reg presetNameToDelete = PresetList.getItemText();
      
          if (!isDefined(AttackTablePresets[presetNameToDelete]))
              return;
      
          Engine.showYesNoWindow("Delete Preset",
              "Are you sure you want to delete \"" + presetNameToDelete + "\"?",
              function(result) // nested callback
              {
                  if (result)  // IF 'YES' 
                  {
                      var newPresets = {};
                      for (k in AttackTablePresets)
                      {
                          if (k != presetNameToDelete) 
                              newPresets[k] = AttackTablePresets[k];
                      }
      
                      AttackTablePresets = newPresets;
      
                      presetFile.writeObject(AttackTablePresets);
      
                      var keyList = [];
                      for (k in AttackTablePresets)
                          keyList.push(k);
      
                      PresetList.set("items", keyList.join("\n"));
                      PresetList.setValue(PresetList.getValue() - 1); // Clear selection
                  }
              });
      };
      
      DeletePresetButton.setControlCallback(onDeletePresetButtonControl);
      
      //------------------------------------RANDOMIZER BUTTON CONTROLS ------------------------//
      const var RandomizePresetButton = Content.getComponent("RandomizePresetButton");
      
      inline function onRandomizePresetButtonControl(component, value)
      {
      	if (!value)
      		return;
      
      	// Collect preset names
      	local presetNames = [];
      	for (k in AttackTablePresets)
      		presetNames.push(k);
      
      	local total = presetNames.length;
      	if (total == 0)
      		return;
      
      	local randomPresetName = "";
      	local tries = 10; // safety cap to avoid infinite loop
      
      	while (tries > 0)
      	{
      		local i = Math.floor(Math.random() * total);
      		randomPresetName = presetNames[i];
      
      		// Stop if the new name is different, or only one preset exists
      		if (randomPresetName != lastRandomPresetName || total == 1)
      			break;
      
      		tries--;
      	}
      
      	// Find index of selected name in ComboBox
      	local comboIndex = 0;
      	for (i = 0; i < presetNames.length; i++)
      	{
      		if (presetNames[i] == randomPresetName)
      		{
      			comboIndex = i + 1;
      			break;
      		}
      	}
      
      	if (comboIndex > 0)
      		PresetList.setValue(comboIndex);
      
      	// Load the new preset
      	local presetData = AttackTablePresets[randomPresetName];
      	if (presetData)
      		TableEnvelope1Pro.restoreFromBase64(0, presetData);
      
      	// Store the name to avoid repetition next time
      	lastRandomPresetName = randomPresetName;
      };
      
      RandomizePresetButton.setControlCallback(onRandomizePresetButtonControl);
      
      
      //--------------------------BACK BUTTON CONTROLS -------------
      const var BackPresetButton = Content.getComponent("BackPresetButton");
      
      inline function onBackPresetButtonControl(component, value)
      {
      	if (!value)
      		return;
      
      	local currentIndex = PresetList.getValue();
      	local totalItems = 0;
      
      	for (k in AttackTablePresets)
      		totalItems++;
      
      	// Wrap to last if we're at the first
      	if (currentIndex <= 1)
      		currentIndex = totalItems + 1;
      
      	local newIndex = currentIndex - 1;
      	PresetList.setValue(newIndex);
      
      	local presetName = PresetList.getItemText();
      	local presetData = AttackTablePresets[presetName];
      
      	if (presetData)
      		TableEnvelope1Pro.restoreFromBase64(0, presetData);
      };
      BackPresetButton.setControlCallback(onBackPresetButtonControl);
      
      
      //-------------------------------NEXT BUTTON CONTROLS ---------------
      
      const var NextPresetButton = Content.getComponent("NextPresetButton");
      
      inline function onNextPresetButtonControl(component, value)
      {
      	if (!value)
      		return;
      
      	local currentIndex = PresetList.getValue();
      	local totalItems = 0;
      
      	for (k in AttackTablePresets)
      		totalItems++;
      
      	// Wrap to first if we're at the last
      	if (currentIndex >= totalItems)
      		currentIndex = 0;
      
      	local newIndex = currentIndex + 1;
      	PresetList.setValue(newIndex);
      
      	local presetName = PresetList.getItemText();
      	local presetData = AttackTablePresets[presetName];
      
      	if (presetData)
      		TableEnvelope1Pro.restoreFromBase64(0, presetData);
      };
      NextPresetButton.setControlCallback(onNextPresetButtonControl);
      
      // -------------------------RENAME PRESET BUTTON CONTROLS-----------------------
      const var RenamePresetButton = Content.getComponent("RenamePresetButton");
      
      inline function onRenamePresetButtonControl(component, value)
      {
      	if (!value)
      		return;
      
      	local selectedIndex = PresetList.getValue();
      	if (selectedIndex <= 0)
      		return;
      
      	local oldName = PresetList.getItemText();
      	local newName = PresetNameToSave.get("text").trim();
      
      	if (newName == "" || newName == oldName)
      		return;
      
      	// If new name already exists, do nothing (or optionally warn)
      	if (isDefined(AttackTablePresets[newName]))
      	{
      		Console.print("A preset with that name already exists.");
      		return;
      	}
      
      	// Copy data to new name
      	AttackTablePresets[newName] = AttackTablePresets[oldName];
      
      	// Rebuild the object without the old key
      	local newPresets = {};
      	for (k in AttackTablePresets)
      	{
      		if (k != oldName)
      			newPresets[k] = AttackTablePresets[k];
      	}
      
      	AttackTablePresets = newPresets;
      
      	// Save updated object to file
      	presetFile.writeObject(AttackTablePresets);
      
      	// Update ComboBox
      	local keyList = [];
      	for (k in AttackTablePresets)
      		keyList.push(k);
      
      	PresetList.set("items", keyList.join("\n"));
      
      	// Select the renamed preset
      	PresetList.setValue(keyList.indexOf(newName) + 1);
      };
      RenamePresetButton.setControlCallback(onRenamePresetButtonControl);
      
      

      I had the help of @d-healey and @Lindon with making this and a few extra helps from gpt.

      Bless! 🙏

      • ROX

      PS> if anybody wants to make improvements and toss it back, have at it! Together we can make the ULtimate Table preset menu. haha.

      posted in Scripting
      ChazroxC
      Chazrox
    • RE: Software for Animation Sprites....

      @rglides SAMPLE:

      *HISE Logo for fun. Dont sue me. lol

      Screenshot 2025-02-02 at 4.42.00 AM.png

      posted in General Questions
      ChazroxC
      Chazrox
    • RE: Software for Animation Sprites....

      Ok just sharing my first 3d Knob that I made! This is gonna be fun.

      @lalalandsynth how do you get your shadows to show up in the animation? I can seem to get mine to show up on the transparent areas.

      ezgif-4668e059bd8e4.gif

      posted in General Questions
      ChazroxC
      Chazrox
    • RE: Guitar Pedal GUI Kit in the making.

      Screenshot 2025-02-11 at 12.11.02 AM.png

      posted in Presets / Scripts / Ideas
      ChazroxC
      Chazrox
    • RE: Help. Project wont open. Instant crash.

      @Chazrox man I really figured this one out on my own and im proud of myself. lol

      I started digging around and I opened the corresponding .xml file for the project and noticed in one of the lines that it was pointing to a default preset that no longer existed in the expected folder it was supposed to be in. Turns out I DID do something, which was move that folder that the preset was supposed to be in. I deleted that line and everything opened up as normal. fweeww! Sweats! haha.

      this thing...

      Screenshot 2025-03-08 at 9.55.41 AM.png

      posted in Scripting
      ChazroxC
      Chazrox
    • RE: Sliders not responding to "Consumed" MIDI CCs

      @CyberGen I had some wierd bug regarding midi and I found on the forum somewhere that if your buffer settings in your DAW are 1024 or higher it would break the midi in some way...I thought that it sounded bogus until I tried it and it fixed my problem. Just throwing that out there because it seems your out in the deep like I was so it wont hurt to try!

      posted in Scripting
      ChazroxC
      Chazrox
    • GRID HELPER || Free Script

      If you're like me and just need an extra visual helper, you might find this useful.

      Screenshot 2025-05-31 at 4.19.37 PM.png

      Drop a panel in your project and name it "Grid1".

      namespace GridHelper
      {
      	const var Grid1 = Content.getComponent("Grid1");
      	
      	Grid1.setPaintRoutine(function(g) 
      	{
      		drawPandelGrid();
      	});
      	
      	inline function drawPandelGrid()
      	{
      		local a = this.getLocalBounds(0);
      		
      		// Size Controls
      		local NumBarsX = 10; // Number of Vertical Lines
      		local NumBarsY = 10; // Number of Horizontal Lines
      		local BarHeight = 1; // Horizontal Bar Size
      		local BarWidth = 1; // Vertical Bar Size
      		
      		// Colour Controls
      		local BarColour = Colours.withAlpha(Colours.black, 0.5); // Bar Colour
      		local BackgroundColour = Colours.withAlpha(Colours.pink, 0.5); // Optional Background Colour
      		
      		// Spacer Logic
      		local spacerY = a[3]/NumBarsY; // Horizontal Line Spacing
      		local spacerX = a[2]/NumBarsX; // Vertical Line Spacing
      		
      		// Paint Background		
      		g.fillAll(BackgroundColour); // Optional Background Colour
      		g.setFont("ArialBOLD", 12);
      		g.drawAlignedText("GRIDHELPER1.0", [5,5,100,5], "left");
      	
      		// Paint Lines
      		for (i=0;i<=NumBarsX;i++) // Vertical Lines
      		{					
      			local x = i * spacerX - (BarWidth/2); // Center Line ON grid
      			
      			g.setColour(BarColour);
      			g.fillRect([x,0,BarWidth,a[3]]);	
      		}
      		for (i=0;i<=NumBarsY;i++) // Horizontal Lines
      		{			
      			local y = i * spacerY - (BarHeight/2); // Center Line ON grid
      					
      			g.setColour(BarColour);
      			g.fillRect([0,y,a[2],BarHeight]);
      		}
      	}
      }
      

      Its a snippet from @Morphoice that I modified to have both horizontal and vertical lines, made it modular with the all the controls variables and customizable so you can set a different amount of x or y bars/lines. Comes in handy sometimes when I just want to visualize a certain part of my plugin and make sure its equally spaced to my desired paramaters.

      (idk if something like this exists already but I thought it was good excercise regardless). Bless! 🙏

      posted in Scripting
      ChazroxC
      Chazrox
    • RE: Player - I'm going crazy

      @clevername27 agreed. Just resubscribed for my second month and the amount that i've learned so far is insane.

      posted in ScriptNode
      ChazroxC
      Chazrox

    Latest posts made by Chazrox

    • RE: Copy & Save '.mid file' to 'folder' || Help.

      Keyzie Midi Drop And Save Working.gif

      posted in Scripting
      ChazroxC
      Chazrox
    • RE: Copy & Save '.mid file' to 'folder' || Help.

      I'll be sharing a cleaned up snippet version and make an example of this for anybody that might be looking for it. Thanks again guys! 🙏

      posted in Scripting
      ChazroxC
      Chazrox
    • RE: Copy & Save '.mid file' to 'folder' || Help.

      @Lindon @d-healey I GOT IT. 🙏 🙏 🙏

      After going through all the debugs I figured it out. Thank you guys so much. This was the last function I needed for my plugin which is just save a history of dropped files...and aside from some visual tweaks.....IM DONE!! Im on to the next step. Now i'll be buggin you guys about code-signing soon. haha. 🤛 Thanks so much!

      posted in Scripting
      ChazroxC
      Chazrox
    • RE: Copy & Save '.mid file' to 'folder' || Help.

      @Lindon

      I was setting my B panels callback to my A panel....thats why none of my prints were hitting. When I was dropping on panel B, Panel A script was running which is already doing what it needs to do fine.

      uhggh.. lol.
      its one letter sometimes messing your whole day up. haha.

      const var pnlMIDIFiles_B = Content.getComponent("pnlMIDIFiles_B");
      pnlMIDIFiles_B.setFileDropCallback("All Callbacks", "*.mid", onpnlMIDIFilesFileDrop_B);
      
      

      Your prints you added are extensive and im going to follow that from now on! Thank You sir! Im getting alot of info from these prints which I should help big time. Again 🙏

      Screenshot 2025-08-31 at 4.22.36 AM.png

      posted in Scripting
      ChazroxC
      Chazrox
    • RE: Copy & Save '.mid file' to 'folder' || Help.

      @Lindon said in Copy & Save '.mid file' to 'folder' || Help.:

      you need to do a LOT more Console.print debugging....

      I really should. 🙏

      posted in Scripting
      ChazroxC
      Chazrox
    • RE: Copy & Save '.mid file' to 'folder' || Help.

      @Lindon bro Thanks!

      Im gonna check this out right now and report back. 🙏
      I really appreciate the time brotha!

      These are a bunch of new api's for me so im sure I made alot of mistakes and asking chat gpt to help sometimes make things worse. lol

      posted in Scripting
      ChazroxC
      Chazrox
    • RE: panel in front

      @VirtualVirgin Took all the code out and just set the settings for each panel as shown below.

      Screenshot 2025-08-30 at 11.46.19 PM.png

      Is this what you need? I could be misunderstanding your issue. 🙏

      HiseSnippet 910.3ocsV0saSjCE1NsFQR2JnRb0d0ndU6JTYRRSonUZozj1sQKsDsAPHtAb83IiU7XGMiSayh3mWBtXubeSP7BrWtuF6aP1imIIyjMAJDnNRQiO+X+8cNGeraEoY73XcDBW5wC5wQ3efzdfxDTOfJTnlMP3ejzHh1oC8TI2oEUwkwNO24g7y3Rz9C5Qii4dHLdoe0ZOt3xnjw+d+8oRphwyDgPOUKX7GJBElLos162DR4gTO9iEg4rd68Zxzp5ZotOfskHtndTVWZG9ITqYEHninwAH7OQpTwmsqq6tUqVykRq5QoaWlW8db+c7Y0bumq2o0bge6fvW6.OgQG01PM7XDd480dCZGnOWktAOUDK.RZmTF0F14TwGpkdVJZkhpGHjdsFGzhQvpzJKDtTZH7VjiEdhIxyBk2LQgSlG4Cf3BSCuklBdkyCO2bvaNPBmCRKmBo0HsYQhdlLMV7rBooxvi7oPdJOTRsEU3MXRcMXgxrUHsK+vHXxDO1XGW2a6Ty0cyetDLFaXGtotNrmVAS1X8jBlpqCl7YzW9RzWY8jsX0R24NNGoO+ObLATy8cZ50cKGoVtkSouogeeEyHzJGs5Dsg+H0FaV5UkJV50kb9+p78mqNK1izRIOZtpsU1QeNG2P0O7TdzscNiJ6ymXHj8ltjf7oKIxWwxRCk4LTqZpDlG0iq9T0wnQwe3qmzrA0Ps0QijA10iGYDVHfavOCNEmVUUjzfG20n6Aq5jjFzIwjnc0w0b1bHR.UVWmjluQW.bA+VXuFX+3ufONW3YBlb7+cc2KfK5DjqQg2dToTedc3+SgNA.TtA4ARoSl.ggGNtgQwqgPCGZ8KSZk7hSVrjFaBUGfVEP4HvJWBApjRfONl.ueFB7xvucBLr1bIvHwyP.C+BSl2e.82oa6WQdoZJs9ywz5etJn0PzuLOZMV7r4kYalAsQ0d8kTyz8Vs2.MRAb5ZpFZ1lVpXgYP9an9t0v8KEhqQZILrf4iwByAivYvqBLN5ZpUIG36yYlL.tL4vmc0bmD5208MPF8XpIRXqxNoeXaH2y3vtqrOpvVvUvVulN20N2FAZyUdISFBiQJKamiGor7XknPJKR+BVZOU6EgWOQBfIUxiFJRN1N2oLJoOa93bHbu7KXroWpYbrxh5X0E0wsWTGqsnNtyh53cWTG28xcz9roGz2nCSO1fPG25fjKov3CT1WllTsh9O5gj4PC
      

      it seems like Z level is baked into dragging. If you needed to script functions you can write mouse callbacks for your panel data, but I think scripting the z level in this situation is causing a bug.


      then again...

      your snippet is working if you just turn on dragging .

      HiseSnippet 951.3ocsV0saaaCElxIJnVadnEXO.B9J4hf.Y63rTTr0zXmrYr5Di4thgMLzxPQYQXIRAQpjYTTr9prq5SSeW1af2gRVVxKtcctszWXd9i7SmyGOjiSDDpTJRPFVOcdLEY7klSlyUA8CvLNZ3.jwWYNBKUzD6bUmNOFKkTOjgwNeuVgQ8cQYi+9QmhCwbBsTEB8LAiPeBKhoJ0N9jejEFdN1i9TVTEuO7jgDAuuHTjB3YGSWTLlLCOkdAV6VMSzOfkAHi6a1oiO4XW2i61smKF20CiOrMs6Cn9G4S549.Wuq54B+NBYr2YdLkHYhBqnRjwtmJ7lOIPbCOeCdFSxtJjpEZil.6bt5yEgd5OQsVT+.Vn23hDkDAqx3xz1N4osu1bDyisReY56tYFrKinZBzn15vam0fW6pvysB71.jLp.ocygz8LmPRXwpRKZ77ElC4P0zGC0opPI2WTMyZl8EfGb0AQ3YzyS.gUQ3bjq6918bca8PKKKnXIU1WiSri4gR6u0152pWD6TppuHJVvAAmliwbZX2ls1ugkMLdON09CwoNMaY86OrA.AeQhsSrMimAgVMrdYdvwGHopQhTIsONL7JfF43mxIJlf6Pak6yRW0ClusC8.RHiLi50pTudnBXR8p8qOgdMMzoYVFoIj.zFeE7+qr15QAlrE7KDJ5kbmVVuzpNrj1+aS99azlNKkHBCoIazr9.Vx6KPGdZzUzj8gxXXJcki.IZclo46lYV8fCIunUwQAeHmotLlxeWGmPKqzvred3.rBqoyK0A9ESSTLMDLFPuFZljStqaNfJmoDwvpthd.MwTYVaTP80rEDCH32wLmdg9C3aw3MvdMWO4tvjaXdpfUcgd8rSBnroAU5W4cBvgD2Tvjj50uulqHsujGNGwTznhtV02CgVrPGUo1NUUmsTCRvSmx3SgOpZn+GvuSN7eaA7+yaA+WD8wB+E81H7Wp9iB9cyg+eU.+8L9jC+EnuaSvuP8sg+s6aBcrEdogX05sw0W1sz.bBZsdm59ibISMu5kgex5s+gBw6YNloHAaFi01.FgyYeNv3xaDaXdluOknJA3tlm+Kedt9C8ShTETQGgUILMG6hznIPsmPgcmCLOcGLnXqCMS1UKqy.SnbuLgEvXow1ZYikFaWXDEgIIhmSx6apuy8NYZ.LwydeRc3gRfrcaTVuzp44H3I.OmPVeotUfc11.6tsAd31FXusMvi11.+lsMvi+uCT+BsGmpDQ4GaPnQiOK6hHCiy3XfAlwVQ+ytB0Of
      

      Sorry. Im just trying to figure this out with you. lol 🤛

      this also works.

      Content.makeFrontInterface(600, 500);
      
      
      const var pnls = 
      [	Content.getComponent("Panel3"),
          Content.getComponent("Panel1"),
          Content.getComponent("Panel2")
      ];
      
      
      for (p in pnls)
      {
          p.setMouseCallback(function(e)
          {
              if (e.clicked)          
                  {
                  	this.set("allowDragging", true);	
                  }
                  else
                  {
                  	this.set("allowDragging", false);
                  }
          });
      }
      
      posted in Scripting
      ChazroxC
      Chazrox
    • RE: Copy & Save '.mid file' to 'folder' || Help.

      This is where im at now, still not working completely. All of the functions work in this code block except for the part where I want the dropped file saved to the AppData folder. Can anyone help with this please? 🙏

      Scroll down a little bit...

      //! onPnlMIDIFilesFileDrop ---------------------------------------------------------------
      inline function onpnlMIDIFilesFileDrop_B(obj)
      {
          // HOVER STATE
          prevHover = this.data.hover ? 1 : 0;
      
          this.data.hover = (obj.hover && !obj.drop) ? 1 : 0;
      
          if ((this.data.hover ? 1 : 0) != prevHover)
          {
          	this.repaint();
          }
      
          // HOVER CHECK
          if (obj.hover && !obj.drop)
          {
              this.data.text    = "Drop to load!";
              this.data.dropped = false;
              this.changed();
              return;
          }
         
          if (!obj.drop || obj.fileName == undefined)
          {
          	return;	
          }
      
          // PARSE BASE NAME
          local full = obj.fileName;   
          local slash = Math.max(full.lastIndexOf("/"), full.lastIndexOf("\\"));   
          local dot = full.lastIndexOf(".");
          
          if (dot < 0) 
          {
          	dot = full.length;
          }
          
          local base = full.substring(slash + 1, dot);
      
          this.data.filename = base;   // paint()
          this.data.fileName = base;   // sync
      	
      	Console.print("BASE__" + base);
          // HIDE RANGE SLIDER WHILE NO EVENTS
          RangeSlider.set("visible", 0);
      
          // LOAD MIDI PLAYER TRACK 1
          MIDIPlayer1.setFile(full, true, true);
          if (MIDIPlayer1.setTrack != undefined) MIDIPlayer1.setTrack(1);
      		
      	// START POLLING EVENTS
      	midiRangeTimer.stopTimer();
      	midiRangeTimer.startTimer(50);
          // -----------------------------------------------------------
          // COPY DROPPED FILE INTO AppData 
          // -----------------------------------------------------------
         
      	local original = FileSystem.fromAbsolutePath(full);
      	local filename =  original.toString(this.data.Filename);
          if (isDefined(original) && original.isFile())
          {
                    
      		Console.print(filename.toString());
             	Console.print("ORIGINAL__" + original);
              
              local appDataDir = FileSystem.getFolder(FileSystem.Downloads);
              local newFile = appDataDir.getChildFile(filename);
      
              original.copy(newFile);
             // newFile.move(appDataDir);
      		Console.print("NEWNEWNEW" + newFile);
          }
      	
          Console.print("Saved copy to AppData: " + newFile.toString(newFile.FullPath));
      	
      		
         
          // Save As "FAVORITE" Midi File in AppDataFolder
          // SaveFavoriteMidiFiles();
      
          // setAnalysisWindowFull();
          disableAllChords();
          // groupMidiNotesByTimeInWindow(analyzeStartMs, analyzeEndMs);
          // RangeSlider.setValue({ min: RangeSlider.get("min"), max: RangeSlider.get("max")});
          disableAllChords();
          // addChordsFromCurrentWindow();
      
          // UI flags
          this.data.text    = "Loaded";
          this.data.dropped = true;
          this.data.hover   = false;
          this.changed();
          this.repaint();
      
          knbSmartStrength.changed();
          pnlCustomMidiPanel.sendRepaintMessage();
          pnlCustomMidiRipView.sendRepaintMessage();
      }
      

      none of my .prints return any results in that section either.

      posted in Scripting
      ChazroxC
      Chazrox
    • RE: Copy & Save '.mid file' to 'folder' || Help.

      @d-healey ok. I'll check all of that now.

      posted in Scripting
      ChazroxC
      Chazrox
    • RE: Copy & Save '.mid file' to 'folder' || Help.

      @d-healey complete mess at the moment but have a look.

      inline function onpnlMIDIFilesFileDrop_B(obj)
      {
          // Maintain hover state for paint()
          local prevHover;
          prevHover = this.data.hover ? 1 : 0;
      
          this.data.hover = (obj.hover && !obj.drop) ? 1 : 0;
      
          if ((this.data.hover ? 1 : 0) != prevHover)
              this.repaint();
      
          // Hover hint
          if (obj.hover && !obj.drop)
          {
              this.data.text    = "Drop to load!";
              this.data.dropped = false;
              this.changed();
              return;
          }
      
          
          if (!obj.drop || obj.fileName == undefined)
              return;
      
          // Parse basename (no path, no extension)
          local full;
          full = obj.fileName;
      
          local slash;
          slash = Math.max(full.lastIndexOf("/"), full.lastIndexOf("\\"));
      
          local dot;
          dot = full.lastIndexOf(".");
          if (dot < 0) dot = full.length;
      
          local base;
          base = full.substring(slash + 1, dot);
      
          this.data.filename = base;   // paint()
          this.data.fileName = base;   // sync
      
          // Hide the slider while bounds/values are inconsistent
          RangeSlider.set("visible", 0);
      
          // Load into MIDIPlayer1 (track 1)
          MIDIPlayer1.setFile(full, true, true);
          if (MIDIPlayer1.setTrack != undefined) MIDIPlayer1.setTrack(1);
      
          // Start polling until the events are actually available
          midiRangeTimer.stopTimer();
          midiRangeTimer.startTimer(50);
      
          // -----------------------------------------------------------
          // COPY DROPPED FILE INTO AppData 
          // -----------------------------------------------------------
          local original;
          original = FileSystem.fromAbsolutePath(full);
      
          if (original == !undefined)
          {
              local filename;
              filename = original.toString(original.Filename);
      
              local appDataDir;
              appDataDir = FileSystem.getFolder(FileSystem.Downloads);
      
              local newFile;
              newFile = appDataDir.getChildFile(filename);
      
              original.copy(newFile);
              //original.move(appDataDir);
      
              Console.print("Saved copy to AppData: " + newFile.toString(newFile.FullPath));
          }
      
          // Your existing flow
          // Save As "FAVORITE" Midi File in AppDataFolder
          // SaveFavoriteMidiFiles();
      
          // setAnalysisWindowFull();
          disableAllChords();
          // groupMidiNotesByTimeInWindow(analyzeStartMs, analyzeEndMs);
          // RangeSlider.setValue({ min: RangeSlider.get("min"), max: RangeSlider.get("max")});
          disableAllChords();
          // addChordsFromCurrentWindow();
      
          // UI flags
          this.data.text    = "Loaded";
          this.data.dropped = true;
          this.data.hover   = false;
          this.changed();
          this.repaint();
      
          knbSmartStrength.changed();
          pnlCustomMidiPanel.sendRepaintMessage();
          pnlCustomMidiRipView.sendRepaintMessage();
      }
      
      posted in Scripting
      ChazroxC
      Chazrox