You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
2.2KB

  1. <h3>Summary</h3>
  2. <div>
  3. <p>Modify a signal with a DAHDSR (Delay Attack Hold Decay Sustain
  4. Release) envelope.
  5. </p>
  6. <p align=center><img src="img/dahdsr.png"></p>
  7. </div>
  8. <h3>Audio Connections</h3>
  9. <table class=doc align=center cellpadding=3>
  10. <tr class=top><th>Port</th><th>Purpose</th></tr>
  11. <tr class=odd><td align=center>In 0</td><td>Signal Input</td></tr>
  12. <tr class=odd><td align=center>Out 0</td><td>Signal with Envelope Applied</td></tr>
  13. </table>
  14. <h3>Functions</h3>
  15. <p class=func><span class=keyword>noteOn</span>();</p>
  16. <p class=desc>Begin the delay to attack, or the attack phase is
  17. delay is zero.
  18. </p>
  19. <p class=func><span class=keyword>noteOff</span>();</p>
  20. <p class=desc>Begin the release phase.
  21. </p>
  22. <p class=func><span class=keyword>delay</span>(milliseconds);</p>
  23. <p class=desc>Set the delay from noteOn to the attach phase. The
  24. default is zero, for no delay.
  25. </p>
  26. <p class=func><span class=keyword>attack</span>(milliseconds);</p>
  27. <p class=desc>Set the attack time. The default is 1.5 milliseconds.
  28. </p>
  29. <p class=func><span class=keyword>hold</span>(milliseconds);</p>
  30. <p class=desc>Set the hold time. The default is 0.5 milliseconds.
  31. </p>
  32. <p class=func><span class=keyword>decay</span>(milliseconds);</p>
  33. <p class=desc>Set the decay time. The default is 15 milliseconds.
  34. </p>
  35. <p class=func><span class=keyword>sustain</span>(level);</p>
  36. <p class=desc>Set the sustain level. The range is 0 to 1.0. The
  37. gain will be maintained at this level after the decay phase,
  38. until noteOff() is called.
  39. </p>
  40. <p class=func><span class=keyword>release</span>(milliseconds);</p>
  41. <p class=desc>Set the release time. The default is 30 millisecond.
  42. </p>
  43. <h3>Examples</h3>
  44. <p class=exam>File &gt; Examples &gt; Audio &gt; Synthesis &gt; PlaySynthMusic
  45. </p>
  46. <p class=exam>File &gt; Examples &gt; Audio &gt; Synthesis &gt; pulseWidth
  47. </p>
  48. <p class=exam>File &gt; Examples &gt; Audio &gt; MemoryAndCpuUsage
  49. </p>
  50. <h3>Notes</h3>
  51. <p>To achieve the more common ADSR shape, simply
  52. set delay and hold to zero.</p>
  53. <p>The recommended range for each of the 5 timing inputs is 0 to 50
  54. milliseconds. Up to 200 ms can be used, with somewhat reduced
  55. accuracy</p>