### Install Expansion with Callback Example Source: https://docs.hise.audio/scripting/scripting-api/expansionhandler/index.html Example demonstrating how to set an installation callback to handle post-installation tasks like rebuilding presets or deleting the archive file. ```scripting const var t = FileSystem.getFolder(FileSystem.Desktop).getChildFile("test.hr1"); const var e = Engine.createExpansionHandler(); function installCallback(obj) { if(obj.Status == 2 && isDefined(obj.Expansion)) { // make sure the user presets are updated obj.Expansion.rebuildUserPresets(); // ask the user if he wants to delete the archive file... Engine.showYesNoWindow("Installation sucessful", "Do you want to delete the archive file", function(ok) { if(ok) t.deleteFileOrDirectory(); }); } }; e.setInstallCallback(installCallback); e.installExpansionFromPackage(t, FileSystem.Expansions); ``` -------------------------------- ### Get Release Start Options Source: https://docs.hise.audio/scripting/scripting-api/sampler/index.html Retrieves the current release start options as a JSON object. ```javascript Sampler.getReleaseStartOptions() ``` -------------------------------- ### Create Windows Installer Script Source: https://docs.hise.audio/glossary/command-line-tool.html Generate a template Inno Setup script for a Windows installer using the 'create-win-installer' command. The '-noaax' flag can be used to exclude AAX plugin formats. ```bash %hise_path% create-win-installer -noaax ``` -------------------------------- ### Get Sample Start Source: https://docs.hise.audio/scripting/scripting-api/audiosampleprocessor/index.html Returns the starting sample index of the current sample range. ```javascript AudioSampleProcessor.getSampleStart() ``` -------------------------------- ### Install Expansion from Package Source: https://docs.hise.audio/scripting/scripting-api/expansionhandler/index.html Decompresses samples and installs the .hxi / .hxp file. Use ScriptPanel.setLoadingCallback for progress indication. ```javascript ExpansionHandler.installExpansionFromPackage(var packageFile, var sampleDirectory) ``` -------------------------------- ### Example Usage Source: https://docs.hise.audio/scripting/scripting-api/scriptedviewport/index.html Example demonstrating how to set table modes, row data with comboboxes, and column configurations. ```APIDOC ```javascript const var ModTable = Content.getComponent("Viewport1"); ModTable.setTableMode({ "MultiColumnMode": false, "HeaderHeight": 32, "RowHeight": 32, "ScrollOnDrag": false }); ModTable.setTableRowData([ { "Source": "Source", "Mode": { "items": ["Yes", "No", "Maybe"], "Value": "No" } }, { "Source": "Other Source", "Mode": { "items": ["Some other item", "Second"], "Value": "Second" } } ]); ModTable.setTableColumns([ { "ID": "Source", "Type": "Text", "MinWidth": 150 }, { "ID": "Mode", "Type": "ComboBox", "MinWidth": 80, "Toggle": true, "Text": "Default", "ValueMode": "Text" } ]); ``` ``` -------------------------------- ### Advanced Sampling Session Example Source: https://docs.hise.audio/scripting/scripting-api/console/index.html Illustrates how to start a sampling session using a scoped statement and capture multiple snapshots of data with labels. ```javascript { .sample("my session"); // starts a sampling session until the block is done var x = [1, 2, 3, 4, 5]; // creates a snapshot of the array and stores it as the first label Console.sample("first", x); x[2] = 0; // creates a snapshot of the array and stores it under the second label Console.sample("second", x); } ``` -------------------------------- ### Get Expansion List Source: https://docs.hise.audio/scripting/scripting-api/engine/index.html Generates a list of all available expansions installed in the system. ```scripting Engine.getExpansionList() ``` -------------------------------- ### Starting a Sampling Session Source: https://docs.hise.audio/scripting/scripting-api/console/index.html Demonstrates how to explicitly start a sampling session with a specified session ID. ```javascript Console.startSampling( String sessionId) ``` -------------------------------- ### Get Expansion for Install Package Source: https://docs.hise.audio/scripting/scripting-api/expansionhandler/index.html Checks if an expansion is already installed and returns a reference if it exists. ```javascript ExpansionHandler.getExpansionForInstallPackage(var packageFile) ``` -------------------------------- ### Loading Example Assets and Creating an Audiofile Source: https://docs.hise.audio/scripting/scripting-api/audiofile/index.html Loads example assets, loads the first asset into an Audiofile pool, creates an Audiofile slot, and loads the asset into the slot. This is a prerequisite for most other Audiofile operations. ```javascript // Load the example assets FileSystem.loadExampleAssets(); // Grab whatever asset is first const var firstAsset = Engine.loadAudioFilesIntoPool()[0]; Console.print(firstAsset); // {PROJECT_FOLDER}breakbeat_44k.wav // Create a audio file slot const var audioFile = Engine.createAndRegisterAudioFile(0); // load the first asset audioFile.loadFile(firstAsset); ``` -------------------------------- ### Set Expansion Installation Callback Source: https://docs.hise.audio/scripting/scripting-api/expansionhandler/index.html Set a function to be called during the installation of a new expansion. The callback receives an object with installation status, progress, and expansion details. ```scripting ExpansionHandler.setInstallCallback(var installationCallback) ``` -------------------------------- ### setInstallCallback Source: https://docs.hise.audio/scripting/scripting-api/expansionhandler/index.html Sets a callback function that is invoked during the installation of a new expansion. The callback receives an object with installation status, progress, and expansion details. ```APIDOC ## setInstallCallback ### Description Set a function that will be called during installation of a new expansion. ### Method Signature ```APIDOC ExpansionHandler.setInstallCallback(var installationCallback) ``` ### Parameters - **installationCallback** (function) - The callback function to be executed during installation. ### Callback Object Properties The callback expects one argument, an object with the following properties: - **obj.Status** (integer): A status code indicating the state of the installation: - `0`: Before extraction starts. - `1`: During extraction. - `2`: Extraction finished. The callback is guaranteed to be executed with `2` at least once. - **obj.Expansion** (Expansion object): If the installation and optional initialization succeeded, this will contain a reference to the expansion for post-installation tasks. - **obj.Progress** (float): The extraction progress, similar to `Engine.getPreloadProgress`. - **obj.SourceFile** (File object): The package file being extracted. - **obj.TargetFolder** (string): The directory where the expansion is being installed. - **obj.SampleFolder** (string): The sample folder used for the samples. ### Usage Example ```APIDOC const var t = FileSystem.getFolder(FileSystem.Desktop).getChildFile("test.hr1"); const var e = Engine.createExpansionHandler(); function installCallback(obj) { if(obj.Status == 2 && isDefined(obj.Expansion)) { // make sure the user presets are updated obj.Expansion.rebuildUserPresets(); // ask the user if he wants to delete the archive file... Engine.showYesNoWindow("Installation sucessful", "Do you want to delete the archive file", function(ok) { if(ok) t.deleteFileOrDirectory(); }); } }; e.setInstallCallback(installCallback); e.installExpansionFromPackage(t, FileSystem.Expansions); ``` ``` -------------------------------- ### Server.callWithGET Example Source: https://docs.hise.audio/scripting/scripting-api/server/index.html Makes a GET request to a specified URL with JSON parameters. The callback processes the response, checking for Server.StatusOK. ```javascript Server.setBaseURL("https://forum.hise.audio"); // The GET arguments as JSON object const var p = { "term": "HISE", "in": "titlespost" }; // => https://forum.hise.audio/api/search?term=HISE&in=titlesposts Server.callWithGET("api/search", p, function(status, response) { if(status == Server.StatusOK) { // Just use the response like any other JSON object Console.print("There are " + response.matchCount + " results"); } }); ``` -------------------------------- ### Add Visual Guide Source: https://docs.hise.audio/scripting/scripting-api/content/index.html Creates visual guide lines or rectangles for debugging and layout alignment. Clears all guides when passed `0`. ```javascript Content.addVisualGuide([0, 200], Colours.white); Content.addVisualGuide([100, 0], Colours.red); Content.addVisualGuide([10, 10, 100, 50], 0xFF00FF00); Content.addVisualGuide(0, 0); ``` -------------------------------- ### Timer Usage Example Source: https://docs.hise.audio/scripting/scripting-api/timer/index.html An example demonstrating how to create, configure, and manage Timer objects, including suspending their callbacks using a broadcaster. ```APIDOC ```javascript // Let's use a broadcaster for this const var suspendBroadcaster = Engine.createBroadcaster({ "id": "suspendBroadcaster", "args": [ "isSuspended" ] }); // If you comment out this line, you'll see that the timer callback is // still being executed while the panel callback is suspended properly. Content.setSuspendTimerCallback(suspendBroadcaster); const var to = Engine.createTimerObject(); to.setTimerCallback(function() { Console.print("to" + Math.random()); }); // by using a broadcaster, we can attach each timer object exactly where we define it, // so you don't have to keep track of all your timers at a global location suspendBroadcaster.addListener(to, "suspend timer object", function(isSuspended) { if(isSuspended) this.stopTimer(); else this.startTimer(400); }); to.startTimer(400); const var panel = Content.addPanel("Panel1", 0, 0); panel.setTimerCallback(function() { Console.print("panel" + Math.random()); }); panel.startTimer(500); ``` ``` -------------------------------- ### Configure Release Start Options Source: https://docs.hise.audio/scripting/scripting-api/sampler/index.html Modify the release start behavior by first retrieving the current options, then updating the desired properties, and finally applying the changes. ```scripting const var obj = Sampler.getReleaseStartOptions(); obj.FadeGamma = 0.5; Sampler.setReleaseStartOptions(obj); ``` -------------------------------- ### ConsolestartSampling Source: https://docs.hise.audio/scripting/scripting-api/console/index.html Starts a sampling session with the given ID. ```APIDOC ## Console.startSampling ### Description Starts a sampling session with the given ID. ### Method Console.startSampling( String sessionId) ### Parameters #### Path Parameters - **sessionId** (String) - The ID for the sampling session. ``` -------------------------------- ### Set Install Full Dynamics Source: https://docs.hise.audio/scripting/scripting-api/expansionhandler/index.html Controls whether the installExpansionFromPackage function should install full dynamics. ```scripting ExpansionHandler.setInstallFullDynamics(bool shouldInstallFullDynamics) ``` -------------------------------- ### Broadcaster Example Source: https://docs.hise.audio/scripting/scripting-api/broadcaster/index.html This example snippet registers a context menu to a button and allows setting the value and toggling the width of the button using two popup menu items. ```APIDOC ## Broadcaster Example This example snippet registers a context menu to a button and allows setting the value and toggling the width of the button using two popup menu items. ``` // We'll attach the context menu to this button const var Button1 = Content.addButton("Button1", 0, 0); Button1.set("enableMidiLearn", false); // we don't want this to popup too... /** Let's define a broadcaster with two arguments. */ const var bc = Engine.createBroadcaster({ "id": "ContextMenu Broadcaster", "args": ["component", "selectedIndex"] }); /** This defines a few items using a markdown-like syntax. */ const var POPUP_MENU_ITEMS = [ "**Set Value / Properties**", // A header "Value is active", // the first item "Set to {DYNAMIC}", // the second item with a dynamic text "___", // a horizontal separator "~~This is always off~~" // an item that is always disabled ]; inline function popupStateFunction(type, index) { // The this object of this function will always // point to the component that was clicked (in our // case it's always Button1). Console.assertEqual(this, Button1); local getEnableState = type == "enabled"; local getTextValue = type == "text"; local getActiveState = type == "active"; if(getEnableState) // We don't want to disable any item return true; // so let's return true... if(getTextValue) { // This function is only called with items // that specify the `{DYNAMIC}` wildcard // in this case the second item with the index 1 Console.assertEqual(value, 1); // Now we can return whatever text we want to show // and this is evaluated each time before the popup // is shown return this.get("width") > 150 ? "small" : "wide"; } if(getActiveState) { // Now we can decide whether the popup menu item // should be displayed as active or not // the first item checks whether the button is active if(index == 0) return this.getValue(); // the second item checks whether its wide or not if(index == 1) return this.get("width") > 150; } }; /** Now we can use the item list and the state function to attach the broadcaster to the context menu of the button (you can attach it to multiple components by passing in a list. */ bc.attachToContextMenu("Button1", popupStateFunction, POPUP_MENU_ITEMS, "Context Menu"); /** This callback will be executed whenever a popup menu item was selected. */ bc.addListener(Button1, "Menu callback", function(component, index) { // the this object will point to the component Console.assertEqual(component, this); if(index == 0) { this.setValue(!component.getValue()); this.changed(); } if(index == 1) { this.set("width", component.get("width") > 150 ? 100 : 200); } }); ``` ``` -------------------------------- ### installExpansionFromPackage Source: https://docs.hise.audio/scripting/scripting-api/expansionhandler/index.html Decompresses and installs an expansion from a package file. ```APIDOC ## installExpansionFromPackage ### Description Decompresses the samples and installs the expansion from the provided package file (.hxi/.hxp). This function can automatically extract samples, copy the expansion file, encrypt it if credentials are available, and refresh the expansion list. The installation is performed asynchronously on the sample loading thread. ### Method ``` ExpansionHandler.installExpansionFromPackage(var packageFile, var sampleDirectory) ``` ### Parameters * **packageFile** (var) - A file object pointing to the .hr1 file to install. * **sampleDirectory** (var) - Specifies where the samples should be installed. This can be `FileSystem.Expansions`, `FileSystem.Samples`, or a custom folder object. ``` -------------------------------- ### Set Project Folder for Installer Creation Source: https://docs.hise.audio/glossary/command-line-tool.html Before creating a Windows installer, set the project folder using the 'set_project_folder' command with the path to your project. ```bash %hise_path% set_project_folder "PROJECT_PATH" ``` -------------------------------- ### Example: Page Handling with Radio Group Broadcaster Source: https://docs.hise.audio/scripting/scripting-api/broadcaster/index.html Demonstrates using a broadcaster attached to a radio group to manage page visibility. This example sets up radio buttons and panels, linking button clicks to panel visibility changes. ```scripting const var bc = Engine.createBroadcaster({"id": "My Page Handler", "colour": -1, "comment": "This broadcaster will handle the page logic", "args": ["pageIndex"]}); ``` ```scripting inline function addRadioButton(i) { local b = Content.addButton("RadioButton " + (i+1), 0, i * 30); b.set("radioGroup", 90); b.set("saveInPreset", false); local p = Content.addPanel("Page"+(i+1), 150 + i* 100, 0); p.set("visible", false); return p; } ``` ```scripting const var Pages = []; ``` ```scripting for(i = 0; i < 4; i++) Pages.push(addRadioButton(i)); ``` ```scripting bc.attachToRadioGroup(90, "Button Group"); ``` ```scripting const var PageList = []; // ``` ```scripting bc.addComponentPropertyListener(Pages, "visible", "Show Panels", function(indexInList, buttonIndex) { return indexInList == buttonIndex; }); ``` ```scripting // Show the first page bc.pageIndex = 0; ``` -------------------------------- ### Metronome Example with TransportHandler Source: https://docs.hise.audio/scripting/scripting-api/transporthandler/index.html This example demonstrates registering both synchronous and asynchronous callbacks for a metronome, reacting to host transport events. It showcases the flexibility of the TransportHandler for audio-thread logic and UI updates. ```javascript HiseSnippet 1721.3oc4WstaaTDEd23rkFWLzhpP7yQQHUGvjZW5MABUGmKsVzjXEmVnRHUMd2isG5tyXlc1jZphD+jGi9XvO4QoOB8MnblYu3cC1oFKZ.AVIVdly4Ly27ctLmoiT3BggBok8JGNdDXY+9NcGyUC2bHkwsZukk8G5bnjxCGIjpCgPkUqwinggfmksco6qUxdkksLed88ZQ8obWXxTVVOVvbgGxBXpIy1o42x782g5AGxBxo8Ma11Uv2T3KhP.Uxot0Hp6ynCf8nZ0Vxwx9Ba6wTBYWEUAgV1K2R3Mt6Pww7X8eLKj0yGzCZX0EWn3o2Q36oQrdVqMGx785jdvCsrrc5LgFJESCW0YWlGKa9IzwkMBHSrHOeXuzYAuF4gW84Gd14f2xwv6JNcckrQpIRzX6RNs4JP1mhtf7vJVWqk9sK3ro.0fqVOf9LXGINHyhp2td8ZjaUu9ZeckxUJe8qSNbHKjf+oFBjvwb2gn9hHbbZ7.YHk64CRxwCYtCIGiNUxHe5XiEAfRqe.P3BjLpTFcsgJxQTIJl7Mjs4CXbXcWIfbUVH1ChWwpYfX2Hznd.gxILtOZAoeD2UwDbbVWZTHPXp3sVFo0wr4zHOl.+Et3dUJeZCE7V3lVsG9UM7.tGbbKpbMRkxunRYB9wW3R8ILODkljg0odd6gGh84UaTib25jOOyJxmQZbiZ3+2oFwvbZ6iMRer2ue+s.jQ.uVi29Hj3a6Uk4oWCixmjbHa2mLVDQbQ9b.f7aD9kfzm5imtgfDpU3LRy4L7GSphldMTDteXpFILpmxGsGS43CH+HSg9WyljRWZ94QsSHGhm.B4WSQFDQQefBPtiDpnXTJYDHYBu0pTFOLgfZeCqsoAiU0XrVBQl4q1ATXX.t9ADeZOvufS+PHXj.YzzHvAfZSANEGGTcUizU0qzDK1SDLS8QYmR6s.9YnuQ5orniHbl5ixVM6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8URwXWVvHeXa9QfO1SiAieT5UMoyVLtdWrE1QCEbladm9AXiyrAC.YdrO0CzFJE1G5jYtZyC.eflO.9Sa9PLviJQdBVPtnw7yEmk+5SbhgKQmLR9uwMck9e4McmKWbbdrGATWo3otwOTRGKeQyL34lmzo3t5wjFVlGOoaxr950sBvJhO00US2eAxOS2lar.17kKfM2bAr4VKfM2dAr4NKfM28LsQeYzFQJQPbpHNQmsMunz1dattObSTu0e.zpy6sH ``` -------------------------------- ### startPerfettoTracing Source: https://docs.hise.audio/scripting/scripting-api/settings/index.html Starts the perfetto profile recording. ```APIDOC ## startPerfettoTracing ### Description Starts the perfetto profile recording. ### Method Settings.startPerfettoTracing() ### Parameters None ### Request Example ```javascript Settings.startPerfettoTracing() ``` ### Response None ``` -------------------------------- ### Initialize MainProcessor with addAndSetup Source: https://docs.hise.audio/cpp_api/raw/classhise_1_1raw_1_1_main_processor.html Demonstrates the recommended way to initialize a subclassed MainProcessor instance by passing it to the addAndSetup helper function. This function handles the entire initialization process. ```cpp class MyData : public hise::FrontendProcessor::RawDataBase, hise::raw::MainProcessor::ConnectedObject { public: MyData(MainController* mc) : RawDataBase(mc) { // This should be the first thing you do, everything else // will probably need the main processor. raw::MainProcessor::addAndSetup(this, new MyDataProcessor(getMainController())); // Do more initialisation here... }; }; ``` -------------------------------- ### Container Split Node Example Source: https://docs.hise.audio/scriptnode/list/container/split.html This example demonstrates the usage of the container.split node to create a parallel signal chain, often used for Dry/Wet mixing. ```javascript ScriptNode583.3oc6UFraSCDDFd1T1JfhDBAbOO.nnRTPbiDHAphTRHpNkJNgVbFYaUauVqWSpKW4NmgK7Ff3JGPhW.NwS.uA7F.yZ2j5X2nlKUUUfOXkc2Yl862y+tYjbJBrq1uG8hOUkNC0vyD1ZoJcrP6BrawskgZgWHpZDG46ogQIAccEggneLv3rZ..Cj1GrzzrMFQEtqzWlnLAQw.ckAAXnFX03y+89dSM6AmcOJBKW4rwBkH.0nxTiZ4UIFnTFcBmawIHeksKwzpQMe4yKTeRZjHNdWQPzDu.bHUkqcEH6oUmUAsv2Qp7ztAm6PWm2OLFU55ozp06YMt9h8ttKpvxRhe+s2d8jDTn+PCTxHZa7xVofVudVCxoR+YKRpJrgyEWmYnbZhuP6ICmHTNntrJX0NdTJv1vHkav2EiQ8KD9IHj+dQAoTSdsumsATnTd2juWLttoV3aJAv7QTz8CeCUSbpIrgdgkJxK+9PwgUJ7.4LTMvKfNnVHx8hhpLKchSiQVdGkk+G+f44qssN.mk20Ly9H6u8Cmub2NFMsIeGSmqBEv5iL.UPty66bZHCvofLE6Yi7eR+z3a26msyO0YEHkZWuPmxb2py5ZloaE+uY9eCybwa3tDalYrBpXy7b2G0ONPlPts0RIvuaWjt2dmOuyuN5cknadjUJGi0UR9dai4LyHbxPxFZNHze5R+OwBdMyebugxI6yuZY7edzjzHzjs0bC4Et0h+fFsZ1r4CgmdXjBiiyzIcnFVgtWbkxYp6dpzKi5doaS+KYTtr9. ``` -------------------------------- ### Get Range Start Source: https://docs.hise.audio/scripting/scripting-api/scriptaudiowaveform/index.html Returns the current start value of the component's defined range. ```javascript ScriptAudioWaveform.getRangeStart() ``` -------------------------------- ### prepareToPlay Source: https://docs.hise.audio/cpp_api/hise/classhise_1_1_modulator_synth.html Sets up the synth and ModulatorChains, including sample rate and block size. Must be called after adding all voices. ```APIDOC ## prepareToPlay ### Description This sets up the synth and the ModulatorChains. Call this instead of Synthesiser::setCurrentPlaybackSampleRate(). It also sets the ModulatorChain 's voice amount, so be sure you add all SynthesiserVoices before you call this function. ### Signature ```cpp void prepareToPlay(double sampleRate, int samplesPerBlock) ``` ``` -------------------------------- ### Basic Scriptnode Synthesizer Example Source: https://docs.hise.audio/hise-modules/modulators/envelopes/list/scriptnodevoicekiller.html This example demonstrates a basic scriptnode synthesizer with a sine wave oscillator. Without proper voice management, notes will not stop playing. This snippet highlights the need for a voice killer mechanism. ```javascript HiseSnippet 1160.3oc4X0saaTDEdV6rN0g.pUBIDbkuLUJJxtzVPhKh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ogjyLSjLmDhYOsdRKXshJT9XmLShEYFzKgcJvdUwmgUbHbc9s7NjohCoi1OAq0sMimfh4PvCfqySGZgSVCvaRlpddJROpDeOEMjMBLeE9bWFO6HOtmUW50SQ69M8zPrG66ghkIdCgqrNghTM9oJl5OfLyNSluoebyYL8u7WSa5e8Eu32l0zM+4n+XW6afzVBeWBl7MZJ6+SCa9Zr+K2c1id8k7nuYp8qchoXhLy9SVdeOZrkz2+Lrq0clowtOuRSutauAT0xG2eSX6JoWOZdGaSs09BwvHZZKxU6EodazPOh5KEm6auqroh8doTv9D7z+sgptcMqq0fb4z9wH7Bqm66O4VMihOZUU7SWUEe7pp3SVUEe5pp3mspJ94udEMuOwdIZQjcTKl22qksQsSKNEuRQ5zBx+.bjgVjB ``` -------------------------------- ### Get Loop Range Source: https://docs.hise.audio/scripting/scripting-api/audiosampleprocessor/index.html Returns the current loop range as a [start, end] array. If subtractStart is true, the start value is subtracted from the end value. ```javascript AudioSampleProcessor.getLoopRange(bool subtractStart) ``` -------------------------------- ### FileSystem.loadExampleAssets Source: https://docs.hise.audio/scripting/scripting-api/filesystem/index.html Loads a bunch of dummy assets (audio files, MIDI files, filmstrips) for use in snippets & examples. ```APIDOC ## FileSystem.loadExampleAssets ### Description Loads a bunch of dummy assets (audio files, MIDI files, filmstrips) for use in snippets & examples. ### Method Signature ``` FileSystem.loadExampleAssets() ``` ``` -------------------------------- ### Get Filter Mode List and Example Source: https://docs.hise.audio/scripting/scripting-api/engine/index.html Retrieves an object containing all available filter modes. This example demonstrates how to use this object to populate a combobox and control a filter effect. ```scripting Engine.getFilterModeList() ``` ```scripting // Create a filter effect const var effect = Synth.addEffect("PolyphonicFilter", "filter", 0); // Create a filter graph const var display = Content.addFloatingTile("tile", 0, 0); display.set("width", 200); display.set("height", 50); display.setContentData({"Type": "FilterDisplay", "ProcessorId": "filter"}); // Create a knob for the frequency const var filterKnob = Content.addKnob("filterKnob", 250, 0); filterKnob.set("mode", "Frequency"); inline function f(component, value){ effect.setAttribute(effect.Frequency, value); }; filterKnob.setControlCallback(f); const var modeSelector = Content.addComboBox("modeSelector", 400, 10); // Create the filter mode list object const var filterList = Engine.getFilterModeList(); // Pick some values from the object and store it in an array const var filterModes = [ filterList.StateVariableNotch, filterList.StateVariableLP ]; // Create an array with a name for each mode const var filterNames = [ "Notch", "SVF Lowpass"]; // Use the filterNames list as combobox items modeSelector.set("items", filterNames.join("\n")); inline function modeCallback(component, value) { // combobox values are starting with 1 local index = value-1; if(index >= 0) { // use the index to get the actual number from the filterModes array. effect.setAttribute(effect.Mode, filterModes[index]); } } modeSelector.setControlCallback(modeCallback); ``` -------------------------------- ### startAsProcess Source: https://docs.hise.audio/scripting/scripting-api/file/index.html Launches the file as a separate process, optionally passing parameters. ```APIDOC ## startAsProcess ### Description Launches the file as a process. ### Method File.startAsProcess(String parameters) ### Parameters #### Path Parameters - **parameters** (String) - Optional - Parameters to pass to the launched process. ``` -------------------------------- ### sfloat::prepare Source: https://docs.hise.audio/scriptnode/snex_api/helper_classes/sfloat.html Setup the processing. The ramp time will be calculated based on the samplerate. ```APIDOC ## prepare ### Description Setup the processing. The ramp time will be calculated based on the samplerate. ### Signature ```cpp void prepare(double samplerate, double timeInMilliseconds) ``` ### Parameters - **samplerate** (double) - The sample rate of the audio processing. - **timeInMilliseconds** (double) - The desired ramp time in milliseconds. ``` -------------------------------- ### Get Range Source: https://docs.hise.audio/scripting/scripting-api/audiofile/index.html Returns the current range of the audio file as an array [start, end]. ```javascript AudioFile.getRange() ``` -------------------------------- ### Get Sample Range Source: https://docs.hise.audio/scripting/scripting-api/audiosampleprocessor/index.html Returns the current sample range as a [start, end] array. ```javascript AudioSampleProcessor.getSampleRange() ``` -------------------------------- ### begin() Source: https://docs.hise.audio/scriptnode/snex_api/containers/dyn.html Returns a pointer to the beginning of the dyn container, enabling range-based for loops. ```APIDOC ## begin() ### Description This allows a range-based loop iterator to go through each element of the dyn array. You will never use this method directly, but use the range-based for loop syntax from C++. ### Method `T * begin() const` ### Request Example ```cpp dyn d1; span data = { 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f }; // let d1 point to the entire data block d1.referTo(data, data.size(), 0); // loop through all elements and add two. // Note the &-qualifier which tells the loop // to grab a reference so you can actually modify // the element! for(auto& element: d1) { element += 2.0f; } // If you omit the &-qualifier, it will create a // local copy of the element and not write it back // to the array. for(auto element: d1) { element += 200.0f; } auto mustBeTrue = data[0] == 2.0f; // not 202.0f! ``` ``` -------------------------------- ### Builder Usage Example Source: https://docs.hise.audio/cpp_api/raw/classhise_1_1raw_1_1_builder.html Demonstrates how to instantiate the Builder and use it to add modules like a sine wave generator and a reverb effect. ```APIDOC ## Builder Usage Example ### Description This example shows how to initialize the `Builder` with a `MainController` and then use it to add a sine wave generator and a reverb effect to the plugin's architecture. ```cpp // The main controller of this project auto mc = getMainController(); // The root container of this project auto masterContainer = mc->getMainSynthChain(); Builder b(mc); // Adds a sine wave generator auto sine = b.create(masterContainer, IDs::Chains::Direct); sine->setAttribute(hise::SineSynth::OctaveTranspose, 5.0f, sendNotification); // Adds a reverb to the sine wave generator auto reverb = b.create(sine, IDs::Chains::FX); reverb->setAttribute(hise::SimpleReverbEffect::WetLevel, 0.5f, sendNotification); ``` ``` -------------------------------- ### Get Point on Path by Distance Source: https://docs.hise.audio/scripting/scripting-api/path/index.html Retrieves the coordinates of a point located at a specific distance from the start of the path. ```javascript Path.getPointOnPath(var distanceFromStart) ``` -------------------------------- ### prepareToPlay Source: https://docs.hise.audio/scripting/scripting-api/dspmodule/index.html Prepares the DspModule for playback by calling the external module's setup method. ```APIDOC ## prepareToPlay ### Description Calls the setup method of the external module. ### Signature ``` DspModule.prepareToPlay(double sampleRate, int samplesPerBlock) ``` ``` -------------------------------- ### getExpansionForInstallPackage Source: https://docs.hise.audio/scripting/scripting-api/expansionhandler/index.html Checks if an expansion is installed and returns a reference if it exists. ```APIDOC ## getExpansionForInstallPackage ### Description Checks if the expansion associated with the given package file is already installed. Returns a reference to the expansion if found. ### Method ``` ExpansionHandler.getExpansionForInstallPackage(var packageFile) ``` ### Parameters * **packageFile** (var) - A file object representing the installation package. ``` -------------------------------- ### Get Loop Range Source: https://docs.hise.audio/scripting/scripting-api/audiofile/index.html Returns the current loop range of the audio file as an array [start, end]. ```javascript AudioFile.getLoopRange(bool subtractStart) ``` -------------------------------- ### Open Website Source: https://docs.hise.audio/scripting/scripting-api/engine/index.html Launches a given URL in the system's default web browser. ```javascript Engine.openWebsite(String url) ``` -------------------------------- ### reset Source: https://docs.hise.audio/scriptnode/snex_api/node_types/snex_node.html Callback called to reset the processing pipeline, for example, after bypassing an effect or starting a new polyphonic voice. ```APIDOC ## reset ### Description This callback will be called whenever the processing pipeline needs to be resetted (eg. after unbypassing an effect or starting a polyphonic voice). ### Signature ``` void reset() ``` ``` -------------------------------- ### ScriptButton Initialization Source: https://docs.hise.audio/scripting/scripting-api/scriptbutton/index.html How to get a reference to a Button UI component. ```APIDOC ## ScriptButton Initialization Creates a reference to a Button UI component and allows modification of its values. ### Usage ```javascript const var Button1 = Content.getComponent("Button1"); ``` ``` -------------------------------- ### Get Engine Uptime Source: https://docs.hise.audio/scripting/scripting-api/engine/index.html Returns the total uptime of the HISE engine in seconds since it was started. Useful for performance monitoring or tracking session duration. ```javascript Engine.getUptime() ``` -------------------------------- ### Get Voice Index Source: https://docs.hise.audio/cpp_api/hise/classhise_1_1_modulator_synth.html Retrieves the index of a given voice within the internal voice array. This is necessary for ModulatorChains to identify the specific voice being started. ```cpp int getVoiceIndex(const SynthesiserVoice *v) const ``` -------------------------------- ### ComboBox Scripting Example Source: https://docs.hise.audio/ui-components/plugin-components/combobox.html This snippet demonstrates how to get a ComboBox component and set up a control callback to print the selected value and item text to the console. ```javascript const var ComboBox1 = Content.getComponent("ComboBox1"); inline function onComboBox1Control(component, value) { Console.print(value); Console.print(ComboBox1.getItemText()); }; Content.getComponent("ComboBox1").setControlCallback(onComboBox1Control); ``` -------------------------------- ### Get Sample Property Range Source: https://docs.hise.audio/scripting/scripting-api/sample/index.html Returns the valid range of values for a given sample property. For example, the loop end cannot exceed the sample's actual end. ```javascript Sample.getRange(int propertyIndex) ``` -------------------------------- ### Console.startBenchmark Source: https://docs.hise.audio/scripting/scripting-api/console/index.html Starts the benchmark. You can give it a name that will be displayed with the result if desired. ```APIDOC ## Console.startBenchmark ### Description Starts the benchmark. You can give it a name that will be displayed with the result if desired. ### Method Console.startBenchmark() ``` -------------------------------- ### Building Plugin Architecture with raw::Builder Source: https://docs.hise.audio/cpp_api/raw/classhise_1_1raw_1_1_builder.html Instantiate the Builder with the MainController and use its methods to create and link modules. This example shows adding a sine wave generator and then a reverb effect to it. Ensure this code runs on the IDs::Threads::Loading thread. ```cpp // The main controller of this project auto mc = getMainController(); // The root container of this project auto masterContainer = mc->getMainSynthChain(); Builder b(mc); // Adds a sine wave generator auto sine = b.create(masterContainer, IDs::Chains::Direct); sine->setAttribute(hise::SineSynth::OctaveTranspose, 5.0f, sendNotification); // Adds a reverb to the sine wave generator auto reverb = b.create(sine, IDs::Chains::FX); reverb->setAttribute(hise::SimpleReverbEffect::WetLevel, 0.5f, sendNotification); ```