<effect>
  <name>Newtonator v1.0</name>
  <enabled>true</enabled>
  <numIns>2</numIns>
  <numOuts>2</numOuts>
  <code>setksmps	1

; General vars
ifollow	=		&lt;follow&gt;
kefatk	=		&lt;efatk&gt;
kefrel	=		&lt;efrel&gt;
iclip	=		&lt;clip&gt;
ifcliplim =		&lt;cliplim&gt;
ipad	=		0dbfs * .985	;padding for limitting
kscale	=		&lt;prescale&gt;
kgscale_ =		sqrt(&lt;gscale&gt;)
kgscale =		(1.0001 - kgscale_) * 2
kdry	=		&lt;dry&gt;
kfattr_	pow		&lt;fattract&gt;, 4
kfattr	=		kfattr_ / 4
kgrav	=		&lt;gravity&gt;	;gravity
igmtype	=		&lt;gmtype&gt;
kgmfrq	=		&lt;gmfreq&gt;
kgmsprd	=		&lt;gmspread&gt; * kgmfrq
kgmdpth	=		&lt;gmdepth&gt;

; Chn 1 vars
kgrav1	init		1		;gravity direction
kpvveloc1	init	-.0001		;previous vertical velocity
kvveloc1	init	0		;vertical velocity
kfloor1	downsamp	ain1*kscale	;floor
kpfloor1	init	0		;previous floor value
kpos1	init		0		;y-position
kppos1	init		0		;previous y-position

; Chn 2 vars
kgrav2	init		-1		;gravity direction
kpvveloc2	init	.0001		;previous vertical velocity
kvveloc2	init	0		;vertical velocity
kfloor2	downsamp	ain2*kscale	;floor
kpfloor2	init	0		;previous floor value
kpos2	init		0		;y-position
kppos2	init		0		;previous y-position

; ********* Gravity Modulation *********
if (igmtype == -1) then
 kgmmod	jspline	kgmdpth, kgmfrq-kgmsprd, kgmfrq+kgmsprd
else
 kgmmod	lfo	kgmdpth, kgmfrq, igmtype
endif
kgrav	=	kgrav*(1+kgmmod)

; ********* 1ST CHANNEL *********
if (abs(kppos1 - kpfloor1) &lt; (kfattr * 0dbfs) &amp;&amp; kpvveloc1 &lt; kfloor1 - kpfloor1 &amp;&amp; kpvveloc1 &gt; kfattr * kgrav1 * kgrav * sr) then
 ; vertical velocity isn&apos;t enough to overcome slope in floor,
 ; calculate new velocity
 kpos_	=	kfloor1
 kvveloc_ =	kfloor1 - kpfloor1
else
 ; calculate current y-position (t is always 1)
 kgravscl =	sqrt(abs(kppos1 - kpfloor1) / (0dbfs * kgscale))
 kpos_	=	kppos1 + kpvveloc1 + (kgrav1 * kgrav * kgravscl / 2)
 kvveloc_ =	kpvveloc1 + (kgrav1 * kgrav)
endif

;normalize values with floor/ceiling
if (kgrav1 &lt; 0 &amp;&amp; kpos_ &lt; kfloor1) then
 kgrav1	=	-kgrav1
elseif (kgrav1 &gt; 0 &amp;&amp; kpos_ &gt;= kfloor1) then
 kgrav1	=	-kgrav1
endif
if (iclip == 0) then
 kpos1	=	kpos_
else
 kpos1	limit	kpos_, -ipad, ipad
endif

;remember previous positions
kppos1	=	kpos1
kpvveloc1 =	kvveloc_
kpfloor1 =	kfloor1

; ********* 2ND CHANNEL *********
if (abs(kppos2 - kpfloor2) &lt; (kfattr * 0dbfs) &amp;&amp; kpvveloc2 &gt; kfloor2 - kpfloor2 &amp;&amp; kpvveloc2 &lt; kfattr * kgrav2 * kgrav * sr) then
 ; vertical velocity isn&apos;t enough to overcome slope in floor,
 ; calculate new velocity
 kpos_	=	kfloor2
 kvveloc_ =	kfloor2 - kpfloor2
else
 ; calculate current y-position (t is always 1)
 kgravscl =	sqrt(abs(kppos2 - kpfloor2) / (0dbfs * kgscale))
 kpos_	=	kppos2 + kpvveloc2 + (kgrav2 * kgrav * kgravscl / 2)
 kvveloc_ =	kpvveloc2 + (kgrav2 * kgrav)
endif

;normalize values with floor/ceiling
if (kgrav2 &lt; 0 &amp;&amp; kpos_ &lt;= kfloor2) then
 kgrav2	=	-kgrav2
elseif (kgrav2 &gt; 0 &amp;&amp; kpos_ &gt; kfloor2) then
 kgrav2	=	-kgrav2
endif
if (iclip == 0) then
 kpos2	=	kpos_
else
 kpos2	limit	kpos_, -ipad, ipad
endif

;remember previous positions
kppos2	=	kpos2
kpvveloc2 =	kvveloc_
kpfloor2 =	kfloor2

;calc output
aout1_	upsamp	kpos1
aout2_	upsamp	kpos2
aout1	=	(kdry * ain1) + ((1 - kdry) * aout1_)
aout2	=	(kdry * ain2) + ((1 - kdry) * aout2_)

;follow original input amp if requested
if (ifollow == 1) then
 afol1	follow2	ain1, kefatk, kefrel
 afol2	follow2	ain2, kefatk, kefrel
 aout1	=	aout1*afol1/0dbfs
 aout2	=	aout2*afol2/0dbfs
endif

;clip if requested
if (ifcliplim &gt; 0) then
 aout1	clip	aout1, 0, 0dbfs*ifcliplim
 aout2	clip	aout2, 0, 0dbfs*ifcliplim
endif
</code>
  <comments>AUTHOR: Michael Bechard, Jan. 2008

VERSION: 1.0

DESCRIPTION:

The Newtonator is an FSU distortion unit of my own design that is more than
capable of mangling the input audio beyond recognition. It is also capable of
more subtle distortion, and can act as a low-pass filter with the correct
settings. It is automation and &quot;randomize&quot; friendly.

The concept behind it is simple. Imagine a ball rolling along on top of the
input waveform at a constant forward velocity equal to the sample-rate. It obeys
the laws of gravity. Because of this, whenever the ball encounters an upward
slope in the waveform (sometimes referred to as the floor in this
documentation), it can be propelled upward beyond the declining slope, depending
on the gravitational pull and steepness of the slope. The output waveform is the
path this ball takes through the air.

That&apos;s the gist of it. The parameters are described in detail below. This was
fun to make and continues to be fun to use. I hope you enjoy.

PARAMETERS:

Gravity - The base gravitational pull on the ball.

Pre-scale - Scales the input audio up or down in amplitude before it is
processed. This can have a significant effect on the output, as a decrease in
amplitude will decrease the steepness of all the slopes in the input. Scaling
down will also make the output more consistent, as high frequency details will
diminish and the ball will be more likely to sail over them. Likewise, scaling
the input up can exagerate the output of the Newtonator.

Final Clip Limit - Clipping occurs at the very end of the signal path in order
to save your speakers and further distort the signal (the Newtonator&apos;s output is
often very hot). This knob affects the limit of the clipping. If this setting is
at zero, no clipping will occur.

Clip Path - Not to be confused with the clipping that takes place at the end of
the output, this clipping occurs at the same time the current position and
velocity of the ball is calculated per-sample. Therefore it can drastically
affect the output sound, and in a much different way than any clipping done at
the final output stage of the Newtonator. Selecting this option is a good way to
tame the output.

Floor Attraction - If floor attraction is low, then the ball may fall right
through the floor (input waveform) when descending down on it, depending on how
low the floor attraction is and on the current vertical velocity of the
ball. When it falls through, the gravitational pull is reversed (note that the
velocity remains the same). One should note that with a low floor attraction,
the Newtonator can output sound even if the input is silence, since it keeps
falling through the dc signal in a more-or-less sine wave path. Also note that
with no floor attraction, the ball will not be projected upwards when
encountering any positive slope, since it will just fall through it. No big
deal, just a different sound.

Gravity Scaling - The gravitational force can be exponentially scaled up
depending on how high above the floor the ball is and how high this setting
is. A high gravity scaling mixed with a high gravity will keep the output more
true to the input waveform.

Dry Mix - Mix in some or all of the original input signal into the output
signal. However, this mixed signal still goes through the envelope follower and
the final clip.

Gravity Modulation - (these parmeters all affect any modulation of the
gravitational pull)

(dropdown box) - This is the type of waveform that will modulate the gravity.

Frequency - The frequency of the modulation.

Spread - This setting only applies if the waveform is Random. In that case, this
determines the range of frequencies that can be covered by the jspline opcode,
as a factor of the modulation Frequency.

Depth - The depth of modulation, as a factor of the value of the Gravity
widget. Please note that a high depth will usually severely mangle the input and
provide a high output amplitude. For a tamer sound, keep the depth below one. To
turn off gravity modulation entirely, set the depth to zero.

Envelope Follower - (these settings all affect how the output follows the
original input&apos;s amplitude)

Use Envelope Follower - If selected, the output amplitude will follow the input
amplitude via the follow2 opcode.

Attack Time, Release Time - Both parameters for the follow2 opcode.

TIPS:

To make a low-pass filter-type effect - Set modulation depth to zero, pre-scale
to one, floor attraction low (~&lt;=0.3), Gravity Scaling very high (1 or .999,
etc). Adjust Gravity to affect the cut-off frequency.

To make the output more true to the input - Any one of these may work; high
gravity scaling (mixed with a high gravity), low(er) pre-scale, high floor
attraction, low(er) gravity modulation depth (usually safe is &lt;1). In most
cases, having a high floor attraction seems to render at least a recognizable
signal.

Help, I&apos;m just getting *clicks* - Try increasing the gravity, lowering the
gravity modulation depth, or selecting Clip Path. Try any one or all.

To prevent output from playing when input is silence - You can either increase
floor attraction or use the Envelope Follower. Or both. But keep in mind that
increasing the floor attraction will affect the resulting tambre, while using
the envelope follower will just affect the amplitude.
</comments>
  <opcodeList/>
  <graphicInterface editEnabled='false'>
    <uniqueNameManager nameIndex='-1' defaultPrefix='bsbObj'/>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
      <objectName>gravity</objectName>
      <x>1</x>
      <y>9</y>
      <automationAllowed>true</automationAllowed>
      <minimum>0.0</minimum>
      <maximum>100.0</maximum>
      <value>25.0</value>
      <knobWidth>120</knobWidth>
      <randomizable>true</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>43</x>
      <y>153</y>
      <label>Gravity</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
      <objectName>prescale</objectName>
      <x>128</x>
      <y>40</y>
      <automationAllowed>true</automationAllowed>
      <minimum>0.0</minimum>
      <maximum>2.0</maximum>
      <value>1.0</value>
      <knobWidth>60</knobWidth>
      <randomizable>true</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>132</x>
      <y>121</y>
      <label>Pre-scale</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
      <objectName>gscale</objectName>
      <x>384</x>
      <y>21</y>
      <automationAllowed>true</automationAllowed>
      <minimum>0.0</minimum>
      <maximum>1.0</maximum>
      <value>0.9</value>
      <knobWidth>80</knobWidth>
      <randomizable>true</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>383</x>
      <y>122</y>
      <label>Gravity Scaling</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
      <objectName>dry</objectName>
      <x>479</x>
      <y>41</y>
      <automationAllowed>true</automationAllowed>
      <minimum>0.0</minimum>
      <maximum>1.0</maximum>
      <value>0.0</value>
      <knobWidth>60</knobWidth>
      <randomizable>false</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>490</x>
      <y>120</y>
      <label>Dry Mix</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
      <objectName>fattract</objectName>
      <x>299</x>
      <y>41</y>
      <automationAllowed>true</automationAllowed>
      <minimum>0.0</minimum>
      <maximum>1.0</maximum>
      <value>0.2860269</value>
      <knobWidth>60</knobWidth>
      <randomizable>true</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>290</x>
      <y>121</y>
      <label>Floor Attraction</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>89</x>
      <y>186</y>
      <label>Gravity Modulation</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
      <objectName>gmfreq</objectName>
      <x>2</x>
      <y>209</y>
      <automationAllowed>true</automationAllowed>
      <minimum>0.0</minimum>
      <maximum>5000.0</maximum>
      <value>116.71914</value>
      <knobWidth>120</knobWidth>
      <randomizable>true</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
      <objectName>gmspread</objectName>
      <x>136</x>
      <y>263</y>
      <automationAllowed>true</automationAllowed>
      <minimum>0.0</minimum>
      <maximum>1.0</maximum>
      <value>0.14170879</value>
      <knobWidth>60</knobWidth>
      <randomizable>true</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>32</x>
      <y>347</y>
      <label>Frequency</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>146</x>
      <y>343</y>
      <label>Spread</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
      <objectName>gmdepth</objectName>
      <x>202</x>
      <y>264</y>
      <automationAllowed>true</automationAllowed>
      <minimum>0.0</minimum>
      <maximum>10.0</maximum>
      <value>0.0</value>
      <knobWidth>60</knobWidth>
      <randomizable>true</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>218</x>
      <y>348</y>
      <label>Depth</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBDropdown'>
      <objectName>gmtype</objectName>
      <x>136</x>
      <y>225</y>
      <bsbDropdownItemList>
        <bsbDropdownItem>
          <name>Random (JSpline)</name>
          <value>-1</value>
        </bsbDropdownItem>
        <bsbDropdownItem>
          <name>Sine</name>
          <value>0</value>
        </bsbDropdownItem>
        <bsbDropdownItem>
          <name>Triangle</name>
          <value>1</value>
        </bsbDropdownItem>
        <bsbDropdownItem>
          <name>Sawtooth</name>
          <value>4</value>
        </bsbDropdownItem>
        <bsbDropdownItem>
          <name>Square</name>
          <value>2</value>
        </bsbDropdownItem>
      </bsbDropdownItemList>
      <selectedIndex>0</selectedIndex>
      <randomizable>true</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBCheckBox'>
      <objectName>clip</objectName>
      <x>175</x>
      <y>12</y>
      <label>Clip Path</label>
      <selected>false</selected>
      <randomizable>true</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
      <objectName>cliplim</objectName>
      <x>204</x>
      <y>41</y>
      <automationAllowed>false</automationAllowed>
      <minimum>0.0</minimum>
      <maximum>1.0</maximum>
      <value>1.0</value>
      <knobWidth>60</knobWidth>
      <randomizable>false</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName>fcliplim</objectName>
      <x>196</x>
      <y>121</y>
      <label>Final Clip Limit</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>365</x>
      <y>188</y>
      <label>Envelope Follower</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBCheckBox'>
      <objectName>follow</objectName>
      <x>351</x>
      <y>214</y>
      <label>Use Envelope Follower</label>
      <selected>false</selected>
      <randomizable>false</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
      <objectName>efatk</objectName>
      <x>342</x>
      <y>244</y>
      <automationAllowed>true</automationAllowed>
      <minimum>0.0</minimum>
      <maximum>1.0</maximum>
      <value>0.0010</value>
      <knobWidth>60</knobWidth>
      <randomizable>false</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>342</x>
      <y>321</y>
      <label>Attack Time</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
      <objectName>efrel</objectName>
      <x>429</x>
      <y>244</y>
      <automationAllowed>true</automationAllowed>
      <minimum>0.0</minimum>
      <maximum>2.0</maximum>
      <value>0.2</value>
      <knobWidth>60</knobWidth>
      <randomizable>false</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>426</x>
      <y>320</y>
      <label>Release Time</label>
    </bsbObject>
  </graphicInterface>
  <bsbParameterList>
    <parameter uniqueId='734083322' name='dry' label='' min='0.0' max='1.0' resolution='-1.0' automationEnabled='false'>
      <line name='' version='2' max='1.0' min='0.0' resolution='-1.0' color='-8355712' rightBound='false'>
        <linePoint x='0.0' y='0.0'/>
      </line>
    </parameter>
    <parameter uniqueId='1514756335' name='efatk' label='' min='0.0' max='1.0' resolution='-1.0' automationEnabled='false'>
      <line name='' version='2' max='1.0' min='0.0' resolution='-1.0' color='-8355712' rightBound='false'>
        <linePoint x='0.0' y='0.0010'/>
      </line>
    </parameter>
    <parameter uniqueId='1514756337' name='efrel' label='' min='0.0' max='2.0' resolution='-1.0' automationEnabled='false'>
      <line name='' version='2' max='2.0' min='0.0' resolution='-1.0' color='-8355712' rightBound='false'>
        <linePoint x='0.0' y='0.2'/>
      </line>
    </parameter>
    <parameter uniqueId='739864074' name='fattract' label='' min='0.0' max='1.0' resolution='-1.0' automationEnabled='false'>
      <line name='' version='2' max='1.0' min='0.0' resolution='-1.0' color='-8355712' rightBound='false'>
        <linePoint x='0.0' y='0.2860269'/>
      </line>
    </parameter>
    <parameter uniqueId='1261337882' name='gmdepth' label='' min='0.0' max='10.0' resolution='-1.0' automationEnabled='false'>
      <line name='' version='2' max='10.0' min='0.0' resolution='-1.0' color='-8355712' rightBound='false'>
        <linePoint x='0.0' y='0.0'/>
      </line>
    </parameter>
    <parameter uniqueId='1261337878' name='gmfreq' label='' min='0.0' max='5000.0' resolution='-1.0' automationEnabled='false'>
      <line name='' version='2' max='5000.0' min='0.0' resolution='-1.0' color='-8355712' rightBound='false'>
        <linePoint x='0.0' y='116.71914'/>
      </line>
    </parameter>
    <parameter uniqueId='1261337880' name='gmspread' label='' min='0.0' max='1.0' resolution='-1.0' automationEnabled='false'>
      <line name='' version='2' max='1.0' min='0.0' resolution='-1.0' color='-8355712' rightBound='false'>
        <linePoint x='0.0' y='0.14170879'/>
      </line>
    </parameter>
    <parameter uniqueId='734083316' name='gravity' label='' min='0.0' max='100.0' resolution='-1.0' automationEnabled='false'>
      <line name='' version='2' max='100.0' min='0.0' resolution='-1.0' color='-8355712' rightBound='false'>
        <linePoint x='0.0' y='25.0'/>
      </line>
    </parameter>
    <parameter uniqueId='734083320' name='gscale' label='' min='0.0' max='1.0' resolution='-1.0' automationEnabled='false'>
      <line name='' version='2' max='1.0' min='0.0' resolution='-1.0' color='-8355712' rightBound='false'>
        <linePoint x='0.0' y='0.9'/>
      </line>
    </parameter>
    <parameter uniqueId='734083318' name='prescale' label='' min='0.0' max='2.0' resolution='-1.0' automationEnabled='false'>
      <line name='' version='2' max='2.0' min='0.0' resolution='-1.0' color='-8355712' rightBound='false'>
        <linePoint x='0.0' y='1.0'/>
      </line>
    </parameter>
  </bsbParameterList>
</effect>