/ HALion Developer Resource / HALion Script / Reference /

Modulation Source Types


On this page:


Description

Enumerator to identify the different modulation sources.

Available in: Controller.

Arguments

IndexsourcesourceInfo1sourceInfo2Comment
0ModulationSource.unassigned--
1ModulationSource.lfo1--
2ModulationSource.lfo2--
3ModulationSource.ampEnv--
4ModulationSource.filterEnv--
5ModulationSource.pitchEnv--
6ModulationSource.userEnv--
7ModulationSource.stepMod--
8ModulationSource.glide--
9ModulationSource.keyFollow--
10ModulationSource.noteOnVelocity--
11ModulationSource.noteOnVelocitySquared--
12ModulationSource.noteOnVelocityNormalized--
13ModulationSource.noteOffVelocity--
14ModulationSource.pitchBend--
15ModulationSource.modWheel--
16ModulationSource.aftertouch--
17ModulationSource.midiControlMIDI controller number (0 - 127).-
18ModulationSource.quickControlElement object of the layer.Index of the quick control (1 - 11).
19ModulationSource.modulationModuleElement object of the MIDI module.Number of the output channel.
20ModulationSource.noteExpressionNumber of the custom note expression (1-8).-
21ModulationSource.noise--
22ModulationSource.output--
23ModulationSource.bus1--
24ModulationSource.bus2--
25ModulationSource.bus3--
26ModulationSource.bus4--
27ModulationSource.bus5--
28ModulationSource.bus6--
29ModulationSource.bus7--
30ModulationSource.bus8--
31ModulationSource.bus9--
32ModulationSource.bus10--
33ModulationSource.bus11--
34ModulationSource.bus12--
35ModulationSource.bus13--
36ModulationSource.bus14--
37ModulationSource.bus15--
38ModulationSource.bus16--
39ModulationSource.xlfoX--
40ModulationSource.xlfoY--
41ModulationSource.sampleAndHoldIndex of the S&H (0 - 5).-Source 2 only.

Jump to Top

Example

-- Define the modulation sources and infos in an array.

modSources = {
    { source = ModulationSource.lfo1, bipolar = 1 },
    { source = ModulationSource.midiControl, bipolar = 0, sourceInfo1 = 1 },
    { source = ModulationSource.quickControl, bipolar = 1, sourceInfo1 = this.program, sourceInfo2 = 1 },
    { source = ModulationSource.modulationModule, bipolar = 0, sourceInfo1 = this, sourceInfo2 = 1 },
    { source = ModulationSource.modulationModule, bipolar = 0, sourceInfo1 = this, sourceInfo2 = 2 },
    { source = ModulationSource.noteExpression, bipolar = 0, sourceInfo1 = 1 }
}
 
-- Define two modulation outputs for the script module.

defineModulation("50%", false)
defineModulation("100%", false)
 
-- Calculate the modulation outputs.

function calcModulation()
    return 0.5, 1
end
 
-- Get the element object of the first zone.

zone = this.program:findZones(true)[1]
 
-- Assign the modulation sources to source 1 in the modulation rows 1 to 6.

for i=1, #modSources do
    local modRow = zone:getModulationMatrixRow(i)
    modRow:setSource1(modSources[i].source, modSources[i].sourceInfo1, modSources[i].sourceInfo2)
    modRow:setParameter("Source1.Polarity", modSources[i].bipolar) -- Set the default polarity of the source.
end
 
-- Assign the sample & hold to source 2 in modulation row 1.

modRow = zone:getModulationMatrixRow(1)
modRow:setSource2(ModulationSource.sampleAndHold, 0)

See also: ModulationMatrixRow, getModulationMatrixRow, setSource1, setSource2, getSource1, getSource2, Modulation Destination Types