@@ -358,8 +358,12 @@ <h5 id="node-help-label">Keyboard Shortcuts <span style="float: right;"><a href=
358358 { "type" :"AudioControlSGTL5000" , "data" :{ "defaults" :{ "name" :{ "value" :"new" } } , "shortName" :"sgtl5000" , "inputs" :"0" , "outputs" :"0" , "category" :"control-function" , "color" :"#E6E0F8" , "icon" :"debug.png" } } ,
359359 { "type" :"AudioInputUSB" , "data" :{ "defaults" :{ "name" :{ "value" :"new" } } , "shortName" :"usbAudioIn" , "inputs" :"0" , "outputs" :"2" , "category" :"input-function" , "color" :"#E6E0F8" , "icon" :"arrow-in.png" } } ,
360360 { "type" :"AudioOutputUSB" , "data" :{ "defaults" :{ "name" :{ "value" :"new" } } , "shortName" :"usbAudioOut" , "inputs" :"2" , "outputs" :"0" , "category" :"output-function" , "color" :"#E6E0F8" , "icon" :"arrow-in.png" } } ,
361+ { "type" :"AudioPlayQueue_F32" , "data" :{ "defaults" :{ "name" :{ "value" :"new" } } , "shortName" :"playQueue" , "inputs" :"0" , "outputs" :"1" , "category" :"play-function" , "color" :"#E6E0F8" , "icon" :"arrow-in.png" } } ,
362+ { "type" :"AudioRecordQueue_F32" , "data" :{ "defaults" :{ "name" :{ "value" :"new" } } , "shortName" :"recordQueue" , "inputs" :"1" , "outputs" :"0" , "category" :"record-function" , "color" :"#E6E0F8" , "icon" :"arrow-in.png" } } ,
363+ { "type" :"AudioSynthNoisePink_F32" , "data" :{ "defaults" :{ "name" :{ "value" :"new" } } , "shortName" :"noisePink" , "inputs" :"0" , "outputs" :"1" , "category" :"synth-function" , "color" :"#E6E0F8" , "icon" :"arrow-in.png" } } ,
361364 { "type" :"AudioSynthWaveformSine_F32" , "data" :{ "defaults" :{ "name" :{ "value" :"new" } } , "shortName" :"sine" , "inputs" :"0" , "outputs" :"1" , "category" :"synth-function" , "color" :"#E6E0F8" , "icon" :"arrow-in.png" } } ,
362- { "type" :"AudioSynthWaveform_F32" , "data" :{ "defaults" :{ "name" :{ "value" :"new" } } , "shortName" :"waveform" , "inputs" :"0" , "outputs" :"1" , "category" :"synth-function" , "color" :"#E6E0F8" , "icon" :"arrow-in.png" } }
365+ { "type" :"AudioSynthWaveform_F32" , "data" :{ "defaults" :{ "name" :{ "value" :"new" } } , "shortName" :"waveform" , "inputs" :"0" , "outputs" :"1" , "category" :"synth-function" , "color" :"#E6E0F8" , "icon" :"arrow-in.png" } } ,
366+ { "type" :"AudioSynthNoiseWhite_F32" , "data" :{ "defaults" :{ "name" :{ "value" :"new" } } , "shortName" :"noiseWhite" , "inputs" :"0" , "outputs" :"1" , "category" :"synth-function" , "color" :"#E6E0F8" , "icon" :"arrow-in.png" } }
363367 ] }
364368</ script >
365369
@@ -1126,6 +1130,153 @@ <h3>Notes</h3>
11261130 </ div >
11271131</ script >
11281132
1133+ < script type ="text/x-red " data-help-name ="AudioPlayQueue_F32 ">
1134+ < h3 > Summary</ h3 >
1135+ < div class = tooltipinfo >
1136+ < p > Play audio data provided by the Arduino sketch. This object provides
1137+ functions to allow the sketch code to push data into the audio system.</ p >
1138+ < / d i v >
1139+ < h3 > Audio Connections</ h3 >
1140+ < table class = doc align = center cellpadding = 3 >
1141+ < tr class = top > < th > Port</ th > < th > Purpose</ th > </ tr >
1142+ < tr class = odd > < td align = center > Out 0</ td > < td > Sound Output < / t d > < / tr>
1143+ < / table >
1144+ < h3 > Functions</ h3 >
1145+ < p class = func > < span class = keyword > play</ span > (int16);</ p >
1146+ < p class = desc > not yet implemented
1147+ </ p >
1148+ < p class = func > < span class = keyword > play</ span > (int16[], length);</ p >
1149+ < p class = desc > not yet implemented
1150+ </ p >
1151+ < p class = func > < span class = keyword > getBuffer</ span > ();</ p >
1152+ < p class = desc > Returns a pointer to an array of 128 int16. This buffer
1153+ is within the audio library memory pool, providing the most efficient
1154+ way to input data to the audio system. The buffer is likely to be
1155+ populated by previously used data, so the entire 128 words should be
1156+ written before calling playBuffer(). Only a single buffer should be
1157+ requested at a time. This function may return NULL if no memory is
1158+ available.
1159+ </ p >
1160+ < p class = func > < span class = keyword > playBuffer</ span > ();</ p >
1161+ < p class = desc > Transmit the buffer previously obtained from getBuffer().
1162+ </ p >
1163+ < h3 > Examples</ h3 >
1164+ < 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 >
1165+ </ p >
1166+ <!--
1167+ < p class = exam > File > Examples > Audio >
1168+ </ p >
1169+ -->
1170+ < h3 > Notes</ h3 >
1171+ < p > TODO: many caveats....</ p >
1172+ < p >
1173+ </ p >
1174+ </ script >
1175+ < script type ="text/x-red " data-template-name ="AudioPlayQueue_F32 ">
1176+ < div class = "form-row" >
1177+ < label for = "node-input-name" > < i class = "fa fa-tag" > </ i > Name</ label >
1178+ < input type = "text" id = "node-input-name" placeholder = "Name" >
1179+ </ div >
1180+ </ script >
1181+
1182+ < script type ="text/x-red " data-help-name ="AudioRecordQueue_F32 ">
1183+ < h3 > Summary</ h3 >
1184+ < div class = tooltipinfo >
1185+ < p > Record audio data by sending to the Arduino sketch. This object allows
1186+ sketch code to receive audio packets.</ p >
1187+ < / d i v >
1188+ < h3 > Audio Connections</ h3 >
1189+ < table class = doc align = center cellpadding = 3 >
1190+ < tr class = top > < th > Port</ th > < th > Purpose</ th > </ tr >
1191+ < tr class = odd > < td align = center > In 0</ td > < td > Sound To Access < / t d > < / tr>
1192+ < / table >
1193+ < h3 > Functions</ h3 >
1194+ < p class = func > < span class = keyword > begin</ span > ();</ p >
1195+ < p class = desc > Begin capturing incoming audio to the queue. After calling
1196+ begin, readBuffer() and freeBuffer(), or clear() must be used frequently
1197+ to prevent the queue from filling up.
1198+ </ p >
1199+ < p class = func > < span class = keyword > available</ span > ();</ p >
1200+ < p class = desc > Returns the number of audio packets available to read.
1201+ </ p >
1202+ < p class = func > < span class = keyword > readBuffer</ span > ();</ p >
1203+ < p class = desc > Read a single audio packet. A pointer to a 128 sample
1204+ array of 16 bit integers is returned. NULL is returned if no packets
1205+ are available.
1206+ </ p >
1207+ < p class = func > < span class = keyword > freeBuffer</ span > ();</ p >
1208+ < p class = desc > Release the memory from the previously read packet returned
1209+ from readBuffer(). Only a single packet at a time may be read, and
1210+ each packet must be freed with this function, to return the memory to
1211+ the audio library.
1212+ </ p >
1213+ < p class = func > < span class = keyword > clear</ span > ();</ p >
1214+ < p class = desc > Discard all audio held in the queue.
1215+ </ p >
1216+ < p class = func > < span class = keyword > end</ span > ();</ p >
1217+ < p class = desc > Stop capturing incoming audio into the queue. Data already
1218+ captured remains in the queue and may be read with readBuffer().
1219+ </ p >
1220+ < h3 > Examples</ h3 >
1221+ < p class = exam > File > Examples > Audio > Recorder
1222+ </ p >
1223+ < h3 > Notes</ h3 >
1224+ < p >
1225+ Up to 52 packets may be queued by this object, which allows approximately
1226+ 150 ms of audio to be held in the queue, to allow time for the Arduino
1227+ sketch to write data to media or do other high-latency tasks.
1228+
1229+ The actual packets are taken
1230+ from the pool created by AudioMemory().
1231+ </ p >
1232+ </ script >
1233+ < script type ="text/x-red " data-template-name ="AudioRecordQueue_F32 ">
1234+ < div class = "form-row" >
1235+ < label for = "node-input-name" > < i class = "fa fa-tag" > </ i > Name</ label >
1236+ < input type = "text" id = "node-input-name" placeholder = "Name" >
1237+ </ div >
1238+ </ script >
1239+
1240+ < script type ="text/x-red " data-help-name ="AudioSynthNoisePink_F32 ">
1241+ < h3 > Summary</ h3 >
1242+ < div class = tooltipinfo >
1243+ < p > Create pink noise, using Stefan Stenzel's "New Shade Of Pink" algorithm.
1244+ </ p >
1245+ < ! --
1246+ < p align = center > < img src = "img/whitenoise.png" > </ p >
1247+ -->
1248+ </ div >
1249+ < h3 > Audio Connections < / h 3 >
1250+ < table class = doc align = center cellpadding = 3 >
1251+ < tr class = top > < th > Port</ th > < th > Purpose</ th > </ tr >
1252+ < tr class = odd > < td align = center > Out 0</ td > < td > Pink Noise</ td > </ tr >
1253+ </ table >
1254+ < h3 > Functions < / h 3 >
1255+ < p class = func > < span class = keyword > amplitude</ span > (level);</ p >
1256+ < p class = desc > Set the output peak level , from 0 ( off ) to 1.0 .
1257+ The default is off . Noise is generated only after setting
1258+ to a non - zero level .
1259+ < / p >
1260+ < h3 > Examples</ h3 >
1261+ < p class = exam > File & gt ; Examples & gt ; Audio & gt ; MemoryAndCpuUsage
1262+ < / p >
1263+ < h3 > Notes</ h3 >
1264+ < p > Setting the amplitude to zero causes this object to stop using
1265+ CPU time . CPU usage is approx 3 % on Teensy 3.1 .
1266+ < / p >
1267+ < p > Stefan Stenzel's
1268+ < a href = "http://stenzel.waldorfmusic.de/post/pink/" target = "_blank" > New Shade Of Pink</ a >
1269+ algorithm. Stefan's terms of use are "Use for any purpose. If used
1270+ in a commercial product, you should give me one."
1271+ </ p >
1272+ </ script >
1273+ < script type ="text/x-red " data-template-name ="AudioSynthNoisePink_F32 ">
1274+ < div class = "form-row" >
1275+ < label for = "node-input-name" > < i class = "fa fa-tag" > </ i > Name</ label >
1276+ < input type = "text" id = "node-input-name" placeholder = "Name" >
1277+ </ div >
1278+ </ script >
1279+
11291280< script type ="text/x-red " data-help-name ="AudioSynthWaveformSine_F32 ">
11301281 < h3 > Summary</ h3 >
11311282 < div class = tooltipinfo >
@@ -1240,5 +1391,38 @@ <h3>Notes</h3>
12401391 </ div >
12411392</ script >
12421393
1394+ < script type ="text/x-red " data-help-name ="AudioSynthNoiseWhite_F32 ">
1395+ < h3 > Summary</ h3 >
1396+ < div class = tooltipinfo >
1397+ < p > Create white noise.
1398+ </ p >
1399+ < p align = center > < img src = "img/whitenoise.png" > </ p >
1400+ < / d i v >
1401+ < h3 > Audio Connections</ h3 >
1402+ < table class = doc align = center cellpadding = 3 >
1403+ < tr class = top > < th > Port</ th > < th > Purpose</ th > </ tr >
1404+ < tr class = odd > < td align = center > Out 0</ td > < td > White Noise < / t d > < / tr>
1405+ < / table >
1406+ < h3 > Functions</ h3 >
1407+ < p class = func > < span class = keyword > amplitude</ span > (level);</ p >
1408+ < p class = desc > Set the output peak level, from 0 (off) to 1.0.
1409+ The default is off. Noise is generated only after setting
1410+ to a non-zero level.
1411+ </ p >
1412+ < h3 > Examples</ h3 >
1413+ < p class = exam > File > Examples > Audio >
1414+ </ p >
1415+ < h3 > Notes</ h3 >
1416+ < p > Setting the amplitude to zero causes this object to stop using
1417+ CPU time to generate random numbers.
1418+ </ p >
1419+ </ script >
1420+ < script type ="text/x-red " data-template-name ="AudioSynthNoiseWhite_F32 ">
1421+ < div class = "form-row" >
1422+ < label for = "node-input-name" > < i class = "fa fa-tag" > </ i > Name</ label >
1423+ < input type = "text" id = "node-input-name" placeholder = "Name" >
1424+ </ div >
1425+ </ script >
1426+
12431427</ body >
12441428</ html >
0 commit comments