Function to add a MIDI module in the specified destination layer. The destination layer is determined by its Layer object. For example, An Element object can only have one parent. It cannot be child of multiple parents. Therefore, an Element object that you retrieved from the running plug-in instance must be removed before it can be inserted again. The Element objects you retrieve through loadPreset or loadPresetAsync can be inserted freely, because these functions create a copy of the Element objects when reading them. Available in: Controller. To explore the following script: Description
this.parent
specifies the parent layer of the script module as destination layer. The MIDI module to be added is determined by its MidiModule object. You can use getMidiModule or findMidiModules to determine the desired MIDI module. The new MIDI module will be added behind the existing MIDI modules. To insert a MIDI module at a specific position in the destination layer, use insertMidiModule instead.Arguments
module The MidiModule object of the MIDI module that you want to append. MidiModule Example
-- append MIDI module 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 MIDI module from the loaded program
module = loadedProgram:getMidiModule()
-- append MIDI module
if module then
this.program:appendMidiModule(module)
end
See Also: appendBus, appendEffect, appendLayer, appendLayerAsync, appendZone, MidiModule
1 Comment
Sabine Pfeifer
proofread done