No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

5451 líneas
247KB

  1. <!DOCTYPE html>
  2. <!-- vim: set ts=4: -->
  3. <html>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
  6. <meta name="apple-mobile-web-app-capable" content="yes">
  7. <meta name="mobile-web-app-capable" content="yes">
  8. <!--
  9. Modified from original Node-Red source, for audio system visualization
  10. Copyright 2013 IBM Corp.
  11. Licensed under the Apache License, Version 2.0 (the "License");
  12. you may not use this file except in compliance with the License.
  13. You may obtain a copy of the License at
  14. http://www.apache.org/licenses/LICENSE-2.0
  15. Unless required by applicable law or agreed to in writing, software
  16. distributed under the License is distributed on an "AS IS" BASIS,
  17. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18. See the License for the specific language governing permissions and
  19. limitations under the License.
  20. -->
  21. <head>
  22. <title>Audio System Design Tool for Teensy Audio Library</title>
  23. <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
  24. <link href="jquery/css/smoothness/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" media="screen">
  25. <link rel="stylesheet" type="text/css" href="orion/built-editor.css"/>
  26. <link rel="stylesheet" type="text/css" href="font-awesome/css/font-awesome.min.css"/>
  27. <link rel="stylesheet" href="style.css">
  28. <style>
  29. table.doc {border-spacing:3px; border-collapse:separate; font-size: 80%}
  30. tr.top {background-color:#C0C0C0}
  31. tr.odd {background-color:#F0F0F0}
  32. tr.even {background-color:#E0E0E0}
  33. p.func {padding-bottom:0; margin:0px}
  34. p.desc {padding-left:2em; margin:0px; padding-top:0.2em; padding-bottom:0.8em; font-size:0.75em}
  35. p.exam {padding-left:2em; text-indent:-1.2em; margin:0px; padding-top:0; padding-bottom:0.5em; font-size:0.75em; font-weight:bold}
  36. pre.desc {padding-left:3em; margin:0px; padding-top:0em; padding-bottom:0.8em; font-size:0.75em;
  37. background-color:#FFFFFF; border:0px; line-height:100%;
  38. }
  39. span.indent {padding-left:2em}
  40. span.literal {color: #006699}
  41. span.comment {color: #777755}
  42. span.keyword {color: #cc6600}
  43. span.function {color: #996600}
  44. span.mainfunction {color: #993300; font-weight: bolder}
  45. </style>
  46. </head>
  47. <body spellcheck="false">
  48. <div class="navbar navbar-inverse navbar-fixed-top">
  49. <div class="navbar-inner">
  50. <div class="container-fluid">
  51. <span class="brand">Audio System Design Tool for <a href="http://www.pjrc.com/teensy/td_libs_Audio.html" target="_blank">Teensy Audio Library</a></span>
  52. <div class="btn-group pull-right">
  53. <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"><i class="icon-align-justify"></i> <span class="caret"></span></a>
  54. <ul class="dropdown-menu">
  55. <li><a id="btn-sidebar" tabindex="-1" href="#"><i class="icon-ok pull-right"></i><i class="icon-list-alt"></i> Sidebar</a></li>
  56. <li class="divider"></li>
  57. <!-- <li><a id="btn-node-status" tabindex="-1" href="#"><i class="icon-ok pull-right"></i><i class="icon-info-sign"></i> Node Status</a></li>
  58. <li class="divider"></li>
  59. -->
  60. <!--
  61. <li class="dropdown-submenu pull-left"><a tabindex="-1" href="#"><i class="icon-edit"></i> Import from...</a>
  62. <ul class="dropdown-menu">
  63. <li><a id="btn-import" tabindex="-1" href="#"><i class="icon-edit"></i> Clipboard...</a></li>
  64. <li id="flow-menu-parent" class="dropdown-submenu pull-left">
  65. <a tabindex="-1" href="#"><i class="icon-book"></i> Library</a>
  66. <ul class="dropdown-menu"></ul>
  67. </li>
  68. </ul>
  69. </li>
  70. <li id="li-menu-export" class="dropdown-submenu disabled pull-left"><a tabindex="-1" href="#"><i class="icon-share"></i> Export to...</a>
  71. <ul class="dropdown-menu">
  72. <li id="li-menu-export-clipboard" class="disabled"><a id="btn-export-clipboard" tabindex="-1" href="#"><i class="icon-share"></i> Clipboard...</a></li>
  73. <li id="li-menu-export-library" class="disabled"><a id="btn-export-library" tabindex="-1" href="#"><i class="icon-book"></i> Library...</a></li>
  74. </ul>
  75. </li>
  76. <li class="divider"></li>
  77. -->
  78. <!--
  79. <li><a id="btn-config-nodes" tabindex="-1" href="#"><i class="icon-th-list"></i> Configuration nodes...</a></li>
  80. <li class="divider"></li>
  81. -->
  82. <!--
  83. <li class="dropdown-submenu pull-left"><a tabindex="-1" href="#"><i class="icon-th-large"></i> Workspaces</a>
  84. <ul id="workspace-menu-list" class="dropdown-menu">
  85. <li><a id="btn-workspace-add" tabindex="-1" href="#"><i class="icon-plus"></i> Add</a></li>
  86. <li><a id="btn-workspace-edit" tabindex="-1" href="#"><i class="icon-edit"></i> Rename</a></li>
  87. <li><a id="btn-workspace-delete" tabindex="-1" href="#"><i class="icon-minus"></i> Delete</a></li>
  88. <li class="divider"></li>
  89. </ul>
  90. </li>
  91. <li class="divider"></li>-->
  92. <li><a id="btn-keyboard-shortcuts" tabindex="-1" href="#"><i class="icon-question-sign"></i> Keyboard Shortcuts</a></li>
  93. <li><a id="btn-help" tabindex="-1" href="http://node-red.github.io/docs" target="_blank"><i class="icon-question-sign"></i> Help...</a></li>
  94. </ul>
  95. </div>
  96. <div class="btn-group pull-left">
  97. <a id="btn-deploy" class="btn action-deploy disabled" href="#"><i id="btn-icn-deploy" class="icon-upload"></i>Export</a>
  98. <a id="btn-import" class="btn action-import disabled" href="#"><i id="btn-icn-download" class="icon-download"></i>Import</a>
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. <div id="main-container" class="sidebar-closed">
  104. <div id="palette">
  105. <img src="img/spin.svg" class="palette-spinner"/>
  106. <div id="palette-container" class="palette-scroll">
  107. </div>
  108. <div id="palette-search">
  109. <i class="icon-search"></i><input id="palette-search-input" type="text" placeholder="filter"><a href="#" id="palette-search-clear"><i class="icon-remove"></i></a></input>
  110. </div>
  111. </div><!-- /palette -->
  112. <div id="workspace">
  113. <ul id="workspace-tabs"></ul>
  114. <!--<div id="workspace-add-tab"><a id="btn-workspace-add-tab" href="#"><i class="icon-plus"></i></a></div>-->
  115. <div id="chart"></div>
  116. <div id="workspace-toolbar">
  117. <div class="btn-group">
  118. <a class="btn btn-small" href="#"><i class="icon-zoom-out"></i></a>
  119. <a class="btn btn-small" href="#"><i class="icon-th"></i></a>
  120. <a class="btn btn-small" href="#"><i class="icon-zoom-in"></i></a>
  121. </div>
  122. </div>
  123. </div>
  124. <div id="chart-zoom-controls">
  125. <div class="btn-group">
  126. <a class="btn btn-mini" id="btn-zoom-out" href="#"><i class="icon-zoom-out"></i></a>
  127. <a class="btn btn-mini" id="btn-zoom-zero" href="#"><i class="icon-th"></i></a>
  128. <a class="btn btn-mini" id="btn-zoom-in" href="#"><i class="icon-zoom-in"></i></a>
  129. </div>
  130. </div>
  131. <div id="sidebar">
  132. <ul id="sidebar-tabs"></ul>
  133. <div id="sidebar-content"></div>
  134. </div>
  135. <div id="sidebar-separator"></div>
  136. </div>
  137. <div id="notifications"></div>
  138. <div id="dropTarget"><div>Drop the flow here</div></div>
  139. <div id="dialog" class="hide"><form id="dialog-form" class="form-horizontal"></form></div>
  140. <div id="node-config-dialog" class="hide"><form id="dialog-config-form" class="form-horizontal"></form><div class="form-tips" id="node-config-dialog-user-count"></div></div>
  141. <div id="node-dialog-confirm-deploy" class="hide">
  142. <form class="form-horizontal">
  143. <div id="node-dialog-confirm-deploy-config" style="text-align: center; padding-top: 30px;">
  144. Some of the nodes are not properly configured. Are you sure you want to deploy?
  145. </div>
  146. <div id="node-dialog-confirm-deploy-unknown" style="text-align: center; padding-top: 10px;">
  147. The workspace contains some unknown node types:
  148. <ul style="width: 300px; margin: auto; text-align: left;" id="node-dialog-confirm-deploy-unknown-list"></ul>
  149. Are you sure you want to deploy?
  150. </div>
  151. </form>
  152. </div>
  153. <div id="node-dialog-error-deploy" class="hide">
  154. <form class="form-horizontal">
  155. <div id="node-dialog-error-deploy-noio" style="text-align: center; padding-top: 10px;">
  156. <p>The workspace contains no input/output nodes!</p>
  157. <p>You need an input or an output to export the data!</p>
  158. <p>Without such a input/output function the exported
  159. code will not run properly!</p>
  160. </div>
  161. </form>
  162. </div>
  163. <div id="node-help" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="node-help-label" aria-hidden="true">
  164. <div class="modal-header">
  165. <h5 id="node-help-label">Keyboard Shortcuts <span style="float: right;"><a href="http://node-red.github.io/docs" target="_blank">Open help in new window &raquo;</a></span></h5>
  166. </div>
  167. <div class="modal-body">
  168. <table>
  169. <tr>
  170. <td><span class="help-key">?</span></td><td>Help</td>
  171. <td><span class="help-key">Ctrl</span> <span class="help-key">a</span></td><td>Select all nodes</td>
  172. </tr>
  173. <tr>
  174. <td><span class="help-key">Ctrl</span> <span class="help-key">Space</span></td><td>Toggle sidebar</td>
  175. <td><span class="help-key">Shift</span> <span class="help-key">Click</span></td><td>Select all connected nodes</td>
  176. </tr>
  177. <tr>
  178. <td><span class="help-key">Ctrl</span> <span class="help-key">z</span></td><td>Undo</td>
  179. <td><span class="help-key">Ctrl</span> <span class="help-key">Click</span></td><td>Add/remove node from selection</td>
  180. </tr>
  181. <tr>
  182. <td></td><td></td>
  183. <td><span class="help-key">Delete</span></td><td>Delete selected nodes or link</td>
  184. </tr>
  185. <tr>
  186. <td><span class="help-key">Ctrl</span> <span class="help-key">x</span></td><td>Cut selected nodes</td>
  187. <td></td><td></td>
  188. </tr>
  189. <tr>
  190. <td><span class="help-key">Ctrl</span> <span class="help-key">c</span></td><td>Copy selected nodes</td>
  191. <td><span class="help-key">Ctrl</span> <span class="help-key">v</span></td><td>Paste nodes</td>
  192. </tr>
  193. <tr>
  194. <td><span class="help-key">Ctrl</span> <span class="help-key">i</span></td><td>Import nodes</td>
  195. <td><span class="help-key">Ctrl</span> <span class="help-key">e</span></td><td>Export selected nodes</td>
  196. </tr>
  197. <tr>
  198. <td colspan="2"></td>
  199. </tr>
  200. <tr>
  201. <td><span class="help-key">Ctrl</span> <span class="help-key">+</span></td><td>Zoom in</td>
  202. <td><span class="help-key">Ctrl</span> <span class="help-key">-</span></td><td>Zoom out</td>
  203. </tr>
  204. </table>
  205. </div>
  206. <div class="modal-footer">
  207. <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
  208. </div>
  209. </div>
  210. <div id="node-dialog-library-save-confirm" class="hide">
  211. <form class="form-horizontal">
  212. <div style="text-align: center; padding-top: 30px;">
  213. A <span id="node-dialog-library-save-type"></span> called <span id="node-dialog-library-save-name"></span> already exists. Overwrite?
  214. </div>
  215. </form>
  216. </div>
  217. <div id="node-dialog-library-save" class="hide">
  218. <form class="form-horizontal">
  219. <div class="form-row">
  220. <label for="node-dialog-library-save-folder"><i class="icon-folder-open"></i> Folder</label>
  221. <input type="text" id="node-dialog-library-save-folder" placeholder="Folder">
  222. </div>
  223. <div class="form-row">
  224. <label for="node-dialog-library-save-filename"><i class="icon-file"></i> Filename</label>
  225. <input type="text" id="node-dialog-library-save-filename" placeholder="Filename">
  226. </div>
  227. </form>
  228. </div>
  229. <div id="node-dialog-library-lookup" class="hide">
  230. <form class="form-horizontal">
  231. <div class="form-row">
  232. <ul id="node-dialog-library-breadcrumbs" class="breadcrumb">
  233. <li class="active"><a href="#">Library</a></li>
  234. </ul>
  235. </div>
  236. <div class="form-row">
  237. <div style="vertical-align: top; display: inline-block; height: 100%; width: 30%; padding-right: 20px;">
  238. <div id="node-select-library" style="border: 1px solid #999; width: 100%; height: 100%; overflow:scroll;"><ul></ul></div>
  239. </div>
  240. <div style="vertical-align: top; display: inline-block;width: 65%; height: 100%;">
  241. <div style="height: 100%; width: 95%;" class="node-text-editor" id="node-select-library-text" ></div>
  242. </div>
  243. </div>
  244. </form>
  245. </div>
  246. <div id="node-dialog-rename-workspace" class="hide">
  247. <form class="form-horizontal">
  248. <div class="form-row">
  249. <label for="node-input-workspace-name" ><i class="icon-tag"></i> Name:</label>
  250. <input type="text" id="node-input-workspace-name">
  251. </div>
  252. </form>
  253. </div>
  254. <div id="node-dialog-delete-workspace" class="hide">
  255. <form class="form-horizontal">
  256. <div style="text-align: center; padding-top: 30px;">
  257. Are you sure you want to delete '<span id="node-dialog-delete-workspace-name"></span>'?
  258. </div>
  259. </form>
  260. </div>
  261. <script type="text/x-red" data-template-name="export-clipboard-dialog">
  262. <div class="form-row">
  263. <label for="node-input-export" style="display: block; width:100%;"><i class="icon-share"></i> Source Code:</label>
  264. <textarea readonly style="font-family: monospace; font-size: 12px; background:rgb(226, 229, 255); padding-left: 0.5em;" class="input-block-level" id="node-input-export" rows="12"></textarea>
  265. </div>
  266. <div class="form-tips">
  267. Select the text above and copy to the clipboard with Ctrl-A Ctrl-C.
  268. </div>
  269. </script>
  270. <script type="text/x-red" data-template-name="export-library-dialog">
  271. <div class="form-row">
  272. <label for="node-input-filename" ><i class="icon-tag"></i> Filename:</label>
  273. <input type="text" id="node-input-filename" placeholder="Filename">
  274. </div>
  275. </script>
  276. <script type="text/x-red" data-template-name="import-dialog">
  277. <div class="form-row">
  278. <label for="node-input-import"><i class="icon-share"></i>Nodes:</label>
  279. <textarea style="font-family: monospace; font-size: 12px; background:rgb(226, 229, 255); padding-left: 0.5em;" class="input-block-level" id="node-input-import" rows="5" placeholder="Paste nodes here, or lookup in the library. When importing Arduino code, the whole flow will be replaced."></textarea>
  280. </div>
  281. <div class="form-tips">
  282. <label for="node-input-arduino" style="font-size: 13px; padding: 2px 0px 0px 4px;">
  283. <input style="margin-bottom: 4px; margin-right: 4px;" type="checkbox" id="node-input-arduino" checked="checked" class="input-block-level" />
  284. &nbsp;Import copied code from the Arduino IDE
  285. </label>
  286. </div>
  287. </script>
  288. <script src="jquery/js/jquery-1.9.1.js"></script>
  289. <script src="bootstrap/js/bootstrap.min.js"></script>
  290. <script src="jquery/js/jquery-ui-1.10.3.custom.min.js"></script>
  291. <script src="jquery/js/jquery.ui.touch-punch.min.js"></script>
  292. <script src="orion/built-editor.min.js"></script>
  293. <script src="red/d3/d3.v3.min.js"></script>
  294. <script src="red/main.js"></script>
  295. <script src="red/ui/state.js"></script>
  296. <script src="red/nodes.js"></script>
  297. <script src="red/storage.js"></script>
  298. <script src="red/history.js"></script>
  299. <script src="red/ui/keyboard.js"></script>
  300. <script src="red/ui/tabs.js"></script>
  301. <script src="red/ui/view.js"></script>
  302. <script src="red/ui/sidebar.js"></script>
  303. <script src="red/ui/palette.js"></script>
  304. <script src="red/ui/tab-info.js"></script>
  305. <script src="red/ui/tab-config.js"></script>
  306. <script src="red/ui/editor.js"></script>
  307. <script src="red/ui/library.js"></script>
  308. <script src="red/ui/notifications.js"></script>
  309. <script src="red/ui/touch/radialMenu.js"></script>
  310. <!--
  311. TODO: generate some or all of this automatically from the C++ source
  312. -->
  313. <!--
  314. TODO: add a field for maximum instance count
  315. -->
  316. <!--
  317. TODO: add a field for exclusive to other objects (not allowed if they're used)
  318. -->
  319. <!--
  320. TODO: add "parameters" fields, to replace the form html stuff
  321. -->
  322. <script type="text/x-red" data-container-name="InputOutputCompatibilityMetadata">
  323. {"requirements":[
  324. {"type":"AudioInputI2S", "resource":"I2S Device", "shareable":true, "setting":"I2S Master"},
  325. {"type":"AudioInputI2S", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  326. {"type":"AudioInputI2S", "resource":"IN1 Pin", "shareable":false},
  327. {"type":"AudioInputI2SQuad", "resource":"I2S Device", "shareable":true, "setting":"I2S Master"},
  328. {"type":"AudioInputI2SQuad", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  329. {"type":"AudioInputI2SQuad", "resource":"IN1 Pin", "shareable":false},
  330. {"type":"AudioInputI2SQuad", "resource":"OUT1D Pin", "shareable":false},
  331. {"type":"AudioInputI2SHex", "resource":"I2S Device", "shareable":true, "setting":"I2S Master"},
  332. {"type":"AudioInputI2SHex", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  333. {"type":"AudioInputI2SHex", "resource":"IN1 Pin", "shareable":false},
  334. {"type":"AudioInputI2SHex", "resource":"OUT1D Pin", "shareable":false},
  335. {"type":"AudioInputI2SHex", "resource":"OUT1C Pin", "shareable":false},
  336. {"type":"AudioInputI2SOct", "resource":"I2S Device", "shareable":true, "setting":"I2S Master"},
  337. {"type":"AudioInputI2SOct", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  338. {"type":"AudioInputI2SOct", "resource":"IN1 Pin", "shareable":false},
  339. {"type":"AudioInputI2SOct", "resource":"OUT1D Pin", "shareable":false},
  340. {"type":"AudioInputI2SOct", "resource":"OUT1C Pin", "shareable":false},
  341. {"type":"AudioInputI2SOct", "resource":"OUT1B Pin", "shareable":false},
  342. {"type":"AudioInputI2Sslave", "resource":"I2S Device", "shareable":true, "setting":"I2S Slave"},
  343. {"type":"AudioInputI2Sslave", "resource":"Sample Rate", "shareable":true, "setting":"LRCLK1 Control"},
  344. {"type":"AudioInputI2Sslave", "resource":"IN1 Pin", "shareable":false},
  345. {"type":"AudioInputI2S2", "resource":"I2S2 Device", "shareable":true, "setting":"I2S Master"},
  346. {"type":"AudioInputI2S2", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  347. {"type":"AudioInputI2S2", "resource":"IN2 Pin", "shareable":false},
  348. {"type":"AudioInputSPDIF3", "resource":"SPDIF Device", "shareable":true, "setting":"SPDIF Protocol"},
  349. {"type":"AudioInputSPDIF3", "resource":"Sample Rate", "shareable":true, "setting":"SPDIF Control"},
  350. {"type":"AudioInputSPDIF3", "resource":"SPDIFIN Pin", "shareable":false},
  351. {"type":"AsyncAudioInputSPDIF3", "resource":"SPDIF Device", "shareable":true, "setting":"SPDIF Protocol"},
  352. {"type":"AsyncAudioInputSPDIF3", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  353. {"type":"AsyncAudioInputSPDIF3", "resource":"SPDIFIN Pin", "shareable":false},
  354. {"type":"AudioInputAnalog", "resource":"ADC1", "shareable":false},
  355. {"type":"AudioInputAnalog", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  356. {"type":"AudioInputAnalogStereo","resource":"ADC1", "shareable":false},
  357. {"type":"AudioInputAnalogStereo","resource":"ADC2", "shareable":false},
  358. {"type":"AudioInputAnalogStereo","resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  359. {"type":"AudioInputPDM", "resource":"I2S Device", "shareable":true, "setting":"PDM Protocol"},
  360. {"type":"AudioInputPDM", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  361. {"type":"AudioInputPDM", "resource":"IN1 Pin", "shareable":false},
  362. {"type":"AudioInputTDM", "resource":"I2S Device", "shareable":true, "setting":"TDM Protocol"},
  363. {"type":"AudioInputTDM", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  364. {"type":"AudioInputTDM", "resource":"IN1 Pin", "shareable":false},
  365. {"type":"AudioInputTDM2", "resource":"I2S2 Device", "shareable":true, "setting":"TDM Protocol"},
  366. {"type":"AudioInputTDM2", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  367. {"type":"AudioInputTDM2", "resource":"IN2 Pin", "shareable":false},
  368. {"type":"AudioInputUSB", "resource":"USB Rx Endpoint","shareable":false},
  369. {"type":"AudioOutputI2S", "resource":"I2S Device", "shareable":true, "setting":"I2S Master"},
  370. {"type":"AudioOutputI2S", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  371. {"type":"AudioOutputI2S", "resource":"OUT1A Pin", "shareable":false},
  372. {"type":"AudioOutputI2SQuad", "resource":"I2S Device", "shareable":true, "setting":"I2S Master"},
  373. {"type":"AudioOutputI2SQuad", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  374. {"type":"AudioOutputI2SQuad", "resource":"OUT1A Pin", "shareable":false},
  375. {"type":"AudioOutputI2SQuad", "resource":"OUT1B Pin", "shareable":false},
  376. {"type":"AudioOutputI2SHex", "resource":"I2S Device", "shareable":true, "setting":"I2S Master"},
  377. {"type":"AudioOutputI2SHex", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  378. {"type":"AudioOutputI2SHex", "resource":"OUT1A Pin", "shareable":false},
  379. {"type":"AudioOutputI2SHex", "resource":"OUT1B Pin", "shareable":false},
  380. {"type":"AudioOutputI2SHex", "resource":"OUT1C Pin", "shareable":false},
  381. {"type":"AudioOutputI2SOct", "resource":"I2S Device", "shareable":true, "setting":"I2S Master"},
  382. {"type":"AudioOutputI2SOct", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  383. {"type":"AudioOutputI2SOct", "resource":"OUT1A Pin", "shareable":false},
  384. {"type":"AudioOutputI2SOct", "resource":"OUT1B Pin", "shareable":false},
  385. {"type":"AudioOutputI2SOct", "resource":"OUT1C Pin", "shareable":false},
  386. {"type":"AudioOutputI2SOct", "resource":"OUT1D Pin", "shareable":false},
  387. {"type":"AudioOutputI2Sslave", "resource":"I2S Device", "shareable":true, "setting":"I2S Slave"},
  388. {"type":"AudioOutputI2Sslave", "resource":"Sample Rate", "shareable":true, "setting":"LRCLK1 Control"},
  389. {"type":"AudioOutputI2Sslave", "resource":"OUT1A Pin", "shareable":false},
  390. {"type":"AudioOutputI2S2", "resource":"I2S2 Device", "shareable":true, "setting":"I2S Master"},
  391. {"type":"AudioOutputI2S2", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  392. {"type":"AudioOutputI2S2", "resource":"OUT2 Pin", "shareable":false},
  393. {"type":"AudioOutputSPDIF", "resource":"I2S Device", "shareable":true, "setting":"SPDIF Protocol"},
  394. {"type":"AudioOutputSPDIF", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  395. {"type":"AudioOutputSPDIF", "resource":"OUT1A Pin", "shareable":false},
  396. {"type":"AudioOutputSPDIF2", "resource":"I2S2 Device", "shareable":true, "setting":"SPDIF Protocol"},
  397. {"type":"AudioOutputSPDIF2", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  398. {"type":"AudioOutputSPDIF2", "resource":"OUT2 Pin", "shareable":false},
  399. {"type":"AudioOutputSPDIF3", "resource":"SPDIF Device", "shareable":true, "setting":"SPDIF Protocol"},
  400. {"type":"AudioOutputSPDIF3", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  401. {"type":"AudioOutputSPDIF3", "resource":"SPDIFOUT Pin", "shareable":false},
  402. {"type":"AudioOutputPT8211", "resource":"I2S Device", "shareable":true, "setting":"PT8211 Protocol"},
  403. {"type":"AudioOutputPT8211", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  404. {"type":"AudioOutputPT8211", "resource":"OUT1A Pin", "shareable":false},
  405. {"type":"AudioOutputPT8211_2", "resource":"I2S2 Device", "shareable":true, "setting":"PT8211 Protocol"},
  406. {"type":"AudioOutputPT8211_2", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  407. {"type":"AudioOutputPT8211_2", "resource":"OUT2 Pin", "shareable":false},
  408. {"type":"AudioOutputAnalog", "resource":"DAC1", "shareable":false},
  409. {"type":"AudioOutputAnalog", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  410. {"type":"AudioOutputAnalogStereo","resource":"DAC1", "shareable":false},
  411. {"type":"AudioOutputAnalogStereo","resource":"DAC2", "shareable":false},
  412. {"type":"AudioOutputAnalogStereo","resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  413. {"type":"AudioOutputPWM", "resource":"DAC1", "shareable":false},
  414. {"type":"AudioOutputPWM", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  415. {"type":"AudioOutputMQS", "resource":"MSQ Device", "shareable":false},
  416. {"type":"AudioOutputMQS", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  417. {"type":"AudioOutputTDM", "resource":"I2S Device", "shareable":true, "setting":"TDM Protocol"},
  418. {"type":"AudioOutputTDM", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  419. {"type":"AudioOutputTDM", "resource":"OUT1A Pin", "shareable":false},
  420. {"type":"AudioOutputTDM2", "resource":"I2S2 Device", "shareable":true, "setting":"TDM Protocol"},
  421. {"type":"AudioOutputTDM2", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  422. {"type":"AudioOutputTDM2", "resource":"OUT2 Pin", "shareable":false},
  423. {"type":"AudioOutputADAT", "resource":"I2S Device", "shareable":true, "setting":"ADAT Protocol"},
  424. {"type":"AudioOutputADAT", "resource":"Sample Rate", "shareable":true, "setting":"Teensy Control"},
  425. {"type":"AudioOutputADAT", "resource":"OUT1A Pin", "shareable":false},
  426. {"type":"AudioOutputUSB", "resource":"USB Tx Endpoint","shareable":false}
  427. ]}
  428. </script>
  429. <script type="text/x-red" data-container-name="NodeDefinitions">
  430. {"nodes":[
  431. {"type":"AudioInputI2S","data":{"defaults":{"name":{"value":"new"}},"shortName":"i2s","inputs":0,"outputs":2,"category":"input-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  432. {"type":"AudioInputI2SQuad","data":{"defaults":{"name":{"value":"new"}},"shortName":"i2s_quad","inputs":0,"outputs":4,"category":"input-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  433. {"type":"AudioInputI2SHex","data":{"defaults":{"name":{"value":"new"}},"shortName":"i2s_hex","inputs":0,"outputs":6,"category":"input-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  434. {"type":"AudioInputI2SOct","data":{"defaults":{"name":{"value":"new"}},"shortName":"i2s_oct","inputs":0,"outputs":8,"category":"input-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  435. {"type":"AudioInputI2Sslave","data":{"defaults":{"name":{"value":"new"}},"shortName":"i2sslave","inputs":0,"outputs":2,"category":"input-function","color":"#F7D8F0","icon":"arrow-in.png"}},
  436. {"type":"AudioInputI2S2","data":{"defaults":{"name":{"value":"new"}},"shortName":"i2s2","inputs":0,"outputs":2,"category":"input-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  437. {"type":"AudioInputSPDIF3","data":{"defaults":{"name":{"value":"new"}},"shortName":"spdif3","inputs":0,"outputs":2,"category":"input-function","color":"#F7D8F0","icon":"arrow-in.png"}},
  438. {"type":"AsyncAudioInputSPDIF3","data":{"defaults":{"name":{"value":"new"}},"shortName":"spdif_async","inputs":0,"outputs":2,"category":"input-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  439. {"type":"AudioInputAnalog","data":{"defaults":{"name":{"value":"new"}},"shortName":"adc","inputs":0,"outputs":1,"category":"input-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  440. {"type":"AudioInputAnalogStereo","data":{"defaults":{"name":{"value":"new"}},"shortName":"adcs","inputs":0,"outputs":2,"category":"input-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  441. {"type":"AudioInputPDM","data":{"defaults":{"name":{"value":"new"}},"shortName":"pdm","inputs":0,"outputs":1,"category":"input-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  442. {"type":"AudioInputTDM","data":{"defaults":{"name":{"value":"new"}},"shortName":"tdm","inputs":0,"outputs":16,"category":"input-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  443. {"type":"AudioInputTDM2","data":{"defaults":{"name":{"value":"new"}},"shortName":"tdm2","inputs":0,"outputs":16,"category":"input-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  444. {"type":"AudioInputUSB","data":{"defaults":{"name":{"value":"new"}},"shortName":"usb","inputs":0,"outputs":2,"category":"input-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  445. {"type":"AudioOutputI2S","data":{"defaults":{"name":{"value":"new"}},"shortName":"i2s","inputs":2,"outputs":0,"category":"output-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  446. {"type":"AudioOutputI2SQuad","data":{"defaults":{"name":{"value":"new"}},"shortName":"i2s_quad","inputs":4,"outputs":0,"category":"output-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  447. {"type":"AudioOutputI2SHex","data":{"defaults":{"name":{"value":"new"}},"shortName":"i2s_hex","inputs":6,"outputs":0,"category":"output-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  448. {"type":"AudioOutputI2SOct","data":{"defaults":{"name":{"value":"new"}},"shortName":"i2s_oct","inputs":8,"outputs":0,"category":"output-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  449. {"type":"AudioOutputI2Sslave","data":{"defaults":{"name":{"value":"new"}},"shortName":"i2sslave","inputs":2,"outputs":0,"category":"output-function","color":"#F7D8F0","icon":"arrow-in.png"}},
  450. {"type":"AudioOutputI2S2","data":{"defaults":{"name":{"value":"new"}},"shortName":"i2s2","inputs":2,"outputs":0,"category":"output-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  451. {"type":"AudioOutputSPDIF","data":{"defaults":{"name":{"value":"new"}},"shortName":"spdif","inputs":2,"outputs":0,"category":"output-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  452. {"type":"AudioOutputSPDIF2","data":{"defaults":{"name":{"value":"new"}},"shortName":"spdif2","inputs":2,"outputs":0,"category":"output-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  453. {"type":"AudioOutputSPDIF3","data":{"defaults":{"name":{"value":"new"}},"shortName":"spdif3","inputs":2,"outputs":0,"category":"output-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  454. {"type":"AudioOutputPT8211","data":{"defaults":{"name":{"value":"new"}},"shortName":"pt8211","inputs":2,"outputs":0,"category":"output-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  455. {"type":"AudioOutputPT8211_2","data":{"defaults":{"name":{"value":"new"}},"shortName":"pt8211_2","inputs":2,"outputs":0,"category":"output-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  456. {"type":"AudioOutputAnalog","data":{"defaults":{"name":{"value":"new"}},"shortName":"dac","inputs":1,"outputs":0,"category":"output-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  457. {"type":"AudioOutputAnalogStereo","data":{"defaults":{"name":{"value":"new"}},"shortName":"dacs","inputs":2,"outputs":0,"category":"output-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  458. {"type":"AudioOutputPWM","data":{"defaults":{"name":{"value":"new"}},"shortName":"pwm","inputs":1,"outputs":0,"category":"output-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  459. {"type":"AudioOutputMQS","data":{"defaults":{"name":{"value":"new"}},"shortName":"mqs","inputs":2,"outputs":0,"category":"output-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  460. {"type":"AudioOutputTDM","data":{"defaults":{"name":{"value":"new"}},"shortName":"tdm","inputs":16,"outputs":0,"category":"output-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  461. {"type":"AudioOutputTDM2","data":{"defaults":{"name":{"value":"new"}},"shortName":"tdm2","inputs":16,"outputs":0,"category":"output-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  462. {"type":"AudioOutputADAT","data":{"defaults":{"name":{"value":"new"}},"shortName":"adat","inputs":8,"outputs":0,"category":"output-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  463. {"type":"AudioOutputUSB","data":{"defaults":{"name":{"value":"new"}},"shortName":"usb","inputs":2,"outputs":0,"category":"output-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  464. {"type":"AudioAmplifier","data":{"defaults":{"name":{"value":"new"}},"shortName":"amp","inputs":1,"outputs":1,"category":"mixer-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  465. {"type":"AudioMixer4","data":{"defaults":{"name":{"value":"new"}},"shortName":"mixer","inputs":4,"outputs":1,"category":"mixer-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  466. {"type":"AudioPlayMemory","data":{"defaults":{"name":{"value":"new"}},"shortName":"playMem","inputs":0,"outputs":1,"category":"play-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  467. {"type":"AudioPlaySdWav","data":{"defaults":{"name":{"value":"new"}},"shortName":"playSdWav","inputs":0,"outputs":2,"category":"play-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  468. {"type":"AudioPlaySdRaw","data":{"defaults":{"name":{"value":"new"}},"shortName":"playSdRaw","inputs":0,"outputs":1,"category":"play-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  469. {"type":"AudioPlaySerialflashRaw","data":{"defaults":{"name":{"value":"new"}},"shortName":"playFlashRaw","inputs":0,"outputs":1,"category":"play-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  470. {"type":"AudioPlayQueue","data":{"defaults":{"name":{"value":"new"}},"shortName":"queue","inputs":0,"outputs":1,"category":"play-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  471. {"type":"AudioRecordQueue","data":{"defaults":{"name":{"value":"new"}},"shortName":"queue","inputs":1,"outputs":0,"category":"record-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  472. {"type":"AudioSynthWavetable","data":{"defaults":{"name":{"value":"new"}},"shortName":"wavetable","inputs":0,"outputs":1,"category":"synth-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  473. {"type":"AudioSynthSimpleDrum","data":{"defaults":{"name":{"value":"new"}},"shortName":"drum","inputs":0,"outputs":1,"category":"synth-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  474. {"type":"AudioSynthKarplusStrong","data":{"defaults":{"name":{"value":"new"}},"shortName":"string","inputs":0,"outputs":1,"category":"synth-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  475. {"type":"AudioSynthWaveformSine","data":{"defaults":{"name":{"value":"new"}},"shortName":"sine","inputs":0,"outputs":1,"category":"synth-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  476. {"type":"AudioSynthWaveformSineHires","data":{"defaults":{"name":{"value":"new"}},"shortName":"sine_hires","inputs":0,"outputs":2,"category":"synth-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  477. {"type":"AudioSynthWaveformSineModulated","data":{"defaults":{"name":{"value":"new"}},"shortName":"sine_fm","inputs":1,"outputs":1,"category":"synth-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  478. {"type":"AudioSynthWaveform","data":{"defaults":{"name":{"value":"new"}},"shortName":"waveform","inputs":0,"outputs":1,"category":"synth-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  479. {"type":"AudioSynthWaveformModulated","data":{"defaults":{"name":{"value":"new"}},"shortName":"waveformMod","inputs":2,"outputs":1,"category":"synth-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  480. {"type":"AudioSynthWaveformPWM","data":{"defaults":{"name":{"value":"new"}},"shortName":"pwm","inputs":1,"outputs":1,"category":"synth-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  481. {"type":"AudioSynthToneSweep","data":{"defaults":{"name":{"value":"new"}},"shortName":"tonesweep","inputs":0,"outputs":1,"category":"synth-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  482. {"type":"AudioSynthWaveformDc","data":{"defaults":{"name":{"value":"new"}},"shortName":"dc","inputs":0,"outputs":1,"category":"synth-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  483. {"type":"AudioSynthNoiseWhite","data":{"defaults":{"name":{"value":"new"}},"shortName":"noise","inputs":0,"outputs":1,"category":"synth-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  484. {"type":"AudioSynthNoisePink","data":{"defaults":{"name":{"value":"new"}},"shortName":"pink","inputs":0,"outputs":1,"category":"synth-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  485. {"type":"AudioEffectFade","data":{"defaults":{"name":{"value":"new"}},"shortName":"fade","inputs":1,"outputs":1,"category":"effect-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  486. {"type":"AudioEffectChorus","data":{"defaults":{"name":{"value":"new"}},"shortName":"chorus","inputs":1,"outputs":1,"category":"effect-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  487. {"type":"AudioEffectFlange","data":{"defaults":{"name":{"value":"new"}},"shortName":"flange","inputs":1,"outputs":1,"category":"effect-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  488. {"type":"AudioEffectReverb","data":{"defaults":{"name":{"value":"new"}},"shortName":"reverb","inputs":1,"outputs":1,"category":"effect-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  489. {"type":"AudioEffectFreeverb","data":{"defaults":{"name":{"value":"new"}},"shortName":"freeverb","inputs":1,"outputs":1,"category":"effect-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  490. {"type":"AudioEffectFreeverbStereo","data":{"defaults":{"name":{"value":"new"}},"shortName":"freeverbs","inputs":1,"outputs":2,"category":"effect-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  491. {"type":"AudioEffectEnvelope","data":{"defaults":{"name":{"value":"new"}},"shortName":"envelope","inputs":1,"outputs":1,"category":"effect-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  492. {"type":"AudioEffectMultiply","data":{"defaults":{"name":{"value":"new"}},"shortName":"multiply","inputs":2,"outputs":1,"category":"effect-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  493. {"type":"AudioEffectDelay","data":{"defaults":{"name":{"value":"new"}},"shortName":"delay","inputs":1,"outputs":8,"category":"effect-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  494. {"type":"AudioEffectDelayExternal","data":{"defaults":{"name":{"value":"new"}},"shortName":"delayExt","inputs":1,"outputs":8,"category":"effect-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  495. {"type":"AudioEffectBitcrusher","data":{"shortName":"bitcrusher","inputs":1,"outputs":1,"category":"effect-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  496. {"type":"AudioEffectMidSide","data":{"shortName":"midside","inputs":2,"outputs":2,"category":"effect-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  497. {"type":"AudioEffectWaveshaper","data":{"shortName":"waveshape","inputs":1,"outputs":1,"category":"effect-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  498. {"type":"AudioEffectGranular","data":{"shortName":"granular","inputs":1,"outputs":1,"category":"effect-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  499. {"type":"AudioEffectDigitalCombine","data":{"shortName":"combine","inputs":2,"outputs":1,"category":"effect-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  500. {"type":"AudioFilterBiquad","data":{"defaults":{"name":{"value":"new"}},"shortName":"biquad","inputs":1,"outputs":1,"category":"filter-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  501. {"type":"AudioFilterFIR","data":{"defaults":{"name":{"value":"new"}},"shortName":"fir","inputs":1,"outputs":1,"category":"filter-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  502. {"type":"AudioFilterStateVariable","data":{"defaults":{"name":{"value":"new"}},"shortName":"filter","inputs":2,"outputs":3,"category":"filter-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  503. {"type":"AudioAnalyzePeak","data":{"defaults":{"name":{"value":"new"}},"shortName":"peak","inputs":1,"outputs":0,"category":"analyze-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  504. {"type":"AudioAnalyzeRMS","data":{"defaults":{"name":{"value":"new"}},"shortName":"rms","inputs":1,"outputs":0,"category":"analyze-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  505. {"type":"AudioAnalyzeFFT256","data":{"defaults":{"name":{"value":"new"}},"shortName":"fft256","inputs":1,"outputs":0,"category":"analyze-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  506. {"type":"AudioAnalyzeFFT1024","data":{"defaults":{"name":{"value":"new"}},"shortName":"fft1024","inputs":1,"outputs":0,"category":"analyze-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  507. {"type":"AudioAnalyzeToneDetect","data":{"defaults":{"name":{"value":"new"}},"shortName":"tone","inputs":1,"outputs":0,"category":"analyze-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  508. {"type":"AudioAnalyzeNoteFrequency","data":{"defaults":{"name":{"value":"new"}},"shortName":"notefreq","inputs":1,"outputs":0,"category":"analyze-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  509. {"type":"AudioAnalyzePrint","data":{"defaults":{"name":{"value":"new"}},"shortName":"print","inputs":1,"outputs":0,"category":"analyze-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  510. {"type":"AudioControlSGTL5000","data":{"defaults":{"name":{"value":"new"}},"shortName":"sgtl5000","inputs":0,"outputs":0,"category":"control-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  511. {"type":"AudioControlAK4558","data":{"defaults":{"name":{"value":"new"}},"shortName":"ak4558","inputs":0,"outputs":0,"category":"control-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  512. {"type":"AudioControlCS4272","data":{"defaults":{"name":{"value":"new"}},"shortName":"cs4272","inputs":0,"outputs":0,"category":"control-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  513. {"type":"AudioControlWM8731","data":{"defaults":{"name":{"value":"new"}},"shortName":"wm8731","inputs":0,"outputs":0,"category":"control-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  514. {"type":"AudioControlWM8731master","data":{"defaults":{"name":{"value":"new"}},"shortName":"wm8731m","inputs":0,"outputs":0,"category":"control-function","color":"#E6E0F8","icon":"arrow-in.png"}},
  515. {"type":"AudioControlCS42448","data":{"defaults":{"name":{"value":"new"}},"shortName":"cs42448","inputs":0,"outputs":0,"category":"control-function","color":"#E6E0F8","icon":"arrow-in.png"}}
  516. ]}
  517. </script>
  518. <script type="text/x-red" data-help-name="AudioInputI2S">
  519. <h3>Summary</h3>
  520. <div class=tooltipinfo>
  521. <p>Receive 16 bit stereo audio from the
  522. <a href="http://www.pjrc.com/store/teensy3_audio.html" target="_blank">audio shield</a>
  523. or another I2S device, using I2S master mode.</p>
  524. <p align=center><img src="img/audioshield_inputs.jpg"></p>
  525. </div>
  526. <h3>Boards Supported</h3>
  527. <ul>
  528. <li>Teensy 3.2
  529. <li>Teensy 3.5
  530. <li>Teensy 3.6
  531. <li>Teensy 4.0
  532. <li>Teensy 4.1
  533. </ul>
  534. <h3>Audio Connections</h3>
  535. <table class=doc align=center cellpadding=3>
  536. <tr class=top><th>Port</th><th>Purpose</th></tr>
  537. <tr class=odd><td align=center>Out 0</td><td>Left Channel</td></tr>
  538. <tr class=odd><td align=center>Out 1</td><td>Right Channel</td></tr>
  539. </table>
  540. <h3>Functions</h3>
  541. <p>This object has no functions to call from the Arduino sketch. It
  542. simply streams data from the I2S hardware to its 2 output ports.</p>
  543. <h3>Hardware</h3>
  544. <p align=center><img src="img/audioshield_backside.jpg"></p>
  545. <p>The I2S signals are used in "master" mode, where Teensy creates
  546. all 3 clock signals and controls all data timing.</p>
  547. <table class=doc align=center cellpadding=3>
  548. <tr class=top><th>T3.x<br>Pin</th><th>T4.x<br>Pin</th><th>Signal</th><th>Direction</th></tr>
  549. <tr class=odd><td align=center>9</td><td align=center>21</td><td>BCLK</td><td>Output</td></tr>
  550. <tr class=odd><td align=center>11</td><td align=center>23</td><td>MCLK</td><td>Output</td></tr>
  551. <tr class=odd><td align=center>13</td><td align=center>8</td><td>RX</td><td>Input</td></tr>
  552. <tr class=odd><td align=center>23</td><td align=center>20</td><td>LRCLK</td><td>Output</td></tr>
  553. </table>
  554. <p>Audio from
  555. master mode I2S may be used in the same project as ADC, DAC and
  556. PWM signals, because all remain in sync to Teensy's timing</p>
  557. <p>Compatible CODEC Chips:
  558. <ul>
  559. <li><a href="https://www.pjrc.com/store/teensy3_audio.html">STGL5000</a>
  560. <li><a href="https://forum.pjrc.com/threads/42665-New-Audio-Board!-TI-TLV320AIC3206">TLV320AIC3206</a>
  561. <li><a href="https://forum.pjrc.com/threads/32276-HiFi-Audio-CODEC-Module-AK4558-evaluation-board-in-a-square-inch-PCB">AK4558</a>
  562. <li>WM8731
  563. </ul>
  564. </p>
  565. <p>Compatible ADC Chips:
  566. <ul>
  567. </ul>
  568. </p>
  569. <p>Compatible Microphones:
  570. <ul>
  571. <li><a href="https://forum.pjrc.com/threads/47010-I2S-Microphone-(SPH0645LM4H-B)?p=157101&viewfull=1#post157101">SPH0645LM4H-B</a>
  572. <li><a href="https://forum.pjrc.com/threads/50534-Why-MEMS-i2s-microphone-ICS-43432-with-teensy-audio-library-not-working?p=173279&viewfull=1#post173279">ICS43432</a>
  573. <li><a href="https://forum.pjrc.com/threads/49065-ICS43434-I2S-Digital-Microphone-and-Teensy-3-2">ICS43434</a>
  574. </ul>
  575. </p>
  576. <h3>Examples</h3>
  577. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; PassThroughStereo
  578. </p>
  579. <p class=exam>File &gt; Examples &gt; Audio &gt; Recorder
  580. </p>
  581. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; PeakMeterStereo
  582. </p>
  583. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; FFT
  584. </p>
  585. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; SpectrumAnalyzerBasic
  586. </p>
  587. <p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Chorus
  588. </p>
  589. <p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Flange
  590. </p>
  591. <p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Filter
  592. </p>
  593. <p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Filter_FIR
  594. </p>
  595. <h3>Notes</h3>
  596. <p>Normally, this object is used with the Audio Shield, which
  597. is controlled separately by the "sgtl5000" object.</p>
  598. <p>Only one I2S input and one I2S output object may be used. Master
  599. and slave modes may not be mixed (both must be of the same type).
  600. </p>
  601. <p>I2S master objects can be used together with non-I2S input and output
  602. objects, for simultaneous audio streaming on different hardware.</p>
  603. </script>
  604. <script type="text/x-red" data-template-name="AudioInputI2S">
  605. <div class="form-row">
  606. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  607. <input type="text" id="node-input-name" placeholder="Name">
  608. </div>
  609. </script>
  610. <script type="text/x-red" data-help-name="AudioInputI2SQuad">
  611. <h3>Summary</h3>
  612. <div class=tooltipinfo>
  613. <p>Receive 16 bit quad (4) channel audio from two
  614. <a href="http://www.pjrc.com/store/teensy3_audio.html" target="_blank">audio shields</a>
  615. or another I2S devices, using I2S master mode.</p>
  616. <p align=center><img src="img/audioshield_quad_in.jpg"></p>
  617. </div>
  618. <h3>Boards Supported</h3>
  619. <ul>
  620. <li>Teensy 3.2
  621. <li>Teensy 3.5
  622. <li>Teensy 3.6
  623. <li>Teensy 4.0
  624. <li>Teensy 4.1
  625. </ul>
  626. <h3>Audio Connections</h3>
  627. <table class=doc align=center cellpadding=3>
  628. <tr class=top><th>Port</th><th>Purpose</th></tr>
  629. <tr class=odd><td align=center>Out 0</td><td>Channel #1</td></tr>
  630. <tr class=odd><td align=center>Out 1</td><td>Channel #2</td></tr>
  631. <tr class=odd><td align=center>Out 2</td><td>Channel #3</td></tr>
  632. <tr class=odd><td align=center>Out 3</td><td>Channel #4</td></tr>
  633. </table>
  634. <h3>Functions</h3>
  635. <p>This object has no functions to call from the Arduino sketch. It
  636. simply streams data from the I2S hardware to its 4 output ports.</p>
  637. <h3>Hardware</h3>
  638. <p>See this Sparkfun blog for <a href="https://www.sparkfun.com/news/2055" target="_blank">how
  639. to connect two audio adaptors for 4 channel audio</a>.
  640. <p>The I2S signals are used in "master" mode, where Teensy creates
  641. all 3 clock signals and controls all data timing.</p>
  642. <table class=doc align=center cellpadding=3>
  643. <tr class=top><th>Teensy<br>3.2<br>Pin</th><th>Teensy<br>3.5/3.6<br>Pin</th><th>Teensy<br>4.x<br>Pin</th><th>Signal</th><th>Direction</th></tr>
  644. <tr class=odd><td align=center>9</td><td align=center>9</td><td align=center>21</td><td>BCLK</td><td>Output</td></tr>
  645. <tr class=odd><td align=center>11</td><td align=center>11</td><td align=center>23</td><td>MCLK</td><td>Output</td></tr>
  646. <tr class=odd><td align=center>13</td><td align=center>13</td><td align=center>8</td><td>RX</td><td>Input</td></tr>
  647. <tr class=odd><td align=center>30</td><td align=center>38</td><td align=center>6</td><td>RX</td><td>Input</td></tr>
  648. <tr class=odd><td align=center>23</td><td align=center>23</td><td align=center>20</td><td>LRCLK</td><td>Output</td></tr>
  649. </table>
  650. <p>Audio from
  651. master mode I2S may be used in the same project as ADC, DAC and
  652. PWM signals, because all remain in sync to Teensy's timing</p>
  653. <h3>Examples</h3>
  654. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; PassThroughQuad
  655. </p>
  656. <h3>Notes</h3>
  657. <p>On Teensy 3.x, the BCLK/LRCLK ratio is 32, which is not compatible with
  658. most MEMS microphones. Teensy 4.x uses BCLK/LRCLK ratio, which can
  659. be used with I2S MEMS microphones.</p>
  660. <p>Normally, this object is used with two Audio Shield, which
  661. are controlled separately by a pair "sgtl5000" object.</p>
  662. </script>
  663. <script type="text/x-red" data-template-name="AudioInputI2SQuad">
  664. <div class="form-row">
  665. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  666. <input type="text" id="node-input-name" placeholder="Name">
  667. </div>
  668. </script>
  669. <script type="text/x-red" data-help-name="AudioInputI2SHex">
  670. <h3>Summary</h3>
  671. <div class=tooltipinfo>
  672. <p>Receive 6 channel audio from three I2S devices, using I2S master mode.</p>
  673. </div>
  674. <h3>Boards Supported</h3>
  675. <ul>
  676. <li>Teensy 4.0
  677. <li>Teensy 4.1
  678. </ul>
  679. <h3>Audio Connections</h3>
  680. <table class=doc align=center cellpadding=3>
  681. <tr class=top><th>Port</th><th>Purpose</th></tr>
  682. <tr class=odd><td align=center>Out 0</td><td>Channel #1</td></tr>
  683. <tr class=odd><td align=center>Out 1</td><td>Channel #2</td></tr>
  684. <tr class=odd><td align=center>Out 2</td><td>Channel #3</td></tr>
  685. <tr class=odd><td align=center>Out 3</td><td>Channel #4</td></tr>
  686. <tr class=odd><td align=center>Out 4</td><td>Channel #5</td></tr>
  687. <tr class=odd><td align=center>Out 5</td><td>Channel #6</td></tr>
  688. </table>
  689. <h3>Functions</h3>
  690. <p>This object has no functions to call from the Arduino sketch. It
  691. simply streams data from the I2S hardware to its 6 output ports.</p>
  692. <h3>Hardware</h3>
  693. <p>The I2S signals are used in "master" mode, where Teensy creates
  694. all 3 clock signals and controls all data timing.</p>
  695. <table class=doc align=center cellpadding=3>
  696. <tr class=top><th>Teensy<br>4.x Pin</th><th>Signal</th><th>Direction</th></tr>
  697. <tr class=odd><td align=center>21</td><td>BCLK</td><td>Output</td></tr>
  698. <tr class=odd><td align=center>23</td><td>MCLK</td><td>Output</td></tr>
  699. <tr class=odd><td align=center>8</td><td>RX (ch 1+2)</td><td>Input</td></tr>
  700. <tr class=odd><td align=center>6</td><td>RX (ch 3+4)</td><td>Input</td></tr>
  701. <tr class=odd><td align=center>9</td><td>RX (ch 5+6)</td><td>Input</td></tr>
  702. <tr class=odd><td align=center>20</td><td>LRCLK</td><td>Output</td></tr>
  703. </table>
  704. <h3>Examples</h3>
  705. <!--<p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; PassThroughQuad
  706. </p>-->
  707. <h3>Notes</h3>
  708. <p>Teensy 4.0 &amp; 4.1's I2S port has a total of 5 data pins
  709. which may each transmit or receive stereo digital audio. This
  710. 6 channel input may be used together with the I2S stereo or
  711. quad channel I2S output, but may not be combined with others
  712. which use the same physical pins.</p>
  713. </script>
  714. <script type="text/x-red" data-template-name="AudioInputI2SHex">
  715. <div class="form-row">
  716. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  717. <input type="text" id="node-input-name" placeholder="Name">
  718. </div>
  719. </script>
  720. <script type="text/x-red" data-help-name="AudioInputI2SOct">
  721. <h3>Summary</h3>
  722. <div class=tooltipinfo>
  723. <p>Receive 8 channel audio from three I2S devices, using I2S master mode.</p>
  724. </div>
  725. <h3>Boards Supported</h3>
  726. <ul>
  727. <li>Teensy 4.0
  728. <li>Teensy 4.1
  729. </ul>
  730. <h3>Audio Connections</h3>
  731. <table class=doc align=center cellpadding=3>
  732. <tr class=top><th>Port</th><th>Purpose</th></tr>
  733. <tr class=odd><td align=center>Out 0</td><td>Channel #1</td></tr>
  734. <tr class=odd><td align=center>Out 1</td><td>Channel #2</td></tr>
  735. <tr class=odd><td align=center>Out 2</td><td>Channel #3</td></tr>
  736. <tr class=odd><td align=center>Out 3</td><td>Channel #4</td></tr>
  737. <tr class=odd><td align=center>Out 4</td><td>Channel #5</td></tr>
  738. <tr class=odd><td align=center>Out 5</td><td>Channel #6</td></tr>
  739. <tr class=odd><td align=center>Out 6</td><td>Channel #7</td></tr>
  740. <tr class=odd><td align=center>Out 7</td><td>Channel #8</td></tr>
  741. </table>
  742. <h3>Functions</h3>
  743. <p>This object has no functions to call from the Arduino sketch. It
  744. simply streams data from the I2S hardware to its 8 output ports.</p>
  745. <h3>Hardware</h3>
  746. <p>The I2S signals are used in "master" mode, where Teensy creates
  747. all 3 clock signals and controls all data timing.</p>
  748. <table class=doc align=center cellpadding=3>
  749. <tr class=top><th>Teensy<br>4.x Pin</th><th>Signal</th><th>Direction</th></tr>
  750. <tr class=odd><td align=center>21</td><td>BCLK</td><td>Output</td></tr>
  751. <tr class=odd><td align=center>23</td><td>MCLK</td><td>Output</td></tr>
  752. <tr class=odd><td align=center>8</td><td>RX (ch 1+2)</td><td>Input</td></tr>
  753. <tr class=odd><td align=center>6</td><td>RX (ch 3+4)</td><td>Input</td></tr>
  754. <tr class=odd><td align=center>9</td><td>RX (ch 5+6)</td><td>Input</td></tr>
  755. <tr class=odd><td align=center>32</td><td>RX (ch 7+8)</td><td>Input</td></tr>
  756. <tr class=odd><td align=center>20</td><td>LRCLK</td><td>Output</td></tr>
  757. </table>
  758. <h3>Examples</h3>
  759. <!--<p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; PassThroughQuad
  760. </p>-->
  761. <h3>Notes</h3>
  762. <p>Teensy 4.0 &amp; 4.1's I2S port has a total of 5 data pins
  763. which may each transmit or receive stereo digital audio. This
  764. 8 channel input may be used together with the I2S stereo
  765. output, but may not be combined with others
  766. which use the same physical pins.</p>
  767. </script>
  768. <script type="text/x-red" data-template-name="AudioInputI2SOct">
  769. <div class="form-row">
  770. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  771. <input type="text" id="node-input-name" placeholder="Name">
  772. </div>
  773. </script>
  774. <script type="text/x-red" data-help-name="AudioInputI2S2">
  775. <h3>Summary</h3>
  776. <div class=tooltipinfo>
  777. <p>Receive 16 bit stereo audio from an I2S device using the 2nd I2S port on Teensy 4.x.</p>
  778. </div>
  779. <h3>Boards Supported</h3>
  780. <ul>
  781. <li>Teensy 4.0
  782. <li>Teensy 4.1
  783. </ul>
  784. <h3>Audio Connections</h3>
  785. <table class=doc align=center cellpadding=3>
  786. <tr class=top><th>Port</th><th>Purpose</th></tr>
  787. <tr class=odd><td align=center>Out 0</td><td>Left Channel</td></tr>
  788. <tr class=odd><td align=center>Out 1</td><td>Right Channel</td></tr>
  789. </table>
  790. <h3>Functions</h3>
  791. <p>This object has no functions to call from the Arduino sketch. It
  792. simply streams data from the I2S hardware to its 2 output ports.</p>
  793. <h3>Hardware</h3>
  794. <p>The I2S signals are used in "master" mode, where Teensy creates
  795. all 3 clock signals and controls all data timing.</p>
  796. <table class=doc align=center cellpadding=3>
  797. <tr class=top><th>T4.x<br>Pin</th><th>Signal</th><th>Direction</th></tr>
  798. <tr class=odd><td align=center>4</td><td>BCLK</td><td>Output</td></tr>
  799. <tr class=odd><td align=center>33</td><td>MCLK</td><td>Output</td></tr>
  800. <tr class=odd><td align=center>5</td><td>RX</td><td>Input</td></tr>
  801. <tr class=odd><td align=center>3</td><td>LRCLK</td><td>Output</td></tr>
  802. </table>
  803. </p>
  804. <h3>Examples</h3>
  805. <h3>Notes</h3>
  806. </script>
  807. <script type="text/x-red" data-template-name="AudioInputI2S2">
  808. <div class="form-row">
  809. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  810. <input type="text" id="node-input-name" placeholder="Name">
  811. </div>
  812. </script>
  813. <script type="text/x-red" data-help-name="AudioInputSPDIF3">
  814. <h3>Summary</h3>
  815. <div class=tooltipinfo>
  816. <p>Receive S/PDIF digital audio, at the rate of the external digital audio source.</p>
  817. <p><span style="color:red">This input is incompatible with most other inputs and outputs</span>
  818. which run at a speed controlled by Teensy's internal sample rate.</p>
  819. </div>
  820. <h3>Boards Supported</h3>
  821. <ul>
  822. <li>Teensy 4.0
  823. <li>Teensy 4.1
  824. </ul>
  825. <h3>Audio Connections</h3>
  826. <table class=doc align=center cellpadding=3>
  827. <tr class=top><th>Port</th><th>Purpose</th></tr>
  828. <tr class=odd><td align=center>Out 0</td><td>Left Channel</td></tr>
  829. <tr class=odd><td align=center>Out 1</td><td>Right Channel</td></tr>
  830. </table>
  831. <h3>Functions</h3>
  832. <p class=func><span class=keyword>pllLocked</span>();</p>
  833. <p class=desc>Returns true if the S/PDIF phase locked loop is tracking
  834. the sample rate of incoming digital audio data.
  835. </p>
  836. <p class=func><span class=keyword>sampleRate</span>();</p>
  837. <p class=desc>Returns the sample rate of incoming data, if the PLL has locked,
  838. or returns 0 if the audio sample rate is unknown.
  839. </p>
  840. <h3>Hardware</h3>
  841. <p>
  842. <table class=doc align=center cellpadding=3>
  843. <tr class=top><th>T4.x<br>Pin</th><th>Signal</th><th>Direction</th></tr>
  844. <tr class=odd><td align=center>15</td><td>S/PDIF Data</td><td>Output</td></tr>
  845. </table>
  846. </p>
  847. <h3>Examples</h3>
  848. <!--<p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; PassThroughAsyncSpdif
  849. </p>-->
  850. <h3>Notes</h3>
  851. <p>This input tries to force the entire audio library to run at the
  852. sample rate of the incoming data. It usually can not be combined
  853. with most other inputs and outputs which run at specific speeds.</p>
  854. </script>
  855. <script type="text/x-red" data-template-name="AudioInputSPDIF3">
  856. <div class="form-row">
  857. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  858. <input type="text" id="node-input-name" placeholder="Name">
  859. </div>
  860. </script>
  861. <script type="text/x-red" data-help-name="AsyncAudioInputSPDIF3">
  862. <h3>Summary</h3>
  863. <div class=tooltipinfo>
  864. <p>Receive S/PDIF digital audio and resample to Teensy's audio sample rate.</p>
  865. <p>Asynchronous resampling contributed by <a href="https://github.com/alex6679">Alex Walch</a>.</p>
  866. </div>
  867. <h3>Boards Supported</h3>
  868. <ul>
  869. <li>Teensy 4.0
  870. <li>Teensy 4.1
  871. </ul>
  872. <h3>Audio Connections</h3>
  873. <table class=doc align=center cellpadding=3>
  874. <tr class=top><th>Port</th><th>Purpose</th></tr>
  875. <tr class=odd><td align=center>Out 0</td><td>Left Channel</td></tr>
  876. <tr class=odd><td align=center>Out 1</td><td>Right Channel</td></tr>
  877. </table>
  878. <h3>Functions</h3>
  879. <p class=func><span class=keyword>getBufferedTime</span>();</p>
  880. <p class=desc>Returns the buffered time in seconds. The buffered time is the duration of the incoming samples which are not resampled yet. The step width of the resampling algorithm is constantly slightly adjusted to keep the buffered time closely to the target latency. The difference between the target latency and the buffered time is typically smaller than 1 microsecond.
  881. </p>
  882. <!--<p class=func><span class=keyword>getInputFrequency</span>();</p>
  883. <p class=desc>TODO: documentation needed here
  884. </p>-->
  885. <p class=func><span class=keyword>isLocked</span>();</p>
  886. <p class=desc>Returns true if the S/PDIF phase locked loop is tracking
  887. the sample rate of incoming digital audio data.
  888. </p>
  889. <p class=func><span class=keyword>getInputFrequency</span>();</p>
  890. <p class=desc>Returns the sample rate of incoming data, if the PLL has locked, or returns 0 if the audio sample rate is unknown.
  891. </p>
  892. <p class=func><span class=keyword>getTargetLantency</span>();</p>
  893. <p class=desc>Returns the target latency in seconds. The latency is the time from the moment a sample is received by the Teensy SPDIF hardware receiver until it is transmitted by the asrc intput. The audio samples arrive at the asrc input in chunks of 32 samples per channel. The target latency consists of these 32 samples + some buffer that is needed to compensate for timing variations.
  894. </p>
  895. <p class=func><span class=keyword>getAttenuation</span>();</p>
  896. <p class=desc>
  897. Returns the actual achieved attenuation of the anti-aliasing filter. If the input sampling rate is smaller or equal to 44.1kHz, no low pass filtering is needed and zero is returned.
  898. </p>
  899. <p class=func><span class=keyword>getHalfFilterLength</span>();</p>
  900. <p class=desc>Returns the half length of the resampling filter. Its complete length is 2*(the returned value)+1.
  901. </p>
  902. <h3>Hardware</h3>
  903. <p>
  904. <table class=doc align=center cellpadding=3>
  905. <tr class=top><th>T4.x<br>Pin</th><th>Signal</th><th>Direction</th></tr>
  906. <tr class=odd><td align=center>15</td><td>S/PDIF Data</td><td>Output</td></tr>
  907. </table>
  908. </p>
  909. <h3>Examples</h3>
  910. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; PassThroughAsyncSpdif
  911. </p>
  912. <h3>Notes</h3>
  913. <p>TODO: document optional instance parameters.... (dither, noiseshaping, attenuation, minHalfFilterLength) </p>
  914. </script>
  915. <script type="text/x-red" data-template-name="AsyncAudioInputSPDIF3">
  916. <div class="form-row">
  917. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  918. <input type="text" id="node-input-name" placeholder="Name">
  919. </div>
  920. </script>
  921. <script type="text/x-red" data-help-name="AudioInputAnalog">
  922. <h3>Summary</h3>
  923. <div class=tooltipinfo>
  924. <p>Receive audio using the built-in analog to digital converter.</p>
  925. </div>
  926. <h3>Boards Supported</h3>
  927. <ul>
  928. <li>Teensy 3.2
  929. <li>Teensy 3.5
  930. <li>Teensy 3.6
  931. <li>Teensy 4.0 - experimental
  932. <li>Teensy 4.1 - experimental
  933. </ul>
  934. <h3>Audio Connections</h3>
  935. <table class=doc align=center cellpadding=3>
  936. <tr class=top><th>Port</th><th>Purpose</th></tr>
  937. <tr class=odd><td align=center>Out 0</td><td>Audio Channel</td></tr>
  938. </table>
  939. <h3>Functions</h3>
  940. <p>This object has no functions to call from the Arduino sketch. It
  941. simply streams data from the ADC to its output port.</p>
  942. <h3>Hardware</h3>
  943. <p>Pin A2 is used for audio input. This circuitry is recommended.</p>
  944. <p align=center><img src="img/adccircuit.png"></p>
  945. <p>Signal range is 0 to 1.2V</p>
  946. <p>With a <a href="https://forum.pjrc.com/threads/40468-Help-with-Basic-Audio-Lib-results?p=126317&viewfull=1#post126317">small modification</a> Adafruit's <a href="https://www.adafruit.com/products/1063">MAX4466 microphone</a> can be used</p>
  947. <p align=center><a href="https://forum.pjrc.com/threads/40468-Help-with-Basic-Audio-Lib-results?p=126317&viewfull=1#post126317"><img src="img/adccircuitmic.jpg" border=0></a></p>
  948. <p>Control Voltage (CV) from +5V to -5V can be adapted with a
  949. <a href="https://www.dorkbotpdx.org/blog/paul/control_voltage_cv_to_analog_input_pin">simple circuit</a>
  950. or better <a href="https://forum.pjrc.com/threads/28423?p=71257&viewfull=1#post71257">opamp-based circuity</a>
  951. to Teensy's 0-1.2V analog input range.</p>
  952. <h3>Examples</h3>
  953. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; PassThroughMono
  954. </p>
  955. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; PeakMeterMono
  956. </p>
  957. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; DialTone_7segment
  958. </p>
  959. <p class=exam>File &gt; Examples &gt; OctoWS2811 &gt; SpectrumAnalyzer
  960. </p>
  961. <h3>Notes</h3>
  962. <p><b>analogRead() must not be used</b>, because AudioInputAnalog is regularly
  963. accessing the ADC hardware. If both access the hardware at the same
  964. moment, analogRead() can end up waiting forever, which effectively
  965. crashes your program.
  966. </p>
  967. <p>A different pin may be used, but adding it as an parameter
  968. to the AudioInputAnalog object definition.
  969. </p>
  970. <p>For example, to use pin A3:
  971. </p>
  972. <p class=desc><span class=keyword>AudioInputAnalog</span> adc1(<span class=literal>A3</span>);
  973. </p>
  974. <p>Noise due to high source impedance, which allows rapidly switching digital signals
  975. to capacitively couple... avoiding higher analog impedance is the solution.</p>
  976. <p>Power Supply rejection issue with simple DC bias (bigger capacitor may be needed if 3.3V has low frequency noise)</p>
  977. <p>Algorithm for automatic DC bias tracking</p>
  978. <p>TODO: actual noise measurements with different input circuitry
  979. (it's not as quiet as the audio shield)</p>
  980. </script>
  981. <script type="text/x-red" data-template-name="AudioInputAnalog">
  982. <div class="form-row">
  983. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  984. <input type="text" id="node-input-name" placeholder="Name">
  985. </div>
  986. </script>
  987. <script type="text/x-red" data-help-name="AudioInputAnalogStereo">
  988. <h3>Summary</h3>
  989. <div class=tooltipinfo>
  990. <p>Receive stereo audio using the built-in analog to digital converters.</p>
  991. </div>
  992. <h3>Boards Supported</h3>
  993. <ul>
  994. <li>Teensy 3.2
  995. <li>Teensy 3.5
  996. <li>Teensy 3.6
  997. </ul>
  998. <h3>Audio Connections</h3>
  999. <table class=doc align=center cellpadding=3>
  1000. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1001. <tr class=odd><td align=center>Out 0</td><td>Audio Channel (Left)</td></tr>
  1002. <tr class=odd><td align=center>Out 1</td><td>Audio Channel (Right)</td></tr>
  1003. </table>
  1004. <h3>Functions</h3>
  1005. <p>This object has no functions to call from the Arduino sketch. It
  1006. simply streams data from both ADCs to its output ports.</p>
  1007. <h3>Hardware</h3>
  1008. <p>By default, pins A2 & A3 are used for audio input. This circuitry is recommended.</p>
  1009. <p align=center><img src="img/adccircuit2.png"></p>
  1010. <p>Signal range is 0 to 1.2V</p>
  1011. <p>Control Voltage (CV) from +5V to -5V can be adapted with a
  1012. <a href="https://www.dorkbotpdx.org/blog/paul/control_voltage_cv_to_analog_input_pin">simple circuit</a>
  1013. or better <a href="https://forum.pjrc.com/threads/28423?p=71257&viewfull=1#post71257">opamp-based circuity</a>
  1014. to Teensy's 0-1.2V analog input range.</p>
  1015. <h3>Examples</h3>
  1016. <!--
  1017. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; PassThroughMono
  1018. </p>
  1019. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; PeakMeterMono
  1020. </p>
  1021. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; DialTone_7segment
  1022. </p>
  1023. <p class=exam>File &gt; Examples &gt; OctoWS2811 &gt; SpectrumAnalyzer
  1024. </p>
  1025. -->
  1026. <h3>Notes</h3>
  1027. <p><b>analogRead() must not be used</b>, because AudioInputAnalogStereo is regularly
  1028. accessing the ADC hardware. If both access the hardware at the same
  1029. moment, analogRead() can end up waiting forever, which effectively
  1030. crashes your program.
  1031. </p>
  1032. <p>A different pin may be used, but adding it as an parameter
  1033. to the AudioInputAnalog object definition.
  1034. </p>
  1035. <p>For example:
  1036. </p>
  1037. <p class=desc><span class=keyword>AudioInputAnalogStereo</span> adc1(<span class=literal>A3</span>, <span class=literal>A2</span>);
  1038. </p>
  1039. <p>TODO: add info here about which pins work for input 0 and 1.
  1040. </p>
  1041. <p>Noise due to high source impedance, which allows rapidly switching digital signals
  1042. to capacitively couple... avoiding higher analog impedance is the solution.</p>
  1043. <p>Power Supply rejection issue with simple DC bias (bigger capacitor may be needed if 3.3V has low frequency noise)</p>
  1044. <p>Algorithm for automatic DC bias tracking</p>
  1045. <p>TODO: actual noise measurements with different input circuitry
  1046. (it's not as quiet as the audio shield)</p>
  1047. </script>
  1048. <script type="text/x-red" data-template-name="AudioInputAnalogStereo">
  1049. <div class="form-row">
  1050. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1051. <input type="text" id="node-input-name" placeholder="Name">
  1052. </div>
  1053. </script>
  1054. <script type="text/x-red" data-help-name="AudioInputI2Sslave">
  1055. <h3>Summary</h3>
  1056. <div class=tooltipinfo>
  1057. <p>Receive 16 bit stereo audio from an I2S device using I2S slave mode
  1058. (where the ADC or codec chip, not Teensy, controls audio timing).</p>
  1059. <p><span style="color:red">This input is incompatible with most other inputs and outputs</span>
  1060. which run at a speed controlled by Teensy's internal sample rate.</p>
  1061. </div>
  1062. <h3>Boards Supported</h3>
  1063. <ul>
  1064. <li>Teensy 3.2
  1065. <li>Teensy 3.5
  1066. <li>Teensy 3.6
  1067. <li>Teensy 4.0
  1068. <li>Teensy 4.1
  1069. </ul>
  1070. <h3>Audio Connections</h3>
  1071. <table class=doc align=center cellpadding=3>
  1072. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1073. <tr class=odd><td align=center>Out 0</td><td>Left Channel</td></tr>
  1074. <tr class=odd><td align=center>Out 1</td><td>Right Channel</td></tr>
  1075. </table>
  1076. <h3>Functions</h3>
  1077. <p>This object has no functions to call from the Arduino sketch. It
  1078. simply streams data from the I2S hardware to its 2 output ports.</p>
  1079. <h3>Hardware</h3>
  1080. <p>The I2S signals are used in "slave" mode, where the I2S device controls
  1081. data timing.</p>
  1082. <table class=doc align=center cellpadding=3>
  1083. <tr class=top><th>Teensy<br>3.x Pin</th><th>Teensy<br>4.x Pin</th><th>Signal</th><th>Direction</th></tr>
  1084. <tr class=odd><td align=center>9</td><td align=center>21</td><td>BCLK</td><td>Input</td></tr>
  1085. <tr class=odd><td align=center>13</td><td align=center>8</td><td>RX</td><td>Input</td></tr>
  1086. <tr class=odd><td align=center>23</td><td align=center>20</td><td>LRCLK</td><td>Input</td></tr>
  1087. </table>
  1088. <!--
  1089. <h3>Examples</h3>
  1090. <p class=exam>File &gt; Examples &gt; Audio &gt;
  1091. </p>
  1092. -->
  1093. <h3>Notes</h3>
  1094. <p>Slave mode I2S <b>should not used in the same project as ADC, DAC and
  1095. PWM</b> signals. Differences in timing between the I2S device and
  1096. Teensy's clock can cause occasional audio glitches when I2S slave mode
  1097. is used together with other input or output objects based on Teensy's
  1098. timing.</p>
  1099. <p>Only one I2S input and one I2S output object may be used. Master
  1100. and slave modes may not be mixed (both must be of the same type).
  1101. </p>
  1102. </script>
  1103. <script type="text/x-red" data-template-name="AudioInputI2Sslave">
  1104. <div class="form-row">
  1105. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1106. <input type="text" id="node-input-name" placeholder="Name">
  1107. </div>
  1108. </script>
  1109. <script type="text/x-red" data-help-name="AudioInputTDM">
  1110. <h3>Summary</h3>
  1111. <div class=tooltipinfo>
  1112. <p>Receive a 256 bit Time Division Multiplexed frame containing
  1113. many audio channels.</p>
  1114. <p align=center><img src="img/tdm.jpg"></p>
  1115. </div>
  1116. <h3>Boards Supported</h3>
  1117. <ul>
  1118. <li>Teensy 3.2
  1119. <li>Teensy 3.5
  1120. <li>Teensy 3.6
  1121. <li>Teensy 4.0
  1122. <li>Teensy 4.1
  1123. </ul>
  1124. <h3>Audio Connections</h3>
  1125. <table class=doc align=center cellpadding=3>
  1126. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1127. <tr class=odd><td align=center>Out 0</td><td>Bits 0 to 15</td></tr>
  1128. <tr class=odd><td align=center>Out 1</td><td>Bits 16 to 31</td></tr>
  1129. <tr class=odd><td align=center>Out 2</td><td>Bits 32 to 47</td></tr>
  1130. <tr class=odd><td align=center>Out 3</td><td>Bits 48 to 63</td></tr>
  1131. <tr class=odd><td align=center>Out 4</td><td>Bits 64 to 79</td></tr>
  1132. <tr class=odd><td align=center>Out 5</td><td>Bits 80 to 95</td></tr>
  1133. <tr class=odd><td align=center>Out 6</td><td>Bits 96 to 111</td></tr>
  1134. <tr class=odd><td align=center>Out 7</td><td>Bits 112 to 127</td></tr>
  1135. <tr class=odd><td align=center>Out 8</td><td>Bits 128 to 143</td></tr>
  1136. <tr class=odd><td align=center>Out 9</td><td>Bits 144 to 159</td></tr>
  1137. <tr class=odd><td align=center>Out 10</td><td>Bits 160 to 175</td></tr>
  1138. <tr class=odd><td align=center>Out 11</td><td>Bits 176 to 191</td></tr>
  1139. <tr class=odd><td align=center>Out 12</td><td>Bits 192 to 207</td></tr>
  1140. <tr class=odd><td align=center>Out 13</td><td>Bits 208 to 223</td></tr>
  1141. <tr class=odd><td align=center>Out 14</td><td>Bits 224 to 239</td></tr>
  1142. <tr class=odd><td align=center>Out 15</td><td>Bits 240 to 255</td></tr>
  1143. </table>
  1144. <h3>Functions</h3>
  1145. <p>This object has no functions to call from the Arduino sketch. It
  1146. simply streams data from the TDM hardware to its 16 output ports.</p>
  1147. <h3>Hardware</h3>
  1148. <p>TDM has been tested with this <a href="https://oshpark.com/shared_projects/2Yj6rFaW">
  1149. CS42448 Circuit Board</a>. It may also work with
  1150. <a href="https://forum.pjrc.com/threads/42894">Invensense ICS-52000 microphones</a>.
  1151. </p>
  1152. <table class=doc align=center cellpadding=3>
  1153. <tr class=top><th>T3.x<br>Pin</th><th>T4.x<br>Pin</th><th>Signal</th><th>Direction</th></tr>
  1154. <tr class=odd><td align=center>9</td><td align=center>21</td><td>BCLK</td><td>Output, 11.3 MHz</td></tr>
  1155. <tr class=odd><td align=center>11</td><td align=center>23</td><td>MCLK</td><td>Output, 22.6 MHz</td></tr>
  1156. <tr class=odd><td align=center>13</td><td align=center>8</td><td>RX</td><td>Input, 11.3 Mbit/sec</td></tr>
  1157. <tr class=odd><td align=center>23</td><td align=center>21</td><td>FS</td><td>Output</td></tr>
  1158. </table>
  1159. <p>Audio from
  1160. master mode TDM may be used in the same project as ADC, DAC and
  1161. PWM signals, because all remain in sync to Teensy's timing</p>
  1162. <!--<h3>Examples</h3>-->
  1163. <h3>Notes</h3>
  1164. <p>Only one TDM input and one TDM output object may be used. The
  1165. I2S hardware is used by TDM, so TDM objects may not be used
  1166. together with I2S, SPDIF or PT8211.</p>
  1167. <p>When used with TDM devices which transmit 32 bit audio, the
  1168. even numbered channels will contain the useful upper 16
  1169. bits of audio data.</p>
  1170. <p>AudioMemory should be at least 16. Even if most channels are
  1171. unused, this TDM object will need to allocate 16 blocks of
  1172. memory.</p>
  1173. </script>
  1174. <script type="text/x-red" data-template-name="AudioInputTDM">
  1175. <div class="form-row">
  1176. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1177. <input type="text" id="node-input-name" placeholder="Name">
  1178. </div>
  1179. </script>
  1180. <script type="text/x-red" data-help-name="AudioInputTDM2">
  1181. <h3>Summary</h3>
  1182. <div class=tooltipinfo>
  1183. <p>Receive a 256 bit Time Division Multiplexed frame containing
  1184. many audio channels, using the I2S2 port.</p>
  1185. </div>
  1186. <h3>Boards Supported</h3>
  1187. <ul>
  1188. <li>Teensy 4.0
  1189. <li>Teensy 4.1
  1190. </ul>
  1191. <h3>Audio Connections</h3>
  1192. <table class=doc align=center cellpadding=3>
  1193. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1194. <tr class=odd><td align=center>Out 0</td><td>Bits 0 to 15</td></tr>
  1195. <tr class=odd><td align=center>Out 1</td><td>Bits 16 to 31</td></tr>
  1196. <tr class=odd><td align=center>Out 2</td><td>Bits 32 to 47</td></tr>
  1197. <tr class=odd><td align=center>Out 3</td><td>Bits 48 to 63</td></tr>
  1198. <tr class=odd><td align=center>Out 4</td><td>Bits 64 to 79</td></tr>
  1199. <tr class=odd><td align=center>Out 5</td><td>Bits 80 to 95</td></tr>
  1200. <tr class=odd><td align=center>Out 6</td><td>Bits 96 to 111</td></tr>
  1201. <tr class=odd><td align=center>Out 7</td><td>Bits 112 to 127</td></tr>
  1202. <tr class=odd><td align=center>Out 8</td><td>Bits 128 to 143</td></tr>
  1203. <tr class=odd><td align=center>Out 9</td><td>Bits 144 to 159</td></tr>
  1204. <tr class=odd><td align=center>Out 10</td><td>Bits 160 to 175</td></tr>
  1205. <tr class=odd><td align=center>Out 11</td><td>Bits 176 to 191</td></tr>
  1206. <tr class=odd><td align=center>Out 12</td><td>Bits 192 to 207</td></tr>
  1207. <tr class=odd><td align=center>Out 13</td><td>Bits 208 to 223</td></tr>
  1208. <tr class=odd><td align=center>Out 14</td><td>Bits 224 to 239</td></tr>
  1209. <tr class=odd><td align=center>Out 15</td><td>Bits 240 to 255</td></tr>
  1210. </table>
  1211. <h3>Functions</h3>
  1212. <p>This object has no functions to call from the Arduino sketch. It
  1213. simply streams data from the TDM hardware to its 16 output ports.</p>
  1214. <h3>Hardware</h3>
  1215. <table class=doc align=center cellpadding=3>
  1216. <tr class=top><th>Teensy<br>4.x Pin</th><th>Signal</th><th>Direction</th></tr>
  1217. <tr class=odd><td align=center>4</td><td>BCLK</td><td>Output, 11.3 MHz</td></tr>
  1218. <tr class=odd><td align=center>33</td><td>MCLK</td><td>Output, 22.6 MHz</td></tr>
  1219. <tr class=odd><td align=center>5</td><td>RX</td><td>Input, 11.3 Mbit/sec</td></tr>
  1220. <tr class=odd><td align=center>3</td><td>FS</td><td>Output</td></tr>
  1221. </table>
  1222. <!--<h3>Examples</h3>-->
  1223. <h3>Notes</h3>
  1224. <p>When used with TDM devices which transmit 32 bit audio, the
  1225. even numbered channels will contain the useful upper 16
  1226. bits of audio data.</p>
  1227. <p>AudioMemory should be at least 16. Even if most channels are
  1228. unused, this TDM object will need to allocate 16 blocks of
  1229. memory.</p>
  1230. </script>
  1231. <script type="text/x-red" data-template-name="AudioInputTDM2">
  1232. <div class="form-row">
  1233. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1234. <input type="text" id="node-input-name" placeholder="Name">
  1235. </div>
  1236. </script>
  1237. <script type="text/x-red" data-help-name="AudioInputPDM">
  1238. <h3>Summary</h3>
  1239. <div class=tooltipinfo>
  1240. <p>Receive (and filter) a Pulse Density Modulated bitstream.
  1241. </p>
  1242. <p align=center><img src="img/pdmmic.jpg"><br><small>PDM MEMS Mic</small></p>
  1243. </div>
  1244. <h3>Boards Supported</h3>
  1245. <ul>
  1246. <li>Teensy 3.2
  1247. <li>Teensy 3.5
  1248. <li>Teensy 3.6
  1249. <!--<li>Teensy 4.0
  1250. <li>Teensy 4.1-->
  1251. </ul>
  1252. <h3>Audio Connections</h3>
  1253. <table class=doc align=center cellpadding=3>
  1254. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1255. <tr class=odd><td align=center>Out 0</td><td>Filtered Audio Output</td></tr>
  1256. </table>
  1257. <h3>Functions</h3>
  1258. <p>This object has no functions to call from the Arduino sketch. It
  1259. simply streams data from the PDM data, filters out the high frequency
  1260. noise and gives you the audio signal.</p>
  1261. <h3>Hardware</h3>
  1262. <p>PDM has been tested with this <a href="https://www.adafruit.com/product/3492">
  1263. Adafruit MP34DT01-M Microphone Board</a>.
  1264. </p>
  1265. <table class=doc align=center cellpadding=3>
  1266. <tr class=top><th>Pin</th><th>Signal</th><th>Direction</th></tr>
  1267. <tr class=odd><td align=center>9</td><td>CLK</td><td>Output, 2.8235 MHz</td></tr>
  1268. <tr class=odd><td align=center>13</td><td>DATA</td><td>Input, Data on rising edge</td></tr>
  1269. </table>
  1270. <p>Data is input on the rising edge. The SEL pin on MP34DT01-M should be
  1271. connected LOW for proper data capture.</p>
  1272. <!--<h3>Examples</h3>-->
  1273. <h3>Notes</h3>
  1274. <p>Filtering consumes approximately 39% of the CPU when running at
  1275. 96 MHz. The code currently consumes this time inside a high
  1276. priority interrupt, blocking other libraries. Perhaps future
  1277. versions will perform filtering at lower priority.
  1278. </p>
  1279. <p>The filter used is a 512 tap FIR with approx &plusmn;1.1 dB gain
  1280. flatness to 10 kHz. While far from audiophile grade, this should
  1281. perform far better than the rapid rolloff of Cascaded Integrator
  1282. Comb (CIC) or simple moving average filters commonly used on
  1283. other microcontrollers. The filter also consumes 2104 bytes of
  1284. RAM for buffering and 32K of Flash for a lookup table to optimized
  1285. the filter computation.
  1286. </p>
  1287. </script>
  1288. <script type="text/x-red" data-template-name="AudioInputPDM">
  1289. <div class="form-row">
  1290. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1291. <input type="text" id="node-input-name" placeholder="Name">
  1292. </div>
  1293. </script>
  1294. <script type="text/x-red" data-help-name="AudioInputUSB">
  1295. <h3>Summary</h3>
  1296. <div class=tooltipinfo>
  1297. <p>Receive stereo audio from a PC or Mac. Teensy appears as a USB
  1298. sound device.</p>
  1299. <p align=center><img src="img/usbtype_audio_in.png"></p>
  1300. </div>
  1301. <h3>Boards Supported</h3>
  1302. <ul>
  1303. <li>Teensy 3.2
  1304. <li>Teensy 3.5
  1305. <li>Teensy 3.6
  1306. <li>Teensy 4.0
  1307. <li>Teensy 4.1
  1308. </ul>
  1309. <h3>Audio Connections</h3>
  1310. <table class=doc align=center cellpadding=3>
  1311. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1312. <tr class=odd><td align=center>Out 0</td><td>Left Channel</td></tr>
  1313. <tr class=odd><td align=center>Out 1</td><td>Right Channel</td></tr>
  1314. </table>
  1315. <h3>Functions</h3>
  1316. <p class=func><span class=keyword>volume</span>();</p>
  1317. <p class=desc>Returns the volume setting requested by the USB host.
  1318. Range is 0 to 1.0. To make the PC's volume control work, this
  1319. setting should be read periodically and used to control the
  1320. system processing the signal.
  1321. </p>
  1322. <!--
  1323. <h3>Hardware</h3>
  1324. -->
  1325. <h3>Examples</h3>
  1326. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; PassThroughUSB</p>
  1327. </p>
  1328. <h3>Notes</h3>
  1329. <p>Arduino's <b>Tools &gt; USB Type</b> menu must be set to <b>Audio</b>.
  1330. </p>
  1331. <p align=center><img src="img/usbtype_audio.png"></p>
  1332. <p>USB input &amp; output does not cause the Teensy Audio Library to
  1333. update. At least one non-USB input or output object must be
  1334. present for the entire library to update properly.</p>
  1335. </script>
  1336. <script type="text/x-red" data-template-name="AudioInputUSB">
  1337. <div class="form-row">
  1338. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1339. <input type="text" id="node-input-name" placeholder="Name">
  1340. </div>
  1341. </script>
  1342. <script type="text/x-red" data-help-name="AudioOutputI2S">
  1343. <h3>Summary</h3>
  1344. <div class=tooltipinfo>
  1345. <p>Transmit 16 bit stereo audio to the
  1346. <a href="http://www.pjrc.com/store/teensy3_audio.html" target="_blank">audio shield</a>
  1347. or another I2S device, using I2S master mode.</p>
  1348. <p align=center><img src="img/audioshield_outputs.jpg"></p>
  1349. </div>
  1350. <h3>Boards Supported</h3>
  1351. <ul>
  1352. <li>Teensy 3.2
  1353. <li>Teensy 3.5
  1354. <li>Teensy 3.6
  1355. <li>Teensy 4.0
  1356. <li>Teensy 4.1
  1357. </ul>
  1358. <h3>Audio Connections</h3>
  1359. <table class=doc align=center cellpadding=3>
  1360. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1361. <tr class=odd><td align=center>In 0</td><td>Left Channel</td></tr>
  1362. <tr class=odd><td align=center>In 1</td><td>Right Channel</td></tr>
  1363. </table>
  1364. <h3>Functions</h3>
  1365. <p>This object has no functions to call from the Arduino sketch. It
  1366. simply streams data from its 2 input ports to the I2S hardware.</p>
  1367. <h3>Hardware</h3>
  1368. <p align=center><img src="img/audioshield_backside.jpg"></p>
  1369. <p>The I2S signals are used in "master" mode, where Teensy creates
  1370. all 3 clock signals and controls all data timing.</p>
  1371. <table class=doc align=center cellpadding=3>
  1372. <tr class=top><th>T3.x<br>Pin</th><th>T4.x<br>Pin</th><th>Signal</th><th>Direction</th></tr>
  1373. <tr class=odd><td align=center>9</td><td align=center>21</td><td>BCLK</td><td>Output</td></tr>
  1374. <tr class=odd><td align=center>11</td><td align=center>23</td><td>MCLK</td><td>Output</td></tr>
  1375. <tr class=odd><td align=center>22</td><td align=center>7</td><td>TX</td><td>Output</td></tr>
  1376. <tr class=odd><td align=center>23</td><td align=center>20</td><td>LRCLK</td><td>Output</td></tr>
  1377. </table>
  1378. <p>Audio from
  1379. master mode I2S may be used in the same project as ADC, DAC and
  1380. PWM signals, because all remain in sync to Teensy's timing</p>
  1381. <p>Compatible CODEC Chips:
  1382. <ul>
  1383. <li><a href="https://www.pjrc.com/store/teensy3_audio.html">STGL5000</a>
  1384. <li><a href="https://forum.pjrc.com/threads/42665-New-Audio-Board!-TI-TLV320AIC3206">TLV320AIC3206</a>
  1385. <li><a href="https://forum.pjrc.com/threads/32276-HiFi-Audio-CODEC-Module-AK4558-evaluation-board-in-a-square-inch-PCB">AK4558</a>
  1386. </ul>
  1387. </p>
  1388. <p>Compatible DAC Chips:
  1389. <ul>
  1390. <li><a href="https://forum.pjrc.com/threads/53069-Teensy-with-PCM5102a-Module-via-I2S?p=183106&viewfull=1#post183106">PCM5102A</a>
  1391. <li><a href="https://forum.pjrc.com/threads/53069-Teensy-with-PCM5102a-Module-via-I2S?p=183176&viewfull=1#post183176">PCM1808</a>
  1392. <li><a href="https://forum.pjrc.com/threads/53069-Teensy-with-PCM5102a-Module-via-I2S?p=188244&viewfull=1#post188244">PCM5242</a>
  1393. <li><a href="https://forum.pjrc.com/threads/55137-I2S-output-with-CS4344?p=197919&viewfull=1#post197919">CS4344</a>
  1394. </ul>
  1395. </p>
  1396. <h3>Examples</h3>
  1397. <p>Nearly all the examples use this object. Here are some of the highlights:</p>
  1398. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; PassThroughStereo
  1399. </p>
  1400. <p class=exam>File &gt; Examples &gt; Audio &gt; SamplePlayer
  1401. </p>
  1402. <p class=exam>File &gt; Examples &gt; Audio &gt; Recorder
  1403. </p>
  1404. <p class=exam>File &gt; Examples &gt; Audio &gt; WavFilePlayer
  1405. </p>
  1406. <p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Chorus
  1407. </p>
  1408. <p class=exam>File &gt; Examples &gt; Audio &gt; Synthesis &gt; PlaySynthMusic
  1409. </p>
  1410. <h3>Notes</h3>
  1411. <p>Normally, this object is used with the Audio Shield, which
  1412. is controlled separately by the "sgtl5000" object.</p>
  1413. <p>Only one I2S input and one I2S output object may be used. Master
  1414. and slave modes may not be mixed (both must be of the same type).
  1415. </p>
  1416. </script>
  1417. <script type="text/x-red" data-template-name="AudioOutputI2S">
  1418. <div class="form-row">
  1419. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1420. <input type="text" id="node-input-name" placeholder="Name">
  1421. </div>
  1422. </script>
  1423. <script type="text/x-red" data-help-name="AudioOutputI2SQuad">
  1424. <h3>Summary</h3>
  1425. <div class=tooltipinfo>
  1426. <p>Transmit quad (4) channel 16 bit audio, using I2S master mode.</p>
  1427. <p align=center><img src="img/audioshield_quad_out.jpg"></p>
  1428. </div>
  1429. <h3>Boards Supported</h3>
  1430. <ul>
  1431. <li>Teensy 3.2
  1432. <li>Teensy 3.5
  1433. <li>Teensy 3.6
  1434. <li>Teensy 4.0
  1435. <li>Teensy 4.1
  1436. </ul>
  1437. <h3>Audio Connections</h3>
  1438. <table class=doc align=center cellpadding=3>
  1439. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1440. <tr class=odd><td align=center>In 0</td><td>Channel #1</td></tr>
  1441. <tr class=odd><td align=center>In 1</td><td>Channel #2</td></tr>
  1442. <tr class=odd><td align=center>In 2</td><td>Channel #3</td></tr>
  1443. <tr class=odd><td align=center>In 3</td><td>Channel #4</td></tr>
  1444. </table>
  1445. <h3>Functions</h3>
  1446. <p>This object has no functions to call from the Arduino sketch. It
  1447. simply streams data from its 4 input ports to the I2S hardware.</p>
  1448. <h3>Hardware</h3>
  1449. <p>See this Sparkfun blog for <a href="https://www.sparkfun.com/news/2055" target="_blank">how
  1450. to connect two audio adaptors for 4 channel audio</a>. More
  1451. <a href="https://forum.pjrc.com/threads/29373-Bit-bang-multiple-I2S-inputs-simultaneously?p=79606#post79606" target="_blank">details</a> are also available.
  1452. <p>The I2S signals are used in "master" mode, where Teensy creates
  1453. all 3 clock signals and controls all data timing.</p>
  1454. <table class=doc align=center cellpadding=3>
  1455. <tr class=top><th>T3.x<br>Pin</th><th>T4.x<br>Pin</th><th>Signal</th><th>Direction</th></tr>
  1456. <tr class=odd><td align=center>9</td><td align=center>21</td><td>BCLK</td><td>Output</td></tr>
  1457. <tr class=odd><td align=center>11</td><td align=center>23</td><td>MCLK</td><td>Output</td></tr>
  1458. <tr class=odd><td align=center>22</td><td align=center>7</td><td>TX (ch 1+2)</td><td>Output</td></tr>
  1459. <tr class=odd><td align=center>15</td><td align=center>32</td><td>TX (ch 3+4)</td><td>Output</td></tr>
  1460. <tr class=odd><td align=center>23</td><td align=center>20</td><td>LRCLK</td><td>Output</td></tr>
  1461. </table>
  1462. <p>Audio from
  1463. master mode I2S may be used in the same project as ADC, DAC and
  1464. PWM signals, because all remain in sync to Teensy's timing</p>
  1465. <h3>Examples</h3>
  1466. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; PassThroughQuad
  1467. </p>
  1468. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; SGTL5000 &gt; QuadChannelOutput
  1469. </p>
  1470. <h3>Notes</h3>
  1471. <p>Normally, this object is used with two Audio Shields, which
  1472. are controlled separately by a pair of "sgtl5000" objects.</p>
  1473. </script>
  1474. <script type="text/x-red" data-template-name="AudioOutputI2SQuad">
  1475. <div class="form-row">
  1476. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1477. <input type="text" id="node-input-name" placeholder="Name">
  1478. </div>
  1479. </script>
  1480. <script type="text/x-red" data-help-name="AudioOutputI2SHex">
  1481. <h3>Summary</h3>
  1482. <div class=tooltipinfo>
  1483. <p>Transmit 6 channel 16 bit audio, using I2S master mode.</p>
  1484. </div>
  1485. <h3>Boards Supported</h3>
  1486. <ul>
  1487. <li>Teensy 4.0
  1488. <li>Teensy 4.1
  1489. </ul>
  1490. <h3>Audio Connections</h3>
  1491. <table class=doc align=center cellpadding=3>
  1492. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1493. <tr class=odd><td align=center>In 0</td><td>Channel #1</td></tr>
  1494. <tr class=odd><td align=center>In 1</td><td>Channel #2</td></tr>
  1495. <tr class=odd><td align=center>In 2</td><td>Channel #3</td></tr>
  1496. <tr class=odd><td align=center>In 3</td><td>Channel #4</td></tr>
  1497. <tr class=odd><td align=center>In 4</td><td>Channel #5</td></tr>
  1498. <tr class=odd><td align=center>In 5</td><td>Channel #6</td></tr>
  1499. </table>
  1500. <h3>Functions</h3>
  1501. <p>This object has no functions to call from the Arduino sketch. It
  1502. simply streams data from its 6 input ports to the I2S hardware.</p>
  1503. <h3>Hardware</h3>
  1504. <p>The I2S signals are used in "master" mode, where Teensy creates
  1505. all 3 clock signals and controls all data timing.</p>
  1506. <table class=doc align=center cellpadding=3>
  1507. <tr class=top><th>Teensy<br>4.x Pin</th><th>Signal</th><th>Direction</th></tr>
  1508. <tr class=odd><td align=center>21</td><td>BCLK</td><td>Output</td></tr>
  1509. <tr class=odd><td align=center>23</td><td>MCLK</td><td>Output</td></tr>
  1510. <tr class=odd><td align=center>7</td><td>TX (ch 1+2)</td><td>Output</td></tr>
  1511. <tr class=odd><td align=center>32</td><td>TX (ch 3+4)</td><td>Output</td></tr>
  1512. <tr class=odd><td align=center>9</td><td>TX (ch 5+6)</td><td>Output</td></tr>
  1513. <tr class=odd><td align=center>20</td><td>LRCLK</td><td>Output</td></tr>
  1514. </table>
  1515. <h3>Examples</h3>
  1516. <h3>Notes</h3>
  1517. <p>Teensy 4.0 &amp; 4.1's I2S port has a total of 5 data pins
  1518. which may each transmit or receive stereo digital audio. This
  1519. 6 channel output may be used together with the I2S stereo or
  1520. quad channel I2S input, but may not be combined with others
  1521. which use the same physical pins.</p>
  1522. </script>
  1523. <script type="text/x-red" data-template-name="AudioOutputI2SHex">
  1524. <div class="form-row">
  1525. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1526. <input type="text" id="node-input-name" placeholder="Name">
  1527. </div>
  1528. </script>
  1529. <script type="text/x-red" data-help-name="AudioOutputI2SOct">
  1530. <h3>Summary</h3>
  1531. <div class=tooltipinfo>
  1532. <p>Transmit 8 channel 16 bit audio, using I2S master mode.</p>
  1533. </div>
  1534. <h3>Boards Supported</h3>
  1535. <ul>
  1536. <li>Teensy 4.0
  1537. <li>Teensy 4.1
  1538. </ul>
  1539. <h3>Audio Connections</h3>
  1540. <table class=doc align=center cellpadding=3>
  1541. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1542. <tr class=odd><td align=center>In 0</td><td>Channel #1</td></tr>
  1543. <tr class=odd><td align=center>In 1</td><td>Channel #2</td></tr>
  1544. <tr class=odd><td align=center>In 2</td><td>Channel #3</td></tr>
  1545. <tr class=odd><td align=center>In 3</td><td>Channel #4</td></tr>
  1546. <tr class=odd><td align=center>In 4</td><td>Channel #5</td></tr>
  1547. <tr class=odd><td align=center>In 5</td><td>Channel #6</td></tr>
  1548. <tr class=odd><td align=center>In 6</td><td>Channel #7</td></tr>
  1549. <tr class=odd><td align=center>In 7</td><td>Channel #8</td></tr>
  1550. </table>
  1551. <h3>Functions</h3>
  1552. <p>This object has no functions to call from the Arduino sketch. It
  1553. simply streams data from its 8 input ports to the I2S hardware.</p>
  1554. <h3>Hardware</h3>
  1555. <p>The I2S signals are used in "master" mode, where Teensy creates
  1556. all 3 clock signals and controls all data timing.</p>
  1557. <table class=doc align=center cellpadding=3>
  1558. <tr class=top><th>Teensy<br>4.x Pin</th><th>Signal</th><th>Direction</th></tr>
  1559. <tr class=odd><td align=center>21</td><td>BCLK</td><td>Output</td></tr>
  1560. <tr class=odd><td align=center>23</td><td>MCLK</td><td>Output</td></tr>
  1561. <tr class=odd><td align=center>7</td><td>TX (ch 1+2)</td><td>Output</td></tr>
  1562. <tr class=odd><td align=center>32</td><td>TX (ch 3+4)</td><td>Output</td></tr>
  1563. <tr class=odd><td align=center>9</td><td>TX (ch 5+6)</td><td>Output</td></tr>
  1564. <tr class=odd><td align=center>6</td><td>TX (ch 7+8)</td><td>Output</td></tr>
  1565. <tr class=odd><td align=center>20</td><td>LRCLK</td><td>Output</td></tr>
  1566. </table>
  1567. <h3>Examples</h3>
  1568. <h3>Notes</h3>
  1569. <p>Teensy 4.0 &amp; 4.1's I2S port has a total of 5 data pins
  1570. which may each transmit or receive stereo digital audio. This
  1571. 8 channel output may be used together with the I2S stereo
  1572. input, but may not be combined with others
  1573. which use the same physical pins.</p>
  1574. </script>
  1575. <script type="text/x-red" data-template-name="AudioOutputI2SOct">
  1576. <div class="form-row">
  1577. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1578. <input type="text" id="node-input-name" placeholder="Name">
  1579. </div>
  1580. </script>
  1581. <script type="text/x-red" data-help-name="AudioOutputI2S2">
  1582. <h3>Summary</h3>
  1583. <div class=tooltipinfo>
  1584. <p>Transmit 16 bit stereo audio to an I2S device, using I2S master mode, on the I2S2 port.</p>
  1585. </div>
  1586. <h3>Boards Supported</h3>
  1587. <ul>
  1588. <li>Teensy 4.0
  1589. <li>Teensy 4.1
  1590. </ul>
  1591. <h3>Audio Connections</h3>
  1592. <table class=doc align=center cellpadding=3>
  1593. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1594. <tr class=odd><td align=center>In 0</td><td>Left Channel</td></tr>
  1595. <tr class=odd><td align=center>In 1</td><td>Right Channel</td></tr>
  1596. </table>
  1597. <h3>Functions</h3>
  1598. <p>This object has no functions to call from the Arduino sketch. It
  1599. simply streams data from its 2 input ports to the I2S hardware.</p>
  1600. <h3>Hardware</h3>
  1601. <p>The I2S signals are used in "master" mode, where Teensy creates
  1602. all 3 clock signals and controls all data timing.</p>
  1603. <table class=doc align=center cellpadding=3>
  1604. <tr class=top><th>T4.x<br>Pin</th><th>Signal</th><th>Direction</th></tr>
  1605. <tr class=odd><td align=center>4</td><td>BCLK</td><td>Output</td></tr>
  1606. <tr class=odd><td align=center>33</td><td>MCLK</td><td>Output</td></tr>
  1607. <tr class=odd><td align=center>2</td><td>TX</td><td>Output</td></tr>
  1608. <tr class=odd><td align=center>3</td><td>LRCLK</td><td>Output</td></tr>
  1609. </table>
  1610. <h3>Examples</h3>
  1611. <h3>Notes</h3>
  1612. </script>
  1613. <script type="text/x-red" data-template-name="AudioOutputI2S2">
  1614. <div class="form-row">
  1615. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1616. <input type="text" id="node-input-name" placeholder="Name">
  1617. </div>
  1618. </script>
  1619. <script type="text/x-red" data-help-name="AudioOutputSPDIF">
  1620. <h3>Summary</h3>
  1621. <div class=tooltipinfo>
  1622. <p>Transmit 16 bit stereo audio as Digital S/PDIF by use of the I2S port.</p>
  1623. <p align=center><img src="img/spdif_proto.jpg"></p>
  1624. </div>
  1625. <h3>Boards Supported</h3>
  1626. <ul>
  1627. <li>Teensy 3.2
  1628. <li>Teensy 3.5
  1629. <li>Teensy 3.6
  1630. <li>Teensy 4.0
  1631. <li>Teensy 4.1
  1632. </ul>
  1633. <h3>Audio Connections</h3>
  1634. <table class=doc align=center cellpadding=3>
  1635. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1636. <tr class=odd><td align=center>In 0</td><td>Left Channel</td></tr>
  1637. <tr class=odd><td align=center>In 1</td><td>Right Channel</td></tr>
  1638. </table>
  1639. <h3>Functions</h3>
  1640. <p>This object has no functions to call from the Arduino sketch. It
  1641. simply streams data from its 2 input ports S/PDIF encoded digital
  1642. audio on pin 22 (Teensy 3.x) or pin 7 (Teensy 4.x).</p>
  1643. <h3>Hardware</h3>
  1644. <p>The S/PDIF output signal can be used to drive an optical TOSLINK
  1645. cable, or a standard (usually orange) RCA jack.</p>
  1646. <table class=doc align=center cellpadding=3>
  1647. <tr class=top><th>Teensy<br>3.x Pin</th><th>Teensy<br>4.x Pin</th><th>Signal</th><th>Direction</th></tr>
  1648. <tr class=odd><td align=center>22</td><td align=center>7</td><td>S/PDIF</td><td>Output</td></tr>
  1649. </table>
  1650. <p>For optical TOSLINK output, this
  1651. <a href="https://www.oshpark.com/shared_projects/KcDBKHta" target="_blank">OSH Park board</a>
  1652. can be used with the inexpensive Everlight PLT133/T6A connector, available
  1653. at Digikey, 1080-1434-ND.
  1654. </p>
  1655. <h3>Examples</h3>
  1656. <p>The AudioOutputSPDIF object can be used in place of the AudioOutputI2S object,
  1657. <p>used in nearly all the examples. The WavFilePlayer shows how to substitute
  1658. output objects for different hardware types.
  1659. </p>
  1660. <p class=exam>File &gt; Examples &gt; Audio &gt; WavFilePlayer
  1661. </p>
  1662. <h3>Credits</h3>
  1663. <p><a href="https://github.com/FrankBoesing" target="_blank">Frank Boesing</a>
  1664. developed the AudioOutputSPDIF code. The original
  1665. <a href="https://forum.pjrc.com/threads/28639-S-pdif" target="_blank">forum disussion</a>
  1666. included valuable input and code from "kpc".
  1667. <h3>Notes</h3>
  1668. <p>S/PDIF output uses the I2S hardware. This object can not be used
  1669. together with any of the I2S objects, because it requires the I2S
  1670. hardware with different internal settings.</p>
  1671. </p>
  1672. </script>
  1673. <script type="text/x-red" data-template-name="AudioOutputSPDIF">
  1674. <div class="form-row">
  1675. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1676. <input type="text" id="node-input-name" placeholder="Name">
  1677. </div>
  1678. </script>
  1679. <script type="text/x-red" data-help-name="AudioOutputSPDIF2">
  1680. <h3>Summary</h3>
  1681. <div class=tooltipinfo>
  1682. <p>Transmit 16 bit stereo audio as Digital S/PDIF by use of the I2S2 port.</p>
  1683. </div>
  1684. <h3>Boards Supported</h3>
  1685. <ul>
  1686. <li>Teensy 4.0
  1687. <li>Teensy 4.1
  1688. </ul>
  1689. <h3>Audio Connections</h3>
  1690. <table class=doc align=center cellpadding=3>
  1691. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1692. <tr class=odd><td align=center>In 0</td><td>Left Channel</td></tr>
  1693. <tr class=odd><td align=center>In 1</td><td>Right Channel</td></tr>
  1694. </table>
  1695. <h3>Functions</h3>
  1696. <p>This object has no functions to call from the Arduino sketch. It
  1697. simply streams data from its 2 input ports S/PDIF encoded digital
  1698. audio on pin 2 (Teensy 4.x).</p>
  1699. <h3>Hardware</h3>
  1700. <p>The S/PDIF output signal can be used to drive an optical TOSLINK
  1701. cable, or a standard (usually orange) RCA jack.</p>
  1702. <table class=doc align=center cellpadding=3>
  1703. <tr class=top><th>Teensy<br>4.x Pin</th><th>Signal</th><th>Direction</th></tr>
  1704. <tr class=odd><td align=center>2</td><td>S/PDIF</td><td>Output</td></tr>
  1705. </table>
  1706. <h3>Examples</h3>
  1707. <p>The AudioOutputSPDIF object can be used in place of the AudioOutputI2S object,
  1708. <p>used in nearly all the examples. The WavFilePlayer shows how to substitute
  1709. output objects for different hardware types.
  1710. </p>
  1711. <p class=exam>File &gt; Examples &gt; Audio &gt; WavFilePlayer
  1712. </p>
  1713. <h3>Credits</h3>
  1714. <p><a href="https://github.com/FrankBoesing" target="_blank">Frank Boesing</a>
  1715. developed the AudioOutputSPDIF code. The original
  1716. <a href="https://forum.pjrc.com/threads/28639-S-pdif" target="_blank">forum disussion</a>
  1717. included valuable input and code from "kpc".
  1718. <h3>Notes</h3>
  1719. <p>S/PDIF output uses the I2S2 hardware. This object can not be used
  1720. together with any of the I2S2 objects, because it requires the I2S2
  1721. hardware with different internal settings.</p>
  1722. </p>
  1723. </script>
  1724. <script type="text/x-red" data-template-name="AudioOutputSPDIF2">
  1725. <div class="form-row">
  1726. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1727. <input type="text" id="node-input-name" placeholder="Name">
  1728. </div>
  1729. </script>
  1730. <script type="text/x-red" data-help-name="AudioOutputSPDIF3">
  1731. <h3>Summary</h3>
  1732. <div class=tooltipinfo>
  1733. <p>Transmit 16 bit stereo audio as Digital S/PDIF by use of the native S/PDIF port.</p>
  1734. </div>
  1735. <h3>Boards Supported</h3>
  1736. <ul>
  1737. <li>Teensy 4.0
  1738. <li>Teensy 4.1
  1739. </ul>
  1740. <h3>Audio Connections</h3>
  1741. <table class=doc align=center cellpadding=3>
  1742. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1743. <tr class=odd><td align=center>In 0</td><td>Left Channel</td></tr>
  1744. <tr class=odd><td align=center>In 1</td><td>Right Channel</td></tr>
  1745. </table>
  1746. <h3>Functions</h3>
  1747. <p>This object has no functions to call from the Arduino sketch. It
  1748. simply streams data from its 2 input ports S/PDIF encoded digital
  1749. audio on pin 14 (Teensy 4.x).</p>
  1750. <h3>Hardware</h3>
  1751. <p>The S/PDIF output signal can be used to drive an optical TOSLINK
  1752. cable, or a standard (usually orange) RCA jack.</p>
  1753. <table class=doc align=center cellpadding=3>
  1754. <tr class=top><th>Teensy<br>4.x Pin</th><th>Signal</th><th>Direction</th></tr>
  1755. <tr class=odd><td align=center>14</td><td>S/PDIF</td><td>Output</td></tr>
  1756. </table>
  1757. <h3>Examples</h3>
  1758. <p>The AudioOutputSPDIF object can be used in place of the AudioOutputI2S object,
  1759. <p>used in nearly all the examples. The WavFilePlayer shows how to substitute
  1760. output objects for different hardware types.
  1761. </p>
  1762. <p class=exam>File &gt; Examples &gt; Audio &gt; WavFilePlayer
  1763. </p>
  1764. <h3>Credits</h3>
  1765. <p><a href="https://github.com/FrankBoesing" target="_blank">Frank Boesing</a>
  1766. developed the AudioOutputSPDIF3 code.
  1767. <h3>Notes</h3>
  1768. <p>Native S/PDIF hardware is used, which is more efficient that use of I2S ports.</p>
  1769. </p>
  1770. </script>
  1771. <script type="text/x-red" data-template-name="AudioOutputSPDIF3">
  1772. <div class="form-row">
  1773. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1774. <input type="text" id="node-input-name" placeholder="Name">
  1775. </div>
  1776. </script>
  1777. <script type="text/x-red" data-help-name="AudioOutputPT8211">
  1778. <h3>Summary</h3>
  1779. <div class=tooltipinfo>
  1780. <p>Transmit 16 bit stereo audio to a low-cost PT8211 DAC chip. 4X oversampling
  1781. and filtering are automatically used to improve output quality.</p>
  1782. <p align=center><img src="img/pt8211.jpg"></p>
  1783. </div>
  1784. <h3>Boards Supported</h3>
  1785. <ul>
  1786. <li>Teensy 3.2
  1787. <li>Teensy 3.5
  1788. <li>Teensy 3.6
  1789. <li>Teensy 4.0
  1790. <li>Teensy 4.1
  1791. </ul>
  1792. <h3>Audio Connections</h3>
  1793. <table class=doc align=center cellpadding=3>
  1794. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1795. <tr class=odd><td align=center>In 0</td><td>Left Channel</td></tr>
  1796. <tr class=odd><td align=center>In 1</td><td>Right Channel</td></tr>
  1797. </table>
  1798. <h3>Functions</h3>
  1799. <p>This object has no functions to call from the Arduino sketch. It
  1800. simply streams data from its 2 input ports to a PT8211 chip. 4X
  1801. oversampling and filtering is automatically used to improve quality.</p>
  1802. <h3>Hardware</h3>
  1803. <table class=doc align=center cellpadding=3>
  1804. <tr class=top><th>Teensy<br>3.x Pin</th><th>Teensy<br>4.x Pin</th><th>Signal</th><th>Direction</th></tr>
  1805. <tr class=odd><td align=center>9</td><td align=center>21</td><td>BCK</td><td>Output</td></tr>
  1806. <tr class=odd><td align=center>22</td><td align=center>7</td><td>DIN</td><td>Output</td></tr>
  1807. <tr class=odd><td align=center>23</td><td align=center>20</td><td>FS</td><td>Output</td></tr>
  1808. </table>
  1809. <p>More information can be found in the PT8211 datasheet.
  1810. </p>
  1811. <h3>Examples</h3>
  1812. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; PT8211Sine
  1813. </p>
  1814. <h3>Credits</h3>
  1815. <p>Frank Boesing and Benjamin developed this PT8211 object. Details can be
  1816. found on this
  1817. <a href="https://forum.pjrc.com/threads/29284-Dual-channel-16bit-dac-PT8211/page3" target="_blank">forum disussion</a>.
  1818. <h3>Notes</h3>
  1819. <p>
  1820. </p>
  1821. </script>
  1822. <script type="text/x-red" data-template-name="AudioOutputPT8211">
  1823. <div class="form-row">
  1824. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1825. <input type="text" id="node-input-name" placeholder="Name">
  1826. </div>
  1827. </script>
  1828. <script type="text/x-red" data-help-name="AudioOutputPT8211_2">
  1829. <h3>Summary</h3>
  1830. <div class=tooltipinfo>
  1831. <p>Transmit 16 bit stereo audio to a low-cost PT8211 DAC chip, using the I2S2 port. 4X oversampling
  1832. and filtering are automatically used to improve output quality.</p>
  1833. </div>
  1834. <h3>Boards Supported</h3>
  1835. <ul>
  1836. <li>Teensy 4.0
  1837. <li>Teensy 4.1
  1838. </ul>
  1839. <h3>Audio Connections</h3>
  1840. <table class=doc align=center cellpadding=3>
  1841. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1842. <tr class=odd><td align=center>In 0</td><td>Left Channel</td></tr>
  1843. <tr class=odd><td align=center>In 1</td><td>Right Channel</td></tr>
  1844. </table>
  1845. <h3>Functions</h3>
  1846. <p>This object has no functions to call from the Arduino sketch. It
  1847. simply streams data from its 2 input ports to a PT8211 chip. 4X
  1848. oversampling and filtering is automatically used to improve quality.</p>
  1849. <h3>Hardware</h3>
  1850. <table class=doc align=center cellpadding=3>
  1851. <tr class=top><th>Teensy<br>4.x Pin</th><th>Signal</th><th>Direction</th></tr>
  1852. <tr class=odd><td align=center>4</td><td>BCK</td><td>Output</td></tr>
  1853. <tr class=odd><td align=center>2</td><td>DIN</td><td>Output</td></tr>
  1854. <tr class=odd><td align=center>3</td><td>FS</td><td>Output</td></tr>
  1855. </table>
  1856. <p>More information can be found in the PT8211 datasheet.
  1857. </p>
  1858. <h3>Examples</h3>
  1859. <h3>Credits</h3>
  1860. <p>Frank Boesing and Benjamin developed this PT8211 object. Details can be
  1861. found on this
  1862. <a href="https://forum.pjrc.com/threads/29284-Dual-channel-16bit-dac-PT8211/page3" target="_blank">forum disussion</a>.
  1863. <h3>Notes</h3>
  1864. <p>
  1865. </p>
  1866. </script>
  1867. <script type="text/x-red" data-template-name="AudioOutputPT8211_2">
  1868. <div class="form-row">
  1869. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1870. <input type="text" id="node-input-name" placeholder="Name">
  1871. </div>
  1872. </script>
  1873. <script type="text/x-red" data-help-name="AudioOutputAnalog">
  1874. <h3>Summary</h3>
  1875. <div class=tooltipinfo>
  1876. <p>Transmit 12 bit audio using Teensy's built-in digital to analog converter.</p>
  1877. <p align=center><img src="img/dac_speaker.jpg"><br>
  1878. <small><a href="http://www.pjrc.com/store/prop_shield.html" target="_blank_">Prop Shield with 4&ohm; Speaker</a></small></p>
  1879. </div>
  1880. <h3>Boards Supported</h3>
  1881. <ul>
  1882. <li>Teensy 3.2
  1883. <li>Teensy 3.5
  1884. <li>Teensy 3.6
  1885. </ul>
  1886. <h3>Audio Connections</h3>
  1887. <table class=doc align=center cellpadding=3>
  1888. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1889. <tr class=odd><td align=center>In 0</td><td>Audio Channel</td></tr>
  1890. </table>
  1891. <h3>Functions</h3>
  1892. <p class=func><span class=keyword>analogReference</span>(ref);</p>
  1893. <p class=desc>Configure output voltage range:<br>
  1894. <span class=literal>INTERNAL</span> selects 1.2 volt peak-to-peak output.<br>
  1895. <span class=literal>EXTERNAL</span> selects 3.3 volt peak-to-peak output.
  1896. </p>
  1897. <h3>Hardware</h3>
  1898. <p align=center><img src="img/dacpin.jpg"></p>
  1899. <p>Signal range default is 0 to 1.2V</p>
  1900. <p>The output voltage has DC level. Some applications require a DC-blocking capacitor. If unsure, a 10&micro;F is usually a safe value to use. If an aluminum or tantalum capacitor is used, the positive terminal should connect to Teensy's DAC pin.</p>
  1901. <p>The DAC pin is used with the
  1902. <a href="http://www.pjrc.com/store/prop_shield.html" target="_blank_">Prop Shield</a>
  1903. to drive speakers.</p>
  1904. <h3>Examples</h3>
  1905. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; PassThroughMono
  1906. </p>
  1907. <p class=exam>File &gt; Examples &gt; Audio &gt; SamplePlayer
  1908. </p>
  1909. <p class=exam><a href="https://github.com/PaulStoffregen/TouchGuitar" target="_blank">TouchGuitar</a>
  1910. </p>
  1911. <p class=exam><a href="https://community.arm.com/groups/embedded/blog/2014/05/23/led-video-panel-at-maker-faire-2014" target="_blank">LED Video Board</a>
  1912. </p>
  1913. <p class=exam>File &gt; Examples &gt; OctoWS2811 &gt; VideoSDcard
  1914. </p>
  1915. <p class=exam>File &gt; Examples &gt; SerialFlash &gt; MP3Player
  1916. </p>
  1917. <h3>Notes</h3>
  1918. <p>The output rate is 44.1 kHz (no oversampling). Ultrasonic noise present if
  1919. not filtered. This may not
  1920. be an issue for many uses, but care should be used if amplified and driven
  1921. to high power tweeters.</p>
  1922. <p>When using 3.3V output, the power supply is used for the analog reference. Noise
  1923. present on the 3.3V power can couple to the DAC output signal.
  1924. </p>
  1925. </script>
  1926. <script type="text/x-red" data-template-name="AudioOutputAnalog">
  1927. <div class="form-row">
  1928. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1929. <input type="text" id="node-input-name" placeholder="Name">
  1930. </div>
  1931. </script>
  1932. <script type="text/x-red" data-help-name="AudioOutputAnalogStereo">
  1933. <h3>Summary</h3>
  1934. <div class=tooltipinfo>
  1935. <p>Transmit 12 bit stereo audio using Teensy 3.5 or 3.6 built-in digital to analog converters.</p>
  1936. <!--<p align=center><img src="img/dac_speaker.jpg"><br>
  1937. <small><a href="http://www.pjrc.com/store/prop_shield.html" target="_blank_">Prop Shield with 4&ohm; Speaker</a></small></p>-->
  1938. </div>
  1939. <h3>Boards Supported</h3>
  1940. <ul>
  1941. <li>Teensy 3.5
  1942. <li>Teensy 3.6
  1943. </ul>
  1944. <h3>Audio Connections</h3>
  1945. <table class=doc align=center cellpadding=3>
  1946. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1947. <tr class=odd><td align=center>In 0</td><td>Audio Channel (Left)</td></tr>
  1948. <tr class=odd><td align=center>In 1</td><td>Audio Channel (Right)</td></tr>
  1949. </table>
  1950. <h3>Functions</h3>
  1951. <p class=func><span class=keyword>analogReference</span>(ref);</p>
  1952. <p class=desc>Configure output voltage range:<br>
  1953. <span class=literal>INTERNAL</span> selects 1.2 volt peak-to-peak output.<br>
  1954. <span class=literal>EXTERNAL</span> selects 3.3 volt peak-to-peak output.
  1955. </p>
  1956. <h3>Hardware</h3>
  1957. <p align=center><img src="img/dacpins.png"></p>
  1958. <p>Signal range default is 0 to 1.2V</p>
  1959. <p>The output voltage has DC level. Some applications require a DC-blocking capacitor. If unsure, a 10&micro;F is usually a safe value to use. If an aluminum or tantalum capacitor is used, the positive terminal should connect to Teensy's DAC pin.</p>
  1960. <p>The DAC pin is used with the
  1961. <a href="http://www.pjrc.com/store/prop_shield.html" target="_blank_">Prop Shield</a>
  1962. to drive speakers.</p>
  1963. <h3>Examples</h3>
  1964. <!--<p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; PassThroughMono
  1965. </p>
  1966. <p class=exam>File &gt; Examples &gt; SerialFlash &gt; MP3Player
  1967. </p>-->
  1968. <h3>Notes</h3>
  1969. <p>The output rate is 44.1 kHz (no oversampling). Ultrasonic noise present if
  1970. not filtered. This may not
  1971. be an issue for many uses, but care should be used if amplified and driven
  1972. to high power tweeters.</p>
  1973. <p>When using 3.3V output, the power supply is used for the analog reference. Noise
  1974. present on the 3.3V power can couple to the DAC output signal.
  1975. </p>
  1976. </script>
  1977. <script type="text/x-red" data-template-name="AudioOutputAnalogStereo">
  1978. <div class="form-row">
  1979. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1980. <input type="text" id="node-input-name" placeholder="Name">
  1981. </div>
  1982. </script>
  1983. <script type="text/x-red" data-help-name="AudioOutputPWM">
  1984. <h3>Summary</h3>
  1985. <div class=tooltipinfo>
  1986. <p>Transmit audio using Teensy 3's PWM pins. Two pins are
  1987. used for coarse and fine pulses, to be combined by scaled
  1988. resistors.</p>
  1989. </div>
  1990. <h3>Boards Supported</h3>
  1991. <ul>
  1992. <li>Teensy 3.2
  1993. <li>Teensy 3.5
  1994. <li>Teensy 3.6
  1995. <!--<li>Teensy 4.0
  1996. <li>Teensy 4.1-->
  1997. </ul>
  1998. <h3>Audio Connections</h3>
  1999. <table class=doc align=center cellpadding=3>
  2000. <tr class=top><th>Port</th><th>Purpose</th></tr>
  2001. <tr class=odd><td align=center>In 0</td><td>Audio Channel</td></tr>
  2002. </table>
  2003. <h3>Functions</h3>
  2004. <p>This object has no functions to call from the Arduino sketch. It
  2005. simply streams data from the its input port to the PWM pins.</p>
  2006. <h3>Hardware</h3>
  2007. <p>The following circuit is recommended.</p>
  2008. <p align=center><img src="img/pwmdualcircuit.jpg"></p>
  2009. <p>Signal range is approx 1.55 Vp-p.</p>
  2010. <p>These resistor values assume approx 20 ohms output impedance
  2011. on the digital pins. The 127K resistor may be adjusted or
  2012. trimmed for variation in output drive and tolerance on the
  2013. 475 ohm resistor.</p>
  2014. <p>A plastic film (Polypropylene, Polyethylene, Polyester, etc) or
  2015. C0G/NPO ceramic capacitor should be used for filtering. Low
  2016. quality ceramic (X7R, Y5V, Z5U, etc) can cause signal distortion.</p>
  2017. <h3>Examples</h3>
  2018. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; PassThroughMono
  2019. </p>
  2020. <h3>Notes</h3>
  2021. <p>This object only works properly when Tools &gt; CPU_Speed is set to
  2022. 48 or 96 MHz. Other speeds aren't supported and will likely fail
  2023. in strange ways.</p>
  2024. <p>The PWM carrier frequency is 88.2 kHz. The suggested circuit
  2025. will only slightly filter the carrier. Extra filtering will be
  2026. required for a clean signal without the ultrasonic PWM carrier.
  2027. </p>
  2028. <p>Analog signals created by filtering PWM waveforms use the digital
  2029. power supply as their reference voltage. Any noise on the digital
  2030. power line can directly couple to the output signal. The built-in DAC or
  2031. <a href="http://www.pjrc.com/store/teensy3_audio.html" target="_blank">audio shield</a>
  2032. should be used when higher quality signals are needed.</p>
  2033. </script>
  2034. <script type="text/x-red" data-template-name="AudioOutputPWM">
  2035. <div class="form-row">
  2036. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  2037. <input type="text" id="node-input-name" placeholder="Name">
  2038. </div>
  2039. </script>
  2040. <script type="text/x-red" data-help-name="AudioOutputMQS">
  2041. <h3>Summary</h3>
  2042. <div class=tooltipinfo>
  2043. <p>Transmit 16 bit stereo audio using Medium Quality Sound pulses, usually better than PWM,
  2044. but not as good as a proper DAC or the audio shield.</p>
  2045. </div>
  2046. <h3>Boards Supported</h3>
  2047. <ul>
  2048. <li>Teensy 4.0
  2049. <li>Teensy 4.1
  2050. </ul>
  2051. <h3>Audio Connections</h3>
  2052. <table class=doc align=center cellpadding=3>
  2053. <tr class=top><th>Port</th><th>Purpose</th></tr>
  2054. <tr class=odd><td align=center>In 0</td><td>Left Channel</td></tr>
  2055. <tr class=odd><td align=center>In 1</td><td>Right Channel</td></tr>
  2056. </table>
  2057. <h3>Functions</h3>
  2058. <p>This object has no functions to call from the Arduino sketch. It
  2059. simply streams data from its 2 input ports to generate output pulses.</p>
  2060. <h3>Hardware</h3>
  2061. <table class=doc align=center cellpadding=3>
  2062. <tr class=top><th>T4.x<br>Pin</th><th>Signal</th><th>Direction</th></tr>
  2063. <tr class=odd><td align=center>12</td><td>Left</td><td>Output</td></tr>
  2064. <tr class=odd><td align=center>10</td><td>Right</td><td>Output</td></tr>
  2065. </table>
  2066. <h3>Examples</h3>
  2067. <h3>Notes</h3>
  2068. <p>TODO: can this really be used together with other inputs and outputs?</p>
  2069. </script>
  2070. <script type="text/x-red" data-template-name="AudioOutputMQS">
  2071. <div class="form-row">
  2072. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  2073. <input type="text" id="node-input-name" placeholder="Name">
  2074. </div>
  2075. </script>
  2076. <script type="text/x-red" data-help-name="AudioOutputI2Sslave">
  2077. <h3>Summary</h3>
  2078. <div class=tooltipinfo>
  2079. <p>Transmit 16 bit stereo audio to an I2S device using I2S slave mode
  2080. (where the DAC or codec chip, not Teensy, controls audio timing).</p>
  2081. <p><span style="color:red">This input is incompatible with most other inputs and outputs</span>
  2082. which run at a speed controlled by Teensy's internal sample rate.</p>
  2083. </div>
  2084. <h3>Boards Supported</h3>
  2085. <ul>
  2086. <li>Teensy 3.2
  2087. <li>Teensy 3.5
  2088. <li>Teensy 3.6
  2089. <li>Teensy 4.0
  2090. <li>Teensy 4.1
  2091. </ul>
  2092. <h3>Audio Connections</h3>
  2093. <table class=doc align=center cellpadding=3>
  2094. <tr class=top><th>Port</th><th>Purpose</th></tr>
  2095. <tr class=odd><td align=center>In 0</td><td>Left Channel</td></tr>
  2096. <tr class=odd><td align=center>In 1</td><td>Right Channel</td></tr>
  2097. </table>
  2098. <h3>Functions</h3>
  2099. <p>This object has no functions to call from the Arduino sketch. It
  2100. simply streams data from its 2 input ports to the I2S hardware.</p>
  2101. <h3>Hardware</h3>
  2102. <p>The I2S signals are used in "slave" mode, where the I2S device controls
  2103. data timing.</p>
  2104. <table class=doc align=center cellpadding=3>
  2105. <tr class=top><th>Teensy<br>3.x Pin</th><th>Teensy<br>4.x Pin</th><th>Signal</th><th>Direction</th></tr>
  2106. <tr class=odd><td align=center>9</td><td align=center>21</td><td>BCLK</td><td>Input</td></tr>
  2107. <tr class=odd><td align=center>22</td><td align=center>7</td><td>TX</td><td>Output</td></tr>
  2108. <tr class=odd><td align=center>23</td><td align=center>20</td><td>LRCLK</td><td>Input</td></tr>
  2109. </table>
  2110. <h3>Examples</h3>
  2111. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; WM8731MikroSine
  2112. </p>
  2113. <h3>Notes</h3>
  2114. <p>Slave mode I2S <b>should not used in the same project as ADC, DAC and
  2115. PWM</b> signals. Differences in timing between the I2S device and
  2116. Teensy's clock can cause occasional audio glitches when I2S slave mode
  2117. is used together with other input or output objects based on Teensy's
  2118. timing.</p>
  2119. <p>Only one I2S input and one I2S output object may be used. Master
  2120. and slave modes may not be mixed (both must be of the same type).
  2121. </p>
  2122. </script>
  2123. <script type="text/x-red" data-template-name="AudioOutputI2Sslave">
  2124. <div class="form-row">
  2125. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  2126. <input type="text" id="node-input-name" placeholder="Name">
  2127. </div>
  2128. </script>
  2129. <script type="text/x-red" data-help-name="AudioOutputTDM">
  2130. <h3>Summary</h3>
  2131. <div class=tooltipinfo>
  2132. <p>Transmit a 256 bit Time Division Multiplexed frame containing
  2133. many audio channels.</p>
  2134. <p align=center><img src="img/tdm.jpg"></p>
  2135. </div>
  2136. <h3>Boards Supported</h3>
  2137. <ul>
  2138. <li>Teensy 3.2
  2139. <li>Teensy 3.5
  2140. <li>Teensy 3.6
  2141. <li>Teensy 4.0
  2142. <li>Teensy 4.1
  2143. </ul>
  2144. <h3>Audio Connections</h3>
  2145. <table class=doc align=center cellpadding=3>
  2146. <tr class=top><th>Port</th><th>Purpose</th></tr>
  2147. <tr class=odd><td align=center>In 0</td><td>Bits 0 to 15</td></tr>
  2148. <tr class=odd><td align=center>In 1</td><td>Bits 16 to 31</td></tr>
  2149. <tr class=odd><td align=center>In 2</td><td>Bits 32 to 47</td></tr>
  2150. <tr class=odd><td align=center>In 3</td><td>Bits 48 to 63</td></tr>
  2151. <tr class=odd><td align=center>In 4</td><td>Bits 64 to 79</td></tr>
  2152. <tr class=odd><td align=center>In 5</td><td>Bits 80 to 95</td></tr>
  2153. <tr class=odd><td align=center>In 6</td><td>Bits 96 to 111</td></tr>
  2154. <tr class=odd><td align=center>In 7</td><td>Bits 112 to 127</td></tr>
  2155. <tr class=odd><td align=center>In 8</td><td>Bits 128 to 143</td></tr>
  2156. <tr class=odd><td align=center>In 9</td><td>Bits 144 to 159</td></tr>
  2157. <tr class=odd><td align=center>In 10</td><td>Bits 160 to 175</td></tr>
  2158. <tr class=odd><td align=center>In 11</td><td>Bits 176 to 191</td></tr>
  2159. <tr class=odd><td align=center>In 12</td><td>Bits 192 to 207</td></tr>
  2160. <tr class=odd><td align=center>In 13</td><td>Bits 208 to 223</td></tr>
  2161. <tr class=odd><td align=center>In 14</td><td>Bits 224 to 239</td></tr>
  2162. <tr class=odd><td align=center>In 15</td><td>Bits 240 to 255</td></tr>
  2163. </table>
  2164. <h3>Functions</h3>
  2165. <p>This object has no functions to call from the Arduino sketch. It
  2166. simply streams data from its 16 input ports to the TDM hardware.</p>
  2167. <h3>Hardware</h3>
  2168. <p>TDM has been tested with this <a href="https://oshpark.com/shared_projects/2Yj6rFaW">
  2169. CS42448 Circuit Board</a>.
  2170. </p>
  2171. <table class=doc align=center cellpadding=3>
  2172. <tr class=top><th>T3.x<br>Pin</th><th>T4.x<br>Pin</th><th>Signal</th><th>Direction</th></tr>
  2173. <tr class=odd><td align=center>9</td><td align=center>21</td><td>BCLK</td><td>Output, 11.3 MHz</td></tr>
  2174. <tr class=odd><td align=center>11</td><td align=center>23</td><td>MCLK</td><td>Output, 22.6 MHz</td></tr>
  2175. <tr class=odd><td align=center>22</td><td align=center>7</td><td>TX</td><td>Output, 11.3 Mbit/sec</td></tr>
  2176. <tr class=odd><td align=center>23</td><td align=center>20</td><td>WS</td><td>Output</td></tr>
  2177. </table>
  2178. <p>Audio from
  2179. master mode TDM may be used in the same project as ADC, DAC and
  2180. PWM signals, because all remain in sync to Teensy's timing</p>
  2181. <!--<h3>Examples</h3>-->
  2182. <h3>Notes</h3>
  2183. <p>Only one TDM input and one TDM output object may be used. The
  2184. I2S hardware is used by TDM, so TDM objects may not be used
  2185. together with I2S, SPDIF or PT8211.</p>
  2186. <p>When used with TDM devices which receive 32 bit audio, the
  2187. even numbered channels are used for the top 16 bits.</p>
  2188. </script>
  2189. <script type="text/x-red" data-template-name="AudioOutputTDM">
  2190. <div class="form-row">
  2191. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  2192. <input type="text" id="node-input-name" placeholder="Name">
  2193. </div>
  2194. </script>
  2195. <script type="text/x-red" data-help-name="AudioOutputTDM2">
  2196. <h3>Summary</h3>
  2197. <div class=tooltipinfo>
  2198. <p>Transmit a 256 bit Time Division Multiplexed frame containing
  2199. many audio channels, using the I2S2 port.</p>
  2200. </div>
  2201. <h3>Boards Supported</h3>
  2202. <ul>
  2203. <li>Teensy 4.0
  2204. <li>Teensy 4.1
  2205. </ul>
  2206. <h3>Audio Connections</h3>
  2207. <table class=doc align=center cellpadding=3>
  2208. <tr class=top><th>Port</th><th>Purpose</th></tr>
  2209. <tr class=odd><td align=center>In 0</td><td>Bits 0 to 15</td></tr>
  2210. <tr class=odd><td align=center>In 1</td><td>Bits 16 to 31</td></tr>
  2211. <tr class=odd><td align=center>In 2</td><td>Bits 32 to 47</td></tr>
  2212. <tr class=odd><td align=center>In 3</td><td>Bits 48 to 63</td></tr>
  2213. <tr class=odd><td align=center>In 4</td><td>Bits 64 to 79</td></tr>
  2214. <tr class=odd><td align=center>In 5</td><td>Bits 80 to 95</td></tr>
  2215. <tr class=odd><td align=center>In 6</td><td>Bits 96 to 111</td></tr>
  2216. <tr class=odd><td align=center>In 7</td><td>Bits 112 to 127</td></tr>
  2217. <tr class=odd><td align=center>In 8</td><td>Bits 128 to 143</td></tr>
  2218. <tr class=odd><td align=center>In 9</td><td>Bits 144 to 159</td></tr>
  2219. <tr class=odd><td align=center>In 10</td><td>Bits 160 to 175</td></tr>
  2220. <tr class=odd><td align=center>In 11</td><td>Bits 176 to 191</td></tr>
  2221. <tr class=odd><td align=center>In 12</td><td>Bits 192 to 207</td></tr>
  2222. <tr class=odd><td align=center>In 13</td><td>Bits 208 to 223</td></tr>
  2223. <tr class=odd><td align=center>In 14</td><td>Bits 224 to 239</td></tr>
  2224. <tr class=odd><td align=center>In 15</td><td>Bits 240 to 255</td></tr>
  2225. </table>
  2226. <h3>Functions</h3>
  2227. <p>This object has no functions to call from the Arduino sketch. It
  2228. simply streams data from its 16 input ports to the TDM hardware.</p>
  2229. <h3>Hardware</h3>
  2230. <table class=doc align=center cellpadding=3>
  2231. <tr class=top><th>Teensy<br>4.x Pin</th><th>Signal</th><th>Direction</th></tr>
  2232. <tr class=odd><td align=center>4</td><td>BCLK</td><td>Output, 11.3 MHz</td></tr>
  2233. <tr class=odd><td align=center>33</td><td>MCLK</td><td>Output, 22.6 MHz</td></tr>
  2234. <tr class=odd><td align=center>2</td><td>TX</td><td>Output, 11.3 Mbit/sec</td></tr>
  2235. <tr class=odd><td align=center>3</td><td>WS</td><td>Output</td></tr>
  2236. </table>
  2237. <!--<h3>Examples</h3>-->
  2238. <h3>Notes</h3>
  2239. <p>When used with TDM devices which receive 32 bit audio, the
  2240. even numbered channels are used for the top 16 bits.</p>
  2241. </script>
  2242. <script type="text/x-red" data-template-name="AudioOutputTDM2">
  2243. <div class="form-row">
  2244. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  2245. <input type="text" id="node-input-name" placeholder="Name">
  2246. </div>
  2247. </script>
  2248. <script type="text/x-red" data-help-name="AudioOutputADAT">
  2249. <h3>Summary</h3>
  2250. <div class=tooltipinfo>
  2251. <p>Transmit ADAT TOSLINK Optical Output</p>
  2252. <p align=center><img src="img/adat.jpg"></p>
  2253. </div>
  2254. <h3>Boards Supported</h3>
  2255. <ul>
  2256. <li>Teensy 3.2
  2257. <li>Teensy 3.5
  2258. <li>Teensy 3.6
  2259. <!--<li>Teensy 4.0
  2260. <li>Teensy 4.1-->
  2261. </ul>
  2262. <p>ADAT output for Teensy 4.0 is discussed on
  2263. <a href="https://forum.pjrc.com/threads/60914?p=239824&viewfull=1#post239824">this forum thread</a>.</p>
  2264. <h3>Audio Connections</h3>
  2265. <table class=doc align=center cellpadding=3>
  2266. <tr class=top><th>Port</th><th>Purpose</th></tr>
  2267. <tr class=odd><td align=center>In 0</td><td>Channel 1</td></tr>
  2268. <tr class=odd><td align=center>In 1</td><td>Channel 2</td></tr>
  2269. <tr class=odd><td align=center>In 2</td><td>Channel 3</td></tr>
  2270. <tr class=odd><td align=center>In 3</td><td>Channel 4</td></tr>
  2271. <tr class=odd><td align=center>In 4</td><td>Channel 5</td></tr>
  2272. <tr class=odd><td align=center>In 5</td><td>Channel 6</td></tr>
  2273. <tr class=odd><td align=center>In 6</td><td>Channel 7</td></tr>
  2274. <tr class=odd><td align=center>In 7</td><td>Channel 8</td></tr>
  2275. </table>
  2276. <h3>Functions</h3>
  2277. <p>This object has no functions to call from the Arduino sketch. It
  2278. simply streams data from its 8 input ports to the TOSLINK output.</p>
  2279. <h3>Hardware</h3>
  2280. <table class=doc align=center cellpadding=3>
  2281. <tr class=top><th>Pin</th><th>Signal</th><th>Direction</th></tr>
  2282. <tr class=odd><td align=center>22</td><td>TX</td><td>TOSLINK Signal</td></tr>
  2283. </table>
  2284. <p>For optical TOSLINK output, this
  2285. <a href="https://www.oshpark.com/shared_projects/KcDBKHta" target="_blank">OSH Park board</a>
  2286. can be used with the inexpensive Everlight PLT133/T6A connector, available
  2287. at Digikey, 1080-1434-ND.
  2288. </p>
  2289. <h3>Examples</h3>
  2290. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; ADAT_DrumSamplePlayer
  2291. </p>
  2292. <h3>Notes</h3>
  2293. <p>ADAT output was contributed by Ernstjan Freriks. See <a href="https://forum.pjrc.com/threads/28639-S-pdif?p=159530&viewfull=1#post159530">this forum thread</a> for details.</p>
  2294. <p>A <a href="https://www.youtube.com/watch?v=e5ov3q02zxo">Youtube video</a>
  2295. also demonstrates how it works.</p>
  2296. </script>
  2297. <script type="text/x-red" data-template-name="AudioOutputADAT">
  2298. <div class="form-row">
  2299. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  2300. <input type="text" id="node-input-name" placeholder="Name">
  2301. </div>
  2302. </script>
  2303. <script type="text/x-red" data-help-name="AudioOutputUSB">
  2304. <h3>Summary</h3>
  2305. <div class=tooltipinfo>
  2306. <p>Send stereo audio to a PC or Mac. Teensy appears as a USB
  2307. sound device.</p>
  2308. <p align=center><img src="img/usbtype_audio_out.png"></p>
  2309. </div>
  2310. <h3>Boards Supported</h3>
  2311. <ul>
  2312. <li>Teensy 3.2
  2313. <li>Teensy 3.5
  2314. <li>Teensy 3.6
  2315. <li>Teensy 4.0
  2316. <li>Teensy 4.1
  2317. </ul>
  2318. <h3>Audio Connections</h3>
  2319. <table class=doc align=center cellpadding=3>
  2320. <tr class=top><th>Port</th><th>Purpose</th></tr>
  2321. <tr class=odd><td align=center>In 0</td><td>Left Channel</td></tr>
  2322. <tr class=odd><td align=center>In 1</td><td>Right Channel</td></tr>
  2323. </table>
  2324. <h3>Functions</h3>
  2325. <p>This object has no functions to call from the Arduino sketch. It
  2326. simply streams from it's 2 input ports to the USB.</p>
  2327. <!--
  2328. <h3>Hardware</h3>
  2329. -->
  2330. <h3>Examples</h3>
  2331. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; WavFilePlayerUSB</p>
  2332. </p>
  2333. <h3>Notes</h3>
  2334. <p>Arduino's <b>Tools &gt; USB Type</b> menu must be set to <b>Audio</b>.
  2335. </p>
  2336. <p align=center><img src="img/usbtype_audio.png"></p>
  2337. <p>USB input &amp; output does not cause the Teensy Audio Library to
  2338. update. At least one non-USB input or output object must be
  2339. present for the entire library to update properly.</p>
  2340. <p>A known problem exists with USB audio from Macintosh computers.
  2341. An imperfect <a href="https://forum.pjrc.com/threads/34855-Distorted-audio-when-using-USB-input-on-Teensy-3-1?p=110392&viewfull=1#post110392">workaround
  2342. can be enabled by editing usb_audio.cpp</a>.
  2343. Find and uncomment "#define MACOSX_ADAPTIVE_LIMIT".</p>
  2344. </script>
  2345. <script type="text/x-red" data-template-name="AudioOutputUSB">
  2346. <div class="form-row">
  2347. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  2348. <input type="text" id="node-input-name" placeholder="Name">
  2349. </div>
  2350. </script>
  2351. <script type="text/x-red" data-help-name="AudioAmplifier">
  2352. <h3>Summary</h3>
  2353. <div class=tooltipinfo>
  2354. <p>Amplify or attenuate a signal, or switch it on/off.
  2355. </p>
  2356. <p align=center><img src="img/ampschematics.png"></p>
  2357. </div>
  2358. <h3>Audio Connections</h3>
  2359. <table class=doc align=center cellpadding=3>
  2360. <tr class=top><th>Port</th><th>Purpose</th></tr>
  2361. <tr class=odd><td align=center>In 0</td><td>Input signal</td></tr>
  2362. <tr class=odd><td align=center>Out 0</td><td>Amplified/Attn. Output</td></tr>
  2363. </table>
  2364. <h3>Functions</h3>
  2365. <p class=func><span class=keyword>gain</span>(level);</p>
  2366. <p class=desc>Adjust the amplification or attenuation.
  2367. "level" may be any floating point number from 0 to 32767.0.
  2368. 1.0 passes the signal through directly. Level of 0 shuts the channel
  2369. off completely. Between 0 to 1.0 attenuates the signal, and above
  2370. 1.0 amplifies it. Negative numbers may also be used, to invert the
  2371. signal.
  2372. </p>
  2373. <!--<h3>Examples</h3>
  2374. <p class=exam>File &gt; Examples &gt; Audio &gt; SamplePlayer
  2375. </p>-->
  2376. <h3>Notes</h3>
  2377. <p>Gain of 0 and 1.0 are handled efficiently as special cases. Zero
  2378. discards data without processing. 1.0 passes data directly, with
  2379. minimal overhead</p>
  2380. <p>Signal clipping can occur when any channel has gain greater than 1.0</p>
  2381. </script>
  2382. <script type="text/x-red" data-template-name="AudioAmplifier">
  2383. <div class="form-row">
  2384. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  2385. <input type="text" id="node-input-name" placeholder="Name">
  2386. </div>
  2387. </script>
  2388. <script type="text/x-red" data-help-name="AudioMixer4">
  2389. <h3>Summary</h3>
  2390. <div class=tooltipinfo>
  2391. <p>Combine up to 4 audio signals together, each with adjustable gain.
  2392. All channels support signal attenuation or amplification.</p>
  2393. </div>
  2394. <h3>Audio Connections</h3>
  2395. <table class=doc align=center cellpadding=3>
  2396. <tr class=top><th>Port</th><th>Purpose</th></tr>
  2397. <tr class=odd><td align=center>In 0</td><td>Input signal #1</td></tr>
  2398. <tr class=odd><td align=center>In 1</td><td>Input signal #2</td></tr>
  2399. <tr class=odd><td align=center>In 2</td><td>Input signal #3</td></tr>
  2400. <tr class=odd><td align=center>In 3</td><td>Input signal #4</td></tr>
  2401. <tr class=odd><td align=center>Out 0</td><td>Sum of all inputs</td></tr>
  2402. </table>
  2403. <h3>Functions</h3>
  2404. <p class=func><span class=keyword>gain</span>(channel, level);</p>
  2405. <p class=desc>Adjust the amplification or attenuation. "channel" must
  2406. be 0 to 3. "level" may be any floating point number from 0 to 32767.0.
  2407. 1.0 passes the signal through directly. Level of 0 shuts the channel
  2408. off completely. Between 0 to 1.0 attenuates the signal, and above
  2409. 1.0 amplifies it. Negative numbers may also be used, to invert the
  2410. signal. All 4 channels have separate gain settings.
  2411. </p>
  2412. <h3>Examples</h3>
  2413. <p class=exam>File &gt; Examples &gt; Audio &gt; SamplePlayer
  2414. </p>
  2415. <p class=exam>File &gt; Examples &gt; Audio &gt; Synthesis &gt; PlaySynthMusic
  2416. </p>
  2417. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; SpectrumAnalyzerBasic
  2418. </p>
  2419. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; DialTone_Serial
  2420. </p>
  2421. <p class=exam>File &gt; Examples &gt; Audio &gt; MemoryAndCpuUsage
  2422. </p>
  2423. <h3>Notes</h3>
  2424. <p>Signal clipping can occur when any channel has gain greater than 1.0,
  2425. or when multiple signals add together to greater than 1.0.</p>
  2426. <p>More than 4 channels may be combined by connecting multiple mixers
  2427. in tandem. For example, a 16 channel mixer may be built using 5
  2428. mixers, where the fifth mixer combines the outputs of the first 4.
  2429. </p>
  2430. </script>
  2431. <script type="text/x-red" data-template-name="AudioMixer4">
  2432. <div class="form-row">
  2433. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  2434. <input type="text" id="node-input-name" placeholder="Name">
  2435. </div>
  2436. </script>
  2437. <script type="text/x-red" data-help-name="AudioPlayMemory">
  2438. <h3>Summary</h3>
  2439. <div class=tooltipinfo>
  2440. <p>Play a short sound clip, stored directly in memory.
  2441. Data files are created with the
  2442. <a href="https://github.com/PaulStoffregen/Audio/tree/master/extras/wav2sketch" target="_blank">wav2sketch program</a>,
  2443. and copied to the sketch folder to become part of your sketch.</p>
  2444. </div>
  2445. <h3>Audio Connections</h3>
  2446. <table class=doc align=center cellpadding=3>
  2447. <tr class=top><th>Port</th><th>Purpose</th></tr>
  2448. <tr class=odd><td align=center>Out 0</td><td>Sound Output</td></tr>
  2449. </table>
  2450. <h3>Functions</h3>
  2451. <p class=func><span class=keyword>play</span>(data);</p>
  2452. <p class=desc>Begin playing a sound clip. If already playing, the
  2453. currently playing clip is stopped and this new data begins
  2454. playing from the beginning.
  2455. </p>
  2456. <p class=func><span class=keyword>stop</span>();</p>
  2457. <p class=desc>Stop playing. If not playing, this function has no effect.
  2458. </p>
  2459. <p class=func><span class=keyword>isPlaying</span>();</p>
  2460. <p class=desc>Return true (non-zero) if playing, or false (zero)
  2461. when not playing.
  2462. </p>
  2463. <p class=func><span class=keyword>positionMillis</span>();</p>
  2464. <p class=desc>While playing, return the current time offset, in
  2465. milliseconds. When not playing, the return from this function
  2466. is undefined.
  2467. </p>
  2468. <p class=func><span class=keyword>lengthMillis</span>();</p>
  2469. <p class=desc>Return the total length of the current sound clip,
  2470. in milliseconds. When not playing, the return from this function
  2471. is undefined.
  2472. </p>
  2473. <h3>Examples</h3>
  2474. <p class=exam>File &gt; Examples &gt; Audio &gt; SamplePlayer
  2475. </p>
  2476. <h3>Notes</h3>
  2477. <p><a href="https://forum.pjrc.com/threads/42401-Instructions-or-tutorials-for-using-wav2sketch?p=135069&viewfull=1#post135069">Step by step instructions for wav2sketch</a>
  2478. running in Terminal on Macintosh.</p>
  2479. <p><a href="https://www.pjrc.com/teensy/td_libs_AudioPlayMemory.html">Old documentation about wav2sketch</a>
  2480. is still available, including details about the data format.</p>
  2481. <p>TODO: supported sample rates: 11.025, 22.05, 44.1</p>
  2482. <p>TODO: ulaw vs uncompressed encoding</p>
  2483. <p>Polyphonic playback can be built by creating multiple
  2484. objects, with their output combined by mixers.</p>
  2485. </script>
  2486. <script type="text/x-red" data-template-name="AudioPlayMemory">
  2487. <div class="form-row">
  2488. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  2489. <input type="text" id="node-input-name" placeholder="Name">
  2490. </div>
  2491. </script>
  2492. <script type="text/x-red" data-help-name="AudioPlaySdWav">
  2493. <h3>Summary</h3>
  2494. <div class=tooltipinfo>
  2495. <p>Play a WAV file, stored on a SD card.</p>
  2496. </div>
  2497. <h3>Audio Connections</h3>
  2498. <table class=doc align=center cellpadding=3>
  2499. <tr class=top><th>Port</th><th>Purpose</th></tr>
  2500. <tr class=odd><td align=center>Out 0</td><td>Left Channel Output</td></tr>
  2501. <tr class=odd><td align=center>Out 1</td><td>Right Channel Output</td></tr>
  2502. </table>
  2503. <h3>Functions</h3>
  2504. <p class=func><span class=keyword>play</span>(filename);</p>
  2505. <p class=desc>Begin playing a WAV file. If a file is already playing,
  2506. it is stopped and this file starts playing from the beginning.
  2507. </p>
  2508. <p class=func><span class=keyword>stop</span>();</p>
  2509. <p class=desc>Stop playing. If not playing, this function has no effect.
  2510. </p>
  2511. <p class=func><span class=keyword>isPlaying</span>();</p>
  2512. <p class=desc>Return true (non-zero) if playing, or false (zero)
  2513. when not playing. See the note below about delayed start.
  2514. </p>
  2515. <p class=func><span class=keyword>positionMillis</span>();</p>
  2516. <p class=desc>While playing, return the current time offset, in
  2517. milliseconds. When not playing, the return from this function
  2518. is undefined.
  2519. </p>
  2520. <p class=func><span class=keyword>lengthMillis</span>();</p>
  2521. <p class=desc>Return the total length of the current sound clip,
  2522. in milliseconds. When not playing, the return from this function
  2523. is undefined.
  2524. </p>
  2525. <h3>Examples</h3>
  2526. <p class=exam>File &gt; Examples &gt; Audio &gt; WavFilePlayer
  2527. </p>
  2528. <h3>Notes</h3>
  2529. <p>Only 16 bit PCM, 44100 Hz WAV files are supported. When mono
  2530. files are played, both output ports transmit a copy of the
  2531. single sound. Of course, stereo WAV files play with the left
  2532. channel on port 0 and the right channel on port 1.
  2533. </p>
  2534. <p>A brief delay after calling play() will usually occur before
  2535. isPlaying() returns true and positionMillis() returns valid
  2536. time offset. WAV files have a header at the beginning of the
  2537. file, which the audio library must read and parse before
  2538. playing can begin.
  2539. </p>
  2540. <p>While playing, the audio library accesses the SD card automatically.
  2541. If card access is required, you must
  2542. <a href="http://www.pjrc.com/teensy/td_libs_AudioProcessorUsage.html" target="_blank">use AudioNoInterrupts()</a>
  2543. to prevent the library from accessing the SD card while you use it.
  2544. Disabling the audio library interrupt for too long may cause audible
  2545. dropouts or glitches.
  2546. </p>
  2547. <p>An experimental SD library optimization exists, which can remove these
  2548. SD library restrictions. It also allows reliable playback of more
  2549. files at the same time. To enable this special code, find and edit
  2550. the SD_t3.h file within your Arduino folder. See the comments within
  2551. that file for details.
  2552. </p>
  2553. </script>
  2554. <script type="text/x-red" data-template-name="AudioPlaySdWav">
  2555. <div class="form-row">
  2556. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  2557. <input type="text" id="node-input-name" placeholder="Name">
  2558. </div>
  2559. </script>
  2560. <script type="text/x-red" data-help-name="AudioPlaySdRaw">
  2561. <h3>Summary</h3>
  2562. <div class=tooltipinfo>
  2563. <p>Play a RAW data file, stored on a SD card. RAW format is simpler
  2564. than WAV and begins playing immediately, without parsing WAV file
  2565. header info.</p>
  2566. </div>
  2567. <h3>Audio Connections</h3>
  2568. <table class=doc align=center cellpadding=3>
  2569. <tr class=top><th>Port</th><th>Purpose</th></tr>
  2570. <tr class=odd><td align=center>Out 0</td><td>Sound Output</td></tr>
  2571. </table>
  2572. <h3>Functions</h3>
  2573. <p class=func><span class=keyword>play</span>(filename);</p>
  2574. <p class=desc>Begin playing a RAW data file. If a file is already playing,
  2575. it is stopped and this file starts playing from the beginning.
  2576. </p>
  2577. <p class=func><span class=keyword>stop</span>();</p>
  2578. <p class=desc>Stop playing. If not playing, this function has no effect.
  2579. </p>
  2580. <p class=func><span class=keyword>isPlaying</span>();</p>
  2581. <p class=desc>Return true (non-zero) if playing, or false (zero)
  2582. when not playing.
  2583. </p>
  2584. <p class=func><span class=keyword>positionMillis</span>();</p>
  2585. <p class=desc>While playing, return the current time offset, in
  2586. milliseconds. When not playing, the return from this function
  2587. is undefined.
  2588. </p>
  2589. <p class=func><span class=keyword>lengthMillis</span>();</p>
  2590. <p class=desc>Return the total length of the current sound clip,
  2591. in milliseconds. When not playing, the return from this function
  2592. is undefined.
  2593. </p>
  2594. <h3>Examples</h3>
  2595. <p class=exam>File &gt; Examples &gt; Audio &gt; Recorder
  2596. </p>
  2597. <h3>Notes</h3>
  2598. <p>The data file must be RAW 16 bit signed integers in LSB-first format.
  2599. </p>
  2600. <p>While playing, the audio library accesses the SD card automatically.
  2601. If card access is required, you must
  2602. <a href="http://www.pjrc.com/teensy/td_libs_AudioProcessorUsage.html" target="_blank">AudioNoInterrupts()</a>
  2603. to prevent the library from accessing the SD card while you use it.
  2604. Disabling the audio library interrupt for too long may cause audible
  2605. dropouts or glitches.
  2606. </p>
  2607. </script>
  2608. <script type="text/x-red" data-template-name="AudioPlaySdRaw">
  2609. <div class="form-row">
  2610. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  2611. <input type="text" id="node-input-name" placeholder="Name">
  2612. </div>
  2613. </script>
  2614. <script type="text/x-red" data-help-name="AudioPlaySerialflashRaw">
  2615. <h3>Summary</h3>
  2616. <div class=tooltipinfo>
  2617. <p>Play a RAW data file, stored on a Serial Flash chip. These chips
  2618. are far more efficient than SD cards, allowing many files to be
  2619. played simultaneously by copies of this object.
  2620. </p>
  2621. <p align=center><img src="img/w25q128fv.jpg"><br><small>W25Q128FV Serial Flash</small></p>
  2622. </div>
  2623. <h3>Audio Connections</h3>
  2624. <table class=doc align=center cellpadding=3>
  2625. <tr class=top><th>Port</th><th>Purpose</th></tr>
  2626. <tr class=odd><td align=center>Out 0</td><td>Sound Output</td></tr>
  2627. </table>
  2628. <h3>Functions</h3>
  2629. <p class=func><span class=keyword>play</span>(filename);</p>
  2630. <p class=desc>Begin playing a RAW data file. If a file is already playing,
  2631. it is stopped and this file starts playing from the beginning.
  2632. </p>
  2633. <p class=func><span class=keyword>stop</span>();</p>
  2634. <p class=desc>Stop playing. If not playing, this function has no effect.
  2635. </p>
  2636. <p class=func><span class=keyword>isPlaying</span>();</p>
  2637. <p class=desc>Return true (non-zero) if playing, or false (zero)
  2638. when not playing.
  2639. </p>
  2640. <p class=func><span class=keyword>positionMillis</span>();</p>
  2641. <p class=desc>While playing, return the current time offset, in
  2642. milliseconds. When not playing, the return from this function
  2643. is undefined.
  2644. </p>
  2645. <p class=func><span class=keyword>lengthMillis</span>();</p>
  2646. <p class=desc>Return the total length of the current sound clip,
  2647. in milliseconds. When not playing, the return from this function
  2648. is undefined.
  2649. </p>
  2650. <h3>Examples</h3>
  2651. <!--
  2652. <p class=exam>File &gt; Examples &gt; Audio &gt; Recorder
  2653. -->
  2654. <p class=exam>TODO: play example needed....
  2655. </p>
  2656. <p class=exam>File &gt; Examples &gt; SerialFlash &gt; CopyFromSD
  2657. </p>
  2658. <h3>Notes</h3>
  2659. <p>The data file must be RAW 16 bit signed integers in LSB-first format.
  2660. </p>
  2661. <p>The <a href="https://github.com/PaulStoffregen/SerialFlash" target="_blank">SerialFlash library</a>
  2662. is used to access the flash chip. You can also use SerialFlash's functions
  2663. to access the stored files, or add data to the flash chip.
  2664. </p>
  2665. <p>File names are case sensitive with SerialFlash. If your sound does
  2666. not play, use <b>File &gt; Examples &gt; SerialFlash &gt; ListFiles</b> to
  2667. check the exact file names stored in the flash memory chip.
  2668. </script>
  2669. <script type="text/x-red" data-template-name="AudioPlaySerialflashRaw">
  2670. <div class="form-row">
  2671. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  2672. <input type="text" id="node-input-name" placeholder="Name">
  2673. </div>
  2674. </script>
  2675. <script type="text/x-red" data-help-name="AudioPlayQueue">
  2676. <h3>Summary</h3>
  2677. <div class=tooltipinfo>
  2678. <p>Play audio data provided by the Arduino sketch. This object provides
  2679. functions to allow the sketch code to push data into the audio system.</p>
  2680. </div>
  2681. <h3>Audio Connections</h3>
  2682. <table class=doc align=center cellpadding=3>
  2683. <tr class=top><th>Port</th><th>Purpose</th></tr>
  2684. <tr class=odd><td align=center>Out 0</td><td>Sound Output</td></tr>
  2685. </table>
  2686. <h3>Functions</h3>
  2687. <p class=func><span class=keyword>play</span>(int16);</p>
  2688. <p class=desc>not yet implemented
  2689. </p>
  2690. <p class=func><span class=keyword>play</span>(int16[], length);</p>
  2691. <p class=desc>not yet implemented
  2692. </p>
  2693. <p class=func><span class=keyword>getBuffer</span>();</p>
  2694. <p class=desc>Returns a pointer to an array of 128 int16. This buffer
  2695. is within the audio library memory pool, providing the most efficient
  2696. way to input data to the audio system. The buffer is likely to be
  2697. populated by previously used data, so the entire 128 words should be
  2698. written before calling playBuffer(). Only a single buffer should be
  2699. requested at a time. This function may return NULL if no memory is
  2700. available.
  2701. </p>
  2702. <p class=func><span class=keyword>playBuffer</span>();</p>
  2703. <p class=desc>Transmit the buffer previously obtained from getBuffer().
  2704. </p>
  2705. <h3>Examples</h3>
  2706. <p><a href="http://community.arm.com/groups/embedded/blog/2014/05/23/led-video-panel-at-maker-faire-2014" target="_blank">4320 LED Video+Sound Project</a>
  2707. </p>
  2708. <!--
  2709. <p class=exam>File &gt; Examples &gt; Audio &gt;
  2710. </p>
  2711. -->
  2712. <h3>Notes</h3>
  2713. <p>TODO: many caveats....</p>
  2714. <p>
  2715. </p>
  2716. </script>
  2717. <script type="text/x-red" data-template-name="AudioPlayQueue">
  2718. <div class="form-row">
  2719. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  2720. <input type="text" id="node-input-name" placeholder="Name">
  2721. </div>
  2722. </script>
  2723. <script type="text/x-red" data-help-name="AudioRecordQueue">
  2724. <h3>Summary</h3>
  2725. <div class=tooltipinfo>
  2726. <p>Record audio data by sending to the Arduino sketch. This object allows
  2727. sketch code to receive audio packets.</p>
  2728. </div>
  2729. <h3>Audio Connections</h3>
  2730. <table class=doc align=center cellpadding=3>
  2731. <tr class=top><th>Port</th><th>Purpose</th></tr>
  2732. <tr class=odd><td align=center>In 0</td><td>Sound To Access</td></tr>
  2733. </table>
  2734. <h3>Functions</h3>
  2735. <p class=func><span class=keyword>begin</span>();</p>
  2736. <p class=desc>Begin capturing incoming audio to the queue. After calling
  2737. begin, readBuffer() and freeBuffer(), or clear() must be used frequently
  2738. to prevent the queue from filling up.
  2739. </p>
  2740. <p class=func><span class=keyword>available</span>();</p>
  2741. <p class=desc>Returns the number of audio packets available to read.
  2742. </p>
  2743. <p class=func><span class=keyword>readBuffer</span>();</p>
  2744. <p class=desc>Read a single audio packet. A pointer to a 128 sample
  2745. array of 16 bit integers is returned. NULL is returned if no packets
  2746. are available.
  2747. </p>
  2748. <p class=func><span class=keyword>freeBuffer</span>();</p>
  2749. <p class=desc>Release the memory from the previously read packet returned
  2750. from readBuffer(). Only a single packet at a time may be read, and
  2751. each packet must be freed with this function, to return the memory to
  2752. the audio library.
  2753. </p>
  2754. <p class=func><span class=keyword>clear</span>();</p>
  2755. <p class=desc>Discard all audio held in the queue.
  2756. </p>
  2757. <p class=func><span class=keyword>end</span>();</p>
  2758. <p class=desc>Stop capturing incoming audio into the queue. Data already
  2759. captured remains in the queue and may be read with readBuffer().
  2760. </p>
  2761. <h3>Examples</h3>
  2762. <p class=exam>File &gt; Examples &gt; Audio &gt; Recorder
  2763. </p>
  2764. <h3>Notes</h3>
  2765. <p>
  2766. Up to 52 packets may be queued by this object, which allows approximately
  2767. 150 ms of audio to be held in the queue, to allow time for the Arduino
  2768. sketch to write data to media or do other high-latency tasks.
  2769. The actual packets are taken
  2770. from the pool created by AudioMemory().
  2771. </p>
  2772. </script>
  2773. <script type="text/x-red" data-template-name="AudioRecordQueue">
  2774. <div class="form-row">
  2775. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  2776. <input type="text" id="node-input-name" placeholder="Name">
  2777. </div>
  2778. </script>
  2779. <script type="text/x-red" data-help-name="AudioSynthWavetable">
  2780. <h3>Summary</h3>
  2781. <div class=tooltipinfo>
  2782. <p>Synthesize musical instruments using wavetable samples.
  2783. Sample data is extracted from SoundFont2 files.
  2784. </p>
  2785. <p align=center><a href="https://www.youtube.com/watch?v=5laaNHLhS98">YouTube Video Demo</a><br>
  2786. <a href="https://www.youtube.com/watch?v=5laaNHLhS98"><img border=0 src="img/wavetablevideo.jpg"></a>
  2787. </p>
  2788. <p><small>
  2789. Portland State University capstone project by
  2790. Ryan Mellmer, Nicholas Craig, Joshua Bucklin, Aida Keifer,
  2791. Jonathan Jensen, Yu Tang, &amp; Connor Delaplane.
  2792. </small></p>
  2793. </div>
  2794. <h3>Audio Connections</h3>
  2795. <table class=doc align=center cellpadding=3>
  2796. <tr class=top><th>Port</th><th>Purpose</th></tr>
  2797. <tr class=odd><td align=center>Out 0</td><td>Output</td></tr>
  2798. </table>
  2799. <h3>Functions</h3>
  2800. <p class=func><span class=keyword>setInstrument</span>(instrument);</p>
  2801. <p class=desc>blah blah
  2802. </p>
  2803. <p class=func><span class=keyword>amplitude</span>(volume);</p>
  2804. <p class=desc>blah blah
  2805. </p>
  2806. <p class=func><span class=keyword>setFrequency</span>(freq);</p>
  2807. <p class=desc>blah blah
  2808. </p>
  2809. <p class=func><span class=keyword>playFrequency</span>(freq, amplitude);</p>
  2810. <p class=desc>blah blah
  2811. </p>
  2812. <p class=func><span class=keyword>stop</span>();</p>
  2813. <p class=desc>blah blah
  2814. </p>
  2815. <p class=func><span class=keyword>isPlaying</span>();</p>
  2816. <p class=desc>blah blah
  2817. </p>
  2818. <p class=func><span class=keyword>getEnvState</span>();</p>
  2819. <p class=desc>blah blah
  2820. </p>
  2821. <h3>Examples</h3>
  2822. <p class=exam>File &gt; Examples &gt; Audio &gt; Synthesis &gt; Wavetable &gt; MidiSynth
  2823. </p>
  2824. <p class=exam>File &gt; Examples &gt; Audio &gt; Synthesis &gt; Wavetable &gt; MidiSynthKeyboard
  2825. </p>
  2826. <p class=exam>File &gt; Examples &gt; Audio &gt; Synthesis &gt; Wavetable &gt; MidiSynthLarge
  2827. </p>
  2828. <p class=exam>File &gt; Examples &gt; Audio &gt; Synthesis &gt; Wavetable &gt; SimpleWavetable
  2829. </p>
  2830. <p class=exam>File &gt; Examples &gt; Audio &gt; Synthesis &gt; Wavetable &gt; Zelda
  2831. </p>
  2832. <h3>Notes</h3>
  2833. <p></p>
  2834. </script>
  2835. <script type="text/x-red" data-template-name="AudioSynthWavetable">
  2836. <div class="form-row">
  2837. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  2838. <input type="text" id="node-input-name" placeholder="Name">
  2839. </div>
  2840. </script>
  2841. <script type="text/x-red" data-help-name="AudioSynthSimpleDrum">
  2842. <h3>Summary</h3>
  2843. <div class=tooltipinfo>
  2844. <p>Generate a synthesised drum sound. Also useful for laser pistol and bursting
  2845. bubble sound effects.</p>
  2846. </div>
  2847. <h3>Audio Connections</h3>
  2848. <table class=doc align=center cellpadding=3>
  2849. <tr class=top><th>Port</th><th>Purpose</th></tr>
  2850. <tr class=odd><td align=center>Out 0</td><td>Drum Tone Output</td></tr>
  2851. </table>
  2852. <h3>Functions</h3>
  2853. <p class=func><span class=keyword>noteOn</span>();</p>
  2854. <p class=desc>Trigger the drum.
  2855. </p>
  2856. <p class=func><span class=keyword>frequency</span>(frequency);</p>
  2857. <p class=desc>Set the base frequency of the drum.
  2858. </p>
  2859. <p class=func><span class=keyword>length</span>(milliseconds);</p>
  2860. <p class=desc>Set the duration of the envelope, in milliseconds.
  2861. </p>
  2862. <p class=func><span class=keyword>secondMix</span>(level);</p>
  2863. <p class=desc>Emulates a two-headed tom, by adding a second sine wave that is
  2864. harmonized a perfect fifth above
  2865. the base frequency. Using this involves a slight CPU penalty.
  2866. </p>
  2867. <p class=func><span class=keyword>pitchMod</span>(depth);</p>
  2868. <p class=desc>Set the depth of envelope of the pitch, by a maximum of two octaves.
  2869. Default is 0.5, with no modulation. Values above 0.5 cause the pitch to sweep
  2870. downwards, values lower than 0.5 cause the pitch to sweep upwards.
  2871. </p>
  2872. <h3>Examples</h3>
  2873. <p class=exam>File &gt; Examples &gt; Synthesis &gt; SimpleDrum
  2874. </p>
  2875. <h3>Notes</h3>
  2876. <p></p>
  2877. </script>
  2878. <script type="text/x-red" data-template-name="AudioSynthSimpleDrum">
  2879. <div class="form-row">
  2880. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  2881. <input type="text" id="node-input-name" placeholder="Name">
  2882. </div>
  2883. </script>
  2884. <script type="text/x-red" data-help-name="AudioSynthKarplusStrong">
  2885. <h3>Summary</h3>
  2886. <div class=tooltipinfo>
  2887. <p>Synthesize a plucked string sound, such as a guitar string.
  2888. </p>
  2889. <p align=center><img src="img/touchguitar.jpg"></p>
  2890. </div>
  2891. <h3>Audio Connections</h3>
  2892. <table class=doc align=center cellpadding=3>
  2893. <tr class=top><th>Port</th><th>Purpose</th></tr>
  2894. <tr class=odd><td align=center>Out 0</td><td>Sound Output</td></tr>
  2895. </table>
  2896. <h3>Functions</h3>
  2897. <p class=func><span class=keyword>noteOn</span>(frequency, velocity);</p>
  2898. <p class=desc>Begin a new string note. Velocity can be from 0 to 1.0,
  2899. indicating how hard the string is plucked.
  2900. </p>
  2901. <p class=func><span class=keyword>noteOff</span>(velocity);</p>
  2902. <p class=desc>Stop the sound output.
  2903. </p>
  2904. <h3>Examples</h3>
  2905. <p class=exam>File &gt; Examples &gt; Synthesis &gt; Guitar
  2906. </p>
  2907. <p class=exam><a href="https://github.com/PaulStoffregen/TouchGuitar" target="_blank">TouchGuitar</a>
  2908. </p>
  2909. <h3>Notes</h3>
  2910. <p></p>
  2911. </script>
  2912. <script type="text/x-red" data-template-name="AudioSynthKarplusStrong">
  2913. <div class="form-row">
  2914. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  2915. <input type="text" id="node-input-name" placeholder="Name">
  2916. </div>
  2917. </script>
  2918. <script type="text/x-red" data-help-name="AudioSynthWaveformSine">
  2919. <h3>Summary</h3>
  2920. <div class=tooltipinfo>
  2921. <p>Create a sine wave signal</p>
  2922. </div>
  2923. <h3>Audio Connections</h3>
  2924. <table class=doc align=center cellpadding=3>
  2925. <tr class=top><th>Port</th><th>Purpose</th></tr>
  2926. <tr class=odd><td align=center>Out 0</td><td>Sine Wave Output</td></tr>
  2927. </table>
  2928. <h3>Functions</h3>
  2929. <p class=func><span class=keyword>amplitude</span>(level);</p>
  2930. <p class=desc>Set the amplitude, from 0 to 1.0.
  2931. </p>
  2932. <p class=func><span class=keyword>frequency</span>(freq);</p>
  2933. <p class=desc>Set the frequency, from 0 to 22000. Very low values may
  2934. be used to create a LFO (Low Frequency Oscillator) for objects
  2935. with modulation signal inputs.
  2936. </p>
  2937. <p class=func><span class=keyword>phase</span>(angle);</p>
  2938. <p class=desc>
  2939. Cause the generated waveform to jump to a specific point within
  2940. its cycle. Angle is from 0 to 360 degrees. When multiple objects
  2941. are configured,
  2942. <a href="http://www.pjrc.com/teensy/td_libs_AudioProcessorUsage.html" target="_blank">AudioNoInterrupts()</a>
  2943. should be used to guarantee all new settings take effect together.
  2944. </p>
  2945. <h3>Examples</h3>
  2946. <p class=exam>File &gt; Examples &gt; Audio &gt; MemoryAndCpuUsage
  2947. </p>
  2948. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; DialTone_Serial
  2949. </p>
  2950. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; FFT
  2951. </p>
  2952. <h3>Notes</h3>
  2953. <p></p>
  2954. </script>
  2955. <script type="text/x-red" data-template-name="AudioSynthWaveformSine">
  2956. <div class="form-row">
  2957. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  2958. <input type="text" id="node-input-name" placeholder="Name">
  2959. </div>
  2960. </script>
  2961. <script type="text/x-red" data-help-name="AudioSynthWaveformSineHires">
  2962. <h3>Summary</h3>
  2963. <div class=tooltipinfo>
  2964. <p>Create a highly precise, low distortion sine wave signal.
  2965. Mainly useful for codec &amp; analog circuitry testing.</p>
  2966. </div>
  2967. <h3>Audio Connections</h3>
  2968. <table class=doc align=center cellpadding=3>
  2969. <tr class=top><th>Port</th><th>Purpose</th></tr>
  2970. <tr class=odd><td align=center>Out 0</td><td>Sine Wave, upper bits</td></tr>
  2971. <tr class=odd><td align=center>Out 1</td><td>Sine Wave, lower bits</td></tr>
  2972. </table>
  2973. <h3>Functions</h3>
  2974. <p class=func><span class=keyword>amplitude</span>(level);</p>
  2975. <p class=desc>Set the amplitude, from 0 to 1.0.
  2976. </p>
  2977. <p class=func><span class=keyword>frequency</span>(freq);</p>
  2978. <p class=desc>Set the frequency, from 0 to 22000. Very low values may
  2979. be used to create a LFO (Low Frequency Oscillator) for objects
  2980. with modulation signal inputs.
  2981. </p>
  2982. <p class=func><span class=keyword>phase</span>(angle);</p>
  2983. <p class=desc>
  2984. Cause the generated waveform to jump to a specific point within
  2985. its cycle. Angle is from 0 to 360 degrees. When multiple objects
  2986. are configured,
  2987. <a href="http://www.pjrc.com/teensy/td_libs_AudioProcessorUsage.html" target="_blank">AudioNoInterrupts()</a>
  2988. should be used to guarantee all new settings take effect together.
  2989. </p>
  2990. <h3>Notes</h3>
  2991. <p>An 11th order Taylor series approximation is used to generate
  2992. a very accurate sine wave. At least the upper 25 bits are believe
  2993. to be perfect. This is mainly intended for testing 24 bit codec chips!</p>
  2994. </script>
  2995. <script type="text/x-red" data-template-name="AudioSynthWaveformSineHires">
  2996. <div class="form-row">
  2997. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  2998. <input type="text" id="node-input-name" placeholder="Name">
  2999. </div>
  3000. </script>
  3001. <script type="text/x-red" data-help-name="AudioSynthWaveformSineModulated">
  3002. <h3>Summary</h3>
  3003. <div class=tooltipinfo>
  3004. <p>Create a modulated sine wave, using any audio signal to continuously
  3005. modulate the sine wave frequency.</p>
  3006. </div>
  3007. <h3>Audio Connections</h3>
  3008. <table class=doc align=center cellpadding=3>
  3009. <tr class=top><th>Port</th><th>Purpose</th></tr>
  3010. <tr class=odd><td align=center>In 0</td><td>Modulation Signal</td></tr>
  3011. <tr class=odd><td align=center>Out 0</td><td>Sine Wave Output</td></tr>
  3012. </table>
  3013. <h3>Functions</h3>
  3014. <p class=func><span class=keyword>amplitude</span>(level);</p>
  3015. <p class=desc>Set the amplitude, from 0 to 1.0.
  3016. </p>
  3017. <p class=func><span class=keyword>frequency</span>(freq);</p>
  3018. <p class=desc>Set the center frequency, from 0 to 11000. The output will
  3019. be this center frequency when the input modulation signal is zero.
  3020. Modulation input 1.0 causes the frequency to double, and input -1.0
  3021. causes zero Hz (DC) output. For less modulation, attenuate the input
  3022. signal (perhaps with a mixer object) before it arrives here.
  3023. </p>
  3024. <p class=func><span class=keyword>phase</span>(angle);</p>
  3025. <p class=desc>
  3026. Cause the generated waveform to jump to a specific point within
  3027. its cycle. Angle is from 0 to 360 degrees. When multiple objects
  3028. are configured,
  3029. <a href="http://www.pjrc.com/teensy/td_libs_AudioProcessorUsage.html" target="_blank">AudioNoInterrupts()</a>
  3030. should be used to guarantee all new settings take effect together.
  3031. </p>
  3032. <!--
  3033. <h3>Examples</h3>
  3034. <p class=exam>File &gt; Examples &gt; Audio &gt;
  3035. </p>
  3036. -->
  3037. <h3>Notes</h3>
  3038. <p></p>
  3039. </script>
  3040. <script type="text/x-red" data-template-name="AudioSynthWaveformSineModulated">
  3041. <div class="form-row">
  3042. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  3043. <input type="text" id="node-input-name" placeholder="Name">
  3044. </div>
  3045. </script>
  3046. <script type="text/x-red" data-help-name="AudioSynthWaveform">
  3047. <h3>Summary</h3>
  3048. <div class=tooltipinfo>
  3049. <p>Create a waveform: sine, sawtooth, square, triangle, pulse, random S&H or arbitrary.</p>
  3050. <p align=center><img src="img/waveforms.png"></p>
  3051. </div>
  3052. <h3>Audio Connections</h3>
  3053. <table class=doc align=center cellpadding=3>
  3054. <tr class=top><th>Port</th><th>Purpose</th></tr>
  3055. <tr class=odd><td align=center>Out 0</td><td>Waveform Output</td></tr>
  3056. </table>
  3057. <h3>Functions</h3>
  3058. <p class=func><span class=keyword>begin</span>(waveform);</p>
  3059. <p class=desc>Configure the waveform type to create.
  3060. </p>
  3061. <p class=func><span class=keyword>begin</span>(level, frequency, waveform);</p>
  3062. <p class=desc>Output a waveform, and set the amplitude and frequency.
  3063. </p>
  3064. <p class=func><span class=keyword>frequency</span>(freq);</p>
  3065. <p class=desc>Change the frequency.
  3066. </p>
  3067. <p class=func><span class=keyword>amplitude</span>(level);</p>
  3068. <p class=desc>Change the amplitude. Set to 0 to turn the signal off.
  3069. </p>
  3070. <p class=func><span class=keyword>offset</span>(level);</p>
  3071. <p class=desc>Add a DC offset, from -1.0 to +1.0. Useful for generating
  3072. waveforms to use as control or modulation signals.
  3073. </p>
  3074. <p class=func><span class=keyword>phase</span>(angle);</p>
  3075. <p class=desc>
  3076. Cause the generated waveform to jump to a specific point within
  3077. its cycle. Angle is from 0 to 360 degrees. When multiple objects
  3078. are configured,
  3079. <a href="http://www.pjrc.com/teensy/td_libs_AudioProcessorUsage.html" target="_blank">AudioNoInterrupts()</a>
  3080. should be used to guarantee all new settings take effect together.
  3081. </p>
  3082. <p class=func><span class=keyword>pulseWidth</span>(amount);</p>
  3083. <p class=desc>Change the width (duty cycle) of the pulse.</p>
  3084. <p class=func><span class=keyword>arbitraryWaveform</span>(array, maxFreq);</p>
  3085. <p class=desc>
  3086. Configure the waveform to be used with WAVEFORM_ARBITRARY. Array
  3087. must be an array of 256 samples. Currently, the data is used
  3088. without any filtering, which can cause aliasing with frequencies
  3089. above 172 Hz. For higher frequency output, you must bandwidth
  3090. limit your waveform data. Someday, "maxFreq" will be used to
  3091. do this automatically.
  3092. </p>
  3093. <h3>Examples</h3>
  3094. <p class=exam>File &gt; Examples &gt; Audio &gt; Synthesis &gt; Waveforms
  3095. </p>
  3096. <p class=exam>File &gt; Examples &gt; Audio &gt; Synthesis &gt; PlaySynthMusic
  3097. </p>
  3098. <p class=exam>File &gt; Examples &gt; Audio &gt; Synthesis &gt; pulseWidth
  3099. </p>
  3100. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; WM8731MikroSine
  3101. </p>
  3102. <h3>Notes</h3>
  3103. <p>Supported Waveforms:<br>
  3104. <ul>
  3105. <li><span class=literal>WAVEFORM_SINE</span></li>
  3106. <li><span class=literal>WAVEFORM_SAWTOOTH</span></li>
  3107. <li><span class=literal>WAVEFORM_SAWTOOTH_REVERSE</span></li>
  3108. <li><span class=literal>WAVEFORM_SQUARE</span></li>
  3109. <li><span class=literal>WAVEFORM_TRIANGLE</span></li>
  3110. <li><span class=literal>WAVEFORM_TRIANGLE_VARIABLE</span></li>
  3111. <li><span class=literal>WAVEFORM_ARBITRARY</span></li>
  3112. <li><span class=literal>WAVEFORM_PULSE</span></li>
  3113. <li><span class=literal>WAVEFORM_SAMPLE_HOLD</span></li>
  3114. </ul>
  3115. </p>
  3116. </script>
  3117. <script type="text/x-red" data-template-name="AudioSynthWaveform">
  3118. <div class="form-row">
  3119. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  3120. <input type="text" id="node-input-name" placeholder="Name">
  3121. </div>
  3122. </script>
  3123. <script type="text/x-red" data-help-name="AudioSynthWaveformModulated">
  3124. <h3>Summary</h3>
  3125. <div class=tooltipinfo>
  3126. <p>Create a waveform <b>with modulation</b>: sine, sawtooth, square, triangle, pulse, random S&H or arbitrary.</p>
  3127. <p align=center><img src="img/waveformsmod.png"></p>
  3128. </div>
  3129. <h3>Audio Connections</h3>
  3130. <table class=doc align=center cellpadding=3>
  3131. <tr class=top><th>Port</th><th>Purpose</th></tr>
  3132. <tr class=odd><td align=center>In 0</td><td>Frequency or Phase</td></tr>
  3133. <tr class=odd><td align=center>In 1</td><td>Shape (Pulse &amp; Var Triangle)</td></tr>
  3134. <tr class=odd><td align=center>Out 0</td><td>Waveform Output</td></tr>
  3135. </table>
  3136. <h3>Functions</h3>
  3137. <p class=func><span class=keyword>begin</span>(waveform);</p>
  3138. <p class=desc>Configure the waveform type to create.
  3139. </p>
  3140. <p class=func><span class=keyword>begin</span>(level, frequency, waveform);</p>
  3141. <p class=desc>Output a waveform, and set the amplitude and base frequency.
  3142. </p>
  3143. <p class=func><span class=keyword>frequency</span>(freq);</p>
  3144. <p class=desc>Change the base (unmodulated) frequency.
  3145. </p>
  3146. <p class=func><span class=keyword>amplitude</span>(level);</p>
  3147. <p class=desc>Change the amplitude. Set to 0 to turn the signal off.
  3148. </p>
  3149. <p class=func><span class=keyword>offset</span>(level);</p>
  3150. <p class=desc>Add a DC offset, from -1.0 to +1.0. Useful for generating
  3151. waveforms to use as control or modulation signals.
  3152. </p>
  3153. <p class=func><span class=keyword>frequencyModulation</span>(octaves);</p>
  3154. <p class=desc>
  3155. Configure for frequency modulation mode (the default) where the
  3156. input signal will adjust the frequency by a specific number of
  3157. octaves (the default is 8 octaves). If the -1.0 to +1.0 signal
  3158. represents a &plusmn;10 volt range and you wish to have control
  3159. at 1 volt/octave, then configure for 10 octaves range. The
  3160. maximum modulation sensitivity is 12 octaves.
  3161. </p>
  3162. <p class=func><span class=keyword>phaseModulation</span>(degrees);</p>
  3163. <p class=desc>
  3164. Configure for phase modulation mode where the input signal will
  3165. adjust the waveform phase angle a specific number of degrees.
  3166. 180.0 allows a full scale &plusmn;1.0 signal to span 1 full
  3167. cycle of the waveform. Maximum modulation sensitivity is 9000
  3168. degrees (&plusmn;25 cycles).
  3169. </p>
  3170. <p class=func><span class=keyword>arbitraryWaveform</span>(array, maxFreq);</p>
  3171. <p class=desc>
  3172. Configure the waveform to be used with WAVEFORM_ARBITRARY. Array
  3173. must be an array of 256 samples. Currently, the data is used
  3174. without any filtering, which can cause aliasing with frequencies
  3175. above 172 Hz. For higher frequency output, you must bandwidth
  3176. limit your waveform data. Someday, "maxFreq" will be used to
  3177. do this automatically.
  3178. </p>
  3179. <h3>Examples</h3>
  3180. <p class=exam>File &gt; Examples &gt; Audio &gt; Synthesis &gt; WaveformsModulated
  3181. </p>
  3182. <h3>Notes</h3>
  3183. <p>Supported Waveforms:<br>
  3184. <ul>
  3185. <li><span class=literal>WAVEFORM_SINE</span></li>
  3186. <li><span class=literal>WAVEFORM_SAWTOOTH</span></li>
  3187. <li><span class=literal>WAVEFORM_SAWTOOTH_REVERSE</span></li>
  3188. <li><span class=literal>WAVEFORM_SQUARE</span></li>
  3189. <li><span class=literal>WAVEFORM_TRIANGLE</span></li>
  3190. <li><span class=literal>WAVEFORM_TRIANGLE_VARIABLE</span></li>
  3191. <li><span class=literal>WAVEFORM_ARBITRARY</span></li>
  3192. <li><span class=literal>WAVEFORM_PULSE</span></li>
  3193. <li><span class=literal>WAVEFORM_SAMPLE_HOLD</span></li>
  3194. </ul>
  3195. </p>
  3196. <p>The Sample &amp; Hold waveform does not support phase modulation.
  3197. Attempting to modulate its phase may give random or
  3198. inconsistent results. Use only frequency modulation
  3199. to vary the Sample &amp; Hold waveform speed
  3200. </p>
  3201. </script>
  3202. <script type="text/x-red" data-template-name="AudioSynthWaveformModulated">
  3203. <div class="form-row">
  3204. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  3205. <input type="text" id="node-input-name" placeholder="Name">
  3206. </div>
  3207. </script>
  3208. <script type="text/x-red" data-help-name="AudioSynthWaveformPWM">
  3209. <h3>Summary</h3>
  3210. <div class=tooltipinfo>
  3211. <p>Create a Pulse Width Modulated waveform, with an audio signal
  3212. controlling the pulse width duty cycle.</p>
  3213. <p align=center><img src="img/pwm.png"></p>
  3214. </div>
  3215. <h3>Audio Connections</h3>
  3216. <table class=doc align=center cellpadding=3>
  3217. <tr class=top><th>Port</th><th>Purpose</th></tr>
  3218. <tr class=odd><td align=center>In 0</td><td>Control Signal Output</td></tr>
  3219. <tr class=odd><td align=center>Out 0</td><td>Waveform Output</td></tr>
  3220. </table>
  3221. <p>The duty cycle is 50% when the control waveform is zero.
  3222. As the control input causes a linear changes in PWM duty
  3223. cycle, from nearly 0 to 100% over -1.0 to +1.0 range.
  3224. See the notes below for minimum and maximum limitations.
  3225. </p>
  3226. <h3>Functions</h3>
  3227. <p class=func><span class=keyword>frequency</span>(freq);</p>
  3228. <p class=desc>Change the frequency.
  3229. </p>
  3230. <p class=func><span class=keyword>amplitude</span>(level);</p>
  3231. <p class=desc>Change the amplitude. Set to 0 to turn the signal off.
  3232. </p>
  3233. <h3>Examples</h3>
  3234. <p class=exam>TODO, examples needed
  3235. </p>
  3236. <h3>Notes</h3>
  3237. <p>The maximum duty cycle is 65536 samples high followed by
  3238. one sample low (99.9985%) and the minimum duty cycle is
  3239. 1 sample high followed by 65536 samples low (0.00153%).
  3240. </p>
  3241. </script>
  3242. <script type="text/x-red" data-template-name="AudioSynthWaveformPWM">
  3243. <div class="form-row">
  3244. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  3245. <input type="text" id="node-input-name" placeholder="Name">
  3246. </div>
  3247. </script>
  3248. <script type="text/x-red" data-help-name="AudioSynthToneSweep">
  3249. <h3>Summary</h3>
  3250. <div class=tooltipinfo>
  3251. <p>Create a continuously varying (in frequency) sine wave</p>
  3252. </div>
  3253. <h3>Audio Connections</h3>
  3254. <table class=doc align=center cellpadding=3>
  3255. <tr class=top><th>Port</th><th>Purpose</th></tr>
  3256. <tr class=odd><td align=center>Out 0</td><td>Continuously varying tone</td></tr>
  3257. </table>
  3258. <h3>Functions</h3>
  3259. <p class=func><span class=keyword>play</span>(level, lowFreq, highFreq, time);</p>
  3260. <p class=desc>Start generating frequency sweep output. The time is specified
  3261. in seconds. Level is 0 to 1.0.
  3262. </p>
  3263. <p class=func><span class=keyword>isPlaying</span>();</p>
  3264. <p class=desc>Returns true (non-zero) while the output is active.
  3265. </p>
  3266. <p class=func><span class=keyword>read</span>();</p>
  3267. <p class=desc>Returns the current frequency, or zero if the output is not active.
  3268. </p>
  3269. <h3>Examples</h3>
  3270. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; ToneSweep
  3271. </p>
  3272. <h3>Notes</h3>
  3273. <p>Uses excessive CPU time.</p>
  3274. <p>The frequency actually changes in discrete steps every 128 samples (2.9 ms).</p>
  3275. </script>
  3276. <script type="text/x-red" data-template-name="AudioSynthToneSweep">
  3277. <div class="form-row">
  3278. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  3279. <input type="text" id="node-input-name" placeholder="Name">
  3280. </div>
  3281. </script>
  3282. <script type="text/x-red" data-help-name="AudioSynthWaveformDc">
  3283. <h3>Summary</h3>
  3284. <div class=tooltipinfo>
  3285. <p>Create constant (DC) signal, useful for control of objects that take
  3286. a modulation or control input signal. This constant level can be
  3287. used to modify other waveforms using mixer or multiplier objects</p>
  3288. </div>
  3289. <h3>Audio Connections</h3>
  3290. <table class=doc align=center cellpadding=3>
  3291. <tr class=top><th>Port</th><th>Purpose</th></tr>
  3292. <tr class=odd><td align=center>Out 0</td><td>Output constant DC level</td></tr>
  3293. </table>
  3294. <h3>Functions</h3>
  3295. <p class=func><span class=keyword>amplitude</span>(level);</p>
  3296. <p class=desc>Set the output. Level is -1.0 to 1.0. The output is
  3297. changed immediately.
  3298. </p>
  3299. <p class=func><span class=keyword>amplitude</span>(level, milliseconds);</p>
  3300. <p class=desc>Set the output. Level is -1.0 to 1.0. The output is
  3301. gradually changed over a "milliseconds" time period. Any time may
  3302. be specified, but periods longer than 1 second may be automatically
  3303. shortened for small level changes, due to numerical precision limits.
  3304. </p>
  3305. <p class=func><span class=keyword>read</span>();</p>
  3306. <p class=desc>Read the current level. Returns -1.0 to 1.0. This can be
  3307. useful for monitoring the amplitude after configuring a slow change.
  3308. </p>
  3309. <!--
  3310. <h3>Examples</h3>
  3311. <p class=exam>File &gt; Examples &gt; Audio &gt;
  3312. </p>
  3313. -->
  3314. <h3>Notes</h3>
  3315. <p>Of course, the term "DC", for Direct Current, doesn't properly apply
  3316. to a pure digital stream of numerical values. But the term is widely
  3317. understood in audio applications, so hopefully it's not too confusing?</p>
  3318. </script>
  3319. <script type="text/x-red" data-template-name="AudioSynthWaveformDc">
  3320. <div class="form-row">
  3321. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  3322. <input type="text" id="node-input-name" placeholder="Name">
  3323. </div>
  3324. </script>
  3325. <script type="text/x-red" data-help-name="AudioSynthNoiseWhite">
  3326. <h3>Summary</h3>
  3327. <div class=tooltipinfo>
  3328. <p>Create white noise.
  3329. </p>
  3330. <p align=center><img src="img/whitenoise.png"></p>
  3331. </div>
  3332. <h3>Audio Connections</h3>
  3333. <table class=doc align=center cellpadding=3>
  3334. <tr class=top><th>Port</th><th>Purpose</th></tr>
  3335. <tr class=odd><td align=center>Out 0</td><td>White Noise</td></tr>
  3336. </table>
  3337. <h3>Functions</h3>
  3338. <p class=func><span class=keyword>amplitude</span>(level);</p>
  3339. <p class=desc>Set the output peak level, from 0 (off) to 1.0.
  3340. The default is off. Noise is generated only after setting
  3341. to a non-zero level.
  3342. </p>
  3343. <h3>Examples</h3>
  3344. <p class=exam>File &gt; Examples &gt; Audio &gt;
  3345. </p>
  3346. <h3>Notes</h3>
  3347. <p>Setting the amplitude to zero causes this object to stop using
  3348. CPU time to generate random numbers.
  3349. </p>
  3350. </script>
  3351. <script type="text/x-red" data-template-name="AudioSynthNoiseWhite">
  3352. <div class="form-row">
  3353. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  3354. <input type="text" id="node-input-name" placeholder="Name">
  3355. </div>
  3356. </script>
  3357. <script type="text/x-red" data-help-name="AudioSynthNoisePink">
  3358. <h3>Summary</h3>
  3359. <div class=tooltipinfo>
  3360. <p>Create pink noise, using Stefan Stenzel's "New Shade Of Pink" algorithm.
  3361. </p>
  3362. <!--
  3363. <p align=center><img src="img/whitenoise.png"></p>
  3364. -->
  3365. </div>
  3366. <h3>Audio Connections</h3>
  3367. <table class=doc align=center cellpadding=3>
  3368. <tr class=top><th>Port</th><th>Purpose</th></tr>
  3369. <tr class=odd><td align=center>Out 0</td><td>Pink Noise</td></tr>
  3370. </table>
  3371. <h3>Functions</h3>
  3372. <p class=func><span class=keyword>amplitude</span>(level);</p>
  3373. <p class=desc>Set the output peak level, from 0 (off) to 1.0.
  3374. The default is off. Noise is generated only after setting
  3375. to a non-zero level.
  3376. </p>
  3377. <h3>Examples</h3>
  3378. <p class=exam>File &gt; Examples &gt; Audio &gt; MemoryAndCpuUsage
  3379. </p>
  3380. <h3>Notes</h3>
  3381. <p>Setting the amplitude to zero causes this object to stop using
  3382. CPU time. CPU usage is approx 3% on Teensy 3.1.
  3383. </p>
  3384. <p>Stefan Stenzel's
  3385. <a href="http://stenzel.waldorfmusic.de/post/pink/" target="_blank">New Shade Of Pink</a>
  3386. algorithm. Stefan's terms of use are "Use for any purpose. If used
  3387. in a commercial product, you should give me one."
  3388. </p>
  3389. </script>
  3390. <script type="text/x-red" data-template-name="AudioSynthNoisePink">
  3391. <div class="form-row">
  3392. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  3393. <input type="text" id="node-input-name" placeholder="Name">
  3394. </div>
  3395. </script>
  3396. <script type="text/x-red" data-help-name="AudioEffectFade">
  3397. <h3>Summary</h3>
  3398. <div class=tooltipinfo>
  3399. <p>Gradually increase or decrease audio level.</p>
  3400. </div>
  3401. <h3>Audio Connections</h3>
  3402. <table class=doc align=center cellpadding=3>
  3403. <tr class=top><th>Port</th><th>Purpose</th></tr>
  3404. <tr class=odd><td align=center>In 0</td><td>Signal Input</td></tr>
  3405. <tr class=odd><td align=center>Out 0</td><td>Signal Output</td></tr>
  3406. </table>
  3407. <h3>Functions</h3>
  3408. <p class=func><span class=keyword>fadeIn</span>(milliseconds);</p>
  3409. <p class=desc>Begin increasing the audio level, to reach 1.0 (input passed
  3410. directly to the output) after "milliseconds" time.
  3411. </p>
  3412. <p class=func><span class=keyword>fadeOut</span>(milliseconds);</p>
  3413. <p class=desc>Begin decreasing the audio level, to reach 0 (no output)
  3414. after "milliseconds" time.
  3415. </p>
  3416. <!--
  3417. <h3>Examples</h3>
  3418. <p class=exam>File &gt; Examples &gt; Audio &gt;
  3419. </p>
  3420. -->
  3421. <h3>Notes</h3>
  3422. <p>Cross fading can be built with 2 fade objects fed into a mixer.
  3423. When one fade object is off (fully faded out) and the other on
  3424. (fully faded in), if both are started at the same moment for the
  3425. same time duration, their signal gains always add to 1.0. This
  3426. allows 2 fade objects to work together for a smooth transition
  3427. between a pair of signals.
  3428. </p>
  3429. <p><a href="http://www.pjrc.com/teensy/td_libs_AudioProcessorUsage.html" target="_blank">AudioNoInterrupts()</a>
  3430. should be used when changing
  3431. settings on multiple objects, so all changes always take effect
  3432. at the same moment.
  3433. </p>
  3434. </script>
  3435. <script type="text/x-red" data-template-name="AudioEffectFade">
  3436. <div class="form-row">
  3437. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  3438. <input type="text" id="node-input-name" placeholder="Name">
  3439. </div>
  3440. </script>
  3441. <script type="text/x-red" data-help-name="AudioEffectChorus">
  3442. <h3>Summary</h3>
  3443. <div class=tooltipinfo>
  3444. <p>The chorus effect simulates the richness of several nearly-identical
  3445. sound sources (like the way a choir sounds different to a single singer).
  3446. It does this by sampling from a delay line, so each voice is actually
  3447. the same but at a slightly different point in time. This is a type of
  3448. comb filtering.</p>
  3449. </div>
  3450. <p>Chorus combines one or more samples ranging from the most recent
  3451. sample back to about 50ms ago. The additional samples are evenly spread
  3452. through the supplied delay line, and there is no modulation.</p>
  3453. <p>If the number of voices is specified as 2, then the
  3454. effect combines the current sample and the oldest sample (the last one
  3455. in the delay line). If the number of voices is 3 then the effect combines
  3456. the most recent sample, the oldest sample and the sample in the middle of
  3457. the delay line.</p>
  3458. <p>For two voices the effect can be represented as:<br/>
  3459. result = (sample(0) + sample(dt))/2<br/>
  3460. where sample(0) represents the current sample and sample(dt)
  3461. is the sample in the delay line from dt milliseconds ago.</p>
  3462. <h3>Audio Connections</h3>
  3463. <table class=doc align=center cellpadding=3>
  3464. <tr class="top"><th>Port</th><th>Purpose</th></tr>
  3465. <tr class="odd"><td align="center">In 0</td><td>Signal Input</td></tr>
  3466. <tr class="odd"><td align="center">Out 0</td><td>Chorused Output</td></tr>
  3467. </table>
  3468. <h3>Functions</h3>
  3469. <p class=func><span class=keyword>begin</span>(delayBuffer, length, n_chorus);</p>
  3470. <p class=desc>Create a chorus by specifying the address of the delayline, the
  3471. total number of samples in the delay line (often done as an integer multiple of
  3472. AUDIO_BLOCK_SAMPLES) and the number of voices in the chorus <em>including</em>
  3473. the original voice (so, 2 and up to get a chorus effect, although you can
  3474. specify 1 if you want).
  3475. </p>
  3476. <p class=func><span class=keyword>voices</span>(n_chorus);</p>
  3477. <p class=desc>Alters the number of voices in a running chorus (previously started with begin).
  3478. </p>
  3479. <h3>Examples</h3>
  3480. <p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Chorus
  3481. </p>
  3482. <h3>Notes</h3>
  3483. <p>The longer the length of the chorus, the more memory blocks are used.</p>
  3484. </script>
  3485. <script type="text/x-red" data-template-name="AudioEffectChorus">
  3486. <div class="form-row">
  3487. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  3488. <input type="text" id="node-input-name" placeholder="Name">
  3489. </div>
  3490. </script>
  3491. <script type="text/x-red" data-help-name="AudioEffectFlange">
  3492. <h3>Summary</h3>
  3493. <div class=tooltipinfo>
  3494. <p>Originally, flanging was produced by playing the same signal on two synchronized
  3495. reel-to-reel tape recorders and making one of the reels slow down and speed up by
  3496. pressing on the flange of the reel (hence the name). This is a type of
  3497. comb filtering, and produces a harmonically-related series of peaks and notches
  3498. in the audio spectrum.</p>
  3499. </div>
  3500. <p>This flanger uses a delay line, combining the original voice with only one sample from the delay
  3501. line, but the position of that sample varies sinusoidally.</p>
  3502. <p>The effect can be represented as:<br>
  3503. result = sample(0) + sample(dt + depth*sin(2*PI*Fe))</p>
  3504. <p>The value of the sine function is always a number from -1 to +1 and
  3505. so the result of depth*(sin(Fe)) is always a number from -depth to +depth.
  3506. Thus, the delayed sample will be selected from the range (dt-depth) to
  3507. (dt+depth). This selection will vary at whatever rate is specified as the
  3508. frequency of the effect, Fe. Typically a low frequency (a few Hertz) is used.
  3509. <h3>Audio Connections</h3>
  3510. <table class=doc align=center cellpadding=3>
  3511. <tr class="top"><th>Port</th><th>Purpose</th></tr>
  3512. <tr class="odd"><td align="center">In 0</td><td>Signal Input</td></tr>
  3513. <tr class="odd"><td align="center">Out 0</td><td>Flanged Output</td></tr>
  3514. </table>
  3515. <h3>Functions</h3>
  3516. <p class=func><span class=keyword>begin</span>(delayBuffer, length, offset, depth, delayRate);</p>
  3517. <p class=desc>Create a flanger by specifying the address of the delayline, the
  3518. total number of samples in the delay line (often done as an integer multiple of
  3519. AUDIO_BLOCK_SAMPLES), the offset (how far back the flanged sample is from the original voice),
  3520. the modulation depth (larger values give a greater variation) and the modulation
  3521. frequency, in Hertz.
  3522. </p>
  3523. <p class=func><span class=keyword>voices</span>(offset, depth, delayRate);</p>
  3524. <p class=desc>Alters the parameters in a running flanger (previously started with begin).
  3525. </p>
  3526. <h3>Examples</h3>
  3527. <p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Flange
  3528. </p>
  3529. <h3>Notes</h3>
  3530. <p>The longer the length of the delay buffer, the more memory blocks are used.</p>
  3531. <p>Try these settings:<br>
  3532. #define FLANGE_DELAY_LENGTH (2*AUDIO_BLOCK_SAMPLES)<br>
  3533. and<br>
  3534. int s_idx = 2*FLANGE_DELAY_LENGTH/4;<br>
  3535. int s_depth = FLANGE_DELAY_LENGTH/4;<br>
  3536. double s_freq = 3;</p>
  3537. <p>The flange effect can also produce a chorus-like effect if a longer
  3538. delay line is used with a slower modulation rate, for example try:<br>
  3539. #define FLANGE_DELAY_LENGTH (12*AUDIO_BLOCK_SAMPLES)<br>
  3540. and<br>
  3541. int s_idx = 3*FLANGE_DELAY_LENGTH/4;<br>
  3542. int s_depth = FLANGE_DELAY_LENGTH/8;<br>
  3543. double s_freq = .0625;</p>
  3544. </script>
  3545. <script type="text/x-red" data-template-name="AudioEffectFlange">
  3546. <div class="form-row">
  3547. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  3548. <input type="text" id="node-input-name" placeholder="Name">
  3549. </div>
  3550. </script>
  3551. <script type="text/x-red" data-help-name="AudioEffectReverb">
  3552. <h3>Summary</h3>
  3553. <div class=tooltipinfo>
  3554. <p>Reverb with adjustable reverberation time. Contributed by Joao Rossi FIlho.
  3555. </p>
  3556. </div>
  3557. <h3>Audio Connections</h3>
  3558. <table class=doc align=center cellpadding=3>
  3559. <tr class="top"><th>Port</th><th>Purpose</th></tr>
  3560. <tr class="odd"><td align="center">In 0</td><td>Input</td></tr>
  3561. <tr class="odd"><td align="center">Out 0</td><td>Output</td></tr>
  3562. </table>
  3563. <h3>Functions</h3>
  3564. <p class=func><span class=keyword>reverbTime</span>(seconds);</p>
  3565. <p class=desc>Sets the amount of reverberation time.
  3566. </p>
  3567. <h3>Examples</h3>
  3568. <p><a href="https://twitter.com/joaorossifilho/status/779737126841753601">Video Demo</a>
  3569. </p>
  3570. <!--<p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Flange
  3571. </p>-->
  3572. <h3>Notes</h3>
  3573. <p>This effect may have distortion problems with the input signal is more than 0.5.</p>
  3574. </script>
  3575. <script type="text/x-red" data-template-name="AudioEffectReverb">
  3576. <div class="form-row">
  3577. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  3578. <input type="text" id="node-input-name" placeholder="Name">
  3579. </div>
  3580. </script>
  3581. <script type="text/x-red" data-help-name="AudioEffectFreeverb">
  3582. <h3>Summary</h3>
  3583. <div class=tooltipinfo>
  3584. <p>High quality Reverb effect, based on Freeverb by Jezar at Dreampoint.
  3585. </p>
  3586. </div>
  3587. <h3>Audio Connections</h3>
  3588. <table class=doc align=center cellpadding=3>
  3589. <tr class="top"><th>Port</th><th>Purpose</th></tr>
  3590. <tr class="odd"><td align="center">In 0</td><td>Input</td></tr>
  3591. <tr class="odd"><td align="center">Out 0</td><td>Output</td></tr>
  3592. </table>
  3593. <h3>Functions</h3>
  3594. <p class=func><span class=keyword>roomsize</span>(amount);</p>
  3595. <p class=desc>Sets the amount of reverberant echo or apparent room
  3596. size, from 0 (smallest) to 1.0 (largest);
  3597. </p>
  3598. <p class=func><span class=keyword>damping</span>(amount);</p>
  3599. <p class=desc>Sets the damping factor, from 0 to 1.0. More damping
  3600. causes higher frequency echo to decay, creating a softer sound,
  3601. similar to a large room filled with people or materials which
  3602. absorb some sound as it travels between reflecting surfaces.
  3603. Lower damping simulates a harsher reverberant field.
  3604. </p>
  3605. <h3>Examples</h3>
  3606. <p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Freeverb
  3607. </p>
  3608. <h3>Notes</h3>
  3609. <p>Freeverb mono consumes about 21% of the CPU time on Teensy 3.2 and
  3610. requires about 22K of RAM.</p>
  3611. </script>
  3612. <script type="text/x-red" data-template-name="AudioEffectFreeverb">
  3613. <div class="form-row">
  3614. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  3615. <input type="text" id="node-input-name" placeholder="Name">
  3616. </div>
  3617. </script>
  3618. <script type="text/x-red" data-help-name="AudioEffectFreeverbStereo">
  3619. <h3>Summary</h3>
  3620. <div class=tooltipinfo>
  3621. <p>High quality stereo Reverb effect, based on Freeverb by Jezar at Dreampoint.
  3622. </p>
  3623. <p>Teensy 3.5 or 3.6 required to run stereo version.</p>
  3624. </div>
  3625. <h3>Audio Connections</h3>
  3626. <table class=doc align=center cellpadding=3>
  3627. <tr class="top"><th>Port</th><th>Purpose</th></tr>
  3628. <tr class="odd"><td align="center">In 0</td><td>Input</td></tr>
  3629. <tr class="odd"><td align="center">Out 0</td><td>Left Output</td></tr>
  3630. <tr class="odd"><td align="center">Out 1</td><td>Right Output</td></tr>
  3631. </table>
  3632. <h3>Functions</h3>
  3633. <p class=func><span class=keyword>roomsize</span>(amount);</p>
  3634. <p class=desc>Sets the amount of reverberant echo or apparent room
  3635. size, from 0 (smallest) to 1.0 (largest);
  3636. </p>
  3637. <p class=func><span class=keyword>damping</span>(amount);</p>
  3638. <p class=desc>Sets the damping factor, from 0 to 1.0. More damping
  3639. causes higher frequency echo to decay, creating a softer sound,
  3640. similar to a large room filled with people or materials which
  3641. absorb some sound as it travels between reflecting surfaces.
  3642. Lower damping simulates a harsher reverberant field.
  3643. </p>
  3644. <h3>Examples</h3>
  3645. <p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Freeverb_Stereo
  3646. </p>
  3647. <h3>Notes</h3>
  3648. <p>Freeverb mono consumes about 18% of the CPU time on Teensy 3.6 and
  3649. requires about 45K of RAM.</p>
  3650. <p>Teensy 3.2 does not have enough RAM to
  3651. run this effect while playing WAV file and implementing USB Serial.</p>
  3652. </script>
  3653. <script type="text/x-red" data-template-name="AudioEffectFreeverbStereo">
  3654. <div class="form-row">
  3655. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  3656. <input type="text" id="node-input-name" placeholder="Name">
  3657. </div>
  3658. </script>
  3659. <script type="text/x-red" data-help-name="AudioEffectEnvelope">
  3660. <h3>Summary</h3>
  3661. <div class=tooltipinfo>
  3662. <p>Modify a signal with a DAHDSR (Delay Attack Hold Decay Sustain
  3663. Release) envelope.
  3664. </p>
  3665. <p align=center><img src="img/dahdsr.png"></p>
  3666. </div>
  3667. <h3>Audio Connections</h3>
  3668. <table class=doc align=center cellpadding=3>
  3669. <tr class=top><th>Port</th><th>Purpose</th></tr>
  3670. <tr class=odd><td align=center>In 0</td><td>Signal Input</td></tr>
  3671. <tr class=odd><td align=center>Out 0</td><td>Signal with Envelope Applied</td></tr>
  3672. </table>
  3673. <h3>Functions</h3>
  3674. <p class=func><span class=keyword>noteOn</span>();</p>
  3675. <p class=desc>Begin the delay to attack, or the attack phase is
  3676. delay is zero.
  3677. </p>
  3678. <p class=func><span class=keyword>noteOff</span>();</p>
  3679. <p class=desc>Begin the release phase.
  3680. </p>
  3681. <p class=func><span class=keyword>delay</span>(milliseconds);</p>
  3682. <p class=desc>Set the delay from noteOn to the attach phase. The
  3683. default is zero, for no delay.
  3684. </p>
  3685. <p class=func><span class=keyword>attack</span>(milliseconds);</p>
  3686. <p class=desc>Set the attack time. The default is 10.5 milliseconds.
  3687. The maximum is 11880 milliseconds.
  3688. </p>
  3689. <p class=func><span class=keyword>hold</span>(milliseconds);</p>
  3690. <p class=desc>Set the hold time. The default is 2.5 milliseconds.
  3691. The maximum is 11880 milliseconds.
  3692. </p>
  3693. <p class=func><span class=keyword>decay</span>(milliseconds);</p>
  3694. <p class=desc>Set the decay time. The default is 35 milliseconds.
  3695. The maximum is 11880 milliseconds.
  3696. </p>
  3697. <p class=func><span class=keyword>sustain</span>(level);</p>
  3698. <p class=desc>Set the sustain level. The range is 0 to 1.0. The
  3699. gain will be maintained at this level after the decay phase,
  3700. until noteOff() is called. The sustain phase may last any
  3701. length of time, controlled by when release() is called.
  3702. </p>
  3703. <p class=func><span class=keyword>release</span>(milliseconds);</p>
  3704. <p class=desc>Set the release time. The default is 300 millisecond.
  3705. The maximum is 11880 milliseconds.
  3706. </p>
  3707. <p class=func><span class=keyword>releaseNoteOn</span>(milliseconds);</p>
  3708. <p class=desc>Set a quick release time to be used when a new note is
  3709. started while the envelop is in any state passing the signal.
  3710. This will add latency before your new attack phase begins, so
  3711. short times are recommended. Zero may be used to completely
  3712. disable this feature (never extra latency). Longer times help
  3713. reduce clicks or pops. The default is 5 millisecond.
  3714. </p>
  3715. <p class=func><span class=keyword>isActive</span>();</p>
  3716. <p class=desc>Returns true when the envelope is currently in any of
  3717. its 6 phases.
  3718. </p>
  3719. <p class=func><span class=keyword>isSustain</span>();</p>
  3720. <p class=desc>Returns true when the envelope is currently in the
  3721. sustain phase.
  3722. </p>
  3723. <h3>Examples</h3>
  3724. <p class=exam>File &gt; Examples &gt; Audio &gt; Synthesis &gt; PlaySynthMusic
  3725. </p>
  3726. <p class=exam>File &gt; Examples &gt; Audio &gt; Synthesis &gt; pulseWidth
  3727. </p>
  3728. <p class=exam>File &gt; Examples &gt; Audio &gt; MemoryAndCpuUsage
  3729. </p>
  3730. <h3>Notes</h3>
  3731. <p>To achieve the more common ADSR shape, simply
  3732. set delay and hold to zero.</p>
  3733. </script>
  3734. <script type="text/x-red" data-template-name="AudioEffectEnvelope">
  3735. <div class="form-row">
  3736. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  3737. <input type="text" id="node-input-name" placeholder="Name">
  3738. </div>
  3739. </script>
  3740. <script type="text/x-red" data-help-name="AudioEffectMultiply">
  3741. <h3>Summary</h3>
  3742. <div class=tooltipinfo>
  3743. <p>Multiply two signals together, useful for amplitude modulation
  3744. or "voltage controlled amplification".
  3745. </p>
  3746. <p align=center><img src="img/multiply.png"><br><small>56 Hz and 1 kHz sine waves multiplied.</small></p>
  3747. </div>
  3748. <h3>Audio Connections</h3>
  3749. <table class=doc align=center cellpadding=3>
  3750. <tr class=top><th>Port</th><th>Purpose</th></tr>
  3751. <tr class=odd><td align=center>In 0</td><td>Signal Input</td></tr>
  3752. <tr class=odd><td align=center>In 1</td><td>Signal Input</td></tr>
  3753. <tr class=odd><td align=center>Out 0</td><td>Signal with Envelope Applied</td></tr>
  3754. </table>
  3755. <h3>Functions</h3>
  3756. <p>There are no functions to call from the Arduino sketch.
  3757. This object simply multiplies the 2 signals to create
  3758. a continuous output
  3759. </p>
  3760. <!--
  3761. <h3>Examples</h3>
  3762. <p class=exam>File &gt; Examples &gt; Audio &gt;
  3763. </p>
  3764. -->
  3765. <h3>Notes</h3>
  3766. <p>
  3767. </p>
  3768. </script>
  3769. <script type="text/x-red" data-template-name="AudioEffectMultiply">
  3770. <div class="form-row">
  3771. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  3772. <input type="text" id="node-input-name" placeholder="Name">
  3773. </div>
  3774. </script>
  3775. <script type="text/x-red" data-help-name="AudioEffectDelay">
  3776. <h3>Summary</h3>
  3777. <div class=tooltipinfo>
  3778. <p>Delay a signal. Up to 8 separate delay taps can be used.</p>
  3779. <p align=center><img src="img/delay.png"><br><small>1 kHz burst, delayed 5.2 ms.</small></p>
  3780. </div>
  3781. <h3>Audio Connections</h3>
  3782. <table class=doc align=center cellpadding=3>
  3783. <tr class=top><th>Port</th><th>Purpose</th></tr>
  3784. <tr class=odd><td align=center>In 0</td><td>Signal Input</td></tr>
  3785. <tr class=odd><td align=center>Out 0</td><td>Delay Tap #1</td></tr>
  3786. <tr class=odd><td align=center>Out 1</td><td>Delay Tap #2</td></tr>
  3787. <tr class=odd><td align=center>Out 2</td><td>Delay Tap #3</td></tr>
  3788. <tr class=odd><td align=center>Out 3</td><td>Delay Tap #4</td></tr>
  3789. <tr class=odd><td align=center>Out 4</td><td>Delay Tap #5</td></tr>
  3790. <tr class=odd><td align=center>Out 5</td><td>Delay Tap #6</td></tr>
  3791. <tr class=odd><td align=center>Out 6</td><td>Delay Tap #7</td></tr>
  3792. <tr class=odd><td align=center>Out 7</td><td>Delay Tap #8</td></tr>
  3793. </table>
  3794. <h3>Functions</h3>
  3795. <p class=func><span class=keyword>delay</span>(channel, milliseconds);</p>
  3796. <p class=desc>Set output channel (0 to 7) to delay the signals by
  3797. milliseconds. See the table below for the maximum delay. The actual delay
  3798. is rounded to the nearest sample. Each channel can be configured for
  3799. any delay. There is no requirement to configure the "taps" in increasing
  3800. delay order.
  3801. </p>
  3802. <p class=func><span class=keyword>disable</span>(channel);</p>
  3803. <p class=desc>Disable a channel. The output of this channel becomes
  3804. silent. If this channel is the longest delay, memory usage is
  3805. automatically reduced to accomodate only the remaining channels used.
  3806. </p>
  3807. <h3>Examples</h3>
  3808. <p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Delay
  3809. </p>
  3810. <h3>Notes</h3>
  3811. <p>Memory for the delayed signal is take from the memory pool allocated by
  3812. <a href="http://www.pjrc.com/teensy/td_libs_AudioConnection.html" target="_blank">AudioMemory()</a>.
  3813. Each block allows about 2.9 milliseconds of delay, so AudioMemory
  3814. should be increased to allow for the longest delay tap.
  3815. </p>
  3816. <p>Each board has a maximum possible delay.
  3817. </p>
  3818. <table class=doc align=center cellpadding=3>
  3819. <tr class=top><th>Board</th><th>Maximum</th></tr>
  3820. <tr class=odd><td>Teensy 3.0</td><td align=center>139.26 ms</td></tr>
  3821. <tr class=odd><td>Teensy 3.1</td><td align=center>449.39 ms</td></tr>
  3822. <tr class=odd><td>Teensy 3.2</td><td align=center>449.39 ms</td></tr>
  3823. <tr class=odd><td>Teensy 3.5</td><td align=center>1671.19 ms</td></tr>
  3824. <tr class=odd><td>Teensy 3.6</td><td align=center>2413.94 ms</td></tr>
  3825. </table>
  3826. </script>
  3827. <script type="text/x-red" data-template-name="AudioEffectDelay">
  3828. <div class="form-row">
  3829. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  3830. <input type="text" id="node-input-name" placeholder="Name">
  3831. </div>
  3832. </script>
  3833. <script type="text/x-red" data-help-name="AudioEffectDelayExternal">
  3834. <h3>Summary</h3>
  3835. <div class=tooltipinfo>
  3836. <p>Delay a signal, using external memory for longer delay times! Up to 8 separate delay taps can be used.</p>
  3837. <p align=center><img src="img/delay.png"><br><small>1 kHz burst, delayed 5.2 ms.</small></p>
  3838. </div>
  3839. <h3>Audio Connections</h3>
  3840. <table class=doc align=center cellpadding=3>
  3841. <tr class=top><th>Port</th><th>Purpose</th></tr>
  3842. <tr class=odd><td align=center>In 0</td><td>Signal Input</td></tr>
  3843. <tr class=odd><td align=center>Out 0</td><td>Delay Tap #1</td></tr>
  3844. <tr class=odd><td align=center>Out 1</td><td>Delay Tap #2</td></tr>
  3845. <tr class=odd><td align=center>Out 2</td><td>Delay Tap #3</td></tr>
  3846. <tr class=odd><td align=center>Out 3</td><td>Delay Tap #4</td></tr>
  3847. <tr class=odd><td align=center>Out 4</td><td>Delay Tap #5</td></tr>
  3848. <tr class=odd><td align=center>Out 5</td><td>Delay Tap #6</td></tr>
  3849. <tr class=odd><td align=center>Out 6</td><td>Delay Tap #7</td></tr>
  3850. <tr class=odd><td align=center>Out 7</td><td>Delay Tap #8</td></tr>
  3851. </table>
  3852. <h3>Functions</h3>
  3853. <p class=func><span class=keyword>delay</span>(channel, milliseconds);</p>
  3854. <p class=desc>Set output channel (0 to 7) to delay the signals by
  3855. milliseconds. The maximum delay is approx 1.5 seconds for each 23LC1024 chip.
  3856. The actual delay
  3857. is rounded to the nearest sample. Each channel can be configured for
  3858. any delay. There is no requirement to configure the "taps" in increasing
  3859. delay order.
  3860. </p>
  3861. <p class=func><span class=keyword>disable</span>(channel);</p>
  3862. <p class=desc>Disable a channel. The output of this channel becomes
  3863. silent. If this channel is the longest delay, memory usage is
  3864. automatically reduced to accomodate only the remaining channels used.
  3865. </p>
  3866. <h3>Hardware</h3>
  3867. <p>By default, or when <span class=literal>AUDIO_MEMORY_23LC1024</span> is used (see below),
  3868. a single 23LC1024 RAM chip is used, with these pins:
  3869. <table class=doc align=center cellpadding=3>
  3870. <tr class=top><th>Pin</th><th>Signal</th></tr>
  3871. <tr class=odd><td align=center>6</td><td>CS</td></tr>
  3872. <tr class=odd><td align=center>7</td><td>MOSI</td></tr>
  3873. <tr class=odd><td align=center>12</td><td>MISO</td></tr>
  3874. <tr class=odd><td align=center>14</td><td>SCK</td></tr>
  3875. </table>
  3876. </p>
  3877. <p>When <span class=literal>AUDIO_MEMORY_CY15B104</span> is used, a single
  3878. CY15B104 FRAM chip is used, with these pins:
  3879. <table class=doc align=center cellpadding=3>
  3880. <tr class=top><th>Pin</th><th>Signal</th></tr>
  3881. <tr class=odd><td align=center>6</td><td>CS</td></tr>
  3882. <tr class=odd><td align=center>7</td><td>SI</td></tr>
  3883. <tr class=odd><td align=center>12</td><td>SO</td></tr>
  3884. <tr class=odd><td align=center>14</td><td>SCK</td></tr>
  3885. </table>
  3886. </p>
  3887. <p>When <span class=literal>AUDIO_MEMORY_MEMORYBOARD</span> is used, up to six
  3888. 23LC1024 chips are used.
  3889. </p>
  3890. <p align=center><img src="img/memoryboard.jpg"><br><small><a href="https://oshpark.com/shared_projects/KZt5PaU7" target="_blank">Memoryboard 4</a></small></p>
  3891. <p>
  3892. <table class=doc align=center cellpadding=3>
  3893. <tr class=top><th>Pin</th><th>Signal</th></tr>
  3894. <tr class=odd><td align=center>2</td><td>CS0 (encoded)</td></tr>
  3895. <tr class=odd><td align=center>3</td><td>CS1 (encoded)</td></tr>
  3896. <tr class=odd><td align=center>4</td><td>CS2 (encoded)</td></tr>
  3897. <tr class=odd><td align=center>7</td><td>MOSI</td></tr>
  3898. <tr class=odd><td align=center>12</td><td>MISO</td></tr>
  3899. <tr class=odd><td align=center>14</td><td>SCK</td></tr>
  3900. </table>
  3901. </p>
  3902. <p>
  3903. If fewer than 6 chips are soldered, the optional parameter for maximum delay
  3904. must be used. See below for details. Each chip provides 1485 ms of delay
  3905. memory, so the total of all objects using AUDIO_MEMORY_MEMORYBOARD must not
  3906. exceed the amount of memory physically present.
  3907. </p>
  3908. <h3>Examples</h3>
  3909. <p>
  3910. <a href="https://www.youtube.com/watch?v=d80d1HWy5_s" target="_blank">Demo Video</a> (YouTube)
  3911. </p>
  3912. <!--
  3913. <p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Delay
  3914. </p>
  3915. -->
  3916. <p>
  3917. <a href="https://forum.pjrc.com/threads/29276-Limits-of-delay-effect-in-audio-library?p=79436&viewfull=1#post79436" target="_blank">Forum Conversaton</a> (with sample code)
  3918. </p>
  3919. <h3>Notes</h3>
  3920. <p>External RAM allows for longer delays without consuming
  3921. limited internal RAM. However, SPI communication is required,
  3922. which consumes much more CPU time. The
  3923. <a href="http://www.pjrc.com/teensy/td_libs_AudioProcessorUsage.html">AudioProcessorUsageMax</a>
  3924. function may be used to monitor how much CPU time is consumed.
  3925. </p>
  3926. <p>You may specify the type of hardware to be used by editing the code. AUDIO_MEMORY_23LC1024
  3927. specifies a single 23LC1024 chip. AUDIO_MEMORY_MEMORYBOARD allows using up to 6 of these
  3928. chips.
  3929. </p>
  3930. <p class=desc><span class=keyword>AudioEffectDelayExternal</span> delayExt1(<span class=literal>AUDIO_MEMORY_23LC1024</span>);
  3931. </p>
  3932. <p>You may also create more than one delay using the same hardware, where the memory is partitioned
  3933. by specifying a maximum delay in milliseconds. This can be useful if you wish to delay both
  3934. channels of a stereo signal.
  3935. <p class=desc><span class=keyword>AudioEffectDelayExternal</span> delayExt1(<span class=literal>AUDIO_MEMORY_23LC1024</span>, 700);<br><span class=keyword>AudioEffectDelayExternal</span> delayExt2(<span class=literal>AUDIO_MEMORY_23LC1024</span>, 700);
  3936. </p>
  3937. <p>When using CY15B104, you
  3938. <a href="https://forum.pjrc.com/threads/45872-Memory-Chip-for-Audio-Adaptor-Board?p=151839&viewfull=1#post151839">may need to add a capacitor between 3.3V & GND</a>
  3939. to make the chip work.
  3940. </p>
  3941. </script>
  3942. <script type="text/x-red" data-template-name="AudioEffectDelayExternal">
  3943. <div class="form-row">
  3944. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  3945. <input type="text" id="node-input-name" placeholder="Name">
  3946. </div>
  3947. </script>
  3948. <script type="text/x-red" data-help-name="AudioEffectBitcrusher">
  3949. <h3>Summary</h3>
  3950. <div class=tooltipinfo>
  3951. <p>Reduce the samplerate and/or bitdepth of a source signal, resulting in
  3952. a distorted sound.</p>
  3953. </div>
  3954. <h3>Audio Connections</h3>
  3955. <table class=doc align=center cellpadding=3>
  3956. <tr class=top><th>Port</th><th>Purpose</th></tr>
  3957. <tr class=odd><td align=center>In 0</td><td>Signal Input</td></tr>
  3958. <tr class=odd><td align=center>Out 0</td><td>Signal Output</td></tr>
  3959. </table>
  3960. <h3>Functions</h3>
  3961. <p class=func><span class=keyword>bits</span>(xcrushBits);</p>
  3962. <p class=desc>xcrushBits sets the bitdepth, from 1 to 16. A Value of 16
  3963. does not crush the bitdepth, and is effectively a passthru for this part
  3964. of the function.</p>
  3965. <p class=func><span class=keyword>sampleRate</span>(xsampleRate);</p>
  3966. <p class=desc>xsampleRate sets the frequency, from 1 to 44100Hz, however it
  3967. works in integer steps so you will only really get a handful of results from
  3968. the many samplerates you can pass. 44100 is passthru.</p>
  3969. <p class=desc>set xbitDepth to 16 and xsampleRate to 44100 to pass audio
  3970. through without any Bitcrush effect.</p>
  3971. <h3>Examples</h3>
  3972. <p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Bitcrusher
  3973. </p>
  3974. <h3>Notes</h3>
  3975. <p>Needs a lot of improvement. Options for anti-aliasing would be nice in
  3976. the future, but for now, it's rough, it's dirty and it sounds a bit like
  3977. Nine Inch Nails.
  3978. </p>
  3979. <p><a href="http://www.pjrc.com/teensy/td_libs_AudioProcessorUsage.html" target="_blank">AudioNoInterrupts()</a>
  3980. should be used when changing
  3981. settings on multiple objects, so all changes always take effect
  3982. at the same moment.
  3983. </p>
  3984. </script>
  3985. <script type="text/x-red" data-template-name="AudioEffectBitcrusher">
  3986. <div class="form-row">
  3987. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  3988. <input type="text" id="node-input-name" placeholder="Name">
  3989. </div>
  3990. </script>
  3991. <script type="text/x-red" data-help-name="AudioEffectMidSide">
  3992. <h3>Summary</h3>
  3993. <div class=tooltipinfo>
  3994. <p>Convert stereo signals to/from Mid-Side format.
  3995. Mid-Side encoding can be used to increase stereo width, make the lower
  3996. frequencies mono (to please your sub), or as the basis of audio compression.</p>
  3997. </div>
  3998. <h3>Audio Connections</h3>
  3999. <table class=doc align=center cellpadding=3>
  4000. <tr class=top><th>Port</th><th>While<br>Encoding</th><th>While<br>Decoding</th></tr>
  4001. <tr class=odd><td align=center>In 0</td><td>Left Input</td><td>Mid Output</td></tr>
  4002. <tr class=odd><td align=center>In 1</td><td>Right Input</td><td>Side Output</td></tr>
  4003. <tr class=odd><td align=center>Out 0</td><td>Mid Input</td><td>Left Output</td></tr>
  4004. <tr class=odd><td align=center>Out 1</td><td>Side Input</td><td>Right Output</td></tr>
  4005. </table>
  4006. <h3>Functions</h3>
  4007. <p class=func><span class=keyword>encode</span>();</p>
  4008. <p class=desc>Configure this object to encode from stereo to Mid-Side format.</p>
  4009. <p class=func><span class=keyword>decode</span>();</p>
  4010. <p class=desc>Configure this object to decode from Mid-Side format back to stereo signals.</p>
  4011. <h3>Examples</h3>
  4012. <p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Mid_Side</p>
  4013. <h3>Notes</h3>
  4014. <p>Many interesting stereo effects can be achieved by manipulating Mid-Side signals.</p>
  4015. <p>Normally a pair of these objects are used, one to encode, then additional
  4016. gain/attenuation or effects applied to the Mid-Side signals, and finally
  4017. decoding back to stereo signals</p>
  4018. <p>To prevent saturation, halving is done in the encoding, that is:</p>
  4019. <p>Mid = (left+right)/2</p>
  4020. <p>Side = (left-right)/2</p>
  4021. <p>And to decode:</p>
  4022. <p>Left = Mid+Side</p>
  4023. <p>Right = Mid-Side</p>
  4024. </script>
  4025. <script type="text/x-red" data-template-name="AudioEffectMidSide">
  4026. <div class="form-row">
  4027. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  4028. <input type="text" id="node-input-name" placeholder="Name">
  4029. </div>
  4030. </script>
  4031. <script type="text/x-red" data-help-name="AudioEffectWaveshaper">
  4032. <h3>Summary</h3>
  4033. <div class=tooltipinfo>
  4034. <p>Modify the waveform shape of a signal.</p>
  4035. <p align=center><img src="img/waveshaper.png"></p>
  4036. <p>Useful for overdrive, distortion, fuzz,
  4037. clipping, expo converters, phase inversion, waveform modification &amp; adjustments.
  4038. </p>
  4039. </div>
  4040. <h3>Audio Connections</h3>
  4041. <table class=doc align=center cellpadding=3>
  4042. <tr class=top><th>Port</th><th>Signal</th></tr>
  4043. <tr class=odd><td align=center>In 0</td><td>Original Input Signal</td></tr>
  4044. <tr class=odd><td align=center>Out 0</td><td>Shaped Output</td></tr>
  4045. </table>
  4046. <h3>Functions</h3>
  4047. <p class=func><span class=keyword>shape</span>(array, length);</p>
  4048. <p class=desc>Configure the waveform shape. Array is a list of float
  4049. numbers, given in order. The first number maps to input -1.0. The
  4050. last maps to input +1.0. The numbers represent the desired output
  4051. level at each of these input levels. Length must be 2, 3, 5, 9, 17,
  4052. 33, 65, 129, 257, 513, 1025, 2049, 4097, 8193, 16385, or 32769.
  4053. </p>
  4054. <h3>Examples</h3>
  4055. <p class=exam>TODO: example needed</p>
  4056. <!--<p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Mid_Side</p>-->
  4057. <h3>Notes</h3>
  4058. <p><a href="https://github.com/dxinteractive/TeensyAudioWaveshaper">More information</a>
  4059. </p>
  4060. </script>
  4061. <script type="text/x-red" data-template-name="AudioEffectWaveshaper">
  4062. <div class="form-row">
  4063. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  4064. <input type="text" id="node-input-name" placeholder="Name">
  4065. </div>
  4066. </script>
  4067. <script type="text/x-red" data-help-name="AudioEffectGranular">
  4068. <h3>Summary</h3>
  4069. <div class=tooltipinfo>
  4070. <p>Classic granular effect that uses a variable speed buffer to shift the pitch
  4071. and freeze incoming audio.
  4072. Contributed by Bleep Labs.
  4073. </p>
  4074. </div>
  4075. <h3>Audio Connections</h3>
  4076. <table class=doc align=center cellpadding=3>
  4077. <tr class=top><th>Port</th><th>Signal</th></tr>
  4078. <tr class=odd><td align=center>In 0</td><td>Input Signal</td></tr>
  4079. <tr class=odd><td align=center>Out 0</td><td>Granular Output</td></tr>
  4080. </table>
  4081. <h3>Functions</h3>
  4082. <p class=func><span class=keyword>begin</span>(array, length);</p>
  4083. <p class=desc>Initialize the granular processing with an array of 16 bit
  4084. integers used to store the sound grains. Until memory is allocated
  4085. with this function, no audio appears at the output.
  4086. </p>
  4087. <p class=func><span class=keyword>setSpeed</span>(ratio);</p>
  4088. <p class=desc>Configure the relative speed grains will be played. 1.0
  4089. plays the grains without any change. Less than 1.0 slows the sound,
  4090. and greater than 1.0 speeds up. The allowed range is 0.125 to 8.0,
  4091. for &plusmn;3 octaves shift.
  4092. </p>
  4093. <p class=func><span class=keyword>beginFreeze</span>(grainLength);</p>
  4094. <p class=desc>Freeze the sound by sampling one grain, then repeated playing
  4095. it. The grainLength is specified in milliseconds, up to the size allowed
  4096. by the array from begin().
  4097. </p>
  4098. <p class=func><span class=keyword>beginPitchShift</span>(grainLength);</p>
  4099. <p class=desc>Pitch shift by continuously sampling grains and playing them
  4100. at altered speed. The grainLength is specified in milliseconds, up to
  4101. one third of the memory from begin();
  4102. </p>
  4103. <p class=func><span class=keyword>stop</span>();</p>
  4104. <p class=desc>Stop granual processing. The input signal is passed to the
  4105. output without any changes.
  4106. </p>
  4107. <h3>Examples</h3>
  4108. <p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Granular</p>
  4109. <!--<h3>Notes</h3>
  4110. <p> </p>-->
  4111. </script>
  4112. <script type="text/x-red" data-template-name="AudioEffectGranular">
  4113. <div class="form-row">
  4114. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  4115. <input type="text" id="node-input-name" placeholder="Name">
  4116. </div>
  4117. </script>
  4118. <script type="text/x-red" data-help-name="AudioEffectDigitalCombine">
  4119. <h3>Summary</h3>
  4120. <div class=tooltipinfo>
  4121. <p>Combine signals with digital logic functions, with results from
  4122. interesting new waveforms to aggressive digital distortion.
  4123. Contributed by Bleep Labs.
  4124. </p>
  4125. </div>
  4126. <h3>Audio Connections</h3>
  4127. <table class=doc align=center cellpadding=3>
  4128. <tr class=top><th>Port</th><th>Signal</th></tr>
  4129. <tr class=odd><td align=center>In 0</td><td>Input Signal #1</td></tr>
  4130. <tr class=odd><td align=center>In 1</td><td>Input Signal #2</td></tr>
  4131. <tr class=odd><td align=center>Out 0</td><td>Combined Output</td></tr>
  4132. </table>
  4133. <h3>Functions</h3>
  4134. <p class=func><span class=keyword>setCombineMode</span>(mode);</p>
  4135. <p class=desc>Configure which digital combine operation is performed.
  4136. </p>
  4137. <p class=desc>Supported modes:<br>
  4138. <span class=keyword>AudioEffectDigitalCombine</span><b>::OR</b><br>
  4139. <span class=keyword>AudioEffectDigitalCombine</span><b>::XOR</b><br>
  4140. <span class=keyword>AudioEffectDigitalCombine</span><b>::AND</b><br>
  4141. <span class=keyword>AudioEffectDigitalCombine</span><b>::MODULO</b><br>
  4142. </p>
  4143. <h3>Examples</h3>
  4144. <!--<p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Combine</p>-->
  4145. <!--<h3>Notes</h3>
  4146. <p> </p>-->
  4147. </script>
  4148. <script type="text/x-red" data-template-name="AudioEffectDigitalCombine">
  4149. <div class="form-row">
  4150. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  4151. <input type="text" id="node-input-name" placeholder="Name">
  4152. </div>
  4153. </script>
  4154. <script type="text/x-red" data-help-name="AudioFilterBiquad">
  4155. <h3>Summary</h3>
  4156. <div class=tooltipinfo>
  4157. <p>Biquadratic cascaded filter, useful for all sorts of filtering.
  4158. Up to 4 stages may be cascaded.
  4159. </p>
  4160. <p align=center><img src="img/biquad.png"></p>
  4161. </div>
  4162. <h3>Audio Connections</h3>
  4163. <table class=doc align=center cellpadding=3>
  4164. <tr class=top><th>Port</th><th>Purpose</th></tr>
  4165. <tr class=odd><td align=center>In 0</td><td>Signal to be filtered</td></tr>
  4166. <tr class=odd><td align=center>Out 0</td><td>Filtered Signal Output</td></tr>
  4167. </table>
  4168. <h3>Functions</h3>
  4169. <p class=func><span class=keyword>setLowpass</span>(stage, frequency, Q);</p>
  4170. <p class=desc>Configure one stage of the filter (0 to 3) with low pass
  4171. response, with the specified corner frequency and Q shape. If Q is
  4172. higher that 0.7071, be careful of filter gain (see below).
  4173. </p>
  4174. <p class=func><span class=keyword>setHighpass</span>(stage, frequency, Q);</p>
  4175. <p class=desc>Configure one stage of the filter (0 to 3) with high pass
  4176. response, with the specified corner frequency and Q shape. If Q is
  4177. higher that 0.7071, be careful of filter gain (see below).
  4178. </p>
  4179. <p class=func><span class=keyword>setBandpass</span>(stage, frequency, Q);</p>
  4180. <p class=desc>Configure one stage of the filter (0 to 3) with band pass
  4181. response. The filter has unity gain at the specified frequency. Q
  4182. controls the width of frequencies allowed to pass.
  4183. </p>
  4184. <p class=func><span class=keyword>setNotch</span>(stage, frequency, Q);</p>
  4185. <p class=desc>Configure one stage of the filter (0 to 3) with band reject (notch)
  4186. response. Q controls the width of rejected frequencies.
  4187. </p>
  4188. <p class=func><span class=keyword>setLowShelf</span>(stage, frequency, gain, slope);</p>
  4189. <p class=desc>Configure one stage of the filter (0 to 3) with low shelf response.
  4190. A low shelf filter attenuates or amplifies signals below the specified frequency.
  4191. Frequency controls the slope midpoint, gain is in dB and can be both
  4192. positive or negative. The slope parameter controls steepness of gain transition.
  4193. A slope of 1 yields maximum steepness without overshoot,
  4194. lower values yield a less steep slope. See the picture below for a visualization
  4195. of the slope parameter's effect.
  4196. Be careful with positive gains and slopes higher than 1 as they introduce gain
  4197. (see warning below).
  4198. </p>
  4199. </p>
  4200. <p class=func><span class=keyword>setHighShelf</span>(stage, frequency, gain, slope);</p>
  4201. <p class=desc>Configure one stage of the filter (0 to 3) with high shelf response.
  4202. A high shelf filter attenuates or amplifies signals above the specified frequency.
  4203. Frequency controls the slope midpoint, gain is in dB and can be both
  4204. positive or negative. The slope parameter controls steepness of gain transition.
  4205. A slope of 1 yields maximum steepness without overshoot,
  4206. lower values yield a less steep slope. See the picture below for a visualization
  4207. of the slope parameter's effect.
  4208. Be careful with positive gains and slopes higher than 1 as they introduce gain
  4209. (see warning below).
  4210. </p>
  4211. <p align=center><img src="img/shelf_filter.png"></p>
  4212. <p class=func><span class=keyword>setCoefficients</span>(stage, array[5]);</p>
  4213. <p class=desc>Configure one stage of the filter (0 to 3) with an arbitrary
  4214. filter response. The array of coefficients is in order: B0, B1, B2, A1, A2.
  4215. Each coefficient must be less than 2.0 and greater than -2.0. The array
  4216. should be type double. Alternately, it may be type int, where 1.0 is
  4217. represented with 1073741824 (2<sup>30</sup>).
  4218. </p>
  4219. <h3>Examples</h3>
  4220. <p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Filter
  4221. </p>
  4222. <h3>Notes</h3>
  4223. <p>Filters can with gain must have their input signals attenuated, so the
  4224. signal does not exceed 1.0.
  4225. </p>
  4226. <p>This object implements up to 4 cascaded stages. Unconfigured stages will
  4227. not pass any signal.
  4228. </p>
  4229. <p>Biquad filters with low corner frequency (under about 400 Hz) can run into
  4230. trouble with limited numerical precision, causing the filter to perform
  4231. poorly. For very low corner frequency, the State Variable (Chamberlin)
  4232. filter should be used.
  4233. </p>
  4234. </script>
  4235. <script type="text/x-red" data-template-name="AudioFilterBiquad">
  4236. <div class="form-row">
  4237. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  4238. <input type="text" id="node-input-name" placeholder="Name">
  4239. </div>
  4240. </script>
  4241. <script type="text/x-red" data-help-name="AudioFilterFIR">
  4242. <h3>Summary</h3>
  4243. <div class=tooltipinfo>
  4244. <p>Finite impulse response filter, useful for all sorts of filtering.
  4245. </p>
  4246. <p align=center><img src="img/fir_filter.png"></p>
  4247. </div>
  4248. <h3>Audio Connections</h3>
  4249. <table class=doc align=center cellpadding=3>
  4250. <tr class=top><th>Port</th><th>Purpose</th></tr>
  4251. <tr class=odd><td align=center>In 0</td><td>Signal to be filtered</td></tr>
  4252. <tr class=odd><td align=center>Out 0</td><td>Filtered Signal Output</td></tr>
  4253. </table>
  4254. <h3>Functions</h3>
  4255. <p class=func><span class=keyword>begin</span>(array, length);</p>
  4256. <p class=desc>Initialize the filter. The array must be 16 bit integers (the
  4257. filter's impulse response), and
  4258. length indicates the number of points in the array. Array may also be
  4259. FIR_PASSTHRU (length = 0), to directly pass the input to output without
  4260. filtering.
  4261. </p>
  4262. <p class=func><span class=keyword>end</span>();</p>
  4263. <p class=desc>Turn the filter off.
  4264. </p>
  4265. <h3>Examples</h3>
  4266. <p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Filter_FIR
  4267. </p>
  4268. <h3>Known Issues</h3>
  4269. <p>Your filter's impulse response array must have an even length. If you have
  4270. add odd number of taps, you must add an extra zero to increase the length
  4271. to an even number.
  4272. </p>
  4273. <p>The minimum number of taps is 4. If you use less, add extra zeros to increase
  4274. the length to 4.
  4275. </p>
  4276. <p>The impulse response must be given in reverse order. Many filters have
  4277. symetrical impluse response, making this a non-issue. If your filter has
  4278. a non-symetrical response, make sure the data is in reverse time order.
  4279. </p>
  4280. <h3>Notes</h3>
  4281. <p>FIR filters requires more CPU time than Biquad (IIR), but they can
  4282. implement filters with better phase response.
  4283. </p>
  4284. <p>A 100 point filter requires 9% CPU time on Teensy 3.1. The maximum
  4285. supported filter length is 200 points.
  4286. </p>
  4287. <p>The free
  4288. <a href="http://t-filter.engineerjs.com/" target="_blank"> TFilter Design Tool</a>
  4289. can be used to create the impulse response array. Be sure to set the sampling
  4290. frequency to 44117 HZ (it defaults to only 2000 Hz) and the output type to "int" (16 bit).
  4291. </p>
  4292. <p>
  4293. If you use TFilter Design's "C/C++ array" option, it's output has "int" definition, which
  4294. is 32 bits on Teensy 3.1. Edit "int" to "short" for an array of 16 bit numbers,
  4295. and add "const" to avoid consuming extra RAM.
  4296. </p>
  4297. </script>
  4298. <script type="text/x-red" data-template-name="AudioFilterFIR">
  4299. <div class="form-row">
  4300. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  4301. <input type="text" id="node-input-name" placeholder="Name">
  4302. </div>
  4303. </script>
  4304. <script type="text/x-red" data-help-name="AudioFilterStateVariable">
  4305. <h3>Summary</h3>
  4306. <div class=tooltipinfo>
  4307. <p>A State Variable (Chamberlin) Filter with 12 dB/octave roll-off,
  4308. adjustable resonance, and optional signal control of corner
  4309. frequency.</p>
  4310. </div>
  4311. <h3>Audio Connections</h3>
  4312. <table class=doc align=center cellpadding=3>
  4313. <tr class=top><th>Port</th><th>Purpose</th></tr>
  4314. <tr class=odd><td align=center>In 0</td><td>Signal to Filter</td></tr>
  4315. <tr class=odd><td align=center>In 1</td><td>Frequency Control</td></tr>
  4316. <tr class=odd><td align=center>Out 0</td><td>Low Pass Output</td></tr>
  4317. <tr class=odd><td align=center>Out 1</td><td>Band Pass Output</td></tr>
  4318. <tr class=odd><td align=center>Out 2</td><td>High Pass Output</td></tr>
  4319. </table>
  4320. <h3>Functions</h3>
  4321. <p class=func><span class=keyword>frequency</span>(freq);</p>
  4322. <p class=desc>Set the filter's corner frequency. When a signal is
  4323. connected to the control input, the filter will implement this
  4324. frequency when the signal is zero.
  4325. </p>
  4326. <p class=func><span class=keyword>resonance</span>(Q);</p>
  4327. <p class=desc>Set the filter's resonance. Q ranges from 0.7 to 5.0.
  4328. Resonance greater than 0.707 will amplify the signal near the
  4329. corner frequency. You must attenuate the signal before input
  4330. to this filter, to prevent clipping.
  4331. </p>
  4332. <p class=func><span class=keyword>octaveControl</span>(octaves);</p>
  4333. <p class=desc>Set how much (in octaves) the control signal can alter
  4334. the filter's corner freqency. Range is 0 to 7 octaves. For
  4335. example, when set to 2.5, a full scale positive signal (1.0) will
  4336. shift the filter frequency up 2.5 octaves, and a full scale negative
  4337. signal will shift it down 2.5 octaves.
  4338. </p>
  4339. <!--
  4340. <h3>Examples</h3>
  4341. <p class=exam>File &gt; Examples &gt; Audio &gt;
  4342. </p>
  4343. -->
  4344. <h3>Notes</h3>
  4345. <p>
  4346. When controlled by a signal, the equation for the filter
  4347. frequency is:
  4348. </p>
  4349. <p>
  4350. F = Fcenter * 2^<sup>(signal * octaves)</sup>
  4351. <br><small>If anyone knows how to do HTML equations, please
  4352. help me improve this.....</small>
  4353. </p>
  4354. <p>When operating with signal control of corner frequency, this
  4355. object uses approximately 4% of the CPU time on Teensy 3.1.
  4356. </p>
  4357. </script>
  4358. <script type="text/x-red" data-template-name="AudioFilterStateVariable">
  4359. <div class="form-row">
  4360. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  4361. <input type="text" id="node-input-name" placeholder="Name">
  4362. </div>
  4363. </script>
  4364. <script type="text/x-red" data-help-name="AudioAnalyzePeak">
  4365. <h3>Summary</h3>
  4366. <div class=tooltipinfo>
  4367. <p>Track the signal peak amplitude. Very useful for simple
  4368. audio level response projects, and general troubleshooting.</p>
  4369. </div>
  4370. <h3>Audio Connections</h3>
  4371. <table class=doc align=center cellpadding=3>
  4372. <tr class=top><th>Port</th><th>Purpose</th></tr>
  4373. <tr class=odd><td align=center>In 0</td><td>Signal to analyze</td></tr>
  4374. </table>
  4375. <h3>Functions</h3>
  4376. <p class=func><span class=keyword>available</span>();</p>
  4377. <p class=desc>Returns true each time new peak data is available.
  4378. </p>
  4379. <p class=func><span class=keyword>read</span>();</p>
  4380. <p class=desc>Read the highest peak amplitude value since the last read.
  4381. Return is from 0.0 to 1.0.
  4382. </p>
  4383. <p class=func><span class=keyword>readPeakToPeak</span>();</p>
  4384. <p class=desc>Read the highest peak-to-peak amplitude since the last read.
  4385. Return is from 0.0 to 2.0.
  4386. </p>
  4387. <h3>Examples</h3>
  4388. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; PeakMeterMono
  4389. </p>
  4390. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; PeakMeterStereo
  4391. </p>
  4392. <h3>Notes</h3>
  4393. <p></p>
  4394. </script>
  4395. <script type="text/x-red" data-template-name="AudioAnalyzePeak">
  4396. <div class="form-row">
  4397. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  4398. <input type="text" id="node-input-name" placeholder="Name">
  4399. </div>
  4400. </script>
  4401. <script type="text/x-red" data-help-name="AudioAnalyzeRMS">
  4402. <h3>Summary</h3>
  4403. <div class=tooltipinfo>
  4404. <p>Track the signal RMS amplitude. Useful for
  4405. audio level response projects, and general troubleshooting.</p>
  4406. </div>
  4407. <h3>Audio Connections</h3>
  4408. <table class=doc align=center cellpadding=3>
  4409. <tr class=top><th>Port</th><th>Purpose</th></tr>
  4410. <tr class=odd><td align=center>In 0</td><td>Signal to analyze</td></tr>
  4411. </table>
  4412. <h3>Functions</h3>
  4413. <p class=func><span class=keyword>available</span>();</p>
  4414. <p class=desc>Returns true if new RMS data is available.
  4415. </p>
  4416. <p class=func><span class=keyword>read</span>();</p>
  4417. <p class=desc>Read the new RMS value.
  4418. Return is from 0.0 to 1.0.
  4419. </p>
  4420. <h3>Examples</h3>
  4421. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; PeakAndRMSMeterStereo</p>
  4422. </p>
  4423. <h3>Notes</h3>
  4424. <p></p>
  4425. </script>
  4426. <script type="text/x-red" data-template-name="AudioAnalyzeRMS">
  4427. <div class="form-row">
  4428. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  4429. <input type="text" id="node-input-name" placeholder="Name">
  4430. </div>
  4431. </script>
  4432. <script type="text/x-red" data-help-name="AudioAnalyzeFFT256">
  4433. <h3>Summary</h3>
  4434. <div class=tooltipinfo>
  4435. <p>Compute a 256 point Fast Fourier Transform (FFT) frequency analysis,
  4436. with real value (magnitude) output. The frequency resolution is
  4437. 172 Hz, useful for simple audio visualization.</p>
  4438. </div>
  4439. <h3>Audio Connections</h3>
  4440. <table class=doc align=center cellpadding=3>
  4441. <tr class=top><th>Port</th><th>Purpose</th></tr>
  4442. <tr class=odd><td align=center>In 0</td><td>Signal to convert to frequency bins</td></tr>
  4443. </table>
  4444. <h3>Functions</h3>
  4445. <p class=func><span class=keyword>available</span>();</p>
  4446. <p class=desc>Returns true each time the FFT analysis produces new output data.
  4447. </p>
  4448. <p class=func><span class=keyword>read</span>(binNumber);</p>
  4449. <p class=desc>Read a single frequency bin, from 0 to 127. The result is scaled
  4450. so 1.0 represents a full scale sine wave.
  4451. </p>
  4452. <p class=func><span class=keyword>read</span>(firstBin, lastBin);</p>
  4453. <p class=desc>Read several frequency bins, returning their sum. The higher
  4454. audio octaves are represented by many bins, which are typically read
  4455. as a group for audio visualization.
  4456. </p>
  4457. <p class=func><span class=keyword>averageTogether</span>(number);</p>
  4458. <p class=desc>New data is produced very radidly, approximately 344 times
  4459. per second. Multiple outputs can be averaged together, so available()
  4460. returns true at a slower rate.
  4461. </p>
  4462. <p class=func><span class=keyword>windowFunction</span>(window);</p>
  4463. <p class=desc>Set the window function to be used. AudioWindowHanning256
  4464. is the default. Windowing may be disabled by NULL, but windowing
  4465. should be used for all non-periodic (music) signals, and all periodic
  4466. signals that are not exact integer division of the sample rate.
  4467. </p>
  4468. <h3>Examples</h3>
  4469. <p class=exam>File &gt; Examples &gt; Audio &gt; MemoryAndCpuUsage
  4470. </p>
  4471. <h3>Notes</h3>
  4472. <p>The raw 16 bit output data bins may be access with myFFT.output[num], where
  4473. num is 0 to 127.</p>
  4474. <p>TODO: caveats about spectral leakage vs frequency precision for arbitrary signals</p>
  4475. <p>Window Types:
  4476. <ul>
  4477. <li><span class=literal>AudioWindowHanning256</span> (default)</li>
  4478. <li><span class=literal>AudioWindowBartlett256</span></li>
  4479. <li><span class=literal>AudioWindowBlackman256</span></li>
  4480. <li><span class=literal>AudioWindowFlattop256</span></li>
  4481. <li><span class=literal>AudioWindowBlackmanHarris256</span></li>
  4482. <li><span class=literal>AudioWindowNuttall256</span></li>
  4483. <li><span class=literal>AudioWindowBlackmanNuttall256</span></li>
  4484. <li><span class=literal>AudioWindowWelch256</span></li>
  4485. <li><span class=literal>AudioWindowHamming256</span></li>
  4486. <li><span class=literal>AudioWindowCosine256</span></li>
  4487. <li><span class=literal>AudioWindowTukey256</span></li>
  4488. </ul>
  4489. </p>
  4490. </script>
  4491. <script type="text/x-red" data-template-name="AudioAnalyzeFFT256">
  4492. <div class="form-row">
  4493. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  4494. <input type="text" id="node-input-name" placeholder="Name">
  4495. </div>
  4496. </script>
  4497. <script type="text/x-red" data-help-name="AudioAnalyzeFFT1024">
  4498. <h3>Summary</h3>
  4499. <div class=tooltipinfo>
  4500. <p>Compute a 1024 point Fast Fourier Transform (FFT) frequency analysis,
  4501. with real value (magnitude) output. The frequency resolution is
  4502. 43 Hz, useful detailed for audio visualization.</p>
  4503. </div>
  4504. <h3>Audio Connections</h3>
  4505. <table class=doc align=center cellpadding=3>
  4506. <tr class=top><th>Port</th><th>Purpose</th></tr>
  4507. <tr class=odd><td align=center>In 0</td><td>Signal to convert to frequency bins</td></tr>
  4508. </table>
  4509. <h3>Functions</h3>
  4510. <p class=func><span class=keyword>available</span>();</p>
  4511. <p class=desc>Returns true each time the FFT analysis produces new output data.
  4512. </p>
  4513. <p class=func><span class=keyword>read</span>(binNumber);</p>
  4514. <p class=desc>Read a single frequency bin, from 0 to 511. The result is scaled
  4515. so 1.0 represents a full scale sine wave.
  4516. </p>
  4517. <p class=func><span class=keyword>read</span>(firstBin, lastBin);</p>
  4518. <p class=desc>Read several frequency bins, returning their sum. The higher
  4519. audio octaves are represented by many bins, which are typically read
  4520. as a group for audio visualization.
  4521. </p>
  4522. <p class=func><span class=keyword>averageTogether</span>(number);</p>
  4523. <p class=desc>This function does nothing. The 1024 point FFT always
  4524. updates at approximately 86 times per second.
  4525. </p>
  4526. <p class=func><span class=keyword>windowFunction</span>(window);</p>
  4527. <p class=desc>Set the window function to be used. AudioWindowHanning1024
  4528. is the default. Windowing may be disabled by NULL, but windowing
  4529. should be used for all non-periodic (music) signals, and all periodic
  4530. signals that are not exact integer division of the sample rate.
  4531. </p>
  4532. <h3>Examples</h3>
  4533. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; FFT
  4534. </p>
  4535. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; SpectrumAnalyzerBasic
  4536. </p>
  4537. <h3>Notes</h3>
  4538. <p>The raw 16 bit output data bins may be access with myFFT.output[num], where
  4539. num is 0 to 511.</p>
  4540. <p>TODO: caveats about spectral leakage vs frequency precision for arbitrary signals</p>
  4541. <p>Window Types:
  4542. <ul>
  4543. <li><span class=literal>AudioWindowHanning1024</span> (default)</li>
  4544. <li><span class=literal>AudioWindowBartlett1024</span></li>
  4545. <li><span class=literal>AudioWindowBlackman1024</span></li>
  4546. <li><span class=literal>AudioWindowFlattop1024</span></li>
  4547. <li><span class=literal>AudioWindowBlackmanHarris1024</span></li>
  4548. <li><span class=literal>AudioWindowNuttall1024</span></li>
  4549. <li><span class=literal>AudioWindowBlackmanNuttall1024</span></li>
  4550. <li><span class=literal>AudioWindowWelch1024</span></li>
  4551. <li><span class=literal>AudioWindowHamming1024</span></li>
  4552. <li><span class=literal>AudioWindowCosine1024</span></li>
  4553. <li><span class=literal>AudioWindowTukey1024</span></li>
  4554. </ul>
  4555. </p>
  4556. <p>1024 point FFT has a peak CPU usage of approx 52% on Teensy 3.1.
  4557. Average usage is much lower. Future versions might distribute the
  4558. load more evenly over time....
  4559. </p>
  4560. </script>
  4561. <script type="text/x-red" data-template-name="AudioAnalyzeFFT1024">
  4562. <div class="form-row">
  4563. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  4564. <input type="text" id="node-input-name" placeholder="Name">
  4565. </div>
  4566. </script>
  4567. <script type="text/x-red" data-help-name="AudioAnalyzeToneDetect">
  4568. <h3>Summary</h3>
  4569. <div class=tooltipinfo>
  4570. <p>Detect the level of a single tone</p>
  4571. </div>
  4572. <h3>Audio Connections</h3>
  4573. <table class=doc align=center cellpadding=3>
  4574. <tr class=top><th>Port</th><th>Purpose</th></tr>
  4575. <tr class=odd><td align=center>In 0</td><td>Signal to analyze</td></tr>
  4576. </table>
  4577. <h3>Functions</h3>
  4578. <p class=func><span class=keyword>frequency</span>(freq);</p>
  4579. <p class=desc>Set the frequency to detect. The default detection time
  4580. will be 10 cycles of this frequency.
  4581. </p>
  4582. <p class=func><span class=keyword>frequency</span>(freq, cycles);</p>
  4583. <p class=desc>Set the frequency to detect, and the number of cycles.
  4584. Longer detection time (more cycles) will give higher precision,
  4585. but of course slower response.
  4586. </p>
  4587. <p class=func><span class=keyword>available</span>();</p>
  4588. <p class=desc>Returns true (non-zero) each time a detection interval
  4589. (number of cycles) completed and a new level is detected.
  4590. </p>
  4591. <p class=func><span class=keyword>read</span>();</p>
  4592. <p class=desc>Read the detected signal level. Range is 0 to 1.0.
  4593. </p>
  4594. <p class=func><span class=keyword>threshold</span>(level);</p>
  4595. <p class=desc>Set a detection threshold, where the bool test operation
  4596. will return true if at or above this level, or false when below.
  4597. </p>
  4598. <p class=func>(bool)</p>
  4599. <p class=desc>By testing the object as a boolean value, you can respond
  4600. to detection of a tone.
  4601. </p>
  4602. <h3>Examples</h3>
  4603. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; DialTone_Serial
  4604. </p>
  4605. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; DialTone_7segment
  4606. </p>
  4607. <h3>Notes</h3>
  4608. <p>Low frequency detection has trouble with numerical precision.
  4609. Works really well for all 8 DTMF frequencies, but fails for
  4610. detecting "sub audible tones" used in some control applications.</p>
  4611. <p>The (bool) test continues to return true until the next detection
  4612. interval (the configured number of cycles). This behavior may
  4613. change in future versions, for a single true each time the signal
  4614. is detected, and then false for the remainder of that interval.</p>
  4615. </script>
  4616. <script type="text/x-red" data-template-name="AudioAnalyzeToneDetect">
  4617. <div class="form-row">
  4618. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  4619. <input type="text" id="node-input-name" placeholder="Name">
  4620. </div>
  4621. </script>
  4622. <script type="text/x-red" data-help-name="AudioAnalyzeNoteFrequency">
  4623. <h3>Summary</h3>
  4624. <div class=tooltipinfo>
  4625. <p>Detect with fairly good accuracy the fundamental frequency f<sub>o</sub>
  4626. of musical notes, such as electric guitar and bass.</p>
  4627. </div>
  4628. <p>Written By Collin Duffy</p>
  4629. <h3>Audio Connections</h3>
  4630. <table class=doc align=center cellpadding=3>
  4631. <tr class=top><th>Port</th><th>Purpose</th></tr>
  4632. <tr class=odd><td align=center>In 0</td><td>Signal to analyze</td></tr>
  4633. </table>
  4634. <h3>Functions</h3>
  4635. <p class=func><span class=keyword>begin</span>(threshold);</p>
  4636. <p class=desc>Initialize and start detecting frequencies,
  4637. with an initial threshold (the amount of allowed uncertainty).
  4638. </p>
  4639. <p class=func><span class=keyword>available</span>();</p>
  4640. <p class=desc>Returns true (non-zero) when a valid
  4641. frequency is detected.
  4642. </p>
  4643. <p class=func><span class=keyword>read</span>();</p>
  4644. <p class=desc>Read the detected frequency.
  4645. </p>
  4646. <p class=func><span class=keyword>probability</span>();</p>
  4647. <p class=desc>Return the level of certainty, betweeo 0 to 1.0.
  4648. </p>
  4649. <p class=func><span class=keyword>threshold</span>(level);</p>
  4650. <p class=desc>Set the detection threshold, the amount of allowed uncertainty.
  4651. </p>
  4652. <h3>Examples</h3>
  4653. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; NoteFrequency
  4654. </p>
  4655. <h3>Notes</h3>
  4656. <p>The <a href="http://recherche.ircam.fr/equipes/pcm/cheveign/pss/2002_JASA_YIN.pdf">YIN algorithm</a> (PDF)
  4657. is used to detect frequencies, with many optimizations for
  4658. frequencies between 29-400Hz. This algorithm can be somewhat
  4659. memory and processor hungry but will allow you to detect with
  4660. fairly good accuracy the fundamental frequencies from
  4661. electric guitars and basses.</p>
  4662. <p>Within the code, AUDIO_GUITARTUNER_BLOCKS
  4663. may be edited to control low frequency range. The default
  4664. (24) allows measurement down to 29.14 Hz, or B(flat)0.</p>
  4665. <p>TODO: The usable upper range of this object is not well known.
  4666. Duff says "it should be good up to 1000Hz", but may have trouble
  4667. at 4 kHz. Please <a href="https://forum.pjrc.com/threads/32252-Different-Range-FFT-Algorithm/page2">post feedback here</a>, ideally with audio clips for the NoteFrequency example.</p>
  4668. <p>This object was contributed by Collin Duffy from his
  4669. <a href="https://github.com/duff2013/AudioTuner">AudioTuner project</a>.
  4670. Additional details and documentation may be found there.</p>
  4671. </script>
  4672. <script type="text/x-red" data-template-name="AudioAnalyzeNoteFrequency">
  4673. <div class="form-row">
  4674. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  4675. <input type="text" id="node-input-name" placeholder="Name">
  4676. </div>
  4677. </script>
  4678. <script type="text/x-red" data-help-name="AudioAnalyzePrint">
  4679. <h3>Summary</h3>
  4680. <div class=tooltipinfo>
  4681. <p>Print raw audio data to the Arduino Serial Monitor. This
  4682. object creates massive output quickly, and should not normally be used.</p>
  4683. </div>
  4684. <h3>Audio Connections</h3>
  4685. <table class=doc align=center cellpadding=3>
  4686. <tr class=top><th>Port</th><th>Purpose</th></tr>
  4687. <tr class=odd><td align=center>In 0</td><td>Signal to print</td></tr>
  4688. </table>
  4689. <h3>Functions</h3>
  4690. <p class=func><span class=keyword>name</span>(string);</p>
  4691. <p class=desc>blah blah blah blah
  4692. </p>
  4693. <p class=func><span class=keyword>trigger</span>();</p>
  4694. <p class=desc>blah blah blah blah
  4695. </p>
  4696. <p class=func><span class=keyword>trigger</span>(level, edge);</p>
  4697. <p class=desc>blah blah blah blah
  4698. </p>
  4699. <p class=func><span class=keyword>delay</span>(samples);</p>
  4700. <p class=desc>blah blah blah blah
  4701. </p>
  4702. <p class=func><span class=keyword>length</span>(samples);</p>
  4703. <p class=desc>blah blah blah blah
  4704. </p>
  4705. <!--
  4706. <h3>Examples</h3>
  4707. <p class=exam>File &gt; Examples &gt; Audio &gt;
  4708. </p>
  4709. -->
  4710. <h3>Notes</h3>
  4711. <p>This object doesn't work very well and probably should not be used.</p>
  4712. </script>
  4713. <script type="text/x-red" data-template-name="AudioAnalyzePrint">
  4714. <div class="form-row">
  4715. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  4716. <input type="text" id="node-input-name" placeholder="Name">
  4717. </div>
  4718. </script>
  4719. <script type="text/x-red" data-help-name="AudioControlSGTL5000">
  4720. <h3>Summary</h3>
  4721. <div class=tooltipinfo>
  4722. <p>Control the SGTL5000 chip on the
  4723. <a href="http://www.pjrc.com/store/teensy3_audio.html" target="_blank">audio shield</a>.
  4724. SGTL5000 is always used in slave mode, where Teensy controls
  4725. all I2S timing.
  4726. </p>
  4727. <p align=center><img src="img/sgtl5000closeup.jpg"></p>
  4728. </div>
  4729. <h3>Audio Connections</h3>
  4730. <p>This object has no audio inputs or outputs. Separate i2s objects
  4731. are used to send and receive audio data. I2S master mode objects
  4732. must be used, because this object configures the SGTL5000 in slave
  4733. mode, where it depends on Teensy to provide all I2S clocks.
  4734. This object controls
  4735. how the SGTL5000 will use those I2S audio streams.</p>
  4736. <h3>Functions</h3>
  4737. <p>These are the most commonly used SGTL5000 functions.</p>
  4738. <p class=func><span class=keyword>enable</span>();</p>
  4739. <p class=desc>Start the SGTL5000. This function should be called first.
  4740. </p>
  4741. <p class=func><span class=keyword>volume</span>(level);</p>
  4742. <p class=desc>Set the headphone volume level. Range is 0 to 1.0, but
  4743. 0.8 corresponds to the maximum undistorted output for a full scale
  4744. signal. Usually 0.5 is a comfortable listening level. The line
  4745. level outputs are <em>not</em> changed by this function.
  4746. </p>
  4747. <p class=func><span class=keyword>inputSelect</span>(input);</p>
  4748. <p class=desc>Select which input to use: AUDIO_INPUT_LINEIN or AUDIO_INPUT_MIC.
  4749. </p>
  4750. <p class=func><span class=keyword>micGain</span>(dB);</p>
  4751. <p class=desc>When using the microphone input, set the amplifier gain.
  4752. The input number is in decibels, from 0 to 63.
  4753. </p>
  4754. <h3>Signal Levels</h3>
  4755. <p>The default signal levels should be used for most applications,
  4756. but these functions allow you to customize the analog signals.</p>
  4757. <p class=func><span class=keyword>muteHeadphone</span>();</p>
  4758. <p class=desc>Silence the headphone output.
  4759. </p>
  4760. <p class=func><span class=keyword>unmuteHeadphone</span>();</p>
  4761. <p class=desc>Turn the headphone output on.
  4762. </p>
  4763. <p class=func><span class=keyword>muteLineout</span>();</p>
  4764. <p class=desc>Silence the line level outputs.
  4765. </p>
  4766. <p class=func><span class=keyword>unmuteLineout</span>();</p>
  4767. <p class=desc>Turn the line level outputs on.
  4768. </p>
  4769. <p class=func><span class=keyword>lineInLevel</span>(both);</p>
  4770. <p class=desc style="padding-bottom:0.2em;">Adjust the sensitivity of the line-level inputs.
  4771. Fifteen settings are possible:
  4772. </p>
  4773. <pre class="desc">
  4774. 0: 3.12 Volts p-p
  4775. 1: 2.63 Volts p-p
  4776. 2: 2.22 Volts p-p
  4777. 3: 1.87 Volts p-p
  4778. 4: 1.58 Volts p-p
  4779. 5: 1.33 Volts p-p (default)
  4780. 6: 1.11 Volts p-p
  4781. 7: 0.94 Volts p-p
  4782. 8: 0.79 Volts p-p
  4783. 9: 0.67 Volts p-p
  4784. 10: 0.56 Volts p-p
  4785. 11: 0.48 Volts p-p
  4786. 12: 0.40 Volts p-p
  4787. 13: 0.34 Volts p-p
  4788. 14: 0.29 Volts p-p
  4789. 15: 0.24 Volts p-p
  4790. </pre>
  4791. <p class=func><span class=keyword>lineInLevel</span>(left, right);</p>
  4792. <p class=desc>Adjust the sensitivity of the line-level inputs, with different
  4793. settings for left and right. The same 15 settings are available.
  4794. </p>
  4795. <p class=func><span class=keyword>lineOutLevel</span>(both);</p>
  4796. <p class=desc style="padding-bottom:0.2em;">Adjust the line level output
  4797. voltage range. The following settings are possible:
  4798. </p>
  4799. <pre class="desc">
  4800. 13: 3.16 Volts p-p
  4801. 14: 2.98 Volts p-p
  4802. 15: 2.83 Volts p-p
  4803. 16: 2.67 Volts p-p
  4804. 17: 2.53 Volts p-p
  4805. 18: 2.39 Volts p-p
  4806. 19: 2.26 Volts p-p
  4807. 20: 2.14 Volts p-p
  4808. 21: 2.02 Volts p-p
  4809. 22: 1.91 Volts p-p
  4810. 23: 1.80 Volts p-p
  4811. 24: 1.71 Volts p-p
  4812. 25: 1.62 Volts p-p
  4813. 26: 1.53 Volts p-p
  4814. 27: 1.44 Volts p-p
  4815. 28: 1.37 Volts p-p
  4816. 29: 1.29 Volts p-p (default)
  4817. 30: 1.22 Volts p-p
  4818. 31: 1.16 Volts p-p
  4819. </pre>
  4820. <p class=func><span class=keyword>lineOutLevel</span>(left, right);</p>
  4821. <p class=desc>Adjust the line level outout voltage range, with separate
  4822. settings for left and right. The same settings (13 to 31) are available.
  4823. </p>
  4824. <h3>Signal Conditioning</h3>
  4825. <p>Usually these digital signal conditioning features should be left at their
  4826. default settings.
  4827. </p>
  4828. <p class=func><span class=keyword>adcHighPassFilterFreeze</span>();</p>
  4829. <p class=desc>By default, the analog input (either line-level inputs or mic)
  4830. is high-pass filtered, to remove any DC component. This function
  4831. freezes the filter, so the current DC component is still substracted, but
  4832. the filter stops tracking any DC or low frequency changes.
  4833. </p>
  4834. <p class=func><span class=keyword>adcHighPassFilterDisable</span>();</p>
  4835. <p class=desc>Completely disable the analog input filter. DC and sub-audible
  4836. low frequencies are allowed to enter the digital signal. This
  4837. <a href="http://openaudio.blogspot.com/2017/03/teensy-audio-board-self-noise.html">may
  4838. reduce noise</a> in some cases.
  4839. </p>
  4840. <p class=func><span class=keyword>adcHighPassFilterEnable</span>();</p>
  4841. <p class=desc>Turn the DC-blocking filter back on, if disabled, or
  4842. allows it to resume tracking DC and low frequency changes, if
  4843. previously frozen. This is the default setting.
  4844. </p>
  4845. <p class=func><span class=keyword>dacVolume</span>(both);</p>
  4846. <p class=desc>Normally output volume should be used with volume(), which
  4847. changes the analog gain in the headphone amplifier. This function
  4848. on the other hand controls digital attenuation before conversion to analog, which
  4849. reduces resolution, but allows another fine control of output
  4850. signal level. The ranges is 0 to 1.0, with the default (no digital attenuation)
  4851. at 1.0.
  4852. </p>
  4853. <p class=desc>dacVolume uses zero-crossing detect to avoid clicks, and graceful
  4854. ramping is handled by the chip so that a new volume may be set directly in
  4855. a single call.
  4856. </p>
  4857. <p class=func><span class=keyword>dacVolume</span>(left, right);</p>
  4858. <p class=desc>Adjust the digital output volume separately on left and
  4859. right channels.
  4860. </p>
  4861. <p class=func><span class=keyword>dacVolumeRamp</span>();</p>
  4862. <p class=desc>Enable graceful volume ramping. The dacVolume adjusts gradually using
  4863. an exponential curve. Pops or loud clicks are avoided when making large
  4864. changes in volume level.
  4865. </p>
  4866. <p class=func><span class=keyword>dacVolumeRampLinear</span>();</p>
  4867. <p class=desc>Enable faster volume ramping. A slight click may be heard during a
  4868. large volume change.
  4869. </p>
  4870. <p class=func><span class=keyword>dacVolumeRampDisable</span>();</p>
  4871. <p class=desc>Do not use any gradual ramping. The zero cross feature still helps
  4872. for small changes, but large volume changes may produce a pop or click.
  4873. </p>
  4874. <h3>Audio Processor</h3>
  4875. <p>The optional digital audio processor is capable of implementing
  4876. one or more of: automatic volume control, surround sound control,
  4877. bass enhancement, and tonal adjustments (either a
  4878. simple tone control, or a parametric equalizer, or a graphic equalizer),
  4879. in that order.
  4880. </p>
  4881. <p>These signal processing features are implemented in the SGTL5000 chip,
  4882. so they do not consume CPU time on Teensy. However, the order of
  4883. these processes is fixed in the hardware.
  4884. </p>
  4885. <p>It is good practice to mute the outputs before enabling or disabling
  4886. the Audio Processor, to avoid clicks or thumps.
  4887. </p>
  4888. <p class=func><span class=keyword>audioPreProcessorEnable</span>();</p>
  4889. <p class=desc>Enable the audio processor to pre-process the input
  4890. (from either line-level inputs or microphone) before it's sent
  4891. to Teensy by I2S.
  4892. </p>
  4893. <p class=func><span class=keyword>audioPostProcessorEnable</span>();</p>
  4894. <p class=desc>Enable the audio processor to post-process Teensy's
  4895. I2S output before it's turned into analog signals for the
  4896. headphones and/or line level outputs.
  4897. </p>
  4898. <p class=func><span class=keyword>audioProcessorDisable</span>();</p>
  4899. <p class=desc>Disable the audio processor.
  4900. </p>
  4901. <p class=func><span class=keyword>autoVolumeControl</span>(maxGain, response, hardLimit, threshold, attack, decay);</p>
  4902. <p class=desc>Configures the auto volume control, which is implemented as a compressor/expander
  4903. or hard limiter. <em>maxGain</em> is the maximum gain that can be applied for expanding, and
  4904. can take one of three values: 0 (0dB), 1 (6.0dB) and 2 (12dB). Values greater than 2 are treated
  4905. as 2. <em>response</em> controls the integration time for the compressor and can take
  4906. four values: 0 (0ms), 1 (25ms), 2 (50ms) or 3 (100ms). Larger values average the volume
  4907. over a longer time, allowing short-term peaks through.
  4908. </p>
  4909. <p class=desc>If <em>hardLimit</em> is 0, a 'soft
  4910. knee' compressor is used to progressively compress louder values which are near to or above the
  4911. threashold (the louder they are, the greater the compression). If it is 1, a hard compressor
  4912. is used (all values above the threashold are the same loudness). The <em>threashold</em> is specified
  4913. as a float in the range 0dBFS to -96dBFS, where -18dBFS is a typical value.
  4914. <em>attack</em> is a float controlling the rate of decrease in gain when the signal is over
  4915. threashold, in dB/s. <em>decay</em> controls how fast gain is restored once the level
  4916. drops below threashold, again in dB/s. It is typically set to a longer value than attack.
  4917. </p>
  4918. <p class=func><span class=keyword>autoVolumeEnable</span>();</p>
  4919. <p class=desc>Enables auto volume control, using the previously specified settings.
  4920. </p>
  4921. <p class=func><span class=keyword>autoVolumeDisable</span>();</p>
  4922. <p class=desc>Disables auto volume control.
  4923. </p>
  4924. <p class=func><span class=keyword>surroundSoundEnable</span>();</p>
  4925. <p class=desc>Enable virtual surround processing, to give a broader and
  4926. deeper stereo image (even with mono input).
  4927. </p>
  4928. <p class=func><span class=keyword>surroundSoundDisable</span>();</p>
  4929. <p class=desc>Disable virtual surround processing. Before disabling, ramp up
  4930. the width to maximum to avoid pops.
  4931. </p>
  4932. <p class=func><span class=keyword>surroundSound</span>(width);</p>
  4933. <p class=desc>Configures virtual surround width from 0 (mono) to 7 (widest).
  4934. </p>
  4935. <p class=func><span class=keyword>surroundSound</span>(width, select);</p>
  4936. <p class=desc>Configures virtual surround width from 0 (mono) to 7 (widest).
  4937. <em>select</em> may be set to 1 (disable), 2 (mono input) or 3 (stereo input).
  4938. </p>
  4939. <p class=func><span class=keyword>enhanceBassEnable</span>();</p>
  4940. <p class=desc>Enable bass enhancement. A mono, low-pass filtered copy of
  4941. the original stereo signal has bass levels boosted and is then mixed back into
  4942. the stereo signal, which is then optionally high pass filtered (to remove
  4943. inaudible subsonic frequencies).
  4944. </p>
  4945. <p class=func><span class=keyword>enhanceBassDisable</span>();</p>
  4946. <p class=desc>Disable bass enhancement. Before disabling, ramp down the bass
  4947. enhancement level to zero.
  4948. </p>
  4949. <p class=func><span class=keyword>enhanceBass</span>(lr_lev, bass_lev);</p>
  4950. <p class=desc>Configures the bass enhancement by setting the levels of the
  4951. original stereo signal and the bass-enhanced mono level which will be mixed together.
  4952. There is no high-pass filter.
  4953. </p>
  4954. <p class=desc>When changing bass level, call this function repeatedly to ramp up or down the bass in
  4955. steps of 0.5dB, to avoid pops.
  4956. </p>
  4957. <p class=func><span class=keyword>enhanceBass</span>(lr_lev, bass_lev, hpf_bypass, cutoff);</p>
  4958. <p class=desc>Configures the bass enhancement by setting the levels of the
  4959. original stereo signal and the bass-enhanced mono level which will be mixed together.
  4960. The high-pass filter may be enabled (0) or bypassed (1). The cutoff frequency is specified
  4961. as follows:
  4962. </p>
  4963. <pre class="desc">
  4964. value frequency
  4965. 0 80Hz
  4966. 1 100Hz
  4967. 2 125Hz
  4968. 3 150Hz
  4969. 4 175Hz
  4970. 5 200Hz
  4971. 6 225Hz
  4972. </pre>
  4973. <p class=desc>When changing bass level, call this function repeatedly to ramp up or down the bass in
  4974. steps of 0.5dB, to avoid pops.
  4975. </p>
  4976. <p class=func><span class=keyword>eqSelect</span>(n);</p>
  4977. <p class=desc>Selects the type of frequency control, where <em>n</em> is
  4978. one of</p>
  4979. <p class=desc><b>FLAT_FREQUENCY (0)</b><br>
  4980. Equalizers and tone controls disabled, flat frequency response.</p>
  4981. <p class=desc><b>PARAMETRIC_EQUALIZER (1)</b><br>
  4982. Enables the 7-band parametric equalizer, thus disabling the
  4983. tone controls and graphic equalizer.</p>
  4984. <p class=desc><b>TONE_CONTROLS (2)</b><br>
  4985. Enables bass and treble tone controls, disabling the parametric
  4986. equalization and graphic equalizer.</p>
  4987. <p class=desc><b>GRAPHIC_EQUALIZER (3)</b><br>
  4988. Enables the five-band graphic equalizer, disabling the parametric
  4989. equalization and tone controls.</p>
  4990. <p class=func><span class=keyword>eqBands</span>(bass, treble);</p>
  4991. <p class=desc>Configures bass and treble tone controls, which are
  4992. implemented as one second order low pass filter (bass) in parallel with
  4993. one second order high pass filter (treble).
  4994. </p>
  4995. <p class=desc>When changing bass or treble level, call this function repeatedly to ramp
  4996. up or down the level in steps of 0.04 (=0.5dB) or so, to avoid pops.
  4997. </p>
  4998. <p class=func><span class=keyword>eqBands</span>(bass, mid_bass, midrange, mid_treble, treble);</p>
  4999. <p class=desc>Configures the graphic equalizer. It is implemented by five parallel,
  5000. second order biquad filters with fixed frequencies of 115Hz, 330Hz, 990Hz, 3kHz,
  5001. and 9.9kHz. Each band has a range of adjustment from 1.00 (+12dB) to -1.00 (-11.75dB).
  5002. </p>
  5003. <p class=func><span class=keyword>eqBand</span>(bandNum, n);</p>
  5004. <p class=desc>Configures the gain or cut on one band in the graphic equalizer.
  5005. <em>bandnum</em> can range from 1 to 5; <em>n</em> is a float in the range 1.00 to -1.00.
  5006. </p>
  5007. <p class=desc>When changing a band, call this function repeatedly to ramp up the gain in steps of 0.5dB,
  5008. to avoid pops.
  5009. </p>
  5010. <p class=func><span class=keyword>eqFilter</span>(filterNum, filterParameters);</p>
  5011. <p class=desc>Configurs the parametric equalizer. The number of filters (1 to 7)
  5012. is specified along with a pointer to an array of filter coefficients.
  5013. The parametric equalizer is implemented using 7 cascaded, second order bi-quad
  5014. filters whose frequencies, gain, and Q may be freely configured, but each filter
  5015. can only be specified as a set of filter coefficients.
  5016. </p>
  5017. <p class=func><span class=keyword>eqFilterCount</span>(n);</p>
  5018. <p class=desc>Enables zero or more of the already enabled parametric filters.
  5019. </p>
  5020. <h3>Examples</h3>
  5021. <p>Nearly all of the library's examples use this object. These
  5022. examples demonstrate its special features.
  5023. </p>
  5024. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; PassThroughStereo
  5025. </p>
  5026. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; SGTL5000 &gt; dap_bass_enhance
  5027. </p>
  5028. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; SGTL5000 &gt; dap_avc_agc
  5029. </p>
  5030. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; SGTL5000 &gt; balanceDAC
  5031. </p>
  5032. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; SGTL5000 &gt; balanceHP
  5033. </p>
  5034. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; SGTL5000 &gt; CalcBiquadToneControlDAP
  5035. </p>
  5036. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; SGTL5000 &gt; VolumeRamp
  5037. </p>
  5038. <h3>Notes</h3>
  5039. <p>TODO: add example with rock/classical/speech presets, where rock uses bass boost
  5040. and surround enhancement while speech uses bandpass filtering and auto volume control
  5041. compression.
  5042. </p>
  5043. <p>TODO: add example with two analogRead pots for bass and treble to demonstrate ramping.
  5044. </p>
  5045. </script>
  5046. <script type="text/x-red" data-template-name="AudioControlSGTL5000">
  5047. <div class="form-row">
  5048. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  5049. <input type="text" id="node-input-name" placeholder="Name">
  5050. </div>
  5051. </script>
  5052. <script type="text/x-red" data-help-name="AudioControlWM8731">
  5053. <h3>Summary</h3>
  5054. <div class=tooltipinfo>
  5055. <p>Control a WM8731 chip in slave mode, where it receives all clocks from Teensy</p>
  5056. </div>
  5057. <h3>Audio Connections</h3>
  5058. <p>This object has no audio inputs or outputs. Separate i2s objects
  5059. are used to send and receive audio data. I2S master mode objects
  5060. must be used, since this control object configures the WM8731 into
  5061. slave mode.
  5062. </p>
  5063. <h3>Functions</h3>
  5064. <p class=func><span class=keyword>enable</span>();</p>
  5065. <p class=desc>Turn on the WS8731.
  5066. </p>
  5067. <p class=func><span class=keyword>disable</span>();</p>
  5068. <p class=desc>not implemented
  5069. </p>
  5070. <p class=func><span class=keyword>volume</span>(level);</p>
  5071. <p class=desc>Set the headphone volume level. Range is 0 to 1.0.
  5072. </p>
  5073. <p class=func><span class=keyword>inputLevel</span>(level);</p>
  5074. <p class=desc>Adjust the line level input gain. Range is 0 to 1.0.
  5075. </p>
  5076. <p class=func><span class=keyword>inputSelect</span>(input);</p>
  5077. <p class=desc>Select which input to use: AUDIO_INPUT_LINEIN or AUDIO_INPUT_MIC.
  5078. </p>
  5079. <!--
  5080. <h3>Examples</h3>
  5081. <p class=exam>File &gt; Examples &gt; Audio &gt;
  5082. </p>
  5083. -->
  5084. <h3>Notes</h3>
  5085. <p></p>
  5086. </script>
  5087. <script type="text/x-red" data-template-name="AudioControlWM8731">
  5088. <div class="form-row">
  5089. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  5090. <input type="text" id="node-input-name" placeholder="Name">
  5091. </div>
  5092. </script>
  5093. <script type="text/x-red" data-help-name="AudioControlWM8731master">
  5094. <h3>Summary</h3>
  5095. <div class=tooltipinfo>
  5096. <p>Control a WM8731 chip in master mode, where it controls all I2S timing.</p>
  5097. </div>
  5098. <h3>Audio Connections</h3>
  5099. <p>This object has no audio inputs or outputs. Separate i2s objects
  5100. are used to send and receive audio data. I2S slave mode objects
  5101. must be used, since this control object configures the WM8731 into
  5102. master mode.
  5103. </p>
  5104. <h3>Functions</h3>
  5105. <p class=func><span class=keyword>enable</span>();</p>
  5106. <p class=desc>Turn on the WS8731, in I2S Master mode. I2S slave mode
  5107. communication must be used by Teensy.
  5108. </p>
  5109. <p class=func><span class=keyword>disable</span>();</p>
  5110. <p class=desc>not implemented
  5111. </p>
  5112. <p class=func><span class=keyword>volume</span>(level);</p>
  5113. <p class=desc>Set the headphone volume level. Range is 0 to 1.0.
  5114. </p>
  5115. <p class=func><span class=keyword>inputLevel</span>(level);</p>
  5116. <p class=desc>Adjust the line level input gain. Range is 0 to 1.0.
  5117. </p>
  5118. <p class=func><span class=keyword>inputSelect</span>(input);</p>
  5119. <p class=desc>Select which input to use: AUDIO_INPUT_LINEIN or AUDIO_INPUT_MIC.
  5120. </p>
  5121. <h3>Examples</h3>
  5122. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; WM8731MikroSine
  5123. </p>
  5124. <h3>Notes</h3>
  5125. <p>The WM8731 will implement a sample rate of its crystal frequency divided by 256.
  5126. To get the 44.1 kHz sample rate the Teensy Audio Library expects, an
  5127. 11.2896 MHz crystal should be used.
  5128. </p>
  5129. </script>
  5130. <script type="text/x-red" data-template-name="AudioControlWM8731master">
  5131. <div class="form-row">
  5132. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  5133. <input type="text" id="node-input-name" placeholder="Name">
  5134. </div>
  5135. </script>
  5136. <script type="text/x-red" data-help-name="AudioControlAK4558">
  5137. <h3>Summary</h3>
  5138. <div class=tooltipinfo>
  5139. <p>Control the AK4558 chip on the <a href="https://hackaday.io/project/8567-hifi-audio-codec-module" target="_blank">HiFi Audio CODEC Module</a>
  5140. in slave mode, where the Teensy controls all I2S timing.</p>
  5141. </div>
  5142. <h3>Audio Connections</h3>
  5143. <p>This object has no audio inputs or outputs. Separate I2S objects
  5144. are used to send and receive audio data.
  5145. </p>
  5146. <h3>Functions</h3>
  5147. <p class=func><span class=keyword>enable</span>();</p>
  5148. <p class=desc>Enables the CODEC to work with 44.1 KHz - 16 bit data. This function does not enable the ADC/DAC modules.
  5149. </p>
  5150. <p class=func><span class=keyword>enableIn</span>();</p>
  5151. <p class=desc>Enables the ADC module.
  5152. </p>
  5153. <p class=func><span class=keyword>enableOut</span>();</p>
  5154. <p class=desc>Enables the DAC module.
  5155. </p>
  5156. <p class=func><span class=keyword>disable</span>();</p>
  5157. <p class=desc>Disables the ADC and the DAC modules.
  5158. </p>
  5159. <p class=func><span class=keyword>disableIn</span>();</p>
  5160. <p class=desc>Disable the ADC module.
  5161. </p>
  5162. <p class=func><span class=keyword>disableOut</span>();</p>
  5163. <p class=desc>Disable the DAC module.
  5164. </p>
  5165. <p class=func><span class=keyword>volume</span>(level);</p>
  5166. <p class=desc>Accepts a float in range 0.0-1.0 and sets the line output volume accordingly.
  5167. </p>
  5168. <p class=func><span class=keyword>volumeLeft</span>(level);</p>
  5169. <p class=desc>Accepts a float in range 0.0-1.0 and sets the left line output volume accordingly.
  5170. </p>
  5171. <p class=func><span class=keyword>volumeRight</span>(level);</p>
  5172. <p class=desc>Accepts a float in range 0.0-1.0 and sets the right line output volume accordingly.
  5173. </p>
  5174. <p class=func><span class=keyword>inputLevel</span>(level);</p>
  5175. <p class=desc>NOT SUPPORTED BY THE AK4558
  5176. </p>
  5177. <p class=func><span class=keyword>inputSelect</span>(input);</p>
  5178. <p class=desc>not implemented yet
  5179. </p>
  5180. <h3>Examples</h3>
  5181. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; AK4558 &gt; PassthroughTest
  5182. </p>
  5183. <p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; AK4558 &gt; SineOutTest
  5184. </p>
  5185. <h3>Notes</h3>
  5186. <p>TODO: Implement inputSelect() function to enable mono left, mono right, stereo operation.</p>
  5187. <p>TODO: Implement ADC and DAC filters control.</p>
  5188. <p>TODO: Implement DAC level attenuator attack rate modifier.</p>
  5189. </script>
  5190. <script type="text/x-red" data-template-name="AudioControlAK4558">
  5191. <div class="form-row">
  5192. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  5193. <input type="text" id="node-input-name" placeholder="Name">
  5194. </div>
  5195. </script>
  5196. <script type="text/x-red" data-help-name="AudioControlCS4272">
  5197. <h3>Summary</h3>
  5198. <div class=tooltipinfo>
  5199. <p>Control the CS4272 chip on the <a href="https://hackaday.io/project/5912-teensy-super-audio-board" target="_blank">Super Audio Board</a>.
  5200. </p>
  5201. <p>TODO: does this control object put the CS4272 into I2S master or slave mode</p>
  5202. </div>
  5203. <h3>Audio Connections</h3>
  5204. <p>This object has no audio inputs or outputs. Separate I2S objects
  5205. are used to send and receive audio data.
  5206. </p>
  5207. <h3>Functions</h3>
  5208. <p class=func><span class=keyword>enable</span>();</p>
  5209. <p class=desc>Enables the CODEC to work with 44.1 KHz - 16 bit data. This function does not enable the ADC/DAC modules.
  5210. </p>
  5211. <p class=func><span class=keyword>volume</span>(vol);</p>
  5212. <p class=desc>Set the volume level. Range is 0 to 1.0.
  5213. </p>
  5214. <p class=func><span class=keyword>volume</span>(left, right);</p>
  5215. <p class=desc>Set the volume level. Range is 0 to 1.0.
  5216. </p>
  5217. <p class=func><span class=keyword>dacVolume</span>(vol);</p>
  5218. <p class=desc>Set the volume level. Range is 0 to 1.0. TODO: what's the
  5219. distinction between volume() and dacVolume()?
  5220. </p>
  5221. <p class=func><span class=keyword>dacVolume</span>(left, right);</p>
  5222. <p class=desc>Set the volume level. Range is 0 to 1.0.
  5223. </p>
  5224. <p class=func><span class=keyword>muteOutput</span>();</p>
  5225. <p class=desc>TODO: description
  5226. </p>
  5227. <p class=func><span class=keyword>unmuteOutput</span>();</p>
  5228. <p class=desc>TODO: description
  5229. </p>
  5230. <p class=func><span class=keyword>muteInput</span>();</p>
  5231. <p class=desc>TODO: description
  5232. </p>
  5233. <p class=func><span class=keyword>unmuteInput</span>();</p>
  5234. <p class=desc>TODO: description
  5235. </p>
  5236. <p class=func><span class=keyword>enableDither</span>();</p>
  5237. <p class=desc>TODO: description
  5238. </p>
  5239. <p class=func><span class=keyword>disableDither</span>();</p>
  5240. <p class=desc>TODO: description
  5241. </p>
  5242. <h3>Hardware</h3>
  5243. <p>Pin 2 must be connected to the CS4272 reset. SDA &amp; SCL are used for all control.
  5244. </p>
  5245. <h3>Notes</h3>
  5246. </script>
  5247. <script type="text/x-red" data-template-name="AudioControlCS4272">
  5248. <div class="form-row">
  5249. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  5250. <input type="text" id="node-input-name" placeholder="Name">
  5251. </div>
  5252. </script>
  5253. <script type="text/x-red" data-help-name="AudioControlCS42448">
  5254. <h3>Summary</h3>
  5255. <div class=tooltipinfo>
  5256. <p>Control the CS42448 chip in TDM mode, for 6 inputs and 8 outputs.
  5257. </p>
  5258. <p align=center><img src="img/cs42448.jpg"></p>
  5259. </div>
  5260. </div>
  5261. <h3>Audio Connections</h3>
  5262. <p>This object has no audio inputs or outputs. Separate TDM objects
  5263. are used to send and receive audio data.
  5264. </p>
  5265. <h3>Functions</h3>
  5266. <p class=func><span class=keyword>enable</span>();</p>
  5267. <p class=desc>Enables the CS42448 to work in TDM mode.
  5268. </p>
  5269. <p class=func><span class=keyword>volume</span>(level);</p>
  5270. <p class=desc>Set the volume level for all output channels. Range is 0 to 1.0.
  5271. </p>
  5272. <p class=func><span class=keyword>volume</span>(channel, level);</p>
  5273. <p class=desc>Set the volume level for a single output. Channel is 1 to 8. Range is 0 to 1.0.
  5274. </p>
  5275. <p class=func><span class=keyword>inputLevel</span>(level);</p>
  5276. <p class=desc>Set the input gain level for all input channels. Range is 0 to 15.85.
  5277. </p>
  5278. <p class=func><span class=keyword>inputLevel</span>(channel, level);</p>
  5279. <p class=desc>Set the input gain level for a single input. Channel is 1 to 6. Range is 0 to 15.85.
  5280. </p>
  5281. <h3>Hardware</h3>
  5282. <p>Tested with this <a href="https://oshpark.com/shared_projects/2Yj6rFaW">
  5283. CS42448 Circuit Board</a>.
  5284. </p>
  5285. <p align=center><img src="img/tdm.jpg"></p>
  5286. </div>
  5287. <h3>Notes</h3>
  5288. </script>
  5289. <script type="text/x-red" data-template-name="AudioControlCS42448">
  5290. <div class="form-row">
  5291. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  5292. <input type="text" id="node-input-name" placeholder="Name">
  5293. </div>
  5294. </script>
  5295. </body>
  5296. </html>