Well, so far I have found that if I do not open the included .js file in a tab inside HISE, it seems I can work on changes inside VS Code and they will be retained when I compile in HISE. I don't know much about the caching system, so I can't guarantee this will continue to work, or work inside other environments. I am keeping a backup copy of the changes at every step at the moment just to keep an eye on it.

Posts
-
RE: Coding in VS Code and HISE
-
RE: Coding in VS Code and HISE
@d-healey I'm finding that HISE sometimes does take the changes made in VS Code at other times not. At this point in time I have not figured out the conditions which cause this however. I would like to continue editing in VS Code and then check out the changes by compiling in HISE. Seems kind of silly to cut and paste the entire script over to HISE no?
-
Coding in VS Code and HISE
I am having issues that when I edit .js include files in VS Code, then hit "compile" in HISE, the .js files sometimes revert their changes, and I'm guessing this is from some cached version of the file in HISE which takes precedence. Is there some way to avoid this problem? Is there a setting to change or a workflow to adopt that will keep the changes made to the .js in VS Code?
-
RE: Looking into the hise_documentation on GitHub- any reason why a majority of the markdown files are empty for the Scripting API?
@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.
-
RE: Looking into the hise_documentation on GitHub- any reason why a majority of the markdown files are empty for the Scripting API?
@d-healey Just that if the markdown files for the Documentation on GitHub has mostly blank files, maybe these are useful? Or maybe I am not understanding the purpose of the markdown files on the GitHub site.
-
RE: Looking into the hise_documentation on GitHub- any reason why a majority of the markdown files are empty for the Scripting API?
@d-healey I hope so! That is what I made them from. I just wanted to be able to use the Scripting API in markdown format, but your response makes me think that I am lacking context or missing something obvious?
-
RE: Looking into the hise_documentation on GitHub- any reason why a majority of the markdown files are empty for the Scripting API?
Ok, the uploads doesn't like .md format so I just put it in a text file:
-
RE: Looking into the hise_documentation on GitHub- any reason why a majority of the markdown files are empty for the Scripting API?
@Christoph-Hart I put the Scripting API into markdown files with on file per class. Would that be useful for the Git Docs? Here is an example:
Unlocker
The
LicenseUnlocker
will aid you in managing HISEs keyfile and unlocking system.You can create anUnlocker
object withEngine.createLicenseUnlocker()
.const var Unlocker = Engine.createLicenseUnlocker();
Class methods
canExpire
Checks if the unlocker's license system has an expiration date.
Unlocker.canExpire()
checkExpirationData
If the unlocker has an expiration date, it will check it against the RSA encoded time string from the server.
Unlocker.checkExpirationData( String encodedTimeString)
checkMuseHub
If you use the MuseHub SDK this will try to activate the plugin using their SDK.
Unlocker.checkMuseHub(var resultCallback)
contains
Checks if the string contains the given substring.
Unlocker.contains(String otherString)
getLicenseKeyFile
Returns the license key file as File object.
Unlocker.getLicenseKeyFile()
getRegisteredMachineId
Returns the machine ID that is encoded into the license file. This does not look in the encrypted blob, but just parses the header string.
Unlocker.getRegisteredMachineId()
getUserEmail
Returns the user email that was used for the registration.
Unlocker.getUserEmail()
isUnlocked
Checks if the registration went OK.
Unlocker.isUnlocked()
isValidKeyFile
Checks if the possibleKeyData might contain a key file.
Unlocker.isValidKeyFile(var possibleKeyData)
keyFileExists
Checks whether the key file exists.
Unlocker.keyFileExists()
loadKeyFile
This checks if there is a key file and applies it.
Unlocker.loadKeyFile()
setProductCheckFunction
Sets a function that performs a product name check and expects to return true or false for a match.
Unlocker.setProductCheckFunction(var f)
writeKeyFile
Writes the key data to the location.
Unlocker.writeKeyFile( String keyData)
-
Looking into the hise_documentation on GitHub- any reason why a majority of the markdown files are empty for the Scripting API?
I am wondering what happened with the .md files here.
https://github.com/christophhart/hise_documentation/tree/master/scripting/scripting-api
I am supposing that an automated process to generate the files is leaving most of them blank? -
RE: MIDI Out Device
I would like to know about this as well. To my knowledge I have not seen a commercial MIDI plugin that can route directly to and from MIDI ports/drivers, but I do remember that the two MIDI plugins here called "midiIn" and "midiOut" attempt to do this:
https://github.com/sleiner/pizmidi/tree/main/pizjuce
Some of the plugins are buggy, so I do not know if they work or not.
I think some of the challenge on Windows is that host apps can gain exclusive control over a port, and I know DAWs like Cubase/Nuendo are aggressive in this regard, but there are utilities to multiply port connections (such as MIDI-OX, Virtual Cable or Bidule), and therefore making it possible for multiple hosts to access the same MIDI input/output.
I would love it if you found a way to do this in a plugin. On an app I believe you should just be able to have access to the output ports from any of the MIDI devices as long as it is not in use by another app (I think it is first-come-first-serve in that regard).
-
RE: Scroll Bar/Scroll within a panel?
@Gab I have tried in the past, but there is one matter prohibiting the implementation: there are no callback events in HISE for the mouse wheel/touch pad scrolling for a panel. The only scrolling I was able to achieve was with making custom point and click scrollbar handles for the panel, but that is very limiting.
-
Is there a way to capture HISE console logs externally?
I'm wondering if the logs are exposed somewhere for the console prints external to HISE, or if maybe there is a method to do so (by exporting a log file on every compile). Is this a possibility?
-
Selecting a whole block of code
Is there a keyboard shortcut to selecting a whole block of code, similar to the way you can select a whole line by placing the cursor at the beginning of a line and using "Ctrl+Shift+right"? Just thinking it would be great to quickly select whole functions or a full namespace this way.
-
RE: panel in front
Ok, so I found an issue with the ZLevel for panels.
It seems it does not function when the panel is set to:
"allowDragging" "Disabled".I found this snippet from @ustk which demonstrates the basic ZLevel change for panels when clicked:
HiseSnippet 929.3ocsVEsaaaCEkxIpnVctXEnOOH3mjAxBjSZZKPQ65hcRgwZRLp6BFZQWACEsEQnHEDoRlQP9W1+v9W56849x9C7tTxxRYQHM1.QuHcO26k5PxykWNLQRnJkLAY078SioHqevdzTgNrWHlIPC5irdn8AXkll3lCs6zXrRQCPVVq8FCfUy0QYO+6urKliEDZIDBcrjQnukEwzknCe8uw378wAz2yhpD8Sd8.hTzSxko.eVy1GEiImhmPODaBqgMx5d6EvzxjQZrlpPVquqLX5nP44h73OloXmvoFitnQv.kCuujGXXrAE0KjwCFVLuUHXTFVtJrV9pvisOfEvVfWtZ7iYNbKyn55gUiahdc+9zyuN5YUgdqmSuGYOhjvh0kdLb6A1CDvF0XLrETkV4whZ7SMr6IgHD5MivmR2OALVjg2S882vcGe+NuvwwA1GTZ2yvItwBtx8kterHyITcOYTrT.FdsGhET91s6rQKG2q8bCozc4SYq1c9zKZAbarLw0K1kIx3VmVNWjORwapn5CjoJZOLmeBHc7FmJHZlT3Q6jGyEk+T1XWO5lDNibJMnyUIiNjoLi1GdK8LJ2qc1RUaXkw37R38kNq7SAmbkhCkZ5QBuNNW3zDFR2+uqwiq0mYQJQx4zjZcaJpRtoD8DoQmPS1.1e4ozEABpqqJeevsS9Rx2ypDnTLPvzGESmaWs9qXVW30GsXxVEpbNVEMapUSXkPWu9AMWSAe86C5i0XSI0bLHtXZhlYlsV8omAmUkWf0ztOUcpVFCi5BgHxxQm4sUQ4mQWhXvL6914xZzegrrstD9WSMebL7w4r.cnw3afQHkMITar9avBjoxy6mfmLgIl.LnQFPg5UY9Q8L5Sk6QB9TDSSiJNcr48PnYyLmZVhtUUXzRP6sxo8WJn8+bWR6Y6TKsmCuLzd6bZ+mEz9q2gzdF5U0Q6BXz0OiF5THCR4X8UaeX5YN2ATTdkyoMmEKTL8zp8TWhdJ925Vd2V59H6gLMIrd91nF9B0V207cdG5V16MdLknKI6516+GqZ63kfJuSlpAAzAXcByn+NLMZDHGHTfIBPUpL5sFFkbtsuw1rxLhJBxLlAOyc10XaM2Y2BmnHLIQ9YR9gal6.b+LDfShrqB0DtSFX61EkcDNjms+l9nH3pIelPLKE+Lv85yYqUHmsWgbdxJjyNqPNOcEx4YqPNO+FywbqveMUKixKS.fg6k0rwxZOAFTYYJRz+ATnnDPF
but if you set "allowDragging" to "Disabled", the the ZLevel no longer changes when clicked:
HiseSnippet 952.3ocsV0saaaCElxIpnVatXEXO.B9J4hf.+eSPwVSiSRmwpSLl6JF1vPGCEUDQnHEDoRlQQeG1iPusWu2f8brGh8F3cnjUj7paWiQKuQ57cNGxOc3GOTSSjDpRISPVNOedLEY8k1ylKzgiBwLAZ7QHq6YOAqzzD2bnCmGiUJpOxxZqmZ.rpuMJa7OO9PLGKHzRHD5ERFg9LVDSWhN8fumw4mf8oOmEUI59GLlHEijbYJvmsraihwjKwWPOEaBqlM56vpPj0CrGzsGou+C861cv9CI3gz8CvAAc542u+v81uSu8w82aHs8.j0cN1mokIyzXMUgr19Po+7YgxqE4KvKXJ14bpwnCZFrx4vmH49lOQCJZTHi6OsnPoPvrLsrrsUdY6qsmv7Y2fWV99pLGtkYTs.ZUaU5s0JzqSU50tB8VCkrpPosyoz8smQRXw5ROF97E1iEvtY.F1mpRk7XQ0rqYORBQHz6FgujdRBXbSFdCa2dG2Asa25QNNNvlkR6dENwMVvUteiqyuTuH2Kn5QxnXo.L7ZNEKn7dMasSCGWX7ABpyGSPca1x4WeTCfBAxDWuXWlHiBsZ37p7ji2UQ0SjoJ5HLmeNHi7BREDMSJ7nsxiYYnlAKv0itKgyHWR8aUhaF5PlxLa+7ynWQ4dMypHMgBfw4qgmu1YiGEbxUJNUpomI7Z47Jm5vT59ecEDrVelpThjyoIq0s4.VxGJQOQZz4zjcfsQdJ8l.AQzpJS62uxr5AGR9lVk.khwBl9rXp38cbBsbmFd6GGeDViMx4kXPbwzDMyPAqinWAMSxE20sOhptTKigY8F4A.qy71nP5aTKHFHvuqct7B86v2h0eBq0byK6AubMyWGZL9avHjxtHTardCXAZG40EJHkYdGYzHJ2yD74HllFUzsp9cPnEKLcwJQ6VEFcKXY2bV9WEr7skrbYuxeK5fBlVz8z+faEaWLXsrcI7sgs8xY6eTv16Y8ImsKPe65XaAL5ca9Asck9obrd0dwlarV5.NFrRCPSSNghomW8FsOYMn+Xo38smxzjv0ywZqgivgkOGbb40ZMrONHfRzkDba6S9oOO2gg9AYplItXBVmvLRpSSilAa0DJr5BPnYZCYUyHNysaarMUfYTgelwBXrzYGis0RmcJbhhvjD4KI4M+LWbd2LDfShrexnN72NfsaGTVCwp04H3d7WRHqNUuShc2zD6soI1eSSbvll3vMMwGtoIt2+ehley5IoZYT9wFDZxziytMwx5XAFTfYpUz+BvtP6LB
-
RE: panel in front
@Chazrox I may be wrong, but I think that is only for keyboard input.
-
RE: Set font style?
@d-healey Even if gets and loads the files using the "{PROJECT_FOLDER}" wildcard? That has to be used for Engine.loadFontAs anyway, so why wouldn't it also work for this?
-
RE: Set font style?
Ok, sorry about that.
This one actually works:// this will load all of your fonts which are stored in the projectFolder/Images/Fonts inline function loadAllFontsFromProjectFolder() { local fontsFolder = FileSystem.getFolder("{PROJECT_FOLDER}").getParentDirectory().getChildFile("Images").getChildFile("Fonts"); local fontFiles = FileSystem.findFiles(fontsFolder, "*.ttf;*.otf", false); for (file in fontFiles) { local fontPath = file.toString("FullPath"); local pathParts = fontPath.split("/"); local fontNameWithExtension = pathParts[pathParts.length - 1]; local targetName = ""; // if the file name suffix is "-Regular", loadAs will use just the prefix if (fontNameWithExtension.contains("-Regular.ttf") || fontNameWithExtension.contains("-Regular.otf")) targetName = fontNameWithExtension.substring(0, fontNameWithExtension.lastIndexOf("-Regular.")); else targetName = fontNameWithExtension.substring(0, fontNameWithExtension.lastIndexOf(".")); Engine.loadFontAs("{PROJECT_FOLDER}Fonts/" + fontNameWithExtension , targetName); } }
-
RE: Set font style?
Ok, well I made it to the Fonts folder by navigating form the Audio folder, back to the Project folder, then on down.
But now I'm having an issue with
File.toString();
which returns the path for "Filename" instead of just the filename:
The Docs says it should just return the file name and not the full path:
-
RE: Set font style?
I've tried using File.Show() on each of these variations here and all three open to the Audio Files folder in the Project Folder instead of the Project Folder itself, so it seems like there is an error with the FileSystem processing of the wildcard?