-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnvelopeModule.binstr
139 lines (130 loc) · 6.05 KB
/
EnvelopeModule.binstr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<instrument type='blue.orchestra.BlueSynthBuilder' editEnabled='true'>
<name>EnvelopeModule</name>
<comment>
DESCRIPTION:
The Envelope Module adds 3 envelopes: Amplitude, Filter and Pitch Bend
- multiply the envelopes to the audiosignal.
- the Filter envelope is or can be used together with the Filter Module code, Ampltude Module, Tuning Module and Pitch Module as it makes references to these.</comment>
<globalOrc/>
<globalSco/>
<instrumentText>;0 inputs, 2 output control signals
;;=========================amplitude envelope===================================
if <envelope amplitude ON> == 1 then
if i(<amplitude exponential switch>) == 1 then ; create amplitude envelope
kenvamp loopxseg <envelope amplitude rate>/p3, 0, 0, <envelope_amplitude envelope>, 0 ; exponential envelope
else
kenvamp loopseg <envelope amplitude rate>/p3, 0, 0, <envelope_amplitude envelope>, 0 ; or linear envelepe
endif
kjitamp jitter <amplitude jitter depth>, <amplitude jitter min>, <amplitude jitter max> ; create some amplitude jitter
aampenv = (kenvamp + kjitamp) * <SF pregain> ; pregain for loaded sample + jitter
else
aampenv = <SF pregain> ; no amplitude envelope, only pregain
endif
;================================pitch envelope=================================
if (<envelope pitch bend ON>) == 1 then ; envelope pitchbend
kenvpitchbend loopxseg <envelope pitch rate>/p3, 0, 0, <envelope_pitch bend envelope>, 0 ; exponential envelope
kenvpitchbend *= <pitchbend depth>
kjitpitch jitter <pitch jitter depth>, <pitch jitter min>, <pitch jitter max> ; create some pitch jitter
ktuning = (ktuning + kjitpitch) + kenvpitchbend
else
kenvpitchbend = 0
endif
;;==============================================================================
; for Filters, see FilterModule
;aout opcode aampenv * amplitude, kenvpitchbend * pitch</instrumentText>
<alwaysOnInstrumentText></alwaysOnInstrumentText>
<graphicInterface editEnabled='false'>
<gridSettings>
<width>10</width>
<height>10</height>
<gridStyle>DOT</gridStyle>
<snapGridEnabled>true</snapGridEnabled>
</gridSettings>
<bsbObject type='blue.orchestra.blueSynthBuilder.BSBGroup'>
<objectName></objectName>
<x>0</x>
<y>0</y>
<groupName>Group</groupName>
<backgroundColor>0x00000033</backgroundColor>
<borderColor>0x000000ff</borderColor>
<labelTextColor>0xffffffff</labelTextColor>
<titleEnabled>true</titleEnabled>
<width>20</width>
<height>20</height>
<font>
<name>Roboto</name>
<size>12.0</size>
<style>0</style>
</font>
<bsbObject type='blue.orchestra.blueSynthBuilder.BSBGroup'>
<objectName></objectName>
<x>0</x>
<y>0</y>
<comment>amplitude = red, filter = blue, brown = pitch</comment>
<groupName>envelopes</groupName>
<backgroundColor>0x282828ff</backgroundColor>
<borderColor>0x000000ff</borderColor>
<labelTextColor>0xffffffff</labelTextColor>
<titleEnabled>true</titleEnabled>
<width>1060</width>
<height>199</height>
<font>
<name>Roboto</name>
<size>12.0</size>
<style>2</style>
</font>
<bsbObject type='blue.orchestra.blueSynthBuilder.BSBGroup'>
<objectName></objectName>
<x>18</x>
<y>14</y>
<comment>amplitude = red, filter = blue, brown = pitch</comment>
<groupName>Group</groupName>
<backgroundColor>0x282828ff</backgroundColor>
<borderColor>0x000000ff</borderColor>
<labelTextColor>0xffffffff</labelTextColor>
<titleEnabled>false</titleEnabled>
<width>987</width>
<height>188</height>
<font>
<name>Roboto</name>
<size>12.0</size>
<style>0</style>
</font>
<bsbObject type='blue.orchestra.blueSynthBuilder.BSBLineObject'>
<objectName>envelope</objectName>
<x>10</x>
<y>10</y>
<comment>amplitude = red, filter = blue, brown = pitch</comment>
<canvasWidth>965</canvasWidth>
<canvasHeight>150</canvasHeight>
<xMax>1.0</xMax>
<relativeXValues>true</relativeXValues>
<separatorType>COMMA</separatorType>
<leadingZero>false</leadingZero>
<locked>false</locked>
<lines>
<line name='amplitude envelope' version='2' max='1.0' min='0.0' bdresolution='-1' color='-52378' rightBound='true' endPointsLinked='false'>
<linePoint x='0.0' y='1.0'/>
<linePoint x='1.0' y='1.0'/>
</line>
<line name='filter envelope' version='2' max='1.0' min='0.0' bdresolution='-1' color='-16737793' rightBound='true' endPointsLinked='false'>
<linePoint x='0.0' y='0.0'/>
<linePoint x='0.6229299363057325' y='1.0'/>
<linePoint x='0.778343949044586' y='0.013333333333333308'/>
<linePoint x='1.0' y='0.5'/>
</line>
<line name='pitch bend envelope' version='2' max='2.0' min='0.5' bdresolution='-1' color='-23296' rightBound='true' endPointsLinked='false'>
<linePoint x='0.0' y='1.0'/>
<linePoint x='0.2576235541535226' y='1.6360294117647058'/>
<linePoint x='1.0' y='1.2830882352941178'/>
</line>
</lines>
</bsbObject>
</bsbObject>
</bsbObject>
</bsbObject>
</graphicInterface>
<parameterList/>
<presetGroup name='Presets'/>
<opcodeList/>
</instrument>