Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
10 anos atrás
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708
  1. <!-- vim: set ts=4: -->
  2. <!-- TODO: generate some or all of this automatically from the C++ source -->
  3. <!-- TODO: add a field for maximum instance count -->
  4. <!-- TODO: add a field for exclusive to other objects (not allowed if they're used) -->
  5. <!-- TODO: add "parameters" fields, to replace the form html stuff -->
  6. <script type="text/javascript">
  7. RED.nodes.registerType('AnalogInputI2S',{
  8. shortName: "i2s",
  9. inputs:0,
  10. outputs:2,
  11. category: 'input-function',
  12. color:"#E6E0F8",
  13. icon: "arrow-in.png"
  14. });
  15. </script>
  16. <script type="text/x-red" data-help-name="AnalogInputI2S">
  17. <h3>Summary</h3>
  18. <p>Receive 16 bit stereo audio from the
  19. <a href="http://www.pjrc.com/store/teensy3_audio.html" target="_blank">audio shield</a>
  20. or another I2S device, using I2S master mode.</p>
  21. <p align=center><img src="audioshield_inputs.jpg"></p>
  22. <h3>Audio Connections</h3>
  23. <table class=doc align=center cellpadding=3>
  24. <tr class=top><th>Port</th><th>Purpose</th></tr>
  25. <tr class=odd><td align=center>Out 0</td><td>Left Channel</td></tr>
  26. <tr class=odd><td align=center>Out 1</td><td>Right Channel</td></tr>
  27. </table>
  28. <h3>Functions</h3>
  29. <p>This object has no functions to call from the Arduino sketch. It
  30. simply streams data from the I2S hardware to its 2 output ports.</p>
  31. <h3>Hardware</h3>
  32. <p align=center><img src="audioshield_backside.jpg"></p>
  33. <p>The I2S signals are used in "master" mode, where Teensy creates
  34. all 3 clock signals and controls all data timing.</p>
  35. <table class=doc align=center cellpadding=3>
  36. <tr class=top><th>Pin</th><th>Signal</th><th>Direction</th></tr>
  37. <tr class=odd><td align=center>9</td><td>BCLK</td><td>Output</td></tr>
  38. <tr class=odd><td align=center>11</td><td>MCLK</td><td>Output</td></tr>
  39. <tr class=odd><td align=center>13</td><td>RX</td><td>Input</td></tr>
  40. <tr class=odd><td align=center>23</td><td>LRCLK</td><td>Output</td></tr>
  41. </table>
  42. <p>Audio from
  43. master mode I2S may be used in the same project as ADC, DAC and
  44. PWM signals, because all remain in sync to Teensy's timing</p>
  45. <h3>Notes</h3>
  46. <p>Normally, this object is used with the Audio Shield, which
  47. is controlled separately by the "sgtl5000" object.</p>
  48. <p>Only one I2S input and one I2S output object may be used. Master
  49. and slave modes may not be mixed (both must be of the same type).
  50. </p>
  51. <p>I2S master objects can be used together with non-I2S input and output
  52. objects, for simultaneous audio streaming on different hardware.</p>
  53. </script>
  54. <script type="text/x-red" data-template-name="AnalogInputI2S">
  55. <div class="form-row">
  56. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  57. <input type="text" id="node-input-name" placeholder="Name">
  58. </div>
  59. </script>
  60. <script type="text/javascript">
  61. RED.nodes.registerType('AnalogInputI2Sslave',{
  62. shortName: "i2ss",
  63. inputs:0,
  64. outputs:2,
  65. category: 'input-function',
  66. color:"#E6E0F8",
  67. icon: "arrow-in.png"
  68. });
  69. </script>
  70. <script type="text/x-red" data-help-name="AnalogInputI2Sslave">
  71. <h3>Summary</h3>
  72. <p>Receive 16 bit stereo audio from an I2S device using I2S slave mode.</p>
  73. <h3>Audio Connections</h3>
  74. <table class=doc align=center cellpadding=3>
  75. <tr class=top><th>Port</th><th>Purpose</th></tr>
  76. <tr class=odd><td align=center>Out 0</td><td>Left Channel</td></tr>
  77. <tr class=odd><td align=center>Out 1</td><td>Right Channel</td></tr>
  78. </table>
  79. <h3>Functions</h3>
  80. <p>This object has no functions to call from the Arduino sketch. It
  81. simply streams data from the I2S hardware to its 2 output ports.</p>
  82. <h3>Hardware</h3>
  83. <p>The I2S signals are used in "slave" mode, where the I2S device controls
  84. data timing.</p>
  85. <table class=doc align=center cellpadding=3>
  86. <tr class=top><th>Pin</th><th>Signal</th><th>Direction</th></tr>
  87. <tr class=odd><td align=center>9</td><td>BCLK</td><td>Input</td></tr>
  88. <tr class=odd><td align=center>13</td><td>RX</td><td>Input</td></tr>
  89. <tr class=odd><td align=center>23</td><td>LRCLK</td><td>Input</td></tr>
  90. </table>
  91. <h3>Notes</h3>
  92. <p>Slave mode I2S <b>should not used in the same project as ADC, DAC and
  93. PWM</b> signals. Differences in timing between the I2S device and
  94. Teensy's clock can cause occasional audio glitches when I2S slave mode
  95. is used together with other input or output objects based on Teensy's
  96. timing.</p>
  97. <p>Only one I2S input and one I2S output object may be used. Master
  98. and slave modes may not be mixed (both must be of the same type).
  99. </p>
  100. </script>
  101. <script type="text/x-red" data-template-name="AnalogInputI2Sslave">
  102. <div class="form-row">
  103. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  104. <input type="text" id="node-input-name" placeholder="Name">
  105. </div>
  106. </script>
  107. <script type="text/javascript">
  108. RED.nodes.registerType('AnalogInputADC',{
  109. shortName: "adc",
  110. inputs:0,
  111. outputs:1,
  112. category: 'input-function',
  113. color:"#E6E0F8",
  114. icon: "arrow-in.png"
  115. });
  116. </script>
  117. <script type="text/x-red" data-help-name="AnalogInputADC">
  118. <h3>Summary</h3>
  119. <p>Receive audio using the built-in analog to digital converter.</p>
  120. <h3>Audio Connections</h3>
  121. <table class=doc align=center cellpadding=3>
  122. <tr class=top><th>Port</th><th>Purpose</th></tr>
  123. <tr class=odd><td align=center>Out 0</td><td>Audio Channel</td></tr>
  124. </table>
  125. <h3>Parameters</h3>
  126. <table class=doc align=center cellpadding=3>
  127. <tr class=top><th>Name</th><th>Type</th><th>Function</th></tr>
  128. <tr class=odd><td align=center>Pin</td><td>Integer</td><td>Analog Pin To Use</td></tr>
  129. </table>
  130. <p>The pin number should be specified as "A0" to "A20"</p>
  131. <p align=center><img src="adcpins2.jpg"></p>
  132. <p align=center><img src="adcpins1.jpg"></p>
  133. <h3>Functions</h3>
  134. <p>This object has no functions to call from the Arduino sketch. It
  135. simply streams data from the ADC to its output port.</p>
  136. <h3>Hardware</h3>
  137. <p>Signal range is 0 to 1.2V</p>
  138. <p>Need for DC bias, approx 0.6V</p>
  139. <p>TODO: suggested circuity for signal input</p>
  140. <h3>Notes</h3>
  141. <p>Algorithm for automatic DC bias tracking</p>
  142. <p>Noise due to high source impedance</p>
  143. <p>Power Supply rejection issue with simple DC bias</p>
  144. <p>TODO: actual noise measurements with different input circuitry
  145. (it's not nearly as quiet as the audio shield)</p>
  146. </script>
  147. <script type="text/x-red" data-template-name="AnalogInputADC">
  148. <div class="form-row">
  149. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  150. <input type="text" id="node-input-name" placeholder="Name">
  151. </div>
  152. </script>
  153. <script type="text/javascript">
  154. RED.nodes.registerType('AnalogOutputI2S',{
  155. shortName: "i2s",
  156. inputs:2,
  157. outputs:0,
  158. category: 'output-function',
  159. color:"#E6E0F8",
  160. icon: "arrow-in.png"
  161. });
  162. </script>
  163. <script type="text/x-red" data-help-name="AnalogOutputI2S">
  164. <h3>Summary</h3>
  165. <p>Transmit 16 bit stereo audio to the
  166. <a href="http://www.pjrc.com/store/teensy3_audio.html" target="_blank">audio shield</a>
  167. or another I2S device, using I2S master mode.</p>
  168. <p align=center><img src="audioshield_outputs.jpg"></p>
  169. <h3>Audio Connections</h3>
  170. <table class=doc align=center cellpadding=3>
  171. <tr class=top><th>Port</th><th>Purpose</th></tr>
  172. <tr class=odd><td align=center>In 0</td><td>Left Channel</td></tr>
  173. <tr class=odd><td align=center>In 1</td><td>Right Channel</td></tr>
  174. </table>
  175. <h3>Functions</h3>
  176. <p>This object has no functions to call from the Arduino sketch. It
  177. simply streams data from its 2 input ports to the I2S hardware.</p>
  178. <h3>Hardware</h3>
  179. <p align=center><img src="audioshield_backside.jpg"></p>
  180. <p>The I2S signals are used in "master" mode, where Teensy creates
  181. all 3 clock signals and controls all data timing.</p>
  182. <table class=doc align=center cellpadding=3>
  183. <tr class=top><th>Pin</th><th>Signal</th><th>Direction</th></tr>
  184. <tr class=odd><td align=center>9</td><td>BCLK</td><td>Output</td></tr>
  185. <tr class=odd><td align=center>11</td><td>MCLK</td><td>Output</td></tr>
  186. <tr class=odd><td align=center>22</td><td>TX</td><td>Output</td></tr>
  187. <tr class=odd><td align=center>23</td><td>LRCLK</td><td>Output</td></tr>
  188. </table>
  189. <p>Audio from
  190. master mode I2S may be used in the same project as ADC, DAC and
  191. PWM signals, because all remain in sync to Teensy's timing</p>
  192. <h3>Notes</h3>
  193. <p>Normally, this object is used with the Audio Shield, which
  194. is controlled separately by the "sgtl5000" object.</p>
  195. <p>Only one I2S input and one I2S output object may be used. Master
  196. and slave modes may not be mixed (both must be of the same type).
  197. </p>
  198. </script>
  199. <script type="text/x-red" data-template-name="AnalogOutputI2S">
  200. <div class="form-row">
  201. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  202. <input type="text" id="node-input-name" placeholder="Name">
  203. </div>
  204. </script>
  205. <script type="text/javascript">
  206. RED.nodes.registerType('AnalogOutputI2Sslave',{
  207. shortName: "i2ss",
  208. inputs:2,
  209. outputs:0,
  210. category: 'output-function',
  211. color:"#E6E0F8",
  212. icon: "arrow-in.png"
  213. });
  214. </script>
  215. <script type="text/x-red" data-help-name="AnalogOutputI2Sslave">
  216. <h3>Summary</h3>
  217. <p>Transmit 16 bit stereo audio to an I2S device using I2S slave mode.</p>
  218. <h3>Audio Connections</h3>
  219. <table class=doc align=center cellpadding=3>
  220. <tr class=top><th>Port</th><th>Purpose</th></tr>
  221. <tr class=odd><td align=center>In 0</td><td>Left Channel</td></tr>
  222. <tr class=odd><td align=center>In 1</td><td>Right Channel</td></tr>
  223. </table>
  224. <h3>Functions</h3>
  225. <p>This object has no functions to call from the Arduino sketch. It
  226. simply streams data from its 2 input ports to the I2S hardware.</p>
  227. <h3>Hardware</h3>
  228. <p>The I2S signals are used in "slave" mode, where the I2S device controls
  229. data timing.</p>
  230. <table class=doc align=center cellpadding=3>
  231. <tr class=top><th>Pin</th><th>Signal</th><th>Direction</th></tr>
  232. <tr class=odd><td align=center>9</td><td>BCLK</td><td>Input</td></tr>
  233. <tr class=odd><td align=center>22</td><td>TX</td><td>Output</td></tr>
  234. <tr class=odd><td align=center>23</td><td>LRCLK</td><td>Input</td></tr>
  235. </table>
  236. <h3>Notes</h3>
  237. <p>Slave mode I2S <b>should not used in the same project as ADC, DAC and
  238. PWM</b> signals. Differences in timing between the I2S device and
  239. Teensy's clock can cause occasional audio glitches when I2S slave mode
  240. is used together with other input or output objects based on Teensy's
  241. timing.</p>
  242. <p>Only one I2S input and one I2S output object may be used. Master
  243. and slave modes may not be mixed (both must be of the same type).
  244. </p>
  245. </script>
  246. <script type="text/x-red" data-template-name="AnalogOutputI2Sslave">
  247. <div class="form-row">
  248. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  249. <input type="text" id="node-input-name" placeholder="Name">
  250. </div>
  251. </script>
  252. <script type="text/javascript">
  253. RED.nodes.registerType('AnalogOutputAnalog',{
  254. shortName: "dac",
  255. inputs:1,
  256. outputs:0,
  257. category: 'output-function',
  258. color:"#E6E0F8",
  259. icon: "arrow-in.png"
  260. });
  261. </script>
  262. <script type="text/x-red" data-help-name="AnalogOutputAnalog">
  263. <h3>Summary</h3>
  264. <p>Transmit 12 bit audio using Teensy 3.1's built-in digital to analog converter.</p>
  265. <h3>Audio Connections</h3>
  266. <table class=doc align=center cellpadding=3>
  267. <tr class=top><th>Port</th><th>Purpose</th></tr>
  268. <tr class=odd><td align=center>In 0</td><td>Audio Channel</td></tr>
  269. </table>
  270. <h3>Functions</h3>
  271. <p>This object has no functions to call from the Arduino sketch. It
  272. simply streams data from the ADC to its output port.</p>
  273. <h3>Hardware</h3>
  274. <p align=center><img src="dacpin.jpg"></p>
  275. <p>Signal range is 0 to 1.2V</p>
  276. <p>Most applications require at least a 10&micro;F DC-blocking capacitor.</p>
  277. <p>TODO: photo of Teensy 3.1 with 10&micro;F capacitor and 3.5mm jack.</p>
  278. <h3>Notes</h3>
  279. <p>The output rate is 44.1 kHz (no oversampling). Ultrasonic noise present if
  280. not filtered. This may not
  281. be an issue for many uses, but care should be used if amplified and driven
  282. to high power tweeters.</p>
  283. </script>
  284. <script type="text/x-red" data-template-name="AnalogOutputAnalog">
  285. <div class="form-row">
  286. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  287. <input type="text" id="node-input-name" placeholder="Name">
  288. </div>
  289. </script>
  290. <script type="text/javascript">
  291. RED.nodes.registerType('AnalogOutputPWM',{
  292. shortName: "pwm",
  293. inputs:1,
  294. outputs:0,
  295. category: 'output-function',
  296. color:"#E6E0F8",
  297. icon: "arrow-in.png"
  298. });
  299. </script>
  300. <script type="text/x-red" data-help-name="AnalogOutputPWM">
  301. <h3>Summary</h3>
  302. <p>Transmit audio using Teensy 3.1's PWM pins. Two pins are
  303. used for coarse and fine pulses, to be combined by scaled
  304. resistors.</p>
  305. <h3>Audio Connections</h3>
  306. <table class=doc align=center cellpadding=3>
  307. <tr class=top><th>Port</th><th>Purpose</th></tr>
  308. <tr class=odd><td align=center>In 0</td><td>Audio Channel</td></tr>
  309. </table>
  310. <h3>Functions</h3>
  311. <p>This object has no functions to call from the Arduino sketch. It
  312. simply streams data from the its input port to the PWM pins.</p>
  313. <h3>Hardware</h3>
  314. <p>The following circuit is recommended.</p>
  315. <p align=center><img src="pwmdualcircuit.jpg"></p>
  316. <p>Signal range is approx 1.55 Vp-p.</p>
  317. <p>These resistor values assume approx 20 ohms output impedance
  318. on the digital pins. The 127K resistor may be adjusted or
  319. trimmed for variation in output drive and tolerance on the
  320. 475 ohm resistor.</p>
  321. <p>A plastic film (Polypropylene, Polyethylene, Polyester, etc) or
  322. C0G/NPO ceramic capacitor should be used for filtering. Low
  323. quality ceramic (X7R, Y5V, Z5U, etc) can cause signal distortion.</p>
  324. <h3>Notes</h3>
  325. <p>The PWM carrier frequency is 88.2 kHz. The suggested circuit
  326. will only slightly filter the carrier. Extra filtering will be
  327. required for a clean signal without the ultrasonic PWM carrier.
  328. </p>
  329. <p>Analog signals created by filtering PWM waveforms use the digital
  330. power supply as their reference voltage. Any noise on the digital
  331. power line can directly couple to the output signal. The built-in DAC or
  332. <a href="http://www.pjrc.com/store/teensy3_audio.html" target="_blank">audio shield</a>
  333. should be used when higher quality signals are needed.</p>
  334. </script>
  335. <script type="text/x-red" data-template-name="AnalogOutputPWM">
  336. <div class="form-row">
  337. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  338. <input type="text" id="node-input-name" placeholder="Name">
  339. </div>
  340. </script>
  341. <script type="text/javascript">
  342. RED.nodes.registerType('AudioMixer4',{
  343. shortName: "mixer",
  344. inputs:4,
  345. outputs:1,
  346. category: 'mixer-function',
  347. color:"#E6E0F8",
  348. icon: "arrow-in.png"
  349. });
  350. </script>
  351. <script type="text/x-red" data-help-name="AudioMixer4">
  352. <h3>Summary</h3>
  353. <p>Combine up to 4 audio signals together, each with adjustable gain.
  354. All channels support signal attenuation or amplification.</p>
  355. <h3>Audio Connections</h3>
  356. <table class=doc align=center cellpadding=3>
  357. <tr class=top><th>Port</th><th>Purpose</th></tr>
  358. <tr class=odd><td align=center>In 0</td><td>Input signal #1</td></tr>
  359. <tr class=odd><td align=center>In 1</td><td>Input signal #2</td></tr>
  360. <tr class=odd><td align=center>In 2</td><td>Input signal #3</td></tr>
  361. <tr class=odd><td align=center>In 3</td><td>Input signal #4</td></tr>
  362. <tr class=odd><td align=center>Out 0</td><td>Sum of all inputs</td></tr>
  363. </table>
  364. <h3>Functions</h3>
  365. <p class=func><span class=keyword>gain</span>(channel, level);</p>
  366. <p class=desc>Adjust the amplification or attenuation. "channel" must
  367. be 0 to 3. "level" may be any floating point number from 0 to 32767.
  368. 1.0 passes the signal through directly. Level of 0 shuts the channel
  369. off completely. Between 0 to 1.0 attenuates the signal, and above
  370. 1.0 amplifies it. All 4 channels have separate settings.
  371. </p>
  372. <h3>Notes</h3>
  373. <p>Signal clipping can occur when any channel has gain greater than 1.0,
  374. or when multiple signals add together to greater than 1.0.</p>
  375. <p>More than 4 channels may be combined by connecting multiple mixers
  376. in tandem. For example, a 16 channel mixer may be built using 5
  377. mixers, where the fifth mixer combines the outputs of the first 4.
  378. </p>
  379. </script>
  380. <script type="text/x-red" data-template-name="AudioMixer4">
  381. <div class="form-row">
  382. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  383. <input type="text" id="node-input-name" placeholder="Name">
  384. </div>
  385. </script>
  386. <script type="text/javascript">
  387. RED.nodes.registerType('AudioPlayMemory',{
  388. shortName: "playMem",
  389. inputs:0,
  390. outputs:1,
  391. category: 'play-function',
  392. color:"#E6E0F8",
  393. icon: "arrow-in.png"
  394. });
  395. </script>
  396. <script type="text/x-red" data-help-name="AudioPlayMemory">
  397. <h3>Summary</h3>
  398. <p>Play a short sound clip, stored directly in memory.
  399. Data files are created with the
  400. <a href="https://github.com/PaulStoffregen/Audio/tree/master/examples/PlayFromSketch/wav2sketch" target="_blank">wav2sketch program</a>,
  401. and copied to the sketch folder to become part of your sketch.</p>
  402. <h3>Audio Connections</h3>
  403. <table class=doc align=center cellpadding=3>
  404. <tr class=top><th>Port</th><th>Purpose</th></tr>
  405. <tr class=odd><td align=center>Out 0</td><td>Sound Output</td></tr>
  406. </table>
  407. <h3>Functions</h3>
  408. <p class=func><span class=keyword>play</span>(data);</p>
  409. <p class=desc>Begin playing a sound clip. If already playing, the
  410. currently playing clip is stopped and this new data begins
  411. playing from the beginning.
  412. </p>
  413. <p class=func><span class=keyword>stop</span>();</p>
  414. <p class=desc>Stop playing. If not playing, this function has no effect.
  415. </p>
  416. <p class=func><span class=keyword>isPlaying</span>();</p>
  417. <p class=desc>Return true (non-zero) if playing, or false (zero)
  418. when not playing.
  419. </p>
  420. <p class=func><span class=keyword>positionMillis</span>();</p>
  421. <p class=desc>While playing, return the current time offset, in
  422. milliseconds. When not playing, the return from this function
  423. is undefined.
  424. </p>
  425. <p class=func><span class=keyword>lengthMillis</span>();</p>
  426. <p class=desc>Return the total length of the current sound clip,
  427. in milliseconds. When not playing, the return from this function
  428. is undefined.
  429. </p>
  430. <h3>Notes</h3>
  431. <p>TODO: supported sample rates: 11.025, 22.05, 44.1</p>
  432. <p>TODO: ulaw vs uncompressed encoding</p>
  433. <p>Polyphonic playback can be built by creating multiple
  434. objects, with their output combined by mixers.</p>
  435. </script>
  436. <script type="text/x-red" data-template-name="AudioPlayMemory">
  437. <div class="form-row">
  438. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  439. <input type="text" id="node-input-name" placeholder="Name">
  440. </div>
  441. </script>
  442. <script type="text/javascript">
  443. RED.nodes.registerType('AudioPlaySdWav',{
  444. shortName: "playWav",
  445. inputs:0,
  446. outputs:2,
  447. category: 'play-function',
  448. color:"#E6E0F8",
  449. icon: "arrow-in.png"
  450. });
  451. </script>
  452. <script type="text/x-red" data-help-name="AudioPlaySdWav">
  453. <h3>Summary</h3>
  454. <p>Play a WAV file, stored on a SD card.</p>
  455. <h3>Audio Connections</h3>
  456. <table class=doc align=center cellpadding=3>
  457. <tr class=top><th>Port</th><th>Purpose</th></tr>
  458. <tr class=odd><td align=center>Out 0</td><td>Left Channel Output</td></tr>
  459. <tr class=odd><td align=center>Out 1</td><td>Right Channel Output</td></tr>
  460. </table>
  461. <h3>Functions</h3>
  462. <p class=func><span class=keyword>play</span>(filename);</p>
  463. <p class=desc>Begin playing a WAV file. If a file is already playing,
  464. it is stopped and this file starts playing from the beginning.
  465. </p>
  466. <p class=func><span class=keyword>stop</span>();</p>
  467. <p class=desc>Stop playing. If not playing, this function has no effect.
  468. </p>
  469. <p class=func><span class=keyword>isPlaying</span>();</p>
  470. <p class=desc>Return true (non-zero) if playing, or false (zero)
  471. when not playing. See the note below about delayed start.
  472. </p>
  473. <p class=func><span class=keyword>positionMillis</span>();</p>
  474. <p class=desc>While playing, return the current time offset, in
  475. milliseconds. When not playing, the return from this function
  476. is undefined.
  477. </p>
  478. <p class=func><span class=keyword>lengthMillis</span>();</p>
  479. <p class=desc>Return the total length of the current sound clip,
  480. in milliseconds. When not playing, the return from this function
  481. is undefined.
  482. </p>
  483. <h3>Notes</h3>
  484. <p>Only 16 bit PCM, 44100 Hz WAV files are supported. When mono
  485. files are played, both output ports transmit a copy of the
  486. single sound. Of course, stereo WAV files play with the left
  487. channel on port 0 and the right channel on port 1.
  488. </p>
  489. <p>A brief delay after calling play() will usually occur before
  490. isPlaying() returns true and positionMillis() returns valid
  491. time offset. WAV files have a header at the beginning of the
  492. file, which the audio library must read and parse before
  493. playing can begin.
  494. </p>
  495. <p>While playing, the audio library accesses the SD card automatically.
  496. If card access is required, you must
  497. <a href="http://www.pjrc.com/teensy/td_libs_AudioProcessorUsage.html" target="_blank">use AudioNoInterrupts()</a>
  498. to prevent the library from accessing the SD card while you use it.
  499. Disabling the audio library interrupt for too long may cause audible
  500. dropouts or glitches.
  501. </p>
  502. </script>
  503. <script type="text/x-red" data-template-name="AudioPlaySdWav">
  504. <div class="form-row">
  505. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  506. <input type="text" id="node-input-name" placeholder="Name">
  507. </div>
  508. </script>
  509. <script type="text/javascript">
  510. RED.nodes.registerType('AudioPlaySdRaw',{
  511. shortName: "playRaw",
  512. inputs:0,
  513. outputs:1,
  514. category: 'play-function',
  515. color:"#E6E0F8",
  516. icon: "arrow-in.png"
  517. });
  518. </script>
  519. <script type="text/x-red" data-help-name="AudioPlaySdRaw">
  520. <h3>Summary</h3>
  521. <p>Play a RAW data file, stored on a SD card. RAW format is simpler
  522. than WAV and begins playing immediately, without parsing WAV file
  523. header info.</p>
  524. <h3>Audio Connections</h3>
  525. <table class=doc align=center cellpadding=3>
  526. <tr class=top><th>Port</th><th>Purpose</th></tr>
  527. <tr class=odd><td align=center>Out 0</td><td>Sound Output</td></tr>
  528. </table>
  529. <h3>Functions</h3>
  530. <p class=func><span class=keyword>play</span>(filename);</p>
  531. <p class=desc>Begin playing a RAW data file. If a file is already playing,
  532. it is stopped and this file starts playing from the beginning.
  533. </p>
  534. <p class=func><span class=keyword>stop</span>();</p>
  535. <p class=desc>Stop playing. If not playing, this function has no effect.
  536. </p>
  537. <p class=func><span class=keyword>isPlaying</span>();</p>
  538. <p class=desc>Return true (non-zero) if playing, or false (zero)
  539. when not playing.
  540. </p>
  541. <p class=func><span class=keyword>positionMillis</span>();</p>
  542. <p class=desc>While playing, return the current time offset, in
  543. milliseconds. When not playing, the return from this function
  544. is undefined.
  545. </p>
  546. <p class=func><span class=keyword>lengthMillis</span>();</p>
  547. <p class=desc>Return the total length of the current sound clip,
  548. in milliseconds. When not playing, the return from this function
  549. is undefined.
  550. </p>
  551. <h3>Notes</h3>
  552. <p>The data file must be RAW 16 bit signed integers in LSB-first format.
  553. </p>
  554. <p>While playing, the audio library accesses the SD card automatically.
  555. If card access is required, you must
  556. <a href="http://www.pjrc.com/teensy/td_libs_AudioProcessorUsage.html" target="_blank">AudioNoInterrupts()</a>
  557. to prevent the library from accessing the SD card while you use it.
  558. Disabling the audio library interrupt for too long may cause audible
  559. dropouts or glitches.
  560. </p>
  561. </script>
  562. <script type="text/x-red" data-template-name="AudioPlaySdRaw">
  563. <div class="form-row">
  564. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  565. <input type="text" id="node-input-name" placeholder="Name">
  566. </div>
  567. </script>
  568. <script type="text/javascript">
  569. RED.nodes.registerType('AudioPlayQueue',{
  570. shortName: "queue",
  571. inputs:0,
  572. outputs:1,
  573. category: 'play-function',
  574. color:"#E6E0F8",
  575. icon: "arrow-in.png"
  576. });
  577. </script>
  578. <script type="text/x-red" data-help-name="AudioPlayQueue">
  579. <h3>Summary</h3>
  580. <p>Play audio data provided by the Arduino sketch. This object provides
  581. functions to allow the sketch code to push data into the audio system.</p>
  582. <h3>Audio Connections</h3>
  583. <table class=doc align=center cellpadding=3>
  584. <tr class=top><th>Port</th><th>Purpose</th></tr>
  585. <tr class=odd><td align=center>Out 0</td><td>Sound Output</td></tr>
  586. </table>
  587. <h3>Functions</h3>
  588. <p class=func><span class=keyword>play</span>(int16);</p>
  589. <p class=desc>not yet implemented
  590. </p>
  591. <p class=func><span class=keyword>play</span>(int16[], length);</p>
  592. <p class=desc>not yet implemented
  593. </p>
  594. <p class=func><span class=keyword>getBuffer</span>();</p>
  595. <p class=desc>Returns a pointer to an array of 128 int16. This buffer
  596. is within the audio library memory pool, providing the most efficient
  597. way to input data to the audio system. The buffer is likely to be
  598. populated by previously used data, so the entire 128 words should be
  599. written before calling playBuffer(). Only a single buffer should be
  600. requested at a time. This function may return NULL if no memory is
  601. available.
  602. </p>
  603. <p class=func><span class=keyword>playBuffer</span>();</p>
  604. <p class=desc>Transmit the buffer previously obtained from getBuffer().
  605. </p>
  606. <h3>Notes</h3>
  607. <p>TODO: many caveats....</p>
  608. <p>
  609. </p>
  610. </script>
  611. <script type="text/x-red" data-template-name="AudioPlayQueue">
  612. <div class="form-row">
  613. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  614. <input type="text" id="node-input-name" placeholder="Name">
  615. </div>
  616. </script>
  617. <script type="text/javascript">
  618. RED.nodes.registerType('AudioSynthWaveformSine',{
  619. shortName: "sine",
  620. inputs:0,
  621. outputs:1,
  622. category: 'synth-function',
  623. color:"#E6E0F8",
  624. icon: "arrow-in.png"
  625. });
  626. </script>
  627. <script type="text/x-red" data-help-name="AudioSynthWaveformSine">
  628. <h3>Summary</h3>
  629. <p>Create a sine wave signal</p>
  630. <h3>Audio Connections</h3>
  631. <table class=doc align=center cellpadding=3>
  632. <tr class=top><th>Port</th><th>Purpose</th></tr>
  633. <tr class=odd><td align=center>Out 0</td><td>Sine Wave Output</td></tr>
  634. </table>
  635. <h3>Functions</h3>
  636. <p class=func><span class=keyword>frequency</span>(freq);</p>
  637. <p class=desc>Set the frequency, from 0 to 22000. Very low values may
  638. be used to create a LFO (Low Frequency Oscillator) for objects
  639. with modulation signal inputs.
  640. </p>
  641. <p class=func><span class=keyword>amplitude</span>(level);</p>
  642. <p class=desc>Set the amplitude, from 0 to 1.0.
  643. </p>
  644. <h3>Notes</h3>
  645. <p></p>
  646. </script>
  647. <script type="text/x-red" data-template-name="AudioSynthWaveformSine">
  648. <div class="form-row">
  649. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  650. <input type="text" id="node-input-name" placeholder="Name">
  651. </div>
  652. </script>
  653. <script type="text/javascript">
  654. RED.nodes.registerType('AudioSynthWaveformSineModulated',{
  655. shortName: "sine_fm",
  656. inputs:1,
  657. outputs:1,
  658. category: 'synth-function',
  659. color:"#E6E0F8",
  660. icon: "arrow-in.png"
  661. });
  662. </script>
  663. <script type="text/x-red" data-help-name="AudioSynthWaveformSineModulated">
  664. <h3>Summary</h3>
  665. <p>Create a modulated sine wave, using any audio signal to continuously
  666. modulate the sine wave frequency.</p>
  667. <h3>Audio Connections</h3>
  668. <table class=doc align=center cellpadding=3>
  669. <tr class=top><th>Port</th><th>Purpose</th></tr>
  670. <tr class=odd><td align=center>In 0</td><td>Modulation Signal</td></tr>
  671. <tr class=odd><td align=center>Out 0</td><td>Sine Wave Output</td></tr>
  672. </table>
  673. <h3>Functions</h3>
  674. <p class=func><span class=keyword>frequency</span>(freq);</p>
  675. <p class=desc>Set the center frequency, from 0 to 11000. The output will
  676. be this center frequency when the input modulation signal is zero.
  677. Modulation input 1.0 causes the frequency to double, and input -1.0
  678. causes zero Hz (DC) output. For less modulation, attenuate the input
  679. signal (perhaps with a mixer object) before it arrives here.
  680. </p>
  681. <p class=func><span class=keyword>amplitude</span>(level);</p>
  682. <p class=desc>Set the amplitude, from 0 to 1.0.
  683. </p>
  684. <h3>Notes</h3>
  685. <p></p>
  686. </script>
  687. <script type="text/x-red" data-template-name="AudioSynthWaveformSineModulated">
  688. <div class="form-row">
  689. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  690. <input type="text" id="node-input-name" placeholder="Name">
  691. </div>
  692. </script>
  693. <script type="text/javascript">
  694. RED.nodes.registerType('AudioSynthWaveform',{
  695. shortName: "waveform",
  696. inputs:0,
  697. outputs:1,
  698. category: 'synth-function',
  699. color:"#E6E0F8",
  700. icon: "arrow-in.png"
  701. });
  702. </script>
  703. <script type="text/x-red" data-help-name="AudioSynthWaveform">
  704. <h3>Summary</h3>
  705. <p>Create a waveform: sine, sawtooth, square, or triangle</p>
  706. <h3>Audio Connections</h3>
  707. <table class=doc align=center cellpadding=3>
  708. <tr class=top><th>Port</th><th>Purpose</th></tr>
  709. <tr class=odd><td align=center>Out 0</td><td>Waveform Output</td></tr>
  710. </table>
  711. <h3>Functions</h3>
  712. <p class=func><span class=keyword>begin</span>(level, frequency, waveform);</p>
  713. <p class=desc>Output a waveform.
  714. </p>
  715. <p class=func><span class=keyword>frequency</span>(freq);</p>
  716. <p class=desc>Change the frequency.
  717. </p>
  718. <p class=func><span class=keyword>amplitude</span>(level);</p>
  719. <p class=desc>Change the amplitude. Set to 0 to turn the signal off.
  720. <h3>Notes</h3>
  721. <p>Supported Waveforms:<br>
  722. <ul>
  723. <li><span class=literal>TONE_TYPE_SINE</span></li>
  724. <li><span class=literal>TONE_TYPE_SAWTOOTH</span></li>
  725. <li><span class=literal>TONE_TYPE_SQUARE</span></li>
  726. <li><span class=literal>TONE_TYPE_TRIANGLE</span></li>
  727. </ul>
  728. </p>
  729. </script>
  730. <script type="text/x-red" data-template-name="AudioSynthWaveform">
  731. <div class="form-row">
  732. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  733. <input type="text" id="node-input-name" placeholder="Name">
  734. </div>
  735. </script>
  736. <script type="text/javascript">
  737. RED.nodes.registerType('AudioSynthToneSweep',{
  738. shortName: "tonesweep",
  739. inputs:0,
  740. outputs:1,
  741. category: 'synth-function',
  742. color:"#E6E0F8",
  743. icon: "arrow-in.png"
  744. });
  745. </script>
  746. <script type="text/x-red" data-help-name="AudioSynthToneSweep">
  747. <h3>Summary</h3>
  748. <p>Create a continuously varying (in frequency) sine wave</p>
  749. <h3>Audio Connections</h3>
  750. <table class=doc align=center cellpadding=3>
  751. <tr class=top><th>Port</th><th>Purpose</th></tr>
  752. <tr class=odd><td align=center>Out 0</td><td>Continuously varying tone</td></tr>
  753. </table>
  754. <h3>Functions</h3>
  755. <p class=func><span class=keyword>play</span>(level, lowFreq, highFreq, time);</p>
  756. <p class=desc>Start generating frequency sweep output. The time is specified
  757. in milliseconds. Level is 0 to 1.0.
  758. </p>
  759. <p class=func><span class=keyword>isPlaying</span>();</p>
  760. <p class=desc>Returns true (non-zero) while the output is active.
  761. </p>
  762. <h3>Notes</h3>
  763. <p>Uses excessive CPU time</p>
  764. </script>
  765. <script type="text/x-red" data-template-name="AudioSynthToneSweep">
  766. <div class="form-row">
  767. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  768. <input type="text" id="node-input-name" placeholder="Name">
  769. </div>
  770. </script>
  771. <script type="text/javascript">
  772. RED.nodes.registerType('AudioEffectFade',{
  773. shortName: "fade",
  774. inputs:1,
  775. outputs:1,
  776. category: 'effect-function',
  777. color:"#E6E0F8",
  778. icon: "arrow-in.png"
  779. });
  780. </script>
  781. <script type="text/x-red" data-help-name="AudioEffectFade">
  782. <h3>Summary</h3>
  783. <p>Gradually increase or decrease audio level.</p>
  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>In 0</td><td>Signal Input</td></tr>
  788. <tr class=odd><td align=center>Out 0</td><td>Signal Output</td></tr>
  789. </table>
  790. <h3>Functions</h3>
  791. <p class=func><span class=keyword>fadeIn</span>(milliseconds);</p>
  792. <p class=desc>Begin increasing the audio level, to reach 1.0 (input passed
  793. directly to the output) after "milliseconds" time.
  794. </p>
  795. <p class=func><span class=keyword>fadeOut</span>(milliseconds);</p>
  796. <p class=desc>Begin increasing the audio level, to reach 0 (no output)
  797. after "milliseconds" time.
  798. </p>
  799. <h3>Notes</h3>
  800. <p>Cross fading can be built with 2 fade objects fed into a mixer.
  801. When one fade object is off (fully faded out) and the other on
  802. (fully faded in), if both are started at the same moment for the
  803. same time duration, their signal gains always add to 1.0. This
  804. allows 2 fade objects to work together for a smooth transition
  805. between a pair of signals.
  806. </p>
  807. <p><a href="http://www.pjrc.com/teensy/td_libs_AudioProcessorUsage.html" target="_blank">AudioNoInterrupts()</a>
  808. should be used when changing
  809. settings on multiple objects, so all changes always take effect
  810. at the same moment.
  811. </p>
  812. </script>
  813. <script type="text/x-red" data-template-name="AudioEffectFade">
  814. <div class="form-row">
  815. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  816. <input type="text" id="node-input-name" placeholder="Name">
  817. </div>
  818. </script>
  819. <script type="text/javascript">
  820. RED.nodes.registerType('AudioEffectChorus',{
  821. shortName: "chorus",
  822. inputs:2,
  823. outputs:2,
  824. category: 'effect-function',
  825. color:"#E6E0F8",
  826. icon: "arrow-in.png"
  827. });
  828. </script>
  829. <script type="text/x-red" data-help-name="AudioEffectChorus">
  830. <h3>Summary</h3>
  831. <p>description</p>
  832. <h3>Audio Connections</h3>
  833. <table class=doc align=center cellpadding=3>
  834. <tr class=top><th>Port</th><th>Purpose</th></tr>
  835. <tr class=odd><td align=center></td><td></td></tr>
  836. </table>
  837. <!--<h3>Parameters</h3>
  838. <table class=doc align=center cellpadding=3>
  839. <tr class=top><th>Name</th><th>Type</th><th>Function</th></tr>
  840. <tr class=odd><td align=center></td><td>Integer</td><td></td></tr>
  841. </table>
  842. <p>Extra description... Section only present if object has params</p>-->
  843. <h3>Functions</h3>
  844. <p class=func><span class=keyword>begin</span>(delayBuffer, length, n_chorus);</p>
  845. <p class=desc>blah blah blah blah
  846. </p>
  847. <p class=func><span class=keyword>stop</span>();</p>
  848. <p class=desc>blah blah blah blah
  849. </p>
  850. <p class=func><span class=keyword>modify</span>(n_chorus);</p>
  851. <p class=desc>blah blah blah blah
  852. </p>
  853. <h3>Notes</h3>
  854. <p></p>
  855. </script>
  856. <script type="text/x-red" data-template-name="AudioEffectChorus">
  857. <div class="form-row">
  858. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  859. <input type="text" id="node-input-name" placeholder="Name">
  860. </div>
  861. </script>
  862. <script type="text/javascript">
  863. RED.nodes.registerType('AudioEffectFlange',{
  864. shortName: "flange",
  865. inputs:2,
  866. outputs:2,
  867. category: 'effect-function',
  868. color:"#E6E0F8",
  869. icon: "arrow-in.png"
  870. });
  871. </script>
  872. <script type="text/x-red" data-help-name="AudioEffectFlange">
  873. <h3>Summary</h3>
  874. <p>description</p>
  875. <h3>Audio Connections</h3>
  876. <table class=doc align=center cellpadding=3>
  877. <tr class=top><th>Port</th><th>Purpose</th></tr>
  878. <tr class=odd><td align=center></td><td></td></tr>
  879. </table>
  880. <!--<h3>Parameters</h3>
  881. <table class=doc align=center cellpadding=3>
  882. <tr class=top><th>Name</th><th>Type</th><th>Function</th></tr>
  883. <tr class=odd><td align=center></td><td>Integer</td><td></td></tr>
  884. </table>
  885. <p>Extra description... Section only present if object has params</p>-->
  886. <h3>Functions</h3>
  887. <p class=func><span class=keyword>begin</span>(delayBuffer, length, offset, depth, delayRate);</p>
  888. <p class=desc>blah blah blah blah
  889. </p>
  890. <p class=func><span class=keyword>modify</span>(offset, depth, delayRate);</p>
  891. <p class=desc>blah blah blah blah
  892. </p>
  893. <p class=func><span class=keyword>stop</span>();</p>
  894. <p class=desc>blah blah blah blah
  895. </p>
  896. <h3>Notes</h3>
  897. <p></p>
  898. </script>
  899. <script type="text/x-red" data-template-name="AudioEffectFlange">
  900. <div class="form-row">
  901. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  902. <input type="text" id="node-input-name" placeholder="Name">
  903. </div>
  904. </script>
  905. <script type="text/javascript">
  906. RED.nodes.registerType('AudioEffectEnvelope',{
  907. shortName: "envelope",
  908. inputs:1,
  909. outputs:1,
  910. category: 'effect-function',
  911. color:"#E6E0F8",
  912. icon: "arrow-in.png"
  913. });
  914. </script>
  915. <script type="text/x-red" data-help-name="AudioEffectEnvelope">
  916. <h3>Summary</h3>
  917. <div>
  918. <p>Modify a signal with a DAHDSR (Delay Attack Hold Decay Sustain
  919. Release) envelope.
  920. </p>
  921. <p align=center><img src="dahdsr.png"></p>
  922. </div>
  923. <h3>Audio Connections</h3>
  924. <table class=doc align=center cellpadding=3>
  925. <tr class=top><th>Port</th><th>Purpose</th></tr>
  926. <tr class=odd><td align=center>In 0</td><td>Signal Input</td></tr>
  927. <tr class=odd><td align=center>Out 0</td><td>Signal with Envelope Applied</td></tr>
  928. </table>
  929. <h3>Functions</h3>
  930. <p class=func><span class=keyword>noteOn</span>();</p>
  931. <p class=desc>Begin the delay to attack, or the attack phase is
  932. delay is zero.
  933. </p>
  934. <p class=func><span class=keyword>noteOff</span>();</p>
  935. <p class=desc>Begin the release phase.
  936. </p>
  937. <p class=func><span class=keyword>delay</span>(milliseconds);</p>
  938. <p class=desc>Set the delay from noteOn to the attach phase. The
  939. default is zero, for no delay.
  940. </p>
  941. <p class=func><span class=keyword>attack</span>(milliseconds);</p>
  942. <p class=desc>Set the attack time. The default is 1.5 milliseconds.
  943. </p>
  944. <p class=func><span class=keyword>hold</span>(milliseconds);</p>
  945. <p class=desc>Set the hold time. The default is 0.5 milliseconds.
  946. </p>
  947. <p class=func><span class=keyword>decay</span>(milliseconds);</p>
  948. <p class=desc>Set the decay time. The default is 15 milliseconds.
  949. </p>
  950. <p class=func><span class=keyword>sustain</span>(level);</p>
  951. <p class=desc>Set the sustain level. The range is 0 to 1.0. The
  952. gain will be maintained at this level after the decay phase,
  953. until noteOff() is called.
  954. </p>
  955. <p class=func><span class=keyword>release</span>(milliseconds);</p>
  956. <p class=desc>Set the release time. The default is 30 millisecond.
  957. </p>
  958. <h3>Notes</h3>
  959. <p>To achieve the more common ADSR shape, simply
  960. set delay and hold to zero.</p>
  961. <p>The recommended range for each of the 5 timing inputs is 0 to 50
  962. milliseconds. Up to 200 ms can be used, with somewhat reduced
  963. accuracy</p>
  964. </script>
  965. <script type="text/x-red" data-template-name="AudioEffectEnvelope">
  966. <div class="form-row">
  967. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  968. <input type="text" id="node-input-name" placeholder="Name">
  969. </div>
  970. </script>
  971. <script type="text/javascript">
  972. RED.nodes.registerType('AudioEffectMultiply',{
  973. shortName: "multiply",
  974. inputs:2,
  975. outputs:1,
  976. category: 'effect-function',
  977. color:"#E6E0F8",
  978. icon: "arrow-in.png"
  979. });
  980. </script>
  981. <script type="text/x-red" data-help-name="AudioEffectMultiply">
  982. <h3>Summary</h3>
  983. <div>
  984. <p>Multiply two signals together, useful for amplitude modulation
  985. or "voltage controlled amplification".
  986. </p>
  987. <p align=center><img src="multiply.png"><br><small>56 Hz and 1 kHz sine waves multiplied.</small></p>
  988. </div>
  989. <h3>Audio Connections</h3>
  990. <table class=doc align=center cellpadding=3>
  991. <tr class=top><th>Port</th><th>Purpose</th></tr>
  992. <tr class=odd><td align=center>In 0</td><td>Signal Input</td></tr>
  993. <tr class=odd><td align=center>In 1</td><td>Signal Input</td></tr>
  994. <tr class=odd><td align=center>Out 0</td><td>Signal with Envelope Applied</td></tr>
  995. </table>
  996. <h3>Functions</h3>
  997. <p>There are no functions to call from the Arduino sketch.
  998. This object simply multiplies the 2 signals to create
  999. a continuous output
  1000. </p>
  1001. <h3>Notes</h3>
  1002. <p>
  1003. </p>
  1004. </script>
  1005. <script type="text/x-red" data-template-name="AudioEffectMultiply">
  1006. <div class="form-row">
  1007. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1008. <input type="text" id="node-input-name" placeholder="Name">
  1009. </div>
  1010. </script>
  1011. <script type="text/javascript">
  1012. RED.nodes.registerType('AudioFilterBiquad',{
  1013. shortName: "biquad",
  1014. inputs:1,
  1015. outputs:1,
  1016. category: 'filter-function',
  1017. color:"#E6E0F8",
  1018. icon: "arrow-in.png"
  1019. });
  1020. </script>
  1021. <script type="text/x-red" data-help-name="AudioFilterBiquad">
  1022. <h3>Summary</h3>
  1023. <p>description</p>
  1024. <h3>Audio Connections</h3>
  1025. <table class=doc align=center cellpadding=3>
  1026. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1027. <tr class=odd><td align=center></td><td></td></tr>
  1028. </table>
  1029. <h3>Parameters</h3>
  1030. <table class=doc align=center cellpadding=3>
  1031. <tr class=top><th>Name</th><th>Type</th><th>Function</th></tr>
  1032. <tr class=odd><td align=center></td><td>Integer</td><td></td></tr>
  1033. </table>
  1034. <p>Extra description... Section only present if object has params</p>
  1035. <h3>Functions</h3>
  1036. <p class=func><span class=keyword>function</span>(parm1, parm2);</p>
  1037. <p class=desc>blah blah blah blah
  1038. </p>
  1039. <h3>Notes</h3>
  1040. <p></p>
  1041. </script>
  1042. <script type="text/x-red" data-template-name="AudioFilterBiquad">
  1043. <div class="form-row">
  1044. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1045. <input type="text" id="node-input-name" placeholder="Name">
  1046. </div>
  1047. </script>
  1048. <script type="text/javascript">
  1049. RED.nodes.registerType('AudioFilterFIR',{
  1050. shortName: "fir",
  1051. inputs:1,
  1052. outputs:1,
  1053. category: 'filter-function',
  1054. color:"#E6E0F8",
  1055. icon: "arrow-in.png"
  1056. });
  1057. </script>
  1058. <script type="text/x-red" data-help-name="AudioFilterFIR">
  1059. <h3>Summary</h3>
  1060. <p>description</p>
  1061. <h3>Audio Connections</h3>
  1062. <table class=doc align=center cellpadding=3>
  1063. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1064. <tr class=odd><td align=center></td><td></td></tr>
  1065. </table>
  1066. <!--<h3>Parameters</h3>
  1067. <table class=doc align=center cellpadding=3>
  1068. <tr class=top><th>Name</th><th>Type</th><th>Function</th></tr>
  1069. <tr class=odd><td align=center></td><td>Integer</td><td></td></tr>
  1070. </table>
  1071. <p>Extra description... Section only present if object has params</p>-->
  1072. <h3>Functions</h3>
  1073. <p class=func><span class=keyword>function</span>(parm1, parm2);</p>
  1074. <p class=desc>blah blah blah blah
  1075. </p>
  1076. <h3>Notes</h3>
  1077. <p></p>
  1078. </script>
  1079. <script type="text/x-red" data-template-name="AudioFilterFIR">
  1080. <div class="form-row">
  1081. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1082. <input type="text" id="node-input-name" placeholder="Name">
  1083. </div>
  1084. </script>
  1085. <script type="text/javascript">
  1086. RED.nodes.registerType('AudioPeak',{
  1087. shortName: "peak",
  1088. inputs:1,
  1089. outputs:0,
  1090. category: 'analyze-function',
  1091. color:"#E6E0F8",
  1092. icon: "arrow-in.png"
  1093. });
  1094. </script>
  1095. <script type="text/x-red" data-help-name="AudioPeak">
  1096. <h3>Summary</h3>
  1097. <p>description</p>
  1098. <h3>Audio Connections</h3>
  1099. <table class=doc align=center cellpadding=3>
  1100. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1101. <tr class=odd><td align=center></td><td></td></tr>
  1102. </table>
  1103. <!--<h3>Parameters</h3>
  1104. <table class=doc align=center cellpadding=3>
  1105. <tr class=top><th>Name</th><th>Type</th><th>Function</th></tr>
  1106. <tr class=odd><td align=center></td><td>Integer</td><td></td></tr>
  1107. </table>
  1108. <p>Extra description... Section only present if object has params</p>-->
  1109. <h3>Functions</h3>
  1110. <p class=func><span class=keyword>begin</span>(noReset);</p>
  1111. <p class=desc>blah blah blah blah
  1112. </p>
  1113. <p class=func><span class=keyword>stop</span>();</p>
  1114. <p class=desc>blah blah blah blah
  1115. </p>
  1116. <p class=func><span class=keyword>Dpp</span>();</p>
  1117. <p class=desc>blah blah blah blah
  1118. </p>
  1119. <h3>Notes</h3>
  1120. <p></p>
  1121. </script>
  1122. <script type="text/x-red" data-template-name="AudioPeak">
  1123. <div class="form-row">
  1124. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1125. <input type="text" id="node-input-name" placeholder="Name">
  1126. </div>
  1127. </script>
  1128. <script type="text/javascript">
  1129. RED.nodes.registerType('AudioAnalyzeFFT256',{
  1130. shortName: "fft256",
  1131. inputs:1,
  1132. outputs:0,
  1133. category: 'analyze-function',
  1134. color:"#E6E0F8",
  1135. icon: "arrow-in.png"
  1136. });
  1137. </script>
  1138. <script type="text/x-red" data-help-name="AudioAnalyzeFFT256">
  1139. <h3>Summary</h3>
  1140. <p>Compute a 256 point Fast Fourier Transform (FFT) frequency analysis,
  1141. with real value (magnitude) output. The frequency resolution is
  1142. 172 Hz, useful for simple audio visualization.</p>
  1143. <h3>Audio Connections</h3>
  1144. <table class=doc align=center cellpadding=3>
  1145. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1146. <tr class=odd><td align=center>In 0</td><td>Signal to convert to frequency bins</td></tr>
  1147. </table>
  1148. <h3>Parameters</h3>
  1149. <table class=doc align=center cellpadding=3>
  1150. <tr class=top><th>Name</th><th>Type</th><th>Function</th></tr>
  1151. <tr class=odd><td align=center>Num</td><td>Integer</td><td># FFTs to average</td></tr>
  1152. <tr class=odd><td align=center>Window</td><td>Array</td><td>Window method to use</td></tr>
  1153. </table>
  1154. <p>Extra description... Section only present if object has params</p>
  1155. <h3>Functions</h3>
  1156. <p class=func><span class=keyword>available</span>();</p>
  1157. <p class=desc>Returns true each time the FFT analysis produces new output data.
  1158. </p>
  1159. <h3>Notes</h3>
  1160. <p>The raw 16 bit output data bins may be access with myFFT.output[num], where
  1161. num is 0 to 127.</p>
  1162. <p>TODO: caveats about spectral leakage vs frequency precision for arbitrary signals</p>
  1163. <p>Known bug in the library limits to only a single instance of this object.
  1164. This bug will be fixed someday... allowing 2 or more FFTs to run on simultaneously.</p>
  1165. <p>Window Types:
  1166. <ul>
  1167. <li><span class=literal>AudioWindowHanning256</span> (default)</li>
  1168. <li><span class=literal>AudioWindowBartlett256</span></li>
  1169. <li><span class=literal>AudioWindowBlackman256</span></li>
  1170. <li><span class=literal>AudioWindowFlattop256</span></li>
  1171. <li><span class=literal>AudioWindowBlackmanHarris256</span></li>
  1172. <li><span class=literal>AudioWindowNuttall256</span></li>
  1173. <li><span class=literal>AudioWindowBlackmanNuttall256</span></li>
  1174. <li><span class=literal>AudioWindowWelch256</span></li>
  1175. <li><span class=literal>AudioWindowHamming256</span></li>
  1176. <li><span class=literal>AudioWindowCosine256</span></li>
  1177. <li><span class=literal>AudioWindowTukey256</span></li>
  1178. </ul>
  1179. </p>
  1180. </script>
  1181. <script type="text/x-red" data-template-name="AudioAnalyzeFFT256">
  1182. <div class="form-row">
  1183. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1184. <input type="text" id="node-input-name" placeholder="Name">
  1185. </div>
  1186. </script>
  1187. <script type="text/javascript">
  1188. RED.nodes.registerType('AudioAnalyzeFFT1024',{
  1189. shortName: "fft1024",
  1190. inputs:1,
  1191. outputs:0,
  1192. category: 'analyze-function',
  1193. color:"#E6E0F8",
  1194. icon: "arrow-in.png"
  1195. });
  1196. </script>
  1197. <script type="text/x-red" data-help-name="AudioAnalyzeFFT1024">
  1198. <h3>Summary</h3>
  1199. <p>Compute a 1024 point Fast Fourier Transform (FFT) frequency analysis,
  1200. with real value (magnitude) output. The frequency resolution is
  1201. 43 Hz, useful detailed for audio visualization.</p>
  1202. <h3>Audio Connections</h3>
  1203. <table class=doc align=center cellpadding=3>
  1204. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1205. <tr class=odd><td align=center>In 0</td><td>Signal to convert to frequency bins</td></tr>
  1206. </table>
  1207. <h3>Parameters</h3>
  1208. <table class=doc align=center cellpadding=3>
  1209. <tr class=top><th>Name</th><th>Type</th><th>Function</th></tr>
  1210. <tr class=odd><td align=center>Num</td><td>Integer</td><td># FFTs to average</td></tr>
  1211. <tr class=odd><td align=center>Window</td><td>Array</td><td>Window method to use</td></tr>
  1212. </table>
  1213. <p>Extra description... Section only present if object has params</p>
  1214. <h3>Functions</h3>
  1215. <p class=func><span class=keyword>available</span>();</p>
  1216. <p class=desc>Returns true each time the FFT analysis produces new output data.
  1217. </p>
  1218. <h3>Notes</h3>
  1219. <p>1024 point FFT uses approx 50% of the CPU power on Teensy 3.1</p>
  1220. <p>The raw 16 bit output data bins may be access with myFFT.output[num], where
  1221. num is 0 to 511.</p>
  1222. <p>TODO: caveats about spectral leakage vs frequency precision for arbitrary signals</p>
  1223. <p>Known bug in the library limits to only a single instance of this object.
  1224. This bug will be fixed someday... but 2 instances may not run due to CPU limitation</p>
  1225. <p>Window Types:
  1226. <ul>
  1227. <li><span class=literal>AudioWindowHanning1024</span> (default)</li>
  1228. </ul>
  1229. </p>
  1230. </script>
  1231. <script type="text/x-red" data-template-name="AudioAnalyzeFFT1024">
  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/javascript">
  1238. RED.nodes.registerType('AudioAnalyzeToneDetect',{
  1239. shortName: "tone",
  1240. inputs:1,
  1241. outputs:0,
  1242. category: 'analyze-function',
  1243. color:"#E6E0F8",
  1244. icon: "arrow-in.png"
  1245. });
  1246. </script>
  1247. <script type="text/x-red" data-help-name="AudioAnalyzeToneDetect">
  1248. <h3>Summary</h3>
  1249. <p>Detect the level of a single tone</p>
  1250. <h3>Audio Connections</h3>
  1251. <table class=doc align=center cellpadding=3>
  1252. <tr class=top><th>Port</th><th>Purpose</th></tr>
  1253. <tr class=odd><td align=center>In 0</td><td>Signal to analyze</td></tr>
  1254. </table>
  1255. <h3>Functions</h3>
  1256. <p class=func><span class=keyword>frequency</span>(freq);</p>
  1257. <p class=desc>Set the frequency to detect. The default detection time
  1258. will be 10 cycles of this frequency.
  1259. </p>
  1260. <p class=func><span class=keyword>frequency</span>(freq, cycles);</p>
  1261. <p class=desc>Set the frequency to detect, and the number of cycles.
  1262. Longer detection time (more cycles) will give higher precision,
  1263. but of course slower response.
  1264. </p>
  1265. <p class=func><span class=keyword>available</span>();</p>
  1266. <p class=desc>Returns true (non-zero) each time a detection interval
  1267. (number of cycles) completed and a new level is detected.
  1268. </p>
  1269. <p class=func><span class=keyword>read</span>();</p>
  1270. <p class=desc>Read the detected signal level. Range is 0 to 1.0.
  1271. </p>
  1272. <p class=func><span class=keyword>threshold</span>(level);</p>
  1273. <p class=desc>Set a detection threshold, where the bool test operation
  1274. will return true if at or above this level, or false when below.
  1275. </p>
  1276. <p class=func>(bool)</p>
  1277. <p class=desc>By testing the object as a boolean value, you can respond
  1278. to detection of a tone.
  1279. </p>
  1280. <h3>Notes</h3>
  1281. <p>Low frequency detection has trouble with numerical precision.
  1282. Works really well for all 8 DTMF frequencies, but fails for
  1283. detecting "sub audible tones" used in some control applications.</p>
  1284. <p>The (bool) test continues to return true until the next detection
  1285. interval (the configured number of cycles). This behavior may
  1286. change in future versions, for a single true each time the signal
  1287. is detected, and then false for the remainder of that interval.</p>
  1288. </script>
  1289. <script type="text/x-red" data-template-name="AudioAnalyzeToneDetect">
  1290. <div class="form-row">
  1291. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1292. <input type="text" id="node-input-name" placeholder="Name">
  1293. </div>
  1294. </script>
  1295. <script type="text/javascript">
  1296. RED.nodes.registerType('AudioAnalyzePrint',{
  1297. shortName: "print",
  1298. inputs:1,
  1299. outputs:0,
  1300. category: 'analyze-function',
  1301. color:"#E6E0F8",
  1302. icon: "arrow-in.png"
  1303. });
  1304. </script>
  1305. <script type="text/x-red" data-help-name="AudioAnalyzePrint">
  1306. <h3>Summary</h3>
  1307. <p>Print raw audio data to the Arduino Serial Monitor. This
  1308. object creates massive output quickly, and should not normall be used.</p>
  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></td><td></td></tr>
  1313. </table>
  1314. <!--<h3>Parameters</h3>
  1315. <table class=doc align=center cellpadding=3>
  1316. <tr class=top><th>Name</th><th>Type</th><th>Function</th></tr>
  1317. <tr class=odd><td align=center></td><td>Integer</td><td></td></tr>
  1318. </table>
  1319. <p>Extra description... Section only present if object has params</p>-->
  1320. <h3>Functions</h3>
  1321. <p class=func><span class=keyword>trigger</span>();</p>
  1322. <p class=desc>blah blah blah blah
  1323. </p>
  1324. <p class=func><span class=keyword>trigger</span>(level, edge);</p>
  1325. <p class=desc>blah blah blah blah
  1326. </p>
  1327. <p class=func><span class=keyword>delay</span>(samples);</p>
  1328. <p class=desc>blah blah blah blah
  1329. </p>
  1330. <p class=func><span class=keyword>length</span>(samples);</p>
  1331. <p class=desc>blah blah blah blah
  1332. </p>
  1333. <h3>Notes</h3>
  1334. <p></p>
  1335. </script>
  1336. <script type="text/x-red" data-template-name="AudioAnalyzePrint">
  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/javascript">
  1343. RED.nodes.registerType('AudioControlSGTL5000',{
  1344. shortName: "sgtl5000",
  1345. inputs:0,
  1346. outputs:0,
  1347. category: 'control-function',
  1348. color:"#E6E0F8",
  1349. icon: "arrow-in.png"
  1350. });
  1351. </script>
  1352. <script type="text/x-red" data-help-name="AudioControlSGTL5000">
  1353. <h3>Summary</h3>
  1354. <p>Control the SGTL5000 chip on the audio shield
  1355. <a href="http://www.pjrc.com/store/teensy3_audio.html" target="_blank">audio shield</a>.
  1356. SGTL5000 is always used in slave mode, where Teensy controls
  1357. all I2S timing.
  1358. </p>
  1359. <p align=center><img src="sgtl5000closeup.jpg"></p>
  1360. <h3>Audio Connections</h3>
  1361. <p>This object has no audio inputs or outputs. Separate i2s objects
  1362. are used to send and receive audio data. I2S master mode objects
  1363. must be used, because this object configures the SGTL5000 in slave
  1364. mode, where it depends on Teensy to provide all I2S clocks.
  1365. This object controls
  1366. how the SGTL5000 will use those I2S audio streams.</p>
  1367. <h3>Functions</h3>
  1368. <p>These are the most commonly used SGTL5000 functions.</p>
  1369. <p class=func><span class=keyword>enable</span>();</p>
  1370. <p class=desc>blah blah blah blah
  1371. </p>
  1372. <p class=func><span class=keyword>disable</span>();</p>
  1373. <p class=desc>blah blah blah blah
  1374. </p>
  1375. <p class=func><span class=keyword>volume</span>(level);</p>
  1376. <p class=desc>blah blah blah blah
  1377. </p>
  1378. <p class=func><span class=keyword>inputLevel</span>(level);</p>
  1379. <p class=desc>blah blah blah blah
  1380. </p>
  1381. <p class=func><span class=keyword>muteHeadphone</span>();</p>
  1382. <p class=desc>blah blah blah blah
  1383. </p>
  1384. <p class=func><span class=keyword>unmuteHeadphone</span>();</p>
  1385. <p class=desc>blah blah blah blah
  1386. </p>
  1387. <p class=func><span class=keyword>muteLineout</span>();</p>
  1388. <p class=desc>blah blah blah blah
  1389. </p>
  1390. <p class=func><span class=keyword>unmuteLineout</span>();</p>
  1391. <p class=desc>blah blah blah blah
  1392. </p>
  1393. <p class=func><span class=keyword>inputSelect</span>(input);</p>
  1394. <p class=desc>AUDIO_INPUT_LINEIN or AUDIO_INPUT_MIC
  1395. </p>
  1396. <h3>Signal Adjustment</h3>
  1397. <p>The SGTL5000 supports flexible signal routing (inside the chip) and
  1398. many optional signal conditioning features.</p>
  1399. <p class=func><span class=keyword>route</span>(i2s, dac, dap);</p>
  1400. <p class=desc>blah blah blah blah
  1401. </p>
  1402. <p class=func><span class=keyword>route</span>(i2s, dac, dap, dapmix);</p>
  1403. <p class=desc>blah blah blah blah
  1404. </p>
  1405. <p class=func><span class=keyword>micGain</span>(n);</p>
  1406. <p class=desc>blah blah blah blah
  1407. </p>
  1408. <p class=func><span class=keyword>lineOutLevel</span>(both);</p>
  1409. <p class=desc>blah blah blah blah
  1410. </p>
  1411. <p class=func><span class=keyword>lineOutLevel</span>(left, right);</p>
  1412. <p class=desc>blah blah blah blah
  1413. </p>
  1414. <p class=func><span class=keyword>dacVolume</span>(both);</p>
  1415. <p class=desc>blah blah blah blah
  1416. </p>
  1417. <p class=func><span class=keyword>dacVolume</span>(left, right);</p>
  1418. <p class=desc>blah blah blah blah
  1419. </p>
  1420. <p class=func><span class=keyword>adcHighPassFilterControl</span>(bypass, freeze);</p>
  1421. <p class=desc>blah blah blah blah
  1422. </p>
  1423. <p class=func><span class=keyword>adcHighPassFilterControl</span>(bypass);</p>
  1424. <p class=desc>blah blah blah blah
  1425. </p>
  1426. <p class=func><span class=keyword>audioMixerEnable</span>(n);</p>
  1427. <p class=desc>blah blah blah blah
  1428. </p>
  1429. <h3>Audio Processor</h3>
  1430. <p>An optional digital audio processor, capable of implementing a
  1431. simple equalizer, filtering, bass enhancement and surround sound
  1432. is available. It can process audio input before the SGTL5000
  1433. sends it by I2S to Teensy, or it can process Teensy's I2S output
  1434. before converting the digital data to analog signals.</p>
  1435. <p class=func><span class=keyword>audioProcessorEnable</span>(n);</p>
  1436. <p class=desc>blah blah blah blah
  1437. </p>
  1438. <p class=func><span class=keyword>audioProcessorEnable</span>();</p>
  1439. <p class=desc>blah blah blah blah
  1440. </p>
  1441. <p class=func><span class=keyword>eqFilterCount</span>(n);</p>
  1442. <p class=desc>blah blah blah blah
  1443. </p>
  1444. <p class=func><span class=keyword>eqSelect</span>(n);</p>
  1445. <p class=desc>blah blah blah blah
  1446. </p>
  1447. <p class=func><span class=keyword>eqBand</span>(bandNum, n);</p>
  1448. <p class=desc>blah blah blah blah
  1449. </p>
  1450. <p class=func><span class=keyword>eqBands</span>(bass, mid_bass, midrange, mid_treble, treble);</p>
  1451. <p class=desc>blah blah blah blah
  1452. </p>
  1453. <p class=func><span class=keyword>eqBands</span>(bass, treble);</p>
  1454. <p class=desc>blah blah blah blah
  1455. </p>
  1456. <p class=func><span class=keyword>eqFilter</span>(filterNum, filterParameters);</p>
  1457. <p class=desc>blah blah blah blah
  1458. </p>
  1459. <p class=func><span class=keyword>autoVolumeControl</span>(maxGain, response, hardLimit, threshold, attack, decay);</p>
  1460. <p class=desc>blah blah blah blah
  1461. </p>
  1462. <p class=func><span class=keyword>autoVolumeEnable</span>(n);</p>
  1463. <p class=desc>blah blah blah blah
  1464. </p>
  1465. <p class=func><span class=keyword>autoVolumeEnable</span>();</p>
  1466. <p class=desc>blah blah blah blah
  1467. </p>
  1468. <p class=func><span class=keyword>enhanceBass</span>(lr_lev, bass_lev);</p>
  1469. <p class=desc>blah blah blah blah
  1470. </p>
  1471. <p class=func><span class=keyword>enhanceBass</span>(lr_lev, bass_lev, hpf_bypass, cutoff);</p>
  1472. <p class=desc>blah blah blah blah
  1473. </p>
  1474. <p class=func><span class=keyword>enhanceBassEnable</span>(n);</p>
  1475. <p class=desc>blah blah blah blah
  1476. </p>
  1477. <p class=func><span class=keyword>enhanceBassEnable</span>();</p>
  1478. <p class=desc>blah blah blah blah
  1479. </p>
  1480. <p class=func><span class=keyword>surroundSound</span>(width);</p>
  1481. <p class=desc>blah blah blah blah
  1482. </p>
  1483. <p class=func><span class=keyword>surroundSound</span>(width, select);</p>
  1484. <p class=desc>blah blah blah blah
  1485. </p>
  1486. <p class=func><span class=keyword>surroundSoundEnable</span>(n);</p>
  1487. <p class=desc>blah blah blah blah
  1488. </p>
  1489. <p class=func><span class=keyword>surroundSoundEnable</span>();</p>
  1490. <p class=desc>blah blah blah blah
  1491. </p>
  1492. <p class=func><span class=keyword>killAutomation</span>();</p>
  1493. <p class=desc>blah blah blah blah
  1494. </p>
  1495. <h3>Notes</h3>
  1496. <p>TODO: how does the input AGC work
  1497. </p>
  1498. <p>TODO: document signal routing
  1499. </p>
  1500. <p>TODO: line level output adjust is weird arbitrary integers. Should this be
  1501. made into more sensible numbers, or do we just document the integer-voltage
  1502. measurements that correspond to the audio shield's hardware?
  1503. </p>
  1504. <p>TODO: make some sense out of the terribly complex audio processor features &amp; options!
  1505. </p>
  1506. <p>TODO: can some of these enable functions be eliminated and have those features
  1507. automatically enabled or disabled depending on whether the route() function has
  1508. configured signals to/from them?
  1509. </p>
  1510. </script>
  1511. <script type="text/x-red" data-template-name="AudioControlSGTL5000">
  1512. <div class="form-row">
  1513. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1514. <input type="text" id="node-input-name" placeholder="Name">
  1515. </div>
  1516. </script>
  1517. <script type="text/javascript">
  1518. RED.nodes.registerType('AudioControlWM8731',{
  1519. shortName: "wm8731",
  1520. inputs:0,
  1521. outputs:0,
  1522. category: 'control-function',
  1523. color:"#E6E0F8",
  1524. icon: "arrow-in.png"
  1525. });
  1526. </script>
  1527. <script type="text/x-red" data-help-name="AudioControlWM8731">
  1528. <h3>Summary</h3>
  1529. <p>Control a WM8731 chip in slave mode, where it receives all clocks from Teensy</p>
  1530. <h3>Audio Connections</h3>
  1531. <p>This object has no audio inputs or outputs. Separate i2s objects
  1532. are used to send and receive audio data. I2S master mode objects
  1533. must be used, since this control object configures the WM8731 into
  1534. slave mode.
  1535. </p>
  1536. <h3>Functions</h3>
  1537. <p class=func><span class=keyword>enable</span>();</p>
  1538. <p class=desc>blah blah blah blah
  1539. </p>
  1540. <p class=func><span class=keyword>disable</span>();</p>
  1541. <p class=desc>not implemented
  1542. </p>
  1543. <p class=func><span class=keyword>volume</span>(level);</p>
  1544. <p class=desc>blah blah blah blah
  1545. </p>
  1546. <p class=func><span class=keyword>inputLevel</span>(level);</p>
  1547. <p class=desc>not implemented
  1548. </p>
  1549. <p class=func><span class=keyword>inputSelect</span>(input);</p>
  1550. <p class=desc>not implemented
  1551. </p>
  1552. <h3>Notes</h3>
  1553. <p></p>
  1554. </script>
  1555. <script type="text/x-red" data-template-name="AudioControlWM8731">
  1556. <div class="form-row">
  1557. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1558. <input type="text" id="node-input-name" placeholder="Name">
  1559. </div>
  1560. </script>
  1561. <script type="text/javascript">
  1562. RED.nodes.registerType('AudioControlWM8731master',{
  1563. shortName: "wm8731m",
  1564. inputs:0,
  1565. outputs:0,
  1566. category: 'control-function',
  1567. color:"#E6E0F8",
  1568. icon: "arrow-in.png"
  1569. });
  1570. </script>
  1571. <script type="text/x-red" data-help-name="AudioControlWM8731master">
  1572. <h3>Summary</h3>
  1573. <p>Control a WM8731 chip in master mode, where it controls all I2S timing.</p>
  1574. <h3>Audio Connections</h3>
  1575. <p>This object has no audio inputs or outputs. Separate i2s objects
  1576. are used to send and receive audio data. I2S slave mode objects
  1577. must be used, since this control object configures the WM8731 into
  1578. master mode.
  1579. </p>
  1580. <h3>Functions</h3>
  1581. <p class=func><span class=keyword>enable</span>();</p>
  1582. <p class=desc>blah blah blah blah
  1583. </p>
  1584. <p class=func><span class=keyword>disable</span>();</p>
  1585. <p class=desc>not implemented
  1586. </p>
  1587. <p class=func><span class=keyword>volume</span>(level);</p>
  1588. <p class=desc>blah blah blah blah
  1589. </p>
  1590. <p class=func><span class=keyword>inputLevel</span>(level);</p>
  1591. <p class=desc>not implemented
  1592. </p>
  1593. <p class=func><span class=keyword>inputSelect</span>(input);</p>
  1594. <p class=desc>not implemented
  1595. </p>
  1596. <h3>Notes</h3>
  1597. <p></p>
  1598. </script>
  1599. <script type="text/x-red" data-template-name="AudioControlWM8731master">
  1600. <div class="form-row">
  1601. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  1602. <input type="text" id="node-input-name" placeholder="Name">
  1603. </div>
  1604. </script>