Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace plugin

Index

Functions

getParamReport

  • getParamReport(steps?: number): { address: string; args: { type: string; value: number }[] }
  • getParamReport asks the server for the state of all the automatable parameters on the selected plugin. The results will be returned in a string containing a JSON array.

    Parameters

    • steps: number = 0

      A non-zero value gets additional information about the plugin's parameters: outputValueStepsAsStrings, outputValueRangeAsStrings, and outputValueRangeAsStringsWithLabels. By default, getParamReport just reports the state of the plugin parameters. However, when creating adapters is useful to get information about the range of the parameters. Note that setting this to true may change the plugin state, so it probably should be avoided when it is not needed.

      // This object was created with steps=15.
      {
        name: 'Lookahead',
        tracktionIndex: 12,
        defaultValue: 0,
        currentExplicitValue: 0,
        currentNormalizedValue: 0,
        currentValue: 0,
        currentValueAsStringWithLabel: '0.00 ms',
        currentValueAsString: '0.00 ms',
        currentBaseValue: 0,
        isDiscrete: false,
        isAutomationActive: false,
        isActive: true,
        hasAutomationPoints: false,
        hasLabels: false,
        currentLabel: 'ms',
        inputValueRange: [ 0, 1 ],
        outputValueStepsAsStrings: [
          '0.00 ms',  '0.71 ms',
          '1.43 ms',  '2.14 ms',
          '2.86 ms',  '3.57 ms',
          '4.29 ms',  '5.00 ms',
          '5.71 ms',  '6.43 ms',
          '7.14 ms',  '7.86 ms',
          '8.57 ms',  '9.29 ms',
          '10.00 ms'
        ],
        outputValueRangeAsStrings: [ '0.00 ms', '10.00 ms' ],
        outputValueRangeAsStringsWithLabels: [ '0.00 ms', '10.00 ms' ]
      }
      

    Returns { address: string; args: { type: string; value: number }[] }

    • address: string
    • args: { type: string; value: number }[]

getReport

  • getReport(): { address: string }
  • getReport asks the server for a JSON report containing information about the state of the currently selected plugin. The exact contents of this may change, so use with caution.

    Example output for a VST(2) plugin as of July 31, 2020:

    {
      "shortName10": "#TCompressor",
      "name": "#TCompressor",
      "idString": "VST-#TCompressor-9b9288bb-436f6d70",
      "automatableParamsCount": 26,
      "pluginType": "vst",
      "externalPluginFormat": "VST",
      "uid": "436f6d70",
      "tracktionXmlStateBase64": "Q2NuSwAAAABGQkNoAAAAAUNvbXAAAQAmAAAAAQ...",
      "pluginState": "Q2NuSwAAAABGQkNoAAAAAUNvbXAAAQAmAAAAAQAAAAAAAAAAAA...",
      "tracktionXml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n\r\n<PLUGIN type=\"vst\"...",
      "currentProgramStateInfo": "Q2NuSwAAAABGUENoAAAAAUNvbXAAAQAmAAAAAU...",
      "currentStateInfo": "Q2NuSwAAAABGQkNoAAAAAUNvbXAAAQAmAAAAAQAAAAAAA...",
      "numPrograms": 1,
      "currentProgramIndex": 0,
      "currentProgramName": "Factory Default",
      "fxb": "Q2NuSwAAAABGQkNoAAAAAUNvbXAAAQAmAAAAAQAAAAAAAAAAAAAAAAAAAA...",
      "fxp": "Q2NuSwAAAABGUENoAAAAAUNvbXAAAQAmAAAAAUZhY3RvcnkgRGVmYXVsdA...",
      "vst2State": "UFJPR1JBTQABBHBsdWdpbklEAAENBVRDb21wcmVzc29yAHByb2dy..."
    }
    

    Tracktion engine includes a variety of different methods for retrieving plugin state. Many of these do the same thing as each other, so some data in the fields of the report will be redundant.

    Take note of the .vst2State field. This is will not be present when a VST3 plugin is selected. In that case, look for a .vst3State field.

    Returns { address: string }

    • address: string

getSingleParamReport

  • getSingleParamReport(paramName: string, steps?: number): { address: string; args: ({ type: string; value: string } | { type: string; value: number })[] }
  • Parameters

    • paramName: string
    • steps: number = 0

    Returns { address: string; args: ({ type: string; value: string } | { type: string; value: number })[] }

    • address: string
    • args: ({ type: string; value: string } | { type: string; value: number })[]

load

  • load(presetName: any): { address: string; args: { type: string; value: string } }
  • Load a preset file. Check the preset search path with cybr --preset-path

    Parameters

    • presetName: any

      Filename, with optional .trkpreset suffix.

    Returns { address: string; args: { type: string; value: string } }

    • address: string
    • args: { type: string; value: string }
      • type: string
      • value: string

loadTrkpreset

  • loadTrkpreset(file: any): { address: string; args: { type: string; value: Buffer }[] }
  • Load a .trkpreset file from the client. Request that the server load that preset on the currently selected track.

    Parameters

    • file: any

      A .trkpreset filename string OR a node Buffer object containing the contents of a .trkpreset file

    Returns { address: string; args: { type: string; value: Buffer }[] }

    • address: string
    • args: { type: string; value: Buffer }[]

loadVst2Preset

  • loadVst2Preset(fxpFxb: Buffer | string): { address: string; args: any[] }
  • Load the preset into the currently selected plugin. You must make sure that the selected plugin is the correct plugin for the supplied preset.

    Parameters

    • fxpFxb: Buffer | string

      the contents of a .fxp of .fxb file in either a Node.js Buffer or a base64-encoded string.

    Returns { address: string; args: any[] }

    • address: string
    • args: any[]

save

  • save(presetName: any): { address: string; args: { type: string; value: string } }
  • Save a preset file on the server. If this is a relative path, the preset will be saved to the first path in the preset search path, which can be found with cybr --preset-path

    Parameters

    • presetName: any

      Filename, optionally with .trkpreset suffix.

    Returns { address: string; args: { type: string; value: string } }

    • address: string
    • args: { type: string; value: string }
      • type: string
      • value: string

select

  • select(pluginName: string, pluginType: string | undefined | null, pluginId?: number): { address: string; args: ({ type: string; value: string } | { type: string; value: number })[] }
  • Creates an object that looks like this:

     {
       address: '/plugin/select',
       args: [
         { type: 'string', value: 'zebra2' },
         { type: 'integer', value: 0 },
         { type: 'string', value: 'vst' },
       ],
     }
    

    Parameters

    • pluginName: string

      the name of the vst plugin

    • pluginType: string | undefined | null
    • pluginId: number = 0

    Returns { address: string; args: ({ type: string; value: string } | { type: string; value: number })[] }

    • address: string
    • args: ({ type: string; value: string } | { type: string; value: number })[]

selectVst2ById

  • selectVst2ById(vstIdUint: number, pluginIdIndex?: number): { address: string; args: { type: string; value: number }[] }
  • Get or create a vst2 plugin on the selected track. Use this when you know UID of the vst2 plugin tha you want to select (or create).

    Parameters

    • vstIdUint: number

      the vst2 UID that identifies the plugin

    • pluginIdIndex: number = 0

      If there are multiple instances of the named plugin on the selected track, use this argument if you want to select a specific one one (by default this selects the first plugin with the given name). Note that pluginId only counts plugins that match the given pluginName, so pluginName='podolski', pluginId=1 will always select the second podolski instance, even if there are many other plugins on the track.

    Returns { address: string; args: { type: string; value: number }[] }

    • address: string
    • args: { type: string; value: number }[]

setExternalParamHelper

  • setExternalParamHelper(paramName: any, paramValue: any, timeInWholeNotes: any, curve: any): { address: string; args: ({ type: string; value: string } | { type: string; value: number })[] }
  • Helper that makes plugin speciffic modules easier to write. You probably do not need this unless you are writing an adapter.

    For Tracktion VSTs, all parameters are normalized, so setParamNormalized and setParamExplicit are effectively the same. This can make code that parameterizes VSTs difficult to read and write. To address this, plugin speciffic adapters can provide an abstraction layer that makes the code pretty and fun to read and write. This is a helper method that makes those adapters cleaner.

    Parameters

    • paramName: any

      the name of the parameter

    • paramValue: any

      the explicit value of the parameter set

    • timeInWholeNotes: any
    • curve: any

    Returns { address: string; args: ({ type: string; value: string } | { type: string; value: number })[] }

    • address: string
    • args: ({ type: string; value: string } | { type: string; value: number })[]

setParamExplicit

  • setParamExplicit(paramName: any, paramValue: any): { address: string; args: ({ type: string; value: string } | { type: string; value: number })[] }
  • Changes the specified parameter to the explicit value provided.

    Parameters

    • paramName: any

      the name of the parameter

    • paramValue: any

      the explicit value of the parameter set

    Returns { address: string; args: ({ type: string; value: string } | { type: string; value: number })[] }

    • address: string
    • args: ({ type: string; value: string } | { type: string; value: number })[]

setParamExplicitAt

  • setParamExplicitAt(paramName: string, paramValue: number, timeInSeconds?: number, curve?: number): { address: string; args: ({ type: string; value: string } | { type: string; value: number })[] }
  • Changes the automation curve of the parameter value, adds a point to the curve at the specified value and time. The server automatically adds a point at the default value of the parameter at time 0.

    Parameters

    • paramName: string

      the name of the parameter

    • paramValue: number

      the explicit value of the parameter set

    • timeInSeconds: number = 0

      time at which the param change will be inserted

    • curve: number = 0

      An optional number from [-1, 1] (inclusive), which represents the curvature of the line formed by this point and the next point. Zero implies a linear change. Higher values create a curve that begins slowly and accelerates. Lower values create a curve that begins quickly, and decelerates.

    Returns { address: string; args: ({ type: string; value: string } | { type: string; value: number })[] }

    • address: string
    • args: ({ type: string; value: string } | { type: string; value: number })[]

setParamNormalized

  • setParamNormalized(paramName: any, normalizedValue: any): { address: string; args: ({ type: string; value: string } | { type: string; value: number })[] }
  • Changes the specified parameter to the normalized value provided.

    Parameters

    • paramName: any

      the name of the parameter

    • normalizedValue: any

      the normalized value of the parameter set

    Returns { address: string; args: ({ type: string; value: string } | { type: string; value: number })[] }

    • address: string
    • args: ({ type: string; value: string } | { type: string; value: number })[]

setParamNormalizedAt

  • setParamNormalizedAt(paramName: string, normalizedValue: number, timeInSeconds?: number, curve?: number): { address: string; args: ({ type: string; value: string } | { type: string; value: number })[] }
  • Changes the automation curve of the parameter value, adds a point to the curve at the specified normalized value and time. The server automatically adds a point at the default value of the parameter at time 0.

    Parameters

    • paramName: string

      the name of the parameter

    • normalizedValue: number

      a normalized parameter value from 0 to 1

    • timeInSeconds: number = 0

      of parameter change in whole notes

    • curve: number = 0

      An optional number from [-1, 1] (inclusive), which represents the curvature of the line formed by this point and the next point. Zero implies a linear change. Higher values create a curve that begins slowly and accelerates. Lower values create a curve that begins quickly, and decelerates.

    Returns { address: string; args: ({ type: string; value: string } | { type: string; value: number })[] }

    • address: string
    • args: ({ type: string; value: string } | { type: string; value: number })[]

setSidechainInput

  • setSidechainInput(inputTrackName: any): { address: string; args: { type: string; value: string }[] }
  • Route the named track to the side chain input for the selected plugin. Note that this might not actually enable the side chain in the plugin configuration. For VSTs, enabling the side chain input may not be accessible from the fluid API, in which case it must be accomplished with a plugin preset.

    Parameters

    • inputTrackName: any

      a track with this name will feed the selected plugin's side chain input. The track will be created if it does not exist.

    Returns { address: string; args: { type: string; value: string }[] }

    • address: string
    • args: { type: string; value: string }[]