您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

59 行
2.5KB

  1. <h3>Summary</h3>
  2. <p>Create a waveform: sine, sawtooth, square, triangle, pulse or arbitrary.</p>
  3. <h3>Audio Connections</h3>
  4. <table class=doc align=center cellpadding=3>
  5. <tr class=top><th>Port</th><th>Purpose</th></tr>
  6. <tr class=odd><td align=center>Out 0</td><td>Waveform Output</td></tr>
  7. </table>
  8. <h3>Functions</h3>
  9. <p class=func><span class=keyword>begin</span>(waveform);</p>
  10. <p class=desc>Configure the waveform type to create.
  11. </p>
  12. <p class=func><span class=keyword>begin</span>(level, frequency, waveform);</p>
  13. <p class=desc>Output a waveform, and set the amplitude and frequency.
  14. </p>
  15. <p class=func><span class=keyword>frequency</span>(freq);</p>
  16. <p class=desc>Change the frequency.
  17. </p>
  18. <p class=func><span class=keyword>amplitude</span>(level);</p>
  19. <p class=desc>Change the amplitude. Set to 0 to turn the signal off.
  20. </p>
  21. <p class=func><span class=keyword>phase</span>(angle);</p>
  22. <p class=desc>
  23. Cause the generated waveform to jump to a specific point within
  24. its cycle. Angle is from 0 to 360 degrees. When multiple objects
  25. are configured,
  26. <a href="http://www.pjrc.com/teensy/td_libs_AudioProcessorUsage.html" target="_blank">AudioNoInterrupts()</a>
  27. should be used to guarantee all new settings take effect together.
  28. </p>
  29. <p class=func><span class=keyword>pulseWidth</span>(amount);</p>
  30. <p class=desc>Change the width (duty cycle) of the pulse.</p>
  31. <p class=func><span class=keyword>arbitraryWaveform</span>(array, maxFreq);</p>
  32. <p class=desc>
  33. Configure the waveform to be used with WAVEFORM_ARBITRARY. Array
  34. must be an array of 256 samples. Currently, the data is used
  35. without any filtering, which can cause aliasing with frequencies
  36. above 172 Hz. For higher frequency output, you must bandwidth
  37. limit your waveform data. Someday, "maxFreq" will be used to
  38. do this automatically.
  39. </p>
  40. <h3>Examples</h3>
  41. <p class=exam>File &gt; Examples &gt; Audio &gt; Synthesis &gt; PlaySynthMusic
  42. </p>
  43. <p class=exam>File &gt; Examples &gt; Audio &gt; Synthesis &gt; pulseWidth
  44. </p>
  45. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; WM8731MikroSine
  46. </p>
  47. <h3>Notes</h3>
  48. <p>Supported Waveforms:<br>
  49. <ul>
  50. <li><span class=literal>WAVEFORM_SINE</span></li>
  51. <li><span class=literal>WAVEFORM_SAWTOOTH</span></li>
  52. <li><span class=literal>WAVEFORM_SQUARE</span></li>
  53. <li><span class=literal>WAVEFORM_TRIANGLE</span></li>
  54. <li><span class=literal>WAVEFORM_ARBITRARY</span></li>
  55. <li><span class=literal>WAVEFORM_PULSE</span></li>
  56. </ul>
  57. </p>