<effect>
  <name>AdFM - Delay-based</name>
  <enabled>false</enabled>
  <numIns>2</numIns>
  <numOuts>2</numOuts>
  <code>itab	chnget	&quot;AdFM.sine_table&quot;

if (itab == 0) then
	itab	ftgen 	0, 0, 65537, 10, 1 ; sine wave
	chnset 	itab, &quot;AdFM.sine_table&quot;
endif

aout1 	DFM	ain1, &lt;fc_fm_ratio&gt;, &lt;index&gt;, itab
aout2 	DFM	ain2, &lt;fc_fm_ratio&gt;, &lt;index&gt;, itab</code>
  <comments>blue port of the delay-based version of Victor Lazzarini&apos;s Adaptive FM Synthesis(AdFM) 

For more information, please consult the article &quot;Adaptive FM Synthesis&quot; by Victor Lazzarini, Joseph Timoney, and Thomas Lysaght, available at:

http://dafx.labri.fr/dafx07_proceedings.html</comments>
  <opcodeList>
    <udo>
      <opcodeName>DFM</opcodeName>
      <outTypes>a</outTypes>
      <inTypes>akki</inTypes>
      <codeBody>setksmps 1
as,krt,knx,ifn xin

ioff = 2/sr /* 2-sample offset*/
/* pitch tracking */
kcps,kamp ptrack as,512
/* modulator */
adt oscili knx/($M_PI*kcps),kcps/krt,ifn
adp delayr 1
/* delay line */
adel deltap3 adt + ioff
delayw as

xout adel</codeBody>
      <comments>asig DFM ain,krat,kndx,ifn

ain ? input signal
krat ? fc:fm ratio
kndx ? index of modulation
ifn ? mod signal function table</comments>
    </udo>
  </opcodeList>
  <graphicInterface editEnabled='true'>
    <uniqueNameManager nameIndex='0' defaultPrefix='bsbObj'/>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
      <objectName>fc_fm_ratio</objectName>
      <x>5</x>
      <y>68</y>
      <automationAllowed>true</automationAllowed>
      <minimum>1.0</minimum>
      <maximum>8.0</maximum>
      <value>2.0</value>
      <knobWidth>60</knobWidth>
      <randomizable>true</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>22</x>
      <y>48</y>
      <label>fc:fm</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
      <objectName>index</objectName>
      <x>69</x>
      <y>68</y>
      <automationAllowed>true</automationAllowed>
      <minimum>0.0</minimum>
      <maximum>12.0</maximum>
      <value>1.0</value>
      <knobWidth>60</knobWidth>
      <randomizable>true</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>84</x>
      <y>48</y>
      <label>index</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>42</x>
      <y>3</y>
      <label>&lt;html&gt;&lt;font size=&quot;+1&quot;&gt;AdFM&lt;/font&gt;&lt;/html&gt;</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>30</x>
      <y>27</y>
      <label>Delay-based</label>
    </bsbObject>
  </graphicInterface>
  <bsbParameterList>
    <parameter uniqueId='-650224302' name='fc_fm_ratio' label='' min='1.0' max='8.0' resolution='-1.0' automationEnabled='false'>
      <line name='' version='2' max='8.0' min='1.0' resolution='-1.0' color='-8355712' rightBound='false'>
        <linePoint x='0.0' y='2.0'/>
      </line>
    </parameter>
    <parameter uniqueId='-650224300' name='index' label='' min='0.0' max='12.0' resolution='-1.0' automationEnabled='false'>
      <line name='' version='2' max='12.0' min='0.0' resolution='-1.0' color='-8355712' rightBound='false'>
        <linePoint x='0.0' y='1.0'/>
      </line>
    </parameter>
  </bsbParameterList>
</effect>