Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

insertEffect(effect, position)

Description

Function to insert an effect at the specified position in a bus. You can use getBus or findBusses to define the bus. The position is the number indexing the existing effects. The new effect will be inserted before the specified position. To add the effect at the end, use appendEffect instead.

Available in: Controller.

Arguments

effectThe element object of the effect that you want to insert.Effect
positionThe position where the inserted is inserted.number

Example

To explore the following script:

  1. Download Program.vstpreset.
  2. Drag the preset on the MediaBay to import it to the user folder for VST presets.
  3. Create an empty program and add a script module.
  4. Paste the script into the text editor of the script module and execute the script.

 

-- insert an effect from Program.vstpreset into the current program
 
-- get the file path for user VST presets
path = getUserPresetPath()
 
-- load VST preset
loadedProgram = loadPreset(path.."/Program/Program.vstpreset")
 
-- get the first effect from the loaded program
effect = loadedProgram:getBus():getEffect()

-- get the first bus of this program
bus = this.program:getBus()

-- insert the effect
if (effect and bus) then
 	bus:insertEffect(effect, 1)
end

  • No labels