cyfaust 0.1.0__cp311-cp311-macosx_15_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (693) hide show
  1. cyfaust/CMakeLists.txt +93 -0
  2. cyfaust/__init__.py +0 -0
  3. cyfaust/__main__.py +819 -0
  4. cyfaust/box.pxd +46 -0
  5. cyfaust/box.pyx +2459 -0
  6. cyfaust/common.pxd +5 -0
  7. cyfaust/common.pyx +61 -0
  8. cyfaust/cyfaust.cpython-311-darwin.so +0 -0
  9. cyfaust/faust_box.pxd +298 -0
  10. cyfaust/faust_box_oo.pyx +66 -0
  11. cyfaust/faust_gui.pxd +261 -0
  12. cyfaust/faust_interp.pxd +160 -0
  13. cyfaust/faust_player.pxd +80 -0
  14. cyfaust/faust_signal.pxd +257 -0
  15. cyfaust/gui_statics.cpp +15 -0
  16. cyfaust/interp.pyx +673 -0
  17. cyfaust/player.cpp +32519 -0
  18. cyfaust/player.pyx +191 -0
  19. cyfaust/resources/architecture/AU/AUPublic/AUBase/AUBase.cpp +2327 -0
  20. cyfaust/resources/architecture/AU/AUPublic/AUBase/AUBase.h +1019 -0
  21. cyfaust/resources/architecture/AU/AUPublic/AUBase/AUDispatch.cpp +423 -0
  22. cyfaust/resources/architecture/AU/AUPublic/AUBase/AUDispatch.h +82 -0
  23. cyfaust/resources/architecture/AU/AUPublic/AUBase/AUInputElement.cpp +151 -0
  24. cyfaust/resources/architecture/AU/AUPublic/AUBase/AUInputElement.h +119 -0
  25. cyfaust/resources/architecture/AU/AUPublic/AUBase/AUOutputElement.cpp +62 -0
  26. cyfaust/resources/architecture/AU/AUPublic/AUBase/AUOutputElement.h +66 -0
  27. cyfaust/resources/architecture/AU/AUPublic/AUBase/AUPlugInDispatch.cpp +615 -0
  28. cyfaust/resources/architecture/AU/AUPublic/AUBase/AUPlugInDispatch.h +128 -0
  29. cyfaust/resources/architecture/AU/AUPublic/AUBase/AUScopeElement.cpp +512 -0
  30. cyfaust/resources/architecture/AU/AUPublic/AUBase/AUScopeElement.h +544 -0
  31. cyfaust/resources/architecture/AU/AUPublic/AUBase/ComponentBase.cpp +370 -0
  32. cyfaust/resources/architecture/AU/AUPublic/AUBase/ComponentBase.h +340 -0
  33. cyfaust/resources/architecture/AU/AUPublic/AUEffectBase/AUEffectBase.cpp +463 -0
  34. cyfaust/resources/architecture/AU/AUPublic/AUEffectBase/AUEffectBase.h +391 -0
  35. cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/AUInstrumentBase.cpp +837 -0
  36. cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/AUInstrumentBase.h +267 -0
  37. cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/AUMIDIBase.cpp +495 -0
  38. cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/AUMIDIBase.h +213 -0
  39. cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/LockFreeFIFO.h +168 -0
  40. cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/MIDIControlHandler.h +92 -0
  41. cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/MusicDeviceBase.cpp +354 -0
  42. cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/MusicDeviceBase.h +126 -0
  43. cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/SynthElement.cpp +419 -0
  44. cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/SynthElement.h +227 -0
  45. cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/SynthEvent.h +145 -0
  46. cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/SynthNote.cpp +138 -0
  47. cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/SynthNote.h +186 -0
  48. cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/SynthNoteList.cpp +93 -0
  49. cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/SynthNoteList.h +232 -0
  50. cyfaust/resources/architecture/AU/AUPublic/Utility/AUBaseHelper.cpp +134 -0
  51. cyfaust/resources/architecture/AU/AUPublic/Utility/AUBaseHelper.h +80 -0
  52. cyfaust/resources/architecture/AU/AUPublic/Utility/AUBuffer.cpp +217 -0
  53. cyfaust/resources/architecture/AU/AUPublic/Utility/AUBuffer.h +267 -0
  54. cyfaust/resources/architecture/AU/AUPublic/Utility/AUMIDIDefs.h +136 -0
  55. cyfaust/resources/architecture/AU/AUPublic/Utility/AUSilentTimeout.h +93 -0
  56. cyfaust/resources/architecture/AU/English.lproj/InfoPlist.strings +0 -0
  57. cyfaust/resources/architecture/AU/FaustAU.exp +2 -0
  58. cyfaust/resources/architecture/AU/FaustAU.xcodeproj/project.pbxproj +968 -0
  59. cyfaust/resources/architecture/AU/FaustAU.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  60. cyfaust/resources/architecture/AU/FaustAUCustomView.plist +14 -0
  61. cyfaust/resources/architecture/AU/Info.plist +47 -0
  62. cyfaust/resources/architecture/AU/PublicUtility/CAAtomic.h +305 -0
  63. cyfaust/resources/architecture/AU/PublicUtility/CAAtomicStack.h +239 -0
  64. cyfaust/resources/architecture/AU/PublicUtility/CAAudioChannelLayout.cpp +153 -0
  65. cyfaust/resources/architecture/AU/PublicUtility/CAAudioChannelLayout.h +199 -0
  66. cyfaust/resources/architecture/AU/PublicUtility/CAAutoDisposer.h +508 -0
  67. cyfaust/resources/architecture/AU/PublicUtility/CABufferList.cpp +264 -0
  68. cyfaust/resources/architecture/AU/PublicUtility/CABufferList.h +319 -0
  69. cyfaust/resources/architecture/AU/PublicUtility/CAByteOrder.h +161 -0
  70. cyfaust/resources/architecture/AU/PublicUtility/CADebugMacros.cpp +88 -0
  71. cyfaust/resources/architecture/AU/PublicUtility/CADebugMacros.h +580 -0
  72. cyfaust/resources/architecture/AU/PublicUtility/CADebugPrintf.cpp +89 -0
  73. cyfaust/resources/architecture/AU/PublicUtility/CADebugPrintf.h +115 -0
  74. cyfaust/resources/architecture/AU/PublicUtility/CADebugger.cpp +77 -0
  75. cyfaust/resources/architecture/AU/PublicUtility/CADebugger.h +56 -0
  76. cyfaust/resources/architecture/AU/PublicUtility/CAException.h +83 -0
  77. cyfaust/resources/architecture/AU/PublicUtility/CAGuard.cpp +339 -0
  78. cyfaust/resources/architecture/AU/PublicUtility/CAGuard.h +133 -0
  79. cyfaust/resources/architecture/AU/PublicUtility/CAHostTimeBase.cpp +110 -0
  80. cyfaust/resources/architecture/AU/PublicUtility/CAHostTimeBase.h +231 -0
  81. cyfaust/resources/architecture/AU/PublicUtility/CALogMacros.h +140 -0
  82. cyfaust/resources/architecture/AU/PublicUtility/CAMath.h +68 -0
  83. cyfaust/resources/architecture/AU/PublicUtility/CAMutex.cpp +345 -0
  84. cyfaust/resources/architecture/AU/PublicUtility/CAMutex.h +163 -0
  85. cyfaust/resources/architecture/AU/PublicUtility/CAReferenceCounted.h +87 -0
  86. cyfaust/resources/architecture/AU/PublicUtility/CAStreamBasicDescription.cpp +795 -0
  87. cyfaust/resources/architecture/AU/PublicUtility/CAStreamBasicDescription.h +409 -0
  88. cyfaust/resources/architecture/AU/PublicUtility/CAThreadSafeList.h +255 -0
  89. cyfaust/resources/architecture/AU/PublicUtility/CAVectorUnit.cpp +191 -0
  90. cyfaust/resources/architecture/AU/PublicUtility/CAVectorUnit.h +100 -0
  91. cyfaust/resources/architecture/AU/PublicUtility/CAVectorUnitTypes.h +59 -0
  92. cyfaust/resources/architecture/AU/PublicUtility/CAXException.cpp +49 -0
  93. cyfaust/resources/architecture/AU/PublicUtility/CAXException.h +338 -0
  94. cyfaust/resources/architecture/AU/SectionPatternLight.tiff +0 -0
  95. cyfaust/resources/architecture/AU/Source/AUSource/FaustAU.h +38 -0
  96. cyfaust/resources/architecture/AU/Source/AUSource/FaustAU.r +153 -0
  97. cyfaust/resources/architecture/AU/Source/AUSource/FaustAUVersion.h +64 -0
  98. cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_Bargraph.h +18 -0
  99. cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_Bargraph.m +21 -0
  100. cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_Button.h +20 -0
  101. cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_Button.m +56 -0
  102. cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_CustomView.h +87 -0
  103. cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_CustomView.m +834 -0
  104. cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_CustomViewFactory.h +13 -0
  105. cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_CustomViewFactory.m +22 -0
  106. cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_Knob.h +81 -0
  107. cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_Knob.m +199 -0
  108. cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_Slider.h +18 -0
  109. cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_Slider.m +21 -0
  110. cyfaust/resources/architecture/AU/version.plist +16 -0
  111. cyfaust/resources/architecture/VST/Info.plist +28 -0
  112. cyfaust/resources/architecture/VST/PkgInfo +1 -0
  113. cyfaust/resources/architecture/VST/README +11 -0
  114. cyfaust/resources/architecture/VST/VST.xcode/project.pbxproj +655 -0
  115. cyfaust/resources/architecture/alsa-console.cpp +246 -0
  116. cyfaust/resources/architecture/alsa-gtk.cpp +220 -0
  117. cyfaust/resources/architecture/alsa-qt.cpp +229 -0
  118. cyfaust/resources/architecture/api/DspFaust.cpp +612 -0
  119. cyfaust/resources/architecture/api/DspFaust.h +511 -0
  120. cyfaust/resources/architecture/api/README.md +237 -0
  121. cyfaust/resources/architecture/api/doc/Generic.md +38 -0
  122. cyfaust/resources/architecture/au-effect.cpp +487 -0
  123. cyfaust/resources/architecture/au-instrument.cpp +573 -0
  124. cyfaust/resources/architecture/bench.cpp +91 -0
  125. cyfaust/resources/architecture/c-jack-gtk.c +227 -0
  126. cyfaust/resources/architecture/ca-gtk.cpp +284 -0
  127. cyfaust/resources/architecture/ca-qt.cpp +424 -0
  128. cyfaust/resources/architecture/cpal.rs +195 -0
  129. cyfaust/resources/architecture/csound.cpp +245 -0
  130. cyfaust/resources/architecture/csvplot.cpp +227 -0
  131. cyfaust/resources/architecture/daisy/Makefile +14 -0
  132. cyfaust/resources/architecture/daisy/README.md +50 -0
  133. cyfaust/resources/architecture/daisy/ex_faust.cpp +173 -0
  134. cyfaust/resources/architecture/dssi.cpp +1262 -0
  135. cyfaust/resources/architecture/dummy-mem.cpp +186 -0
  136. cyfaust/resources/architecture/dummy.cpp +294 -0
  137. cyfaust/resources/architecture/faust/au/AUUI.h +404 -0
  138. cyfaust/resources/architecture/faust/audio/alsa-dsp.h +693 -0
  139. cyfaust/resources/architecture/faust/audio/android-dsp.h +583 -0
  140. cyfaust/resources/architecture/faust/audio/audio.h +115 -0
  141. cyfaust/resources/architecture/faust/audio/channels.h +122 -0
  142. cyfaust/resources/architecture/faust/audio/coreaudio-dsp.h +1543 -0
  143. cyfaust/resources/architecture/faust/audio/coreaudio-ios-dsp.h +743 -0
  144. cyfaust/resources/architecture/faust/audio/dummy-audio.h +255 -0
  145. cyfaust/resources/architecture/faust/audio/esp32-dsp.h +284 -0
  146. cyfaust/resources/architecture/faust/audio/fpe.h +164 -0
  147. cyfaust/resources/architecture/faust/audio/jack-dsp.h +534 -0
  148. cyfaust/resources/architecture/faust/audio/juce-dsp.h +119 -0
  149. cyfaust/resources/architecture/faust/audio/netjack-dsp.h +354 -0
  150. cyfaust/resources/architecture/faust/audio/oboe-dsp.h +308 -0
  151. cyfaust/resources/architecture/faust/audio/ofaudio-dsp.h +155 -0
  152. cyfaust/resources/architecture/faust/audio/opensles-android-dsp.h +631 -0
  153. cyfaust/resources/architecture/faust/audio/osc-dsp.h +120 -0
  154. cyfaust/resources/architecture/faust/audio/portaudio-dsp.h +236 -0
  155. cyfaust/resources/architecture/faust/audio/rtaudio-dsp.h +241 -0
  156. cyfaust/resources/architecture/faust/audio/samAudio.h +140 -0
  157. cyfaust/resources/architecture/faust/audio/teensy-dsp.h +171 -0
  158. cyfaust/resources/architecture/faust/dsp/cmajor-cpp-dsp.h +253 -0
  159. cyfaust/resources/architecture/faust/dsp/cmajorpatch-dsp.h +483 -0
  160. cyfaust/resources/architecture/faust/dsp/cpp-dsp-adapter.h +38 -0
  161. cyfaust/resources/architecture/faust/dsp/dsp-adapter.h +836 -0
  162. cyfaust/resources/architecture/faust/dsp/dsp-bench.h +611 -0
  163. cyfaust/resources/architecture/faust/dsp/dsp-checker.h +115 -0
  164. cyfaust/resources/architecture/faust/dsp/dsp-combiner.h +810 -0
  165. cyfaust/resources/architecture/faust/dsp/dsp-compute-adapter.h +159 -0
  166. cyfaust/resources/architecture/faust/dsp/dsp-multi.h +702 -0
  167. cyfaust/resources/architecture/faust/dsp/dsp-multifun.h +90 -0
  168. cyfaust/resources/architecture/faust/dsp/dsp-optimizer.h +511 -0
  169. cyfaust/resources/architecture/faust/dsp/dsp-tools.h +229 -0
  170. cyfaust/resources/architecture/faust/dsp/dsp.h +321 -0
  171. cyfaust/resources/architecture/faust/dsp/fastmath.cpp +301 -0
  172. cyfaust/resources/architecture/faust/dsp/faust-dynamic-engine.cpp +494 -0
  173. cyfaust/resources/architecture/faust/dsp/faust-dynamic-engine.h +386 -0
  174. cyfaust/resources/architecture/faust/dsp/faust-engine.h +75 -0
  175. cyfaust/resources/architecture/faust/dsp/faust-poly-engine.h +638 -0
  176. cyfaust/resources/architecture/faust/dsp/interpreter-dsp-c.h +288 -0
  177. cyfaust/resources/architecture/faust/dsp/interpreter-dsp.h +362 -0
  178. cyfaust/resources/architecture/faust/dsp/interpreter-machine-dsp.h +233 -0
  179. cyfaust/resources/architecture/faust/dsp/libfaust-box-c.h +817 -0
  180. cyfaust/resources/architecture/faust/dsp/libfaust-box.h +889 -0
  181. cyfaust/resources/architecture/faust/dsp/libfaust-c.h +116 -0
  182. cyfaust/resources/architecture/faust/dsp/libfaust-signal-c.h +649 -0
  183. cyfaust/resources/architecture/faust/dsp/libfaust-signal.h +731 -0
  184. cyfaust/resources/architecture/faust/dsp/llvm-dsp-adapter.h +160 -0
  185. cyfaust/resources/architecture/faust/dsp/llvm-dsp-c.h +524 -0
  186. cyfaust/resources/architecture/faust/dsp/llvm-dsp.h +575 -0
  187. cyfaust/resources/architecture/faust/dsp/llvm-machine-dsp.h +215 -0
  188. cyfaust/resources/architecture/faust/dsp/one-sample-dsp.h +477 -0
  189. cyfaust/resources/architecture/faust/dsp/poly-dsp.h +1079 -0
  190. cyfaust/resources/architecture/faust/dsp/poly-interpreter-dsp.h +143 -0
  191. cyfaust/resources/architecture/faust/dsp/poly-llvm-dsp.h +249 -0
  192. cyfaust/resources/architecture/faust/dsp/poly-wasm-dsp.h +257 -0
  193. cyfaust/resources/architecture/faust/dsp/proxy-dsp.h +108 -0
  194. cyfaust/resources/architecture/faust/dsp/proxy-osc-dsp.h +109 -0
  195. cyfaust/resources/architecture/faust/dsp/rnbo-dsp.h +187 -0
  196. cyfaust/resources/architecture/faust/dsp/sound-player.h +428 -0
  197. cyfaust/resources/architecture/faust/dsp/timed-dsp.h +279 -0
  198. cyfaust/resources/architecture/faust/dsp/wasm-dsp-imp.h +188 -0
  199. cyfaust/resources/architecture/faust/dsp/wasm-dsp.h +309 -0
  200. cyfaust/resources/architecture/faust/dsp/ysfx-dsp.h +188 -0
  201. cyfaust/resources/architecture/faust/export.h +61 -0
  202. cyfaust/resources/architecture/faust/gui/APIUI.h +726 -0
  203. cyfaust/resources/architecture/faust/gui/BelaOSCUI.h +170 -0
  204. cyfaust/resources/architecture/faust/gui/CGlue.h +667 -0
  205. cyfaust/resources/architecture/faust/gui/CInterface.h +142 -0
  206. cyfaust/resources/architecture/faust/gui/ControlSequenceUI.h +197 -0
  207. cyfaust/resources/architecture/faust/gui/ControlUI.h +137 -0
  208. cyfaust/resources/architecture/faust/gui/DaisyControlUI.h +283 -0
  209. cyfaust/resources/architecture/faust/gui/DaisyPatchInitControlUI.h +254 -0
  210. cyfaust/resources/architecture/faust/gui/DecoratorUI.h +115 -0
  211. cyfaust/resources/architecture/faust/gui/Esp32ControlUI.h +341 -0
  212. cyfaust/resources/architecture/faust/gui/Esp32Reader.h +102 -0
  213. cyfaust/resources/architecture/faust/gui/Esp32SensorUI.h +137 -0
  214. cyfaust/resources/architecture/faust/gui/FUI.h +147 -0
  215. cyfaust/resources/architecture/faust/gui/GTKUI.h +1414 -0
  216. cyfaust/resources/architecture/faust/gui/GUI.h +465 -0
  217. cyfaust/resources/architecture/faust/gui/JSONControl.h +48 -0
  218. cyfaust/resources/architecture/faust/gui/JSONUI.h +722 -0
  219. cyfaust/resources/architecture/faust/gui/JSONUIDecoder.h +589 -0
  220. cyfaust/resources/architecture/faust/gui/JuceGUI.h +2061 -0
  221. cyfaust/resources/architecture/faust/gui/JuceOSCUI.h +163 -0
  222. cyfaust/resources/architecture/faust/gui/JuceParameterUI.h +158 -0
  223. cyfaust/resources/architecture/faust/gui/JuceReader.h +103 -0
  224. cyfaust/resources/architecture/faust/gui/JuceStateUI.h +88 -0
  225. cyfaust/resources/architecture/faust/gui/LayoutUI.h +423 -0
  226. cyfaust/resources/architecture/faust/gui/LibsndfileReader.h +366 -0
  227. cyfaust/resources/architecture/faust/gui/MapUI.h +370 -0
  228. cyfaust/resources/architecture/faust/gui/MemoryReader.h +111 -0
  229. cyfaust/resources/architecture/faust/gui/MetaDataUI.h +357 -0
  230. cyfaust/resources/architecture/faust/gui/MidiUI.h +939 -0
  231. cyfaust/resources/architecture/faust/gui/OCVUI.h +688 -0
  232. cyfaust/resources/architecture/faust/gui/OSCUI.h +219 -0
  233. cyfaust/resources/architecture/faust/gui/PathBuilder.h +228 -0
  234. cyfaust/resources/architecture/faust/gui/PresetUI.h +337 -0
  235. cyfaust/resources/architecture/faust/gui/PrintCUI.h +152 -0
  236. cyfaust/resources/architecture/faust/gui/PrintUI.h +121 -0
  237. cyfaust/resources/architecture/faust/gui/QTUI.h +1891 -0
  238. cyfaust/resources/architecture/faust/gui/RosCI.h +493 -0
  239. cyfaust/resources/architecture/faust/gui/RosUI.h +488 -0
  240. cyfaust/resources/architecture/faust/gui/SaveUI.h +163 -0
  241. cyfaust/resources/architecture/faust/gui/SimpleParser.h +583 -0
  242. cyfaust/resources/architecture/faust/gui/SoundUI.h +217 -0
  243. cyfaust/resources/architecture/faust/gui/Soundfile.h +342 -0
  244. cyfaust/resources/architecture/faust/gui/Styles/Blue.qrc +5 -0
  245. cyfaust/resources/architecture/faust/gui/Styles/Blue.qss +177 -0
  246. cyfaust/resources/architecture/faust/gui/Styles/Default.qrc +5 -0
  247. cyfaust/resources/architecture/faust/gui/Styles/Default.qss +117 -0
  248. cyfaust/resources/architecture/faust/gui/Styles/Grey.qrc +5 -0
  249. cyfaust/resources/architecture/faust/gui/Styles/Grey.qss +174 -0
  250. cyfaust/resources/architecture/faust/gui/Styles/Salmon.qrc +5 -0
  251. cyfaust/resources/architecture/faust/gui/Styles/Salmon.qss +171 -0
  252. cyfaust/resources/architecture/faust/gui/UI.h +87 -0
  253. cyfaust/resources/architecture/faust/gui/ValueConverter.h +543 -0
  254. cyfaust/resources/architecture/faust/gui/WaveReader.h +364 -0
  255. cyfaust/resources/architecture/faust/gui/console.h +322 -0
  256. cyfaust/resources/architecture/faust/gui/httpdUI.h +372 -0
  257. cyfaust/resources/architecture/faust/gui/meta.h +39 -0
  258. cyfaust/resources/architecture/faust/gui/mspUI.h +580 -0
  259. cyfaust/resources/architecture/faust/gui/qrcodegen.h +269 -0
  260. cyfaust/resources/architecture/faust/gui/qrcodegen.impl.h +1025 -0
  261. cyfaust/resources/architecture/faust/gui/ring-buffer.h +414 -0
  262. cyfaust/resources/architecture/faust/midi/RtMidi.cpp +3054 -0
  263. cyfaust/resources/architecture/faust/midi/RtMidi.h +1034 -0
  264. cyfaust/resources/architecture/faust/midi/bela-midi.h +266 -0
  265. cyfaust/resources/architecture/faust/midi/daisy-midi.h +116 -0
  266. cyfaust/resources/architecture/faust/midi/esp32-midi.h +185 -0
  267. cyfaust/resources/architecture/faust/midi/gramophone-midi.h +107 -0
  268. cyfaust/resources/architecture/faust/midi/iplug2-midi.h +148 -0
  269. cyfaust/resources/architecture/faust/midi/jack-midi.h +247 -0
  270. cyfaust/resources/architecture/faust/midi/juce-midi.h +275 -0
  271. cyfaust/resources/architecture/faust/midi/midi.h +475 -0
  272. cyfaust/resources/architecture/faust/midi/rt-midi.h +315 -0
  273. cyfaust/resources/architecture/faust/midi/teensy-midi.h +89 -0
  274. cyfaust/resources/architecture/faust/misc.h +106 -0
  275. cyfaust/resources/architecture/faust/sound-file.h +132 -0
  276. cyfaust/resources/architecture/faust/unity/AudioPluginInterface.h +301 -0
  277. cyfaust/resources/architecture/faust/vst/faust.h +141 -0
  278. cyfaust/resources/architecture/faust/vst/voice.h +43 -0
  279. cyfaust/resources/architecture/faust/vst/vstui.h +524 -0
  280. cyfaust/resources/architecture/faustvst.cpp +3435 -0
  281. cyfaust/resources/architecture/faustvstqt.h +91 -0
  282. cyfaust/resources/architecture/gen-json.cpp +76 -0
  283. cyfaust/resources/architecture/jack-console.cpp +267 -0
  284. cyfaust/resources/architecture/jack-gtk-ros.cpp +139 -0
  285. cyfaust/resources/architecture/jack-gtk.cpp +282 -0
  286. cyfaust/resources/architecture/jack-internal.cpp +560 -0
  287. cyfaust/resources/architecture/jack-qt-chain-footer.cpp +87 -0
  288. cyfaust/resources/architecture/jack-qt-chain-header.cpp +92 -0
  289. cyfaust/resources/architecture/jack-qt.cpp +281 -0
  290. cyfaust/resources/architecture/jack.rs +171 -0
  291. cyfaust/resources/architecture/juce/README.md +84 -0
  292. cyfaust/resources/architecture/juce/juce-plugin.cpp +809 -0
  293. cyfaust/resources/architecture/juce/juce-standalone.cpp +413 -0
  294. cyfaust/resources/architecture/juce/plugin/plugin-llvm.jucer +184 -0
  295. cyfaust/resources/architecture/juce/plugin/plugin.jucer +159 -0
  296. cyfaust/resources/architecture/juce/standalone/standalone-llvm.jucer +216 -0
  297. cyfaust/resources/architecture/juce/standalone/standalone.jucer +191 -0
  298. cyfaust/resources/architecture/ladspa.cpp +543 -0
  299. cyfaust/resources/architecture/latexheader.tex +65 -0
  300. cyfaust/resources/architecture/lv2.cpp +2090 -0
  301. cyfaust/resources/architecture/lv2qtgui.h +62 -0
  302. cyfaust/resources/architecture/lv2ui.cpp +1966 -0
  303. cyfaust/resources/architecture/max-msp/README.md +109 -0
  304. cyfaust/resources/architecture/max-msp/faustgen-wrapper-poly.maxpat +184 -0
  305. cyfaust/resources/architecture/max-msp/faustgen-wrapper.maxpat +163 -0
  306. cyfaust/resources/architecture/max-msp/max-msp.cpp +734 -0
  307. cyfaust/resources/architecture/max-msp/max-msp64.cpp +789 -0
  308. cyfaust/resources/architecture/max-msp/py2max/README.md +277 -0
  309. cyfaust/resources/architecture/max-msp/py2max/py2max/__init__.py +3 -0
  310. cyfaust/resources/architecture/max-msp/py2max/py2max/common.py +7 -0
  311. cyfaust/resources/architecture/max-msp/py2max/py2max/core.py +1387 -0
  312. cyfaust/resources/architecture/max-msp/py2max/py2max/maxclassdb.py +318 -0
  313. cyfaust/resources/architecture/max-msp/py2max/py2max/utils.py +20 -0
  314. cyfaust/resources/architecture/max-msp/rnbo.py +1591 -0
  315. cyfaust/resources/architecture/max-msp/sndfile/sndfile.h +857 -0
  316. cyfaust/resources/architecture/max-msp/ui.js +230 -0
  317. cyfaust/resources/architecture/max-msp/wrapper-poly.maxpat +153 -0
  318. cyfaust/resources/architecture/max-msp/wrapper.maxpat +131 -0
  319. cyfaust/resources/architecture/minimal-bench.cpp +100 -0
  320. cyfaust/resources/architecture/minimal-effect.c +149 -0
  321. cyfaust/resources/architecture/minimal-effect.cpp +70 -0
  322. cyfaust/resources/architecture/minimal-fixed-point.cpp +195 -0
  323. cyfaust/resources/architecture/minimal-static.cpp +160 -0
  324. cyfaust/resources/architecture/minimal.c +103 -0
  325. cyfaust/resources/architecture/minimal.cpp +84 -0
  326. cyfaust/resources/architecture/minimal.rs +223 -0
  327. cyfaust/resources/architecture/module.cpp +91 -0
  328. cyfaust/resources/architecture/octave.cpp +471 -0
  329. cyfaust/resources/architecture/oscio-gtk.cpp +115 -0
  330. cyfaust/resources/architecture/oscio-qt.cpp +121 -0
  331. cyfaust/resources/architecture/owl.cpp +345 -0
  332. cyfaust/resources/architecture/pa-gtk.cpp +119 -0
  333. cyfaust/resources/architecture/pa-qt.cpp +261 -0
  334. cyfaust/resources/architecture/path-printer.cpp +100 -0
  335. cyfaust/resources/architecture/plot.cpp +128 -0
  336. cyfaust/resources/architecture/portaudio.rs +192 -0
  337. cyfaust/resources/architecture/puredata.cpp +636 -0
  338. cyfaust/resources/architecture/ra-qt.cpp +238 -0
  339. cyfaust/resources/architecture/sam/fast_pow2.h +69 -0
  340. cyfaust/resources/architecture/sam/fastexp.h +140 -0
  341. cyfaust/resources/architecture/sam/samFaustDSP.cpp +125 -0
  342. cyfaust/resources/architecture/sam/samFaustDSP.h +107 -0
  343. cyfaust/resources/architecture/scheduler.cpp +1391 -0
  344. cyfaust/resources/architecture/sndfile.cpp +291 -0
  345. cyfaust/resources/architecture/supercollider.cpp +611 -0
  346. cyfaust/resources/architecture/teensy/README.md +13 -0
  347. cyfaust/resources/architecture/teensy/teensy.cpp +214 -0
  348. cyfaust/resources/architecture/teensy/teensy.h +71 -0
  349. cyfaust/resources/architecture/thread.h +373 -0
  350. cyfaust/resources/architecture/vcvrack/README.md +78 -0
  351. cyfaust/resources/architecture/vcvrack/template/.gitignore +6 -0
  352. cyfaust/resources/architecture/vcvrack/template/Makefile +22 -0
  353. cyfaust/resources/architecture/vcvrack/template/res/FaustModule.svg +299 -0
  354. cyfaust/resources/architecture/vcvrack/template/src/FaustModule.cpp +942 -0
  355. cyfaust/resources/architecture/vst.cpp +947 -0
  356. cyfaust/resources/libraries/aanl.lib +900 -0
  357. cyfaust/resources/libraries/all.lib +36 -0
  358. cyfaust/resources/libraries/analyzers.lib +980 -0
  359. cyfaust/resources/libraries/basics.lib +2681 -0
  360. cyfaust/resources/libraries/compressors.lib +1341 -0
  361. cyfaust/resources/libraries/delays.lib +401 -0
  362. cyfaust/resources/libraries/demos.lib +1556 -0
  363. cyfaust/resources/libraries/dx7.lib +1036 -0
  364. cyfaust/resources/libraries/effect.lib +1645 -0
  365. cyfaust/resources/libraries/envelopes.lib +666 -0
  366. cyfaust/resources/libraries/examples/README.md +13 -0
  367. cyfaust/resources/libraries/examples/ambisonics/fourSourcesToOcto.dsp +20 -0
  368. cyfaust/resources/libraries/examples/ambisonics/oneSourceToStereo.dsp +12 -0
  369. cyfaust/resources/libraries/examples/analysis/FFT.dsp +26 -0
  370. cyfaust/resources/libraries/examples/analysis/dbmeter.dsp +19 -0
  371. cyfaust/resources/libraries/examples/analysis/spectralLevel.dsp +8 -0
  372. cyfaust/resources/libraries/examples/analysis/spectralTiltLab.dsp +20 -0
  373. cyfaust/resources/libraries/examples/analysis/vumeter.dsp +18 -0
  374. cyfaust/resources/libraries/examples/autodiff/delay/diff.dsp +2 -0
  375. cyfaust/resources/libraries/examples/autodiff/delay/gt.dsp +2 -0
  376. cyfaust/resources/libraries/examples/autodiff/gain/diff.dsp +7 -0
  377. cyfaust/resources/libraries/examples/autodiff/gain/gt.dsp +1 -0
  378. cyfaust/resources/libraries/examples/autodiff/gain_dc/diff.dsp +7 -0
  379. cyfaust/resources/libraries/examples/autodiff/gain_dc/gt.dsp +4 -0
  380. cyfaust/resources/libraries/examples/autodiff/gain_exp/diff.dsp +9 -0
  381. cyfaust/resources/libraries/examples/autodiff/gain_exp/gt.dsp +1 -0
  382. cyfaust/resources/libraries/examples/autodiff/gain_pow/diff.dsp +9 -0
  383. cyfaust/resources/libraries/examples/autodiff/gain_pow/gt.dsp +1 -0
  384. cyfaust/resources/libraries/examples/autodiff/gain_pow_trig/diff.dsp +12 -0
  385. cyfaust/resources/libraries/examples/autodiff/gain_pow_trig/gt.dsp +1 -0
  386. cyfaust/resources/libraries/examples/autodiff/gain_sq/diff.dsp +7 -0
  387. cyfaust/resources/libraries/examples/autodiff/gain_sq/gt.dsp +1 -0
  388. cyfaust/resources/libraries/examples/autodiff/mem/diff.dsp +1 -0
  389. cyfaust/resources/libraries/examples/autodiff/mem/gt.dsp +1 -0
  390. cyfaust/resources/libraries/examples/autodiff/noise.dsp +2 -0
  391. cyfaust/resources/libraries/examples/autodiff/noop.dsp +2 -0
  392. cyfaust/resources/libraries/examples/autodiff/one_zero/diff.dsp +2 -0
  393. cyfaust/resources/libraries/examples/autodiff/one_zero/gt.dsp +2 -0
  394. cyfaust/resources/libraries/examples/autodiff/ramp.dsp +1 -0
  395. cyfaust/resources/libraries/examples/autodiff/recursion/diff.dsp +2 -0
  396. cyfaust/resources/libraries/examples/autodiff/recursion/gt.dsp +1 -0
  397. cyfaust/resources/libraries/examples/autodiff/recursion/target.dsp +13 -0
  398. cyfaust/resources/libraries/examples/autodiff/tremolo/diff.dsp +14 -0
  399. cyfaust/resources/libraries/examples/autodiff/tremolo/diffable.lib +7 -0
  400. cyfaust/resources/libraries/examples/autodiff/tremolo/gt.dsp +11 -0
  401. cyfaust/resources/libraries/examples/delayEcho/echo.dsp +15 -0
  402. cyfaust/resources/libraries/examples/delayEcho/quadEcho.dsp +21 -0
  403. cyfaust/resources/libraries/examples/delayEcho/smoothDelay.dsp +26 -0
  404. cyfaust/resources/libraries/examples/delayEcho/stereoEcho.dsp +16 -0
  405. cyfaust/resources/libraries/examples/delayEcho/tapiir.dsp +44 -0
  406. cyfaust/resources/libraries/examples/dynamic/compressor.dsp +8 -0
  407. cyfaust/resources/libraries/examples/dynamic/distortion.dsp +8 -0
  408. cyfaust/resources/libraries/examples/dynamic/gateCompressor.dsp +10 -0
  409. cyfaust/resources/libraries/examples/dynamic/noiseGate.dsp +8 -0
  410. cyfaust/resources/libraries/examples/dynamic/volume.dsp +15 -0
  411. cyfaust/resources/libraries/examples/filtering/APF.dsp +13 -0
  412. cyfaust/resources/libraries/examples/filtering/BPF.dsp +13 -0
  413. cyfaust/resources/libraries/examples/filtering/DNN.dsp +25 -0
  414. cyfaust/resources/libraries/examples/filtering/HPF.dsp +13 -0
  415. cyfaust/resources/libraries/examples/filtering/LPF.dsp +13 -0
  416. cyfaust/resources/libraries/examples/filtering/bandFilter.dsp +44 -0
  417. cyfaust/resources/libraries/examples/filtering/cryBaby.dsp +4 -0
  418. cyfaust/resources/libraries/examples/filtering/diodeLadder.dsp +12 -0
  419. cyfaust/resources/libraries/examples/filtering/filterBank.dsp +6 -0
  420. cyfaust/resources/libraries/examples/filtering/graphicEqLab.dsp +10 -0
  421. cyfaust/resources/libraries/examples/filtering/highShelf.dsp +13 -0
  422. cyfaust/resources/libraries/examples/filtering/korg35HPF.dsp +13 -0
  423. cyfaust/resources/libraries/examples/filtering/korg35LPF.dsp +13 -0
  424. cyfaust/resources/libraries/examples/filtering/lfBoost.dsp +40 -0
  425. cyfaust/resources/libraries/examples/filtering/lowBoost.dsp +40 -0
  426. cyfaust/resources/libraries/examples/filtering/lowCut.dsp +40 -0
  427. cyfaust/resources/libraries/examples/filtering/lowShelf.dsp +13 -0
  428. cyfaust/resources/libraries/examples/filtering/moogHalfLadder.dsp +12 -0
  429. cyfaust/resources/libraries/examples/filtering/moogLadder.dsp +12 -0
  430. cyfaust/resources/libraries/examples/filtering/moogVCF.dsp +6 -0
  431. cyfaust/resources/libraries/examples/filtering/multibandFilter.dsp +14 -0
  432. cyfaust/resources/libraries/examples/filtering/notch.dsp +13 -0
  433. cyfaust/resources/libraries/examples/filtering/oberheim.dsp +14 -0
  434. cyfaust/resources/libraries/examples/filtering/oberheimBPF.dsp +13 -0
  435. cyfaust/resources/libraries/examples/filtering/oberheimBSF.dsp +13 -0
  436. cyfaust/resources/libraries/examples/filtering/oberheimHPF.dsp +13 -0
  437. cyfaust/resources/libraries/examples/filtering/oberheimLPF.dsp +13 -0
  438. cyfaust/resources/libraries/examples/filtering/parametricEqLab.dsp +10 -0
  439. cyfaust/resources/libraries/examples/filtering/parametricEqualizer.dsp +6 -0
  440. cyfaust/resources/libraries/examples/filtering/peakNotch.dsp +13 -0
  441. cyfaust/resources/libraries/examples/filtering/peakingEQ.dsp +13 -0
  442. cyfaust/resources/libraries/examples/filtering/sallenKey2ndOrder.dsp +14 -0
  443. cyfaust/resources/libraries/examples/filtering/sallenKey2ndOrderBPF.dsp +13 -0
  444. cyfaust/resources/libraries/examples/filtering/sallenKey2ndOrderHPF.dsp +13 -0
  445. cyfaust/resources/libraries/examples/filtering/sallenKey2ndOrderLPF.dsp +13 -0
  446. cyfaust/resources/libraries/examples/filtering/sallenKeyOnePole.dsp +13 -0
  447. cyfaust/resources/libraries/examples/filtering/sallenKeyOnePoleHPF.dsp +12 -0
  448. cyfaust/resources/libraries/examples/filtering/sallenKeyOnePoleLPF.dsp +12 -0
  449. cyfaust/resources/libraries/examples/filtering/spectralTilt.dsp +8 -0
  450. cyfaust/resources/libraries/examples/filtering/vcfWahLab.dsp +12 -0
  451. cyfaust/resources/libraries/examples/filtering/vocoder.dsp +8 -0
  452. cyfaust/resources/libraries/examples/filtering/wahPedal.dsp +6 -0
  453. cyfaust/resources/libraries/examples/gameaudio/bubble.dsp +42 -0
  454. cyfaust/resources/libraries/examples/gameaudio/door.dsp +58 -0
  455. cyfaust/resources/libraries/examples/gameaudio/fire.dsp +46 -0
  456. cyfaust/resources/libraries/examples/gameaudio/insects.dsp +148 -0
  457. cyfaust/resources/libraries/examples/gameaudio/rain.dsp +27 -0
  458. cyfaust/resources/libraries/examples/gameaudio/wind.dsp +23 -0
  459. cyfaust/resources/libraries/examples/generator/filterOsc.dsp +8 -0
  460. cyfaust/resources/libraries/examples/generator/noise.dsp +52 -0
  461. cyfaust/resources/libraries/examples/generator/noiseMetadata.dsp +74 -0
  462. cyfaust/resources/libraries/examples/generator/osc.dsp +17 -0
  463. cyfaust/resources/libraries/examples/generator/osci.dsp +17 -0
  464. cyfaust/resources/libraries/examples/generator/sawtoothLab.dsp +8 -0
  465. cyfaust/resources/libraries/examples/generator/virtualAnalog.dsp +8 -0
  466. cyfaust/resources/libraries/examples/generator/virtualAnalogLab.dsp +10 -0
  467. cyfaust/resources/libraries/examples/misc/UITester.dsp +71 -0
  468. cyfaust/resources/libraries/examples/misc/autopan.dsp +59 -0
  469. cyfaust/resources/libraries/examples/misc/capture.dsp +24 -0
  470. cyfaust/resources/libraries/examples/misc/drumkit.dsp +36 -0
  471. cyfaust/resources/libraries/examples/misc/guitarix.dsp +184 -0
  472. cyfaust/resources/libraries/examples/misc/matrix.dsp +17 -0
  473. cyfaust/resources/libraries/examples/misc/midiTester.dsp +122 -0
  474. cyfaust/resources/libraries/examples/misc/mixer.dsp +27 -0
  475. cyfaust/resources/libraries/examples/misc/statespace.dsp +39 -0
  476. cyfaust/resources/libraries/examples/misc/switcher.dsp +20 -0
  477. cyfaust/resources/libraries/examples/misc/tester.dsp +32 -0
  478. cyfaust/resources/libraries/examples/misc/tester2.dsp +31 -0
  479. cyfaust/resources/libraries/examples/old/README.md +5 -0
  480. cyfaust/resources/libraries/examples/old/freeverb.dsp +109 -0
  481. cyfaust/resources/libraries/examples/old/rewriting/Makefile +21 -0
  482. cyfaust/resources/libraries/examples/old/rewriting/fact.dsp +3 -0
  483. cyfaust/resources/libraries/examples/old/rewriting/fold.dsp +61 -0
  484. cyfaust/resources/libraries/examples/old/rewriting/mesh.dsp +43 -0
  485. cyfaust/resources/libraries/examples/old/rewriting/mesh.pd +37 -0
  486. cyfaust/resources/libraries/examples/old/rewriting/sample.pd +12 -0
  487. cyfaust/resources/libraries/examples/old/rewriting/serial.dsp +7 -0
  488. cyfaust/resources/libraries/examples/old/rewriting/sum.dsp +55 -0
  489. cyfaust/resources/libraries/examples/old/rewriting/test.pd +48 -0
  490. cyfaust/resources/libraries/examples/phasing/flanger.dsp +8 -0
  491. cyfaust/resources/libraries/examples/phasing/phaser.dsp +8 -0
  492. cyfaust/resources/libraries/examples/phasing/phaserFlangerLab.dsp +12 -0
  493. cyfaust/resources/libraries/examples/physicalModeling/brass.dsp +8 -0
  494. cyfaust/resources/libraries/examples/physicalModeling/brassMIDI.dsp +8 -0
  495. cyfaust/resources/libraries/examples/physicalModeling/churchBell.dsp +8 -0
  496. cyfaust/resources/libraries/examples/physicalModeling/clarinet.dsp +8 -0
  497. cyfaust/resources/libraries/examples/physicalModeling/clarinetMIDI.dsp +8 -0
  498. cyfaust/resources/libraries/examples/physicalModeling/djembeMIDI.dsp +8 -0
  499. cyfaust/resources/libraries/examples/physicalModeling/elecGuitarMIDI.dsp +10 -0
  500. cyfaust/resources/libraries/examples/physicalModeling/englishBell.dsp +8 -0
  501. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/NLFeks.dsp +91 -0
  502. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/NLFfm.dsp +70 -0
  503. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/README +125 -0
  504. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/bass.dsp +84 -0
  505. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/bass.h +91 -0
  506. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/blowBottle.dsp +102 -0
  507. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/bowed.dsp +114 -0
  508. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/brass.dsp +103 -0
  509. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/clarinet.dsp +110 -0
  510. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/flute.dsp +116 -0
  511. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/fluteStk.dsp +121 -0
  512. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/glassHarmonica.dsp +131 -0
  513. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/harpsi.dsp +90 -0
  514. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/harpsichord.h +185 -0
  515. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/instrument.h +114 -0
  516. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/modalBar.dsp +122 -0
  517. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/modalBar.h +48 -0
  518. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/audio-out.pd +33 -0
  519. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/bottle.pd +10 -0
  520. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/clarinets.pd +15 -0
  521. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/canon/audio-out.pd +33 -0
  522. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/canon/bass.pd +162 -0
  523. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/canon/canon.pd +55 -0
  524. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/canon/flute.pd +343 -0
  525. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/canon/pachelbel.mid +0 -0
  526. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/daisy/audio-out.pd +33 -0
  527. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/daisy/daisy.mid +0 -0
  528. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/daisy/daisy.pd +45 -0
  529. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/daisy/piano.pd +205 -0
  530. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/daisy/voiceForm.pd +340 -0
  531. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/take5/audio-out.pd +33 -0
  532. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/take5/blowHole.pd +330 -0
  533. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/take5/piano.pd +205 -0
  534. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/take5/take5.mid +0 -0
  535. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/take5/take5.pd +45 -0
  536. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/turkish-march/audio-out.pd +33 -0
  537. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/turkish-march/harpsi.pd +204 -0
  538. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/turkish-march/turkish-march.mid +0 -0
  539. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/turkish-march/turkish-march.pd +31 -0
  540. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/what-a-friend/audio-out.pd +33 -0
  541. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/what-a-friend/bass.pd +162 -0
  542. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/what-a-friend/modalBar.pd +258 -0
  543. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/what-a-friend/piano.pd +205 -0
  544. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/what-a-friend/what-a-friend.pd +52 -0
  545. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/what-a-friend/what_a_friend.mid +0 -0
  546. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/flutes.pd +15 -0
  547. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fm.pd +10 -0
  548. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/glassBare.pd +10 -0
  549. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/harpsichord-poly.pd +10 -0
  550. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/ironBare.pd +10 -0
  551. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/midi-in.pd +111 -0
  552. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/modal.pd +10 -0
  553. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/osc.pd +26 -0
  554. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/piano-poly.pd +10 -0
  555. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/plucked.pd +20 -0
  556. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/saxophone.pd +10 -0
  557. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/tibetan.pd +10 -0
  558. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/trumpet.pd +10 -0
  559. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/violin.pd +10 -0
  560. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/voiceSynth.pd +10 -0
  561. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/woodenBare.pd +10 -0
  562. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/phonemes.h +189 -0
  563. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/piano.dsp +255 -0
  564. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/piano.h +751 -0
  565. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/saxophony.dsp +114 -0
  566. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/sitar.dsp +48 -0
  567. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/tibetanBowl.dsp +155 -0
  568. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/tunedBar.dsp +123 -0
  569. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/uniBar.dsp +100 -0
  570. cyfaust/resources/libraries/examples/physicalModeling/faust-stk/voiceForm.dsp +125 -0
  571. cyfaust/resources/libraries/examples/physicalModeling/fds/1dDampedWaveEquation.dsp +43 -0
  572. cyfaust/resources/libraries/examples/physicalModeling/fds/2dKirchhoffThinPlate.dsp +75 -0
  573. cyfaust/resources/libraries/examples/physicalModeling/fds/BowedString.dsp +61 -0
  574. cyfaust/resources/libraries/examples/physicalModeling/fds/ControllableNonPhysicalString.dsp +72 -0
  575. cyfaust/resources/libraries/examples/physicalModeling/fds/HammeredString.dsp +74 -0
  576. cyfaust/resources/libraries/examples/physicalModeling/fds/PianoHammeredString.dsp +85 -0
  577. cyfaust/resources/libraries/examples/physicalModeling/fds/StiffString.dsp +54 -0
  578. cyfaust/resources/libraries/examples/physicalModeling/flute.dsp +8 -0
  579. cyfaust/resources/libraries/examples/physicalModeling/fluteMIDI.dsp +8 -0
  580. cyfaust/resources/libraries/examples/physicalModeling/frenchBell.dsp +8 -0
  581. cyfaust/resources/libraries/examples/physicalModeling/germanBell.dsp +8 -0
  582. cyfaust/resources/libraries/examples/physicalModeling/guitarMIDI.dsp +8 -0
  583. cyfaust/resources/libraries/examples/physicalModeling/karplus.dsp +8 -0
  584. cyfaust/resources/libraries/examples/physicalModeling/marimbaMIDI.dsp +10 -0
  585. cyfaust/resources/libraries/examples/physicalModeling/mi-faust/00_BasicOscillator/harmonicOscillator.dsp +58 -0
  586. cyfaust/resources/libraries/examples/physicalModeling/mi-faust/00_BasicOscillator/harmonicOscillator2.dsp +62 -0
  587. cyfaust/resources/libraries/examples/physicalModeling/mi-faust/00_BasicOscillator/harmonicOscillator3.dsp +65 -0
  588. cyfaust/resources/libraries/examples/physicalModeling/mi-faust/01_ParamControl/paramOsc.dsp +63 -0
  589. cyfaust/resources/libraries/examples/physicalModeling/mi-faust/02_AudioParamControl/audioParamOsc.dsp +63 -0
  590. cyfaust/resources/libraries/examples/physicalModeling/mi-faust/03_HammerTime/hammerOsc.dsp +71 -0
  591. cyfaust/resources/libraries/examples/physicalModeling/mi-faust/04_Gravity/bouncingOsc.dsp +64 -0
  592. cyfaust/resources/libraries/examples/physicalModeling/mi-faust/05_PluckedOscillator/pluckedOsc.dsp +57 -0
  593. cyfaust/resources/libraries/examples/physicalModeling/mi-faust/06_BowedOscillator/bowedOsc.dsp +65 -0
  594. cyfaust/resources/libraries/examples/physicalModeling/mi-faust/07_NonLinearOscillator/nlOsc.dsp +78 -0
  595. cyfaust/resources/libraries/examples/physicalModeling/mi-faust/08_TwoMassChain/2massChain.dsp +75 -0
  596. cyfaust/resources/libraries/examples/physicalModeling/mi-faust/09_TinyString/tinyString.dsp +101 -0
  597. cyfaust/resources/libraries/examples/physicalModeling/mi-faust/10_PluckedString/pluckedString.dsp +678 -0
  598. cyfaust/resources/libraries/examples/physicalModeling/mi-faust/11_BowedString/bowedString.dsp +671 -0
  599. cyfaust/resources/libraries/examples/physicalModeling/mi-faust/12_TriangleMesh/triangleMesh.dsp +448 -0
  600. cyfaust/resources/libraries/examples/physicalModeling/mi-faust/13_Construction/construction.dsp +1036 -0
  601. cyfaust/resources/libraries/examples/physicalModeling/mi-faust/14_Polyphonic/polyTriangle.dsp +79 -0
  602. cyfaust/resources/libraries/examples/physicalModeling/mi-faust/15_PhysicalLFO/physicalLFO.dsp +107 -0
  603. cyfaust/resources/libraries/examples/physicalModeling/modularInterpInstrMIDI.dsp +8 -0
  604. cyfaust/resources/libraries/examples/physicalModeling/nylonGuitarMIDI.dsp +8 -0
  605. cyfaust/resources/libraries/examples/physicalModeling/old/harpe.dsp +45 -0
  606. cyfaust/resources/libraries/examples/physicalModeling/old/karplus.dsp +34 -0
  607. cyfaust/resources/libraries/examples/physicalModeling/old/karplus32.dsp +47 -0
  608. cyfaust/resources/libraries/examples/physicalModeling/russianBell.dsp +8 -0
  609. cyfaust/resources/libraries/examples/physicalModeling/standardBell.dsp +8 -0
  610. cyfaust/resources/libraries/examples/physicalModeling/violin.dsp +8 -0
  611. cyfaust/resources/libraries/examples/physicalModeling/violinMIDI.dsp +8 -0
  612. cyfaust/resources/libraries/examples/physicalModeling/vocalBP.dsp +8 -0
  613. cyfaust/resources/libraries/examples/physicalModeling/vocalBPMIDI.dsp +8 -0
  614. cyfaust/resources/libraries/examples/physicalModeling/vocalFOF.dsp +8 -0
  615. cyfaust/resources/libraries/examples/physicalModeling/vocalFOFMIDI.dsp +8 -0
  616. cyfaust/resources/libraries/examples/pitchShifting/pitchShifter.dsp +20 -0
  617. cyfaust/resources/libraries/examples/psychoacoustic/harmonicExciter.dsp +10 -0
  618. cyfaust/resources/libraries/examples/quantizing/quantizedChords.dsp +49 -0
  619. cyfaust/resources/libraries/examples/reverb/dattorro.dsp +8 -0
  620. cyfaust/resources/libraries/examples/reverb/fdnRev.dsp +8 -0
  621. cyfaust/resources/libraries/examples/reverb/freeverb.dsp +8 -0
  622. cyfaust/resources/libraries/examples/reverb/greyhole.dsp +8 -0
  623. cyfaust/resources/libraries/examples/reverb/jprev.dsp +8 -0
  624. cyfaust/resources/libraries/examples/reverb/reverbDesigner.dsp +12 -0
  625. cyfaust/resources/libraries/examples/reverb/reverbTester.dsp +8 -0
  626. cyfaust/resources/libraries/examples/reverb/zitaRev.dsp +8 -0
  627. cyfaust/resources/libraries/examples/reverb/zitaRevFDN.dsp +8 -0
  628. cyfaust/resources/libraries/examples/smartKeyboard/acGuitar.dsp +100 -0
  629. cyfaust/resources/libraries/examples/smartKeyboard/associatedEffects/elecGuitarEffect.dsp +8 -0
  630. cyfaust/resources/libraries/examples/smartKeyboard/associatedEffects/myEffect.dsp +5 -0
  631. cyfaust/resources/libraries/examples/smartKeyboard/associatedEffects/reverb.dsp +5 -0
  632. cyfaust/resources/libraries/examples/smartKeyboard/bells.dsp +80 -0
  633. cyfaust/resources/libraries/examples/smartKeyboard/bowed.dsp +87 -0
  634. cyfaust/resources/libraries/examples/smartKeyboard/brass.dsp +82 -0
  635. cyfaust/resources/libraries/examples/smartKeyboard/clarinet.dsp +113 -0
  636. cyfaust/resources/libraries/examples/smartKeyboard/crazyGuiro.dsp +96 -0
  637. cyfaust/resources/libraries/examples/smartKeyboard/drums.dsp +74 -0
  638. cyfaust/resources/libraries/examples/smartKeyboard/dubDub.dsp +87 -0
  639. cyfaust/resources/libraries/examples/smartKeyboard/elecGuitar.dsp +67 -0
  640. cyfaust/resources/libraries/examples/smartKeyboard/fm.dsp +78 -0
  641. cyfaust/resources/libraries/examples/smartKeyboard/frog.dsp +74 -0
  642. cyfaust/resources/libraries/examples/smartKeyboard/harp.dsp +84 -0
  643. cyfaust/resources/libraries/examples/smartKeyboard/midiOnly.dsp +62 -0
  644. cyfaust/resources/libraries/examples/smartKeyboard/multiSynth.dsp +75 -0
  645. cyfaust/resources/libraries/examples/smartKeyboard/toy.dsp +71 -0
  646. cyfaust/resources/libraries/examples/smartKeyboard/trumpet.dsp +59 -0
  647. cyfaust/resources/libraries/examples/smartKeyboard/turenas.dsp +114 -0
  648. cyfaust/resources/libraries/examples/smartKeyboard/violin.dsp +91 -0
  649. cyfaust/resources/libraries/examples/smartKeyboard/violin2.dsp +84 -0
  650. cyfaust/resources/libraries/examples/smartKeyboard/vocal.dsp +43 -0
  651. cyfaust/resources/libraries/examples/spat/panpot.dsp +17 -0
  652. cyfaust/resources/libraries/examples/spat/spat.dsp +25 -0
  653. cyfaust/resources/libraries/fds.lib +535 -0
  654. cyfaust/resources/libraries/filter.lib +1710 -0
  655. cyfaust/resources/libraries/filters.lib +3125 -0
  656. cyfaust/resources/libraries/hoa.lib +1081 -0
  657. cyfaust/resources/libraries/instruments.lib +263 -0
  658. cyfaust/resources/libraries/interpolators.lib +675 -0
  659. cyfaust/resources/libraries/math.lib +602 -0
  660. cyfaust/resources/libraries/maths.lib +798 -0
  661. cyfaust/resources/libraries/maxmsp.lib +237 -0
  662. cyfaust/resources/libraries/mi.lib +528 -0
  663. cyfaust/resources/libraries/misceffects.lib +998 -0
  664. cyfaust/resources/libraries/music.lib +496 -0
  665. cyfaust/resources/libraries/noises.lib +487 -0
  666. cyfaust/resources/libraries/oscillator.lib +450 -0
  667. cyfaust/resources/libraries/oscillators.lib +1838 -0
  668. cyfaust/resources/libraries/phaflangers.lib +235 -0
  669. cyfaust/resources/libraries/physmodels.lib +3990 -0
  670. cyfaust/resources/libraries/platform.lib +59 -0
  671. cyfaust/resources/libraries/quantizers.lib +310 -0
  672. cyfaust/resources/libraries/reducemaps.lib +235 -0
  673. cyfaust/resources/libraries/reverbs.lib +686 -0
  674. cyfaust/resources/libraries/routes.lib +262 -0
  675. cyfaust/resources/libraries/sf.lib +53 -0
  676. cyfaust/resources/libraries/signals.lib +570 -0
  677. cyfaust/resources/libraries/soundfiles.lib +234 -0
  678. cyfaust/resources/libraries/spats.lib +173 -0
  679. cyfaust/resources/libraries/stdfaust.lib +38 -0
  680. cyfaust/resources/libraries/synths.lib +322 -0
  681. cyfaust/resources/libraries/tonestacks.lib +427 -0
  682. cyfaust/resources/libraries/tubes.lib +5039 -0
  683. cyfaust/resources/libraries/vaeffects.lib +984 -0
  684. cyfaust/resources/libraries/version.lib +22 -0
  685. cyfaust/resources/libraries/wdmodels.lib +2276 -0
  686. cyfaust/resources/libraries/webaudio.lib +402 -0
  687. cyfaust/signal.pxd +44 -0
  688. cyfaust/signal.pyx +1993 -0
  689. cyfaust-0.1.0.dist-info/METADATA +355 -0
  690. cyfaust-0.1.0.dist-info/RECORD +693 -0
  691. cyfaust-0.1.0.dist-info/WHEEL +5 -0
  692. cyfaust-0.1.0.dist-info/entry_points.txt +3 -0
  693. cyfaust-0.1.0.dist-info/licenses/LICENSE +26 -0
cyfaust/box.pyx ADDED
@@ -0,0 +1,2459 @@
1
+ # distutils: language = c++
2
+
3
+ from libc.stdlib cimport malloc, free
4
+ from libcpp.string cimport string
5
+
6
+ from . cimport faust_box as fb
7
+ from . cimport faust_signal as fs
8
+
9
+ from .signal cimport SignalVector
10
+ from .signal import SignalVector
11
+
12
+ from .common cimport ParamArray
13
+ from .common import ParamArray
14
+
15
+ ## ---------------------------------------------------------------------------
16
+ ## faust/dsp/libfaust-box
17
+
18
+ def box_or_int(var: Box | int) -> Box:
19
+ if isinstance(var, int):
20
+ return Box.from_int(var)
21
+ if isinstance(var, Box):
22
+ assert is_box_int(var), "box is not an int box"
23
+ return var
24
+ raise TypeError("argument must be an int or a boxInt")
25
+
26
+ def box_or_float(var: Box | float) -> Box:
27
+ if isinstance(var, float):
28
+ return Box.from_real(var)
29
+ elif isinstance(var, Box):
30
+ assert is_box_real(var), "box is not a float box"
31
+ return var
32
+ raise TypeError("argument must be an float or a boxReal")
33
+
34
+ def box_or_number(var: Box | float | int) -> Box:
35
+ if isinstance(var, int):
36
+ return Box.from_int(var)
37
+ if isinstance(var, float):
38
+ return Box.from_real(var)
39
+ elif isinstance(var, Box):
40
+ assert is_box_real(var) or is_box_int(var), "box is not a float or int box"
41
+ return var
42
+ raise TypeError("argument must be of type float or int or boxReal or boxInt")
43
+
44
+
45
+ class box_context:
46
+ """box context manager
47
+
48
+ required for box operations
49
+ """
50
+ def __enter__(self):
51
+ fb.createLibContext()
52
+ def __exit__(self, type, value, traceback):
53
+ fb.destroyLibContext()
54
+
55
+
56
+ cdef class BoxVector:
57
+ """wraps tvec: a std::vector<CTree*>"""
58
+ # cdef vector[fb.Box] ptr
59
+ # cdef bint ptr_owner
60
+
61
+ def __cinit__(self):
62
+ self.ptr_owner = False
63
+
64
+ def __iter__(self):
65
+ for i in self.ptr:
66
+ yield Box.from_ptr(i)
67
+
68
+ @staticmethod
69
+ cdef BoxVector from_ptr(fb.tvec ptr):
70
+ """Wrap a fs.tvec instance."""
71
+ cdef BoxVector bv = BoxVector.__new__(BoxVector)
72
+ bv.ptr = ptr
73
+ return bv
74
+
75
+ cdef add_ptr(self, fb.Box b):
76
+ """add pointer to unwrapped Box"""
77
+ self.ptr.push_back(b)
78
+
79
+ def add(self, Box b):
80
+ """add wrapped Box"""
81
+ self.ptr.push_back(b.ptr)
82
+
83
+ def create_source(self, name_app: str, lang, *args) -> str:
84
+ """Create source code in a target language from a box expression."""
85
+ return create_source_from_boxes(name_app, self, lang, *args)
86
+
87
+
88
+
89
+ cdef class Box:
90
+ """faust Box wrapper.
91
+ """
92
+ # cdef fb.Box ptr
93
+ # cdef public int inputs
94
+ # cdef public int outputs
95
+
96
+ def __cinit__(self):
97
+ self.ptr = NULL
98
+ self.inputs = 0
99
+ self.outputs = 0
100
+
101
+ def __init__(self, value = None):
102
+ if not value:
103
+ self.ptr = fb.boxWire()
104
+ elif isinstance(value, int):
105
+ self.ptr = fb.boxInt(value)
106
+ elif isinstance(value, float):
107
+ self.ptr = fb.boxReal(value)
108
+
109
+ @staticmethod
110
+ cdef Box from_ptr(fb.Box ptr, bint ptr_owner=False):
111
+ """Wrap external factory from pointer"""
112
+ cdef Box box = Box.__new__(Box)
113
+ box.ptr = ptr
114
+ return box
115
+
116
+ @staticmethod
117
+ def from_int(int value) -> Box:
118
+ """Create box from int"""
119
+ return box_int(value)
120
+
121
+ @staticmethod
122
+ def from_float(float value) -> Box:
123
+ """Create box from float"""
124
+ return box_float(value)
125
+
126
+ from_real = from_float
127
+
128
+ @staticmethod
129
+ def from_wire() -> Box:
130
+ """Create box from wire box, copies its input to its output"""
131
+ return box_wire()
132
+
133
+ @staticmethod
134
+ def from_cut() -> Box:
135
+ """Create box from a cut box, to stop/terminate a signal"""
136
+ return box_cut()
137
+
138
+ @staticmethod
139
+ def from_soundfile(str label, chan: Box | int, part: Box | None, ridx: Box | int | None) -> Box:
140
+ """Create a soundfile block.
141
+
142
+ label - of form "label[url:{'path1';'path2';'path3'}]" to describe a list of soundfiles
143
+ chan - the number of outputs channels, a constant numerical expression
144
+ part - in the [0..255] range to select a given sound number, a constant numerical expression
145
+ ridx - the read index (an integer between 0 and the selected sound length)
146
+
147
+ returns the soundfile box.
148
+ """
149
+ return box_soundfile(label, chan, part, ridx)
150
+
151
+ @staticmethod
152
+ def from_readonly_table(n: Box | int, Box init, ridx: Box | int) -> Box:
153
+ """Create a read only table.
154
+
155
+ n - the table size, a constant numerical expression
156
+ init - the table content
157
+ ridx - the read index (an int between 0 and n-1)
158
+
159
+ returns the table box.
160
+ """
161
+ _n = box_or_int(n)
162
+ _ridx = box_or_int(ridx)
163
+ return box_readonly_table(_n, init, _ridx)
164
+
165
+ @staticmethod
166
+ def from_write_read_table(n: Box | int, Box init, widx: Box | int, Box wsig, ridx: Box | int) -> Box:
167
+ """Create a read/write table.
168
+
169
+ n - the table size, a constant numerical expression
170
+ init - the table content
171
+ widx - the write index (an integer between 0 and n-1)
172
+ wsig - the input of the table
173
+ ridx - the read index (an integer between 0 and n-1)
174
+
175
+ returns the table box.
176
+ """
177
+ _n = box_or_int(n)
178
+ _ridx = box_or_int(ridx)
179
+ _widx = box_or_int(widx)
180
+ return box_write_read_table(_n, init, _widx, wsig, _ridx)
181
+
182
+ @staticmethod
183
+ def from_waveform(BoxVector wf) -> Box:
184
+ """Create a waveform.
185
+
186
+ wf - the content of the waveform as a vector of boxInt or boxDouble boxes
187
+
188
+ returns the waveform box.
189
+ """
190
+ return box_waveform(wf)
191
+
192
+ @staticmethod
193
+ def from_fconst(fb.SType type, str name, str file) -> Box:
194
+ """Create a foreign constant box.
195
+
196
+ type - the foreign constant type of SType {kSInt, kSReal}
197
+ name - the foreign constant name
198
+ file - the include file where the foreign constant is defined
199
+
200
+ returns the foreign constant box.
201
+ """
202
+ return box_fconst(type, name, file)
203
+
204
+ @staticmethod
205
+ def from_fvar(fb.SType type, str name, str file) -> Box:
206
+ """Create a foreign variable box.
207
+
208
+ type - the foreign variable type of SType {kSInt, kSReal}
209
+ name - the foreign variable name
210
+ file - the include file where the foreign variable is defined
211
+
212
+ returns the foreign variable box.
213
+ """
214
+ return box_fvar(type, name, file)
215
+
216
+ def is_valid(self) -> bool:
217
+ """Return true if box is defined, false otherwise
218
+
219
+ sets number of inputs and outputs as a side-effect
220
+ """
221
+ return fb.getBoxType(self.ptr, &self.inputs, &self.outputs)
222
+
223
+ def to_string(self, shared: bool = False, max_size: int = 256) -> str:
224
+ """Convert the box to a string via printBox mechanism
225
+
226
+ box - the box to be converted
227
+ shared - whether the identical sub boxes are converted as identifiers
228
+ max_size - the maximum number of characters to be converted (possibly
229
+ needed for big expressions in non shared mode)
230
+
231
+ returns the box as a string
232
+ """
233
+ return to_string(self, shared, max_size).decode()
234
+
235
+ def print(self, shared: bool = False, max_size: int = 256):
236
+ """Print this box."""
237
+ print_box(self, shared, max_size)
238
+
239
+ def create_source(self, str name_app, str lang, *args) -> str:
240
+ """Create source code in a target language from a box expression.
241
+
242
+ name_app - the name of the Faust program
243
+ lang - the target source code's language which can be one of
244
+ 'c', 'cpp', 'cmajor', 'codebox', 'csharp', 'dlang', 'fir',
245
+ 'interp', 'java', 'jax','jsfx', 'julia', 'ocpp', 'rust' or 'wast'
246
+ (depending of which of the corresponding backends are compiled in libfaust)
247
+ args - tuple of parameters if any
248
+
249
+ returns a string of source code on success, printing error_msg if error.
250
+ """
251
+ return create_source_from_boxes(name_app, self, lang, *args)
252
+
253
+ def __add__(self, Box other):
254
+ """Add this box to another."""
255
+ return box_add(self, other)
256
+
257
+ def __radd__(self, Box other):
258
+ """Reverse add this box to another."""
259
+ return box_add(self, other)
260
+
261
+ def __sub__(self, Box other):
262
+ """Subtract this box from another."""
263
+ return box_sub(self, other)
264
+
265
+ def __rsub__(self, Box other):
266
+ """Subtract this box from another."""
267
+ return box_sub(self, other)
268
+
269
+ def __mul__(self, Box other):
270
+ """Multiply this box with another."""
271
+ return box_mul(self, other)
272
+
273
+ def __rmul__(self, Box other):
274
+ """Reverse multiply this box with another."""
275
+ return box_mul(self, other)
276
+
277
+ def __div__(self, Box other):
278
+ """Divide this box with another."""
279
+ return box_div(self, other)
280
+
281
+ def __rdiv__(self, Box other):
282
+ """Reverse divide this box with another."""
283
+ return box_div(self, other)
284
+
285
+ def __eq__(self, Box other):
286
+ """Compare for equality with another box."""
287
+ return box_eq(self, other)
288
+
289
+ def __ne__(self, Box other):
290
+ """Assert this box is not equal with another box."""
291
+ return box_ne(self, other)
292
+
293
+ def __gt__(self, Box other):
294
+ """Is this box greater than another box."""
295
+ return box_gt(self, other)
296
+
297
+ def __ge__(self, Box other):
298
+ """Is this box greater than or equal from another box."""
299
+ return box_ge(self, other)
300
+
301
+ def __lt__(self, Box other):
302
+ """Is this box lesser than another box."""
303
+ return box_lt(self, other)
304
+
305
+ def __le__(self, Box other):
306
+ """Is this box lesser than or equal from another box."""
307
+ return box_le(self, other)
308
+
309
+ def __and__(self, Box other):
310
+ """logical and with another box"""
311
+ return box_and(self, other)
312
+
313
+ def __or__(self, Box other):
314
+ """logical or with another box"""
315
+ return box_or(self, other)
316
+
317
+ def __xor__(self, Box other):
318
+ """logical xor with another box"""
319
+ return box_xor(self, other)
320
+
321
+ def __lshift__(self, Box other):
322
+ """bitwise left-shift"""
323
+ return box_leftshift(self, other)
324
+
325
+ def __rshift__(self, Box other):
326
+ """bitwise right-shift"""
327
+ return box_lrightshift(self, other)
328
+
329
+ def arightshift(self, Box other) -> Box:
330
+ """bitwise arithmetic right shift"""
331
+ return box_arightshift(self, other)
332
+
333
+ def tree2str(self):
334
+ """Convert this box tree (such as the label of a UI) to a string."""
335
+ return fb.tree2str(self.ptr).decode()
336
+
337
+ def tree2int(self):
338
+ """If this box tree has a node of type int, return it, otherwise error."""
339
+ return fb.tree2int(self.ptr).decode()
340
+
341
+ def abs(self) -> Box:
342
+ """returns an absolute value box of this instance."""
343
+ return box_abs(self)
344
+
345
+ def acos(self) -> Box:
346
+ """returns an arccosine box of this instance."""
347
+ return box_acos(self)
348
+
349
+ def tan(self) -> Box:
350
+ """returns a tangent box of this instance."""
351
+ return box_tan(self)
352
+
353
+ def sqrt(self) -> Box:
354
+ """returns a sqrt box of this instance."""
355
+ return box_sqrt(self)
356
+
357
+ def sin(self) -> Box:
358
+ """returns a sin box of this instance."""
359
+ return box_sin(self)
360
+
361
+ def rint(self) -> Box:
362
+ """returns a round to nearest int box of this instance."""
363
+ return box_rint(self)
364
+
365
+ def round(self) -> Box:
366
+ """returns a round box of this instance."""
367
+ return box_round(self)
368
+
369
+ def log(self) -> Box:
370
+ """returns a log box of this instance."""
371
+ return box_log(self)
372
+
373
+ def log10(self) -> Box:
374
+ """returns a log10 box of this instance."""
375
+ return box_log10(self)
376
+
377
+ def floor(self) -> Box:
378
+ """returns a floor box of this instance."""
379
+ return box_floor(self)
380
+
381
+ def exp(self) -> Box:
382
+ """returns an exp box of this instance."""
383
+ return box_exp(self)
384
+
385
+ def exp10(self) -> Box:
386
+ """returns an exp10 box of this instance."""
387
+ return box_exp10(self)
388
+
389
+ def cos(self) -> Box:
390
+ """returns an cosine box of this instance."""
391
+ return box_cos(self)
392
+
393
+ def ceil(self) -> Box:
394
+ """returns an ceiling box of this instance."""
395
+ return box_ceil(self)
396
+
397
+ def atan(self) -> Box:
398
+ """returns an arc tangent box of this instance."""
399
+ return box_atan(self)
400
+
401
+ def asin(self) -> Box:
402
+ """returns an arc sine box of this instance."""
403
+ return box_asin(self)
404
+
405
+ # boolean methods ----------------
406
+
407
+ def is_nil(self) -> bool:
408
+ """Test if a box is nil."""
409
+ return box_is_nil(self)
410
+
411
+ def is_abstr(self) -> bool:
412
+ """Test if a box is an abstraction.
413
+
414
+ see: https://faustdoc.grame.fr/manual/syntax
415
+ """
416
+ return is_box_abstr(self)
417
+
418
+ def is_appl(self) -> bool:
419
+ """Test if a box is an application."""
420
+ return is_box_appl(self)
421
+
422
+ def is_button(self) -> bool:
423
+ """Test if a box is a button."""
424
+ return is_box_button(self)
425
+
426
+ def is_case(self) -> bool:
427
+ return is_box_case(self)
428
+
429
+ def is_checkbox(self) -> bool:
430
+ """Test if a box is an checkbox."""
431
+ return is_box_checkbox(self)
432
+
433
+ def is_cut(self) -> bool:
434
+ """Test if a box is a cut."""
435
+ return is_box_cut(self)
436
+
437
+ def is_environment(self) -> bool:
438
+ """Test if a box is an environmnent."""
439
+ return is_box_environment(self)
440
+
441
+ def is_error(self) -> bool:
442
+ """Test if a box is an error."""
443
+ return is_box_error(self)
444
+
445
+ def is_fconst(self) -> bool:
446
+ """Test if a box is an fconst."""
447
+ return is_box_fconst(self)
448
+
449
+ def is_ffun(self) -> bool:
450
+ """Test if a box is an ffun."""
451
+ return is_box_ffun(self)
452
+
453
+ def is_fvar(self) -> bool:
454
+ """Test if a box is an fvar."""
455
+ return is_box_fvar(self)
456
+
457
+ def is_hbargraph(self) -> bool:
458
+ """Test if a box is an hbargraph."""
459
+ return is_box_hbargraph(self)
460
+
461
+ def is_hgroup(self) -> bool:
462
+ """Test if a box is an hgroup."""
463
+ return is_box_hgroup(self)
464
+
465
+ def is_hslider(self) -> bool:
466
+ """Test if a box is an hslider."""
467
+ return is_box_hslider(self)
468
+
469
+ def is_ident(self) -> bool:
470
+ """Test if a box is an indentifier."""
471
+ return is_box_ident(self)
472
+
473
+ def is_int(self) -> bool:
474
+ """Test if a box is an int."""
475
+ return is_box_int(self)
476
+
477
+ def is_numentry(self) -> bool:
478
+ """Test if a box is an numentry."""
479
+ return is_box_numentry(self)
480
+
481
+ def is_prim0(self) -> bool:
482
+ """Test if a box is a nullary function."""
483
+ return is_box_prim0(self)
484
+
485
+ def is_prim1(self) -> bool:
486
+ """Test if a box is a unitary function."""
487
+ return is_box_prim1(self)
488
+
489
+ def is_prim2(self) -> bool:
490
+ """Test if a box is a binary function."""
491
+ return is_box_prim2(self)
492
+
493
+ def is_prim3(self) -> bool:
494
+ """Test if a box is a ternary function."""
495
+ return is_box_prim3(self)
496
+
497
+ def is_prim4(self) -> bool:
498
+ """Test if a box is a 4 param function."""
499
+ return is_box_prim4(self)
500
+
501
+ def is_prim5(self) -> bool:
502
+ """Test if a box is a 5 param function."""
503
+ return is_box_prim5(self)
504
+
505
+ def is_real(self) -> bool:
506
+ """Test if a box is a real or floot box."""
507
+ return is_box_real(self)
508
+
509
+ def is_slot(self) -> bool:
510
+ """Test if a box is a slot."""
511
+ return is_box_slot(self)
512
+
513
+ def is_soundfile(self) -> bool:
514
+ """Test if a box is a soundfile."""
515
+ return is_box_soundfile(self)
516
+
517
+ def is_symbolic(self) -> bool:
518
+ """Test if a box is symbolic."""
519
+ return is_box_symbolic(self)
520
+
521
+ def is_tgroup(self) -> bool:
522
+ """Test if a box is a tab group."""
523
+ return is_box_tgroup(self)
524
+
525
+ def is_vgroup(self) -> bool:
526
+ """Test if a box is a vertical group."""
527
+ return is_box_vgroup(self)
528
+
529
+ def is_vslider(self) -> bool:
530
+ """Test if a box is a vertical slider."""
531
+ return is_box_vslider(self)
532
+
533
+ def is_hslider(self) -> bool:
534
+ """Test if a box is a horizontal slider."""
535
+ return is_box_hslider(self)
536
+
537
+ def is_waveform(self) -> bool:
538
+ """Test if a box is a waveform."""
539
+ return is_box_waveform(self)
540
+
541
+ def is_wire(self) -> bool:
542
+ """Test if a box is a wire (pass-through) box."""
543
+ return is_box_wire(self)
544
+
545
+
546
+ def int_cast(self) -> Box:
547
+ """return an int casted box."""
548
+ return box_int_cast(self)
549
+
550
+
551
+ def float_cast(self) -> Box:
552
+ """return a float/double casted box.""
553
+
554
+ s - the signal to be casted as float/double value
555
+ (depends of -single or -double compilation parameter)
556
+
557
+ returns the casted box.
558
+ """
559
+ return box_float_cast(self)
560
+
561
+
562
+ def seq(self, Box y) -> Box:
563
+ """The sequential composition of two blocks (e.g., A:B)
564
+
565
+ expects: outputs(A)=inputs(B)
566
+
567
+ returns the seq box.
568
+ """
569
+ return box_seq(self, y)
570
+
571
+ def par(self, Box y) -> Box:
572
+ """The parallel composition of two blocks (e.g., A,B).
573
+
574
+ Creates a two block-diagram with one block on top of the other,
575
+ without connections.
576
+
577
+ returns the par box.
578
+ """
579
+ return box_par(self, y)
580
+
581
+
582
+ def par3(self, Box y, Box z) -> Box:
583
+ """The parallel composition of three blocks (e.g., A,B,C).
584
+
585
+ Creates a three block-diagram with one block on top of the other,
586
+ without connections.
587
+
588
+ returns the par box.
589
+ """
590
+ return box_par3(self, y, z)
591
+
592
+
593
+ def par4(self, Box b, Box c, Box d) -> Box:
594
+ """The parallel composition of four blocks (e.g., A,B,C,D).
595
+
596
+ Creates a four block-diagram with one block on top of the other,
597
+ without connections.
598
+
599
+ returns the par box.
600
+ """
601
+ return box_par4(self, b, c, d)
602
+
603
+
604
+ def par5(self, Box b, Box c, Box d, Box e) -> Box:
605
+ """The parallel composition of five blocks (e.g., A,B,C,D,E).
606
+
607
+ Creates a five block-diagram with one block on top of the other,
608
+ without connections.
609
+
610
+ returns the par box.
611
+ """
612
+ return box_par4(self, b, c, d, e)
613
+
614
+
615
+ def split(self, Box y) -> Box:
616
+ """The split composition (e.g., A<:B) operator is used to distribute
617
+ the outputs of A to the inputs of B.
618
+
619
+ For the operation to be valid, the number of inputs of B
620
+ must be a multiple of the number of outputs of A: outputs(A).k=inputs(B)
621
+
622
+ returns the split box.
623
+ """
624
+ return box_split(self, y)
625
+
626
+
627
+ def merge(self, Box y) -> Box:
628
+ """The merge composition (e.g., A:>B) is the dual of the split composition.
629
+
630
+ The number of outputs of A must be a multiple of the number of inputs of B:
631
+ outputs(A)=k.inputs(B)
632
+
633
+ returns the merge box.
634
+ """
635
+ return box_merge(self, y)
636
+
637
+
638
+ def rec(self, Box y) -> Box:
639
+ """The recursive composition (e.g., A~B) is used to create cycles in the
640
+ block-diagram in order to express recursive computations.
641
+
642
+ It is the most complex operation in terms of connections:
643
+ outputs(A)≥inputs(B) and inputs(A)≥outputs(B)
644
+
645
+ returns the rec box.
646
+ """
647
+ return box_rec(self, y)
648
+
649
+
650
+ def get_def_name_property(self) -> Box | None:
651
+ """Returns the identifier (if any) the expression was a definition of.
652
+
653
+ b the expression
654
+ id reference to the identifier
655
+
656
+ returns the identifier if the expression b was a definition of id
657
+ else returns None
658
+ """
659
+ cdef fb.Box id = NULL
660
+ if fb.getDefNameProperty(self.ptr, id):
661
+ return Box.from_ptr(id)
662
+
663
+ def extract_name(self) -> str:
664
+ """Extract the name from a label.
665
+
666
+ full_label the label to be analyzed
667
+
668
+ returns the extracted name
669
+ """
670
+ return extract_name(self)
671
+
672
+ def delay(self, d: int | Box) -> Box:
673
+ """Create a delayed box.
674
+
675
+ s - the box to be delayed
676
+ d - the delay box that doesn't have to be fixed but must be bounded
677
+ and cannot be negative
678
+
679
+ returns the delayed box.
680
+ """
681
+ if isinstance(d, int):
682
+ return box_delay(self, Box.from_int(d))
683
+ else:
684
+ return box_delay(self, d.ptr)
685
+
686
+ def select2(self, Box b1, Box b2) -> Box:
687
+ """return a selector between two boxes.
688
+
689
+ selector - when 0 at time t returns s1[t], otherwise returns s2[t]
690
+ s1 - first box to be selected
691
+ s2 - second box to be selected
692
+
693
+ returns the selected box depending of the selector value at each time t.
694
+ """
695
+ return box_select2(self, b1, b2)
696
+
697
+
698
+ def select3(self, Box b1, Box b2, Box b3) -> Box:
699
+ """return a selector between three boxes.
700
+
701
+ selector - when 0 at time t returns s1[t], when 1 at time t returns s2[t],
702
+ otherwise returns s3[t]
703
+ s1 - first box to be selected
704
+ s2 - second box to be selected
705
+ s3 - third box to be selected
706
+
707
+ returns the selected box depending of the selector value at each time t.
708
+ """
709
+ return box_select3(self, b1, b2, b3)
710
+
711
+
712
+ def to_string(Box box, bint shared, int max_size) -> str:
713
+ """Convert the box to a string
714
+
715
+ box - the box to be converted
716
+ shared - whether the identical sub boxes are converted as identifiers
717
+ max_size - the maximum number of characters to be converted (possibly
718
+ needed for big expressions in non shared mode)
719
+
720
+ returns the box as a string
721
+ """
722
+ return fb.printBox(box.ptr, shared, max_size).decode()
723
+
724
+
725
+ def print_box(Box box, bint shared, int max_size) -> str:
726
+ """Print the box.
727
+
728
+ box - the box to be printed
729
+ shared - whether the identical sub boxes are printed as identifiers
730
+ max_size - the maximum number of characters to be printed (possibly
731
+ needed for big expressions in non shared mode)
732
+
733
+ returns the printed box as a string
734
+ """
735
+ return print(fb.printBox(box.ptr, shared, max_size).decode())
736
+
737
+
738
+ def get_def_name_property(Box b) -> Box | None:
739
+ """Returns the identifier (if any) the expression was a definition of.
740
+
741
+ b the expression
742
+ id reference to the identifier
743
+
744
+ returns the identifier if the expression b was a definition of id
745
+ else returns None
746
+ """
747
+ cdef fb.Box id = NULL
748
+ if fb.getDefNameProperty(b.ptr, id):
749
+ return Box.from_ptr(id)
750
+
751
+ def extract_name(Box full_label) -> str:
752
+ """Extract the name from a label.
753
+
754
+ full_label the label to be analyzed
755
+
756
+ returns the extracted name
757
+ """
758
+ return fb.extractName(full_label.ptr).decode()
759
+
760
+ def create_lib_context():
761
+ """Create global compilation context, has to be done first."""
762
+ fb.createLibContext()
763
+
764
+ def destroy_lib_context():
765
+ """Destroy global compilation context, has to be done last."""
766
+ fb.destroyLibContext()
767
+
768
+
769
+ # cdef void* get_user_data(Box b):
770
+ # """Return the xtended type of a box.
771
+
772
+ # b - the box whose xtended type to return
773
+
774
+ # returns a pointer to xtended type if it exists, otherwise nullptr.
775
+ # """
776
+ # return fb.getUserData(b.ptr)
777
+
778
+
779
+ def box_is_nil(Box b) -> bool:
780
+ """Check if a box is nil.
781
+
782
+ b - the box
783
+
784
+ returns true if the box is nil, otherwise false.
785
+ """
786
+ return fb.isNil(b.ptr)
787
+
788
+
789
+ def tree2str(Box b) -> str:
790
+ """Convert a box (such as the label of a UI) to a string.
791
+
792
+ b - the box to convert
793
+
794
+ returns a string representation of a box.
795
+ """
796
+ return fb.tree2str(b.ptr).decode()
797
+
798
+
799
+ def tree2int(Box b) -> int:
800
+ """If t has a node of type int, return it. Otherwise error
801
+
802
+ b - the box to convert
803
+
804
+ returns the int value of the box.
805
+ """
806
+ return fb.tree2int(b.ptr)
807
+
808
+
809
+
810
+ def box_int(int n) -> Box:
811
+ """Constant integer : for all t, x(t) = n.
812
+
813
+ n - the integer
814
+
815
+ returns the integer box.
816
+ """
817
+ cdef fb.Box b = fb.boxInt(n)
818
+ return Box.from_ptr(b)
819
+
820
+
821
+ def box_float(float n) -> Box:
822
+ """Constant real : for all t, x(t) = n.
823
+
824
+ n - the float/double value (depends of -single or -double compilation parameter)
825
+
826
+ returns the float/double box.
827
+ """
828
+ cdef fb.Box b = fb.boxReal(n)
829
+ return Box.from_ptr(b)
830
+
831
+ box_real = box_float
832
+
833
+
834
+ def box_wire() -> Box:
835
+ """The identity box, copy its input to its output.
836
+
837
+ returns the identity box.
838
+ """
839
+ cdef fb.Box b = fb.boxWire()
840
+ return Box.from_ptr(b)
841
+
842
+
843
+ def box_cut() -> Box:
844
+ """The cut box, to stop/terminate a signal.
845
+
846
+ returns the cut box.
847
+ """
848
+ cdef fb.Box b = fb.boxCut()
849
+ return Box.from_ptr(b)
850
+
851
+
852
+ def box_seq(Box x, Box y) -> Box:
853
+ """The sequential composition of two blocks (e.g., A:B)
854
+ expects: outputs(A)=inputs(B)
855
+
856
+ returns the seq box.
857
+ """
858
+ cdef fb.Box b = fb.boxSeq(x.ptr, y.ptr)
859
+ return Box.from_ptr(b)
860
+
861
+
862
+ def box_par(Box x, Box y) -> Box:
863
+ """The parallel composition of two blocks (e.g., A,B).
864
+
865
+ It places the two block-diagrams one on top of the other,
866
+ without connections.
867
+
868
+ returns the par box.
869
+ """
870
+ cdef fb.Box b = fb.boxPar(x.ptr, y.ptr)
871
+ return Box.from_ptr(b)
872
+
873
+
874
+ def box_par3(Box x, Box y, Box z) -> Box:
875
+ """The parallel composition of three blocks (e.g., A,B,C).
876
+
877
+ It places the three block-diagrams one on top of the other,
878
+ without connections.
879
+
880
+ returns the par box.
881
+ """
882
+ cdef fb.Box b = fb.boxPar3(x.ptr, y.ptr, z.ptr)
883
+ return Box.from_ptr(b)
884
+
885
+
886
+ def box_par4(Box a, Box b, Box c, Box d) -> Box:
887
+ """The parallel composition of four blocks (e.g., A,B,C,D).
888
+
889
+ It places the four block-diagrams one on top of the other,
890
+ without connections.
891
+
892
+ returns the par box.
893
+ """
894
+ cdef fb.Box p = fb.boxPar4(a.ptr, b.ptr, c.ptr, d.ptr)
895
+ return Box.from_ptr(p)
896
+
897
+
898
+ def box_par5(Box a, Box b, Box c, Box d, Box e) -> Box:
899
+ """The parallel composition of five blocks (e.g., A,B,C,D,E).
900
+
901
+ It places the five block-diagrams one on top of the other,
902
+ without connections.
903
+
904
+ returns the par box.
905
+ """
906
+ cdef fb.Box p = fb.boxPar5(a.ptr, b.ptr, c.ptr, d.ptr, e.ptr)
907
+ return Box.from_ptr(p)
908
+
909
+ def box_split(Box x, Box y) -> Box:
910
+ """The split composition (e.g., A<:B) operator is used to distribute
911
+ the outputs of A to the inputs of B.
912
+
913
+ For the operation to be valid, the number of inputs of B
914
+ must be a multiple of the number of outputs of A:
915
+ outputs(A).k=inputs(B)
916
+
917
+ returns the split box.
918
+ """
919
+ cdef fb.Box b = fb.boxSplit(x.ptr, y.ptr)
920
+ return Box.from_ptr(b)
921
+
922
+
923
+ def box_merge(Box x, Box y) -> Box:
924
+ """The merge composition (e.g., A:>B) is the dual of the split composition.
925
+
926
+ The number of outputs of A must be a multiple of the number of inputs of B:
927
+ outputs(A)=k.inputs(B)
928
+
929
+ returns the merge box.
930
+ """
931
+ cdef fb.Box b = fb.boxMerge(x.ptr, y.ptr)
932
+ return Box.from_ptr(b)
933
+
934
+
935
+ def box_rec(Box x, Box y) -> Box:
936
+ """The recursive composition (e.g., A~B) is used to create cycles
937
+ in the block-diagram in order to express recursive computations.
938
+
939
+ It is the most complex operation in terms of connections:
940
+ outputs(A)≥inputs(B) and inputs(A)≥outputs(B)
941
+
942
+ returns the rec box.
943
+ """
944
+ cdef fb.Box b = fb.boxRec(x.ptr, y.ptr)
945
+ return Box.from_ptr(b)
946
+
947
+ def box_route(Box n, Box m, Box r) -> Box:
948
+ """The route primitive facilitates the routing of signals in Faust.
949
+
950
+ It has the following syntax:
951
+ route(A,B,a,b,c,d,...) or route(A,B,(a,b),(c,d),...)
952
+
953
+ n - the number of input signals
954
+ m - the number of output signals
955
+ r - the routing description, a 'par' expression of
956
+ a,b / (a,b) input/output pairs
957
+
958
+ returns the route box.
959
+ """
960
+ cdef fb.Box b = fb.boxRoute(n.ptr, m.ptr, r.ptr)
961
+ return Box.from_ptr(b)
962
+
963
+
964
+ def box_delay_op() -> Box:
965
+ """Create a delayed box.
966
+
967
+ returns the delayed box.
968
+ """
969
+ cdef fb.Box b = fb.boxDelay()
970
+ return Box.from_ptr(b)
971
+
972
+
973
+ def box_delay(Box b, Box d) -> Box:
974
+ """Create a delayed box.
975
+
976
+ s - the box to be delayed
977
+ d - the delay box that doesn't have to be fixed but must be bounded
978
+ and cannot be negative
979
+
980
+ returns the delayed box.
981
+ """
982
+ cdef fb.Box _b = fb.boxDelay(b.ptr, d.ptr)
983
+ return Box.from_ptr(_b)
984
+
985
+
986
+ def box_int_cast_op() -> Box:
987
+ """Create a casted box.
988
+
989
+ returns the casted box.
990
+ """
991
+ cdef fb.Box _b = fb.boxIntCast()
992
+ return Box.from_ptr(_b)
993
+
994
+
995
+ def box_int_cast(Box b) -> Box:
996
+ """Create a casted box.
997
+
998
+ s - the box to be casted in integer
999
+
1000
+ returns the casted box.
1001
+ """
1002
+ cdef fb.Box _b = fb.boxIntCast(b.ptr)
1003
+ return Box.from_ptr(_b)
1004
+
1005
+
1006
+ def box_float_cast_op() -> Box:
1007
+ """Create a casted box."""
1008
+ cdef fb.Box _b = fb.boxFloatCast()
1009
+ return Box.from_ptr(_b)
1010
+
1011
+
1012
+ def box_float_cast(Box b) -> Box:
1013
+ """Create a casted box.
1014
+
1015
+ s - the signal to be casted as float/double value (depends of
1016
+ -single or -double compilation parameter)
1017
+
1018
+ returns the casted box.
1019
+ """
1020
+ cdef fb.Box _b = fb.boxFloatCast(b.ptr)
1021
+ return Box.from_ptr(_b)
1022
+
1023
+
1024
+ def box_readonly_table_op() -> Box:
1025
+ """Create a read only table.
1026
+
1027
+ returns the table box.
1028
+ """
1029
+ cdef fb.Box b = fb.boxReadOnlyTable()
1030
+ return Box.from_ptr(b)
1031
+
1032
+
1033
+ def box_readonly_table(Box n, Box init, Box ridx) -> Box:
1034
+ """Create a read only table.
1035
+
1036
+ n - the table size, a constant numerical expression
1037
+ init - the table content
1038
+ ridx - the read index (an int between 0 and n-1)
1039
+
1040
+ returns the table box.
1041
+ """
1042
+ cdef fb.Box b = fb.boxReadOnlyTable(n.ptr, init.ptr, ridx.ptr)
1043
+ return Box.from_ptr(b)
1044
+
1045
+ def box_write_read_table_op() -> Box:
1046
+ """Create a read/write table.
1047
+
1048
+ returns the table box.
1049
+ """
1050
+ cdef fb.Box b = fb.boxWriteReadTable()
1051
+ return Box.from_ptr(b)
1052
+
1053
+ def box_write_read_table(Box n, Box init, Box widx, Box wsig, Box ridx) -> Box:
1054
+ """Create a read/write table.
1055
+
1056
+ n - the table size, a constant numerical expression
1057
+ init - the table content
1058
+ widx - the write index (an integer between 0 and n-1)
1059
+ wsig - the input of the table
1060
+ ridx - the read index (an integer between 0 and n-1)
1061
+
1062
+ returns the table box.
1063
+ """
1064
+ cdef fb.Box b = fb.boxWriteReadTable(n.ptr, init.ptr, widx.ptr, wsig.ptr, ridx.ptr)
1065
+ return Box.from_ptr(b)
1066
+
1067
+
1068
+ def box_waveform(BoxVector wf):
1069
+ """Create a waveform.
1070
+
1071
+ wf - the content of the waveform as a vector of boxInt or boxDouble boxes
1072
+
1073
+ returns the waveform box.
1074
+ """
1075
+ cdef fb.Box b = fb.boxWaveform(<const fs.tvec>wf.ptr)
1076
+ return Box.from_ptr(b)
1077
+
1078
+
1079
+ def box_soundfile(str label, chan: Box | int, part: Box | None, ridx: Box | int | None) -> Box:
1080
+ """Create a soundfile block.
1081
+
1082
+ label - of form "label[url:{'path1';'path2';'path3'}]" to describe a list of soundfiles
1083
+ chan - the number of outputs channels, a constant numerical expression
1084
+
1085
+ (box_soundfile2 parameters)
1086
+ part - in the [0..255] range to select a given sound number, a constant numerical expression
1087
+ ridx - the read index (an integer between 0 and the selected sound length)
1088
+
1089
+ returns the soundfile box.
1090
+ """
1091
+ _chan = box_or_int(chan)
1092
+ if part and ridx:
1093
+ _ridx = box_or_int(ridx)
1094
+ return __box_soundfile2(label, _chan, part, _ridx)
1095
+ else:
1096
+ return __box_soundfile1(label, _chan)
1097
+
1098
+
1099
+ cdef Box __box_soundfile1(str label, Box chan):
1100
+ """Create a soundfile block.
1101
+
1102
+ label - of form "label[url:{'path1';'path2';'path3'}]" to describe a list of soundfiles
1103
+ chan - the number of outputs channels, a constant numerical expression
1104
+
1105
+ returns the soundfile box.
1106
+ """
1107
+ cdef fb.Box b = fb.boxSoundfile(label.encode('utf8'), chan.ptr)
1108
+ return Box.from_ptr(b)
1109
+
1110
+
1111
+ cdef Box __box_soundfile2(str label, Box chan, Box part, Box ridx):
1112
+ """Create a soundfile block.
1113
+
1114
+ label - of form "label[url:{'path1';'path2';'path3'}]" to describe a list of soundfiles
1115
+ chan - the number of outputs channels, a constant numerical expression
1116
+ part - in the [0..255] range to select a given sound number, a constant numerical expression
1117
+ ridx - the read index (an integer between 0 and the selected sound length)
1118
+
1119
+ returns the soundfile box.
1120
+ """
1121
+ cdef fb.Box b = fb.boxSoundfile(label.encode('utf8'), chan.ptr, part.ptr, ridx.ptr)
1122
+ return Box.from_ptr(b)
1123
+
1124
+
1125
+ def box_select2(Box selector, Box b1, Box b2) -> Box:
1126
+ """Create a selector between two boxes.
1127
+
1128
+ selector - when 0 at time t returns s1[t], otherwise returns s2[t]
1129
+ s1 - first box to be selected
1130
+ s2 - second box to be selected
1131
+
1132
+ returns the selected box depending of the selector value at each time t.
1133
+ """
1134
+ cdef fb.Box b = fb.boxSelect2(selector.ptr, b1.ptr, b2.ptr)
1135
+ return Box.from_ptr(b)
1136
+
1137
+
1138
+ def box_select2_op() -> Box:
1139
+ """Create a selector between two boxes.
1140
+
1141
+ returns the selected box depending of the selector value at each time t.
1142
+ """
1143
+ cdef fb.Box b = fb.boxSelect2()
1144
+ return Box.from_ptr(b)
1145
+
1146
+
1147
+ def box_select3(Box selector, Box b1, Box b2, Box b3) -> Box:
1148
+ """Create a selector between three boxes.
1149
+
1150
+ selector - when 0 at time t returns s1[t], when 1 at time t returns s2[t],
1151
+ otherwise returns s3[t]
1152
+ s1 - first box to be selected
1153
+ s2 - second box to be selected
1154
+ s3 - third box to be selected
1155
+
1156
+ returns the selected box depending of the selector value at each time t.
1157
+ """
1158
+ cdef fb.Box b = fb.boxSelect3(selector.ptr, b1.ptr, b2.ptr, b3.ptr)
1159
+ return Box.from_ptr(b)
1160
+
1161
+ def box_fconst(fb.SType type, str name, str file) -> Box:
1162
+ """Create a foreign constant box.
1163
+
1164
+ type - the foreign constant type of SType
1165
+ name - the foreign constant name
1166
+ file - the include file where the foreign constant is defined
1167
+
1168
+ returns the foreign constant box.
1169
+ """
1170
+ cdef fb.Box b = fb.boxFConst(type, name.encode('utf8'), file.encode('utf8'))
1171
+ return Box.from_ptr(b)
1172
+
1173
+ def box_fvar(fb.SType type, str name, str file) -> Box:
1174
+ """Create a foreign variable box.
1175
+
1176
+ type - the foreign variable type of SType
1177
+ name - the foreign variable name
1178
+ file - the include file where the foreign variable is defined
1179
+
1180
+ returns the foreign variable box.
1181
+ """
1182
+ cdef fb.Box b = fb.boxFVar(type, name.encode('utf8'), file.encode('utf8'))
1183
+ return Box.from_ptr(b)
1184
+
1185
+ def box_bin_op0(fb.SOperator op) -> Box:
1186
+ """Generic binary mathematical functions.
1187
+
1188
+ op - the operator in SOperator set
1189
+
1190
+ returns the result box of op(x,y).
1191
+ """
1192
+ cdef fb.Box b = fb.boxBinOp(op)
1193
+ return Box.from_ptr(b)
1194
+
1195
+ def box_bin_op(fb.SOperator op, Box b1, Box b2) -> Box:
1196
+ """Generic binary mathematical functions.
1197
+
1198
+ op - the operator in SOperator set
1199
+
1200
+ returns the result box of op(x,y).
1201
+ """
1202
+ cdef fb.Box b = fb.boxBinOp(op, b1.ptr, b2.ptr)
1203
+ return Box.from_ptr(b)
1204
+
1205
+
1206
+ def box_add_op() -> Box:
1207
+ """nullary box add operation."""
1208
+ cdef fb.Box b = fb.boxAdd()
1209
+ return Box.from_ptr(b)
1210
+
1211
+ def box_add(Box b1, Box b2) -> Box:
1212
+ """binary box add operation."""
1213
+ cdef fb.Box b = fb.boxAdd(b1.ptr, b2.ptr)
1214
+ return Box.from_ptr(b)
1215
+
1216
+ def box_sub_op() -> Box:
1217
+ """nullary box substract operation."""
1218
+ cdef fb.Box b = fb.boxSub()
1219
+ return Box.from_ptr(b)
1220
+
1221
+ def box_sub(Box b1, Box b2) -> Box:
1222
+ """binary box substract operation."""
1223
+ cdef fb.Box b = fb.boxSub(b1.ptr, b2.ptr)
1224
+ return Box.from_ptr(b)
1225
+
1226
+ def box_mul_op() -> Box:
1227
+ """nullary box multipy operation."""
1228
+ cdef fb.Box b = fb.boxMul()
1229
+ return Box.from_ptr(b)
1230
+
1231
+ def box_mul(Box b1, Box b2) -> Box:
1232
+ """binary box multiply operation."""
1233
+ cdef fb.Box b = fb.boxMul(b1.ptr, b2.ptr)
1234
+ return Box.from_ptr(b)
1235
+
1236
+ def box_div_op() -> Box:
1237
+ """nullary box divide operation."""
1238
+ cdef fb.Box b = fb.boxDiv()
1239
+ return Box.from_ptr(b)
1240
+
1241
+ def box_div(Box b1, Box b2) -> Box:
1242
+ """binary box divide operation."""
1243
+ cdef fb.Box b = fb.boxDiv(b1.ptr, b2.ptr)
1244
+ return Box.from_ptr(b)
1245
+
1246
+ def box_rem_op() -> Box:
1247
+ """nullary box modulo operation."""
1248
+ cdef fb.Box b = fb.boxRem()
1249
+ return Box.from_ptr(b)
1250
+
1251
+ def box_rem(Box b1, Box b2) -> Box:
1252
+ """binary box modulo operation."""
1253
+ cdef fb.Box b = fb.boxRem(b1.ptr, b2.ptr)
1254
+ return Box.from_ptr(b)
1255
+
1256
+ def box_leftshift_op() -> Box:
1257
+ """nullary box left bitshift operation."""
1258
+ cdef fb.Box b = fb.boxLeftShift()
1259
+ return Box.from_ptr(b)
1260
+
1261
+ def box_leftshift(Box b1, Box b2) -> Box:
1262
+ """binary box left bit shift operation."""
1263
+ cdef fb.Box b = fb.boxLeftShift(b1.ptr, b2.ptr)
1264
+ return Box.from_ptr(b)
1265
+
1266
+ def box_lrightshift_op() -> Box:
1267
+ """nullary box logical right bit shift operation."""
1268
+ cdef fb.Box b = fb.boxLRightShift()
1269
+ return Box.from_ptr(b)
1270
+
1271
+ def box_lrightshift(Box b1, Box b2) -> Box:
1272
+ """binary box logical right bit shift operation."""
1273
+ cdef fb.Box b = fb.boxLRightShift(b1.ptr, b2.ptr)
1274
+ return Box.from_ptr(b)
1275
+
1276
+ def box_arightshift_op() -> Box:
1277
+ """bitwise arithmetic right bit shift op"""
1278
+ cdef fb.Box b = fb.boxARightShift()
1279
+ return Box.from_ptr(b)
1280
+
1281
+ def box_arightshift(Box b1, Box b2) -> Box:
1282
+ """bitwise arithmetic right shift"""
1283
+ cdef fb.Box b = fb.boxARightShift(b1.ptr, b2.ptr)
1284
+ return Box.from_ptr(b)
1285
+
1286
+ def box_gt_op() -> Box:
1287
+ """nullary greater than operation."""
1288
+ cdef fb.Box b = fb.boxGT()
1289
+ return Box.from_ptr(b)
1290
+
1291
+ def box_gt(Box b1, Box b2) -> Box:
1292
+ """binary box greater than operation."""
1293
+ cdef fb.Box b = fb.boxGT(b1.ptr, b2.ptr)
1294
+ return Box.from_ptr(b)
1295
+
1296
+ def box_lt_op() -> Box:
1297
+ """nullary less than operation."""
1298
+ cdef fb.Box b = fb.boxLT()
1299
+ return Box.from_ptr(b)
1300
+
1301
+ def box_lt(Box b1, Box b2) -> Box:
1302
+ """binary box lesser than operation."""
1303
+ cdef fb.Box b = fb.boxLT(b1.ptr, b2.ptr)
1304
+ return Box.from_ptr(b)
1305
+
1306
+ def box_ge_op() -> Box:
1307
+ """nullary greater than or equal operation."""
1308
+ cdef fb.Box b = fb.boxGE()
1309
+ return Box.from_ptr(b)
1310
+
1311
+ def box_ge(Box b1, Box b2) -> Box:
1312
+ """binary box greater than or equal operation."""
1313
+ cdef fb.Box b = fb.boxGE(b1.ptr, b2.ptr)
1314
+ return Box.from_ptr(b)
1315
+
1316
+ def box_le_op() -> Box:
1317
+ """nullary less than than equal operation."""
1318
+ cdef fb.Box b = fb.boxLE()
1319
+ return Box.from_ptr(b)
1320
+
1321
+ def box_le(Box b1, Box b2) -> Box:
1322
+ """binary box lesser than or equaloperation."""
1323
+ cdef fb.Box b = fb.boxLE(b1.ptr, b2.ptr)
1324
+ return Box.from_ptr(b)
1325
+
1326
+ def box_eq_op() -> Box:
1327
+ """nullary equal operation."""
1328
+ cdef fb.Box b = fb.boxEQ()
1329
+ return Box.from_ptr(b)
1330
+
1331
+ def box_eq(Box b1, Box b2) -> Box:
1332
+ """binary box equals operation."""
1333
+ cdef fb.Box b = fb.boxEQ(b1.ptr, b2.ptr)
1334
+ return Box.from_ptr(b)
1335
+
1336
+ def box_ne_op() -> Box:
1337
+ """nullary not equal than operation."""
1338
+ cdef fb.Box b = fb.boxNE()
1339
+ return Box.from_ptr(b)
1340
+
1341
+ def box_ne(Box b1, Box b2) -> Box:
1342
+ """binary box not equals than operation."""
1343
+ cdef fb.Box b = fb.boxNE(b1.ptr, b2.ptr)
1344
+ return Box.from_ptr(b)
1345
+
1346
+ def box_and_op() -> Box:
1347
+ """nullary AND operation."""
1348
+ cdef fb.Box b = fb.boxAND()
1349
+ return Box.from_ptr(b)
1350
+
1351
+ def box_and(Box b1, Box b2) -> Box:
1352
+ """binary box AND operation."""
1353
+ cdef fb.Box b = fb.boxAND(b1.ptr, b2.ptr)
1354
+ return Box.from_ptr(b)
1355
+
1356
+ def box_or_op() -> Box:
1357
+ """nullary OR operation."""
1358
+ cdef fb.Box b = fb.boxOR()
1359
+ return Box.from_ptr(b)
1360
+
1361
+ def box_or(Box b1, Box b2) -> Box:
1362
+ """binary box OR operation."""
1363
+ cdef fb.Box b = fb.boxOR(b1.ptr, b2.ptr)
1364
+ return Box.from_ptr(b)
1365
+
1366
+ def box_xor_op() -> Box:
1367
+ """nullary XOR operation."""
1368
+ cdef fb.Box b = fb.boxXOR()
1369
+ return Box.from_ptr(b)
1370
+
1371
+ def box_xor(Box b1, Box b2) -> Box:
1372
+ """binary box XOR operation."""
1373
+ cdef fb.Box b = fb.boxXOR(b1.ptr, b2.ptr)
1374
+ return Box.from_ptr(b)
1375
+
1376
+
1377
+ def box_abs_op() -> Box:
1378
+ """nullary absolute operation."""
1379
+ cdef fb.Box b = fb.boxAbs()
1380
+ return Box.from_ptr(b)
1381
+
1382
+ def box_abs(Box x) -> Box:
1383
+ """unitary box absolute operation."""
1384
+ cdef fb.Box b = fb.boxAbs(x.ptr)
1385
+ return Box.from_ptr(b)
1386
+
1387
+ def box_acos_op() -> Box:
1388
+ """nullary arccosine than operation."""
1389
+ cdef fb.Box b = fb.boxAcos()
1390
+ return Box.from_ptr(b)
1391
+
1392
+ def box_acos(Box x) -> Box:
1393
+ """unitary box arccosine operation."""
1394
+ cdef fb.Box b = fb.boxAcos(x.ptr)
1395
+ return Box.from_ptr(b)
1396
+
1397
+ def box_tan_op() -> Box:
1398
+ """nullary tangent operation."""
1399
+ cdef fb.Box b = fb.boxTan()
1400
+ return Box.from_ptr(b)
1401
+
1402
+ def box_tan(Box x) -> Box:
1403
+ """unitary box tangent operation."""
1404
+ cdef fb.Box b = fb.boxTan(x.ptr)
1405
+ return Box.from_ptr(b)
1406
+
1407
+ def box_sqrt_op() -> Box:
1408
+ """nullary square root than operation."""
1409
+ cdef fb.Box b = fb.boxSqrt()
1410
+ return Box.from_ptr(b)
1411
+
1412
+ def box_sqrt(Box x) -> Box:
1413
+ """unitary box sqrt operation."""
1414
+ cdef fb.Box b = fb.boxSqrt(x.ptr)
1415
+ return Box.from_ptr(b)
1416
+
1417
+ def box_sin_op() -> Box:
1418
+ """nullary sine op than operation."""
1419
+ cdef fb.Box b = fb.boxSin()
1420
+ return Box.from_ptr(b)
1421
+
1422
+ def box_sin(Box x) -> Box:
1423
+ """unitary box sine operation."""
1424
+ cdef fb.Box b = fb.boxSin(x.ptr)
1425
+ return Box.from_ptr(b)
1426
+
1427
+ def box_rint_op() -> Box:
1428
+ """nullary round int operation."""
1429
+ cdef fb.Box b = fb.boxRint()
1430
+ return Box.from_ptr(b)
1431
+
1432
+ def box_rint(Box x) -> Box:
1433
+ """unitary box round int operation."""
1434
+ cdef fb.Box b = fb.boxRint(x.ptr)
1435
+ return Box.from_ptr(b)
1436
+
1437
+ def box_round_op() -> Box:
1438
+ """nullary round float operation."""
1439
+ cdef fb.Box b = fb.boxRound()
1440
+ return Box.from_ptr(b)
1441
+
1442
+ def box_round(Box x) -> Box:
1443
+ """unitary box round operation."""
1444
+ cdef fb.Box b = fb.boxRound(x.ptr)
1445
+ return Box.from_ptr(b)
1446
+
1447
+ def box_log_op() -> Box:
1448
+ """nullary log operation."""
1449
+ cdef fb.Box b = fb.boxLog()
1450
+ return Box.from_ptr(b)
1451
+
1452
+ def box_log(Box x) -> Box:
1453
+ """unitary box log operation."""
1454
+ cdef fb.Box b = fb.boxLog(x.ptr)
1455
+ return Box.from_ptr(b)
1456
+
1457
+ def box_log10_op() -> Box:
1458
+ """nullary log10 operation."""
1459
+ cdef fb.Box b = fb.boxLog10()
1460
+ return Box.from_ptr(b)
1461
+
1462
+ def box_log10(Box x) -> Box:
1463
+ """unitary box log10 operation."""
1464
+ cdef fb.Box b = fb.boxLog10(x.ptr)
1465
+ return Box.from_ptr(b)
1466
+
1467
+ def box_floor_op() -> Box:
1468
+ """nullary floor operation."""
1469
+ cdef fb.Box b = fb.boxFloor()
1470
+ return Box.from_ptr(b)
1471
+
1472
+ def box_floor(Box x) -> Box:
1473
+ """unitary box floor operation."""
1474
+ cdef fb.Box b = fb.boxFloor(x.ptr)
1475
+ return Box.from_ptr(b)
1476
+
1477
+ def box_exp_op() -> Box:
1478
+ """nullary exp operation."""
1479
+ cdef fb.Box b = fb.boxExp()
1480
+ return Box.from_ptr(b)
1481
+
1482
+ def box_exp(Box x) -> Box:
1483
+ """unitary box exp operation."""
1484
+ cdef fb.Box b = fb.boxExp(x.ptr)
1485
+ return Box.from_ptr(b)
1486
+
1487
+ def box_exp10_op() -> Box:
1488
+ """nullary exp10 operation."""
1489
+ cdef fb.Box b = fb.boxExp10()
1490
+ return Box.from_ptr(b)
1491
+
1492
+ def box_exp10(Box x) -> Box:
1493
+ """unitary box exp10 operation."""
1494
+ cdef fb.Box b = fb.boxExp10(x.ptr)
1495
+ return Box.from_ptr(b)
1496
+
1497
+ def box_cos_op() -> Box:
1498
+ """nullary cosine operation."""
1499
+ cdef fb.Box b = fb.boxCos()
1500
+ return Box.from_ptr(b)
1501
+
1502
+ def box_cos(Box x) -> Box:
1503
+ """unitary box cosine operation."""
1504
+ cdef fb.Box b = fb.boxCos(x.ptr)
1505
+ return Box.from_ptr(b)
1506
+
1507
+ def box_ceil_op() -> Box:
1508
+ """nullary ceiling operation."""
1509
+ cdef fb.Box b = fb.boxCeil()
1510
+ return Box.from_ptr(b)
1511
+
1512
+ def box_ceil(Box x) -> Box:
1513
+ """unitary box ceiling operation."""
1514
+ cdef fb.Box b = fb.boxCeil(x.ptr)
1515
+ return Box.from_ptr(b)
1516
+
1517
+ def box_atan_op() -> Box:
1518
+ """nullary arc tangent operation."""
1519
+ cdef fb.Box b = fb.boxAtan()
1520
+ return Box.from_ptr(b)
1521
+
1522
+ def box_atan(Box x) -> Box:
1523
+ """unitary box arctangent operation."""
1524
+ cdef fb.Box b = fb.boxAtan(x.ptr)
1525
+ return Box.from_ptr(b)
1526
+
1527
+ def box_asin_op() -> Box:
1528
+ """nullary arcsine operation."""
1529
+ cdef fb.Box b = fb.boxAsin()
1530
+ return Box.from_ptr(b)
1531
+
1532
+ def box_asin(Box x) -> Box:
1533
+ """unitary box arcsine operation."""
1534
+ cdef fb.Box b = fb.boxAsin(x.ptr)
1535
+ return Box.from_ptr(b)
1536
+
1537
+ def box_remainder_op() -> Box:
1538
+ """nullary remainder operation."""
1539
+ cdef fb.Box b = fb.boxRemainder()
1540
+ return Box.from_ptr(b)
1541
+
1542
+ def box_remainder(Box b1, Box b2) -> Box:
1543
+ """binary box remainder operation."""
1544
+ cdef fb.Box b = fb.boxRemainder(b1.ptr, b2.ptr)
1545
+ return Box.from_ptr(b)
1546
+
1547
+ def box_pow_op() -> Box:
1548
+ """nullary power operation."""
1549
+ cdef fb.Box b = fb.boxPow()
1550
+ return Box.from_ptr(b)
1551
+
1552
+ def box_pow(Box b1, Box b2) -> Box:
1553
+ """binary box power operation."""
1554
+ cdef fb.Box b = fb.boxPow(b1.ptr, b2.ptr)
1555
+ return Box.from_ptr(b)
1556
+
1557
+ def box_min_op() -> Box:
1558
+ """nullary minimum operation."""
1559
+ cdef fb.Box b = fb.boxMin()
1560
+ return Box.from_ptr(b)
1561
+
1562
+ def box_min(Box b1, Box b2) -> Box:
1563
+ """binary box minimum operation."""
1564
+ cdef fb.Box b = fb.boxMin(b1.ptr, b2.ptr)
1565
+ return Box.from_ptr(b)
1566
+
1567
+ def box_max_op() -> Box:
1568
+ """nullary maximum operation."""
1569
+ cdef fb.Box b = fb.boxMax()
1570
+ return Box.from_ptr(b)
1571
+
1572
+ def box_max(Box b1, Box b2) -> Box:
1573
+ """binary box maximum operation."""
1574
+ cdef fb.Box b = fb.boxMax(b1.ptr, b2.ptr)
1575
+ return Box.from_ptr(b)
1576
+
1577
+ def box_fmod_op() -> Box:
1578
+ """nullary fmod operation."""
1579
+ cdef fb.Box b = fb.boxFmod()
1580
+ return Box.from_ptr(b)
1581
+
1582
+ def box_fmod(Box b1, Box b2) -> Box:
1583
+ """binary box fmod operation."""
1584
+ cdef fb.Box b = fb.boxFmod(b1.ptr, b2.ptr)
1585
+ return Box.from_ptr(b)
1586
+
1587
+ def box_atan2_op() -> Box:
1588
+ """nullary arctangent2 operation."""
1589
+ cdef fb.Box b = fb.boxAtan2()
1590
+ return Box.from_ptr(b)
1591
+
1592
+ def box_atan2(Box b1, Box b2) -> Box:
1593
+ """binary box arctan2 operation."""
1594
+ cdef fb.Box b = fb.boxAtan2(b1.ptr, b2.ptr)
1595
+ return Box.from_ptr(b)
1596
+
1597
+
1598
+ def box_button(str label) -> Box:
1599
+ """Create a button box.
1600
+
1601
+ label - the label definition (see [2])
1602
+
1603
+ returns the button box.
1604
+ """
1605
+ cdef fb.Box b = fb.boxButton(label.encode('utf8'))
1606
+ return Box.from_ptr(b)
1607
+
1608
+
1609
+ def box_checkbox(str label) -> Box:
1610
+ """Create a checkbox box.
1611
+
1612
+ label - the label definition (see [2])
1613
+
1614
+ returns the checkbox box.
1615
+ """
1616
+ cdef fb.Box b = fb.boxCheckbox(label.encode('utf8'))
1617
+ return Box.from_ptr(b)
1618
+
1619
+
1620
+ def box_vslider(str label, Box init, Box min, Box max, Box step) -> Box:
1621
+ """Create a vertical slider box.
1622
+
1623
+ label - the label definition (see [2])
1624
+ init - the init box, a constant numerical expression
1625
+ min - the min box, a constant numerical expression
1626
+ max - the max box, a constant numerical expression
1627
+ step - the step box, a constant numerical expression
1628
+
1629
+ returns the vertical slider box.
1630
+ """
1631
+ cdef fb.Box b = fb.boxVSlider(label.encode('utf8'), init.ptr, min.ptr, max.ptr, step.ptr)
1632
+ return Box.from_ptr(b)
1633
+
1634
+ def box_hslider(str label, Box init, Box min, Box max, Box step) -> Box:
1635
+ """Create an horizontal slider box.
1636
+
1637
+ label - the label definition (see [2])
1638
+ init - the init box, a constant numerical expression
1639
+ min - the min box, a constant numerical expression
1640
+ max - the max box, a constant numerical expression
1641
+ step - the step box, a constant numerical expression
1642
+
1643
+ returns the horizontal slider box.
1644
+ """
1645
+ cdef fb.Box b = fb.boxHSlider(label.encode('utf8'), init.ptr, min.ptr, max.ptr, step.ptr)
1646
+ return Box.from_ptr(b)
1647
+
1648
+ def box_numentry(str label, Box init, Box min, Box max, Box step) -> Box:
1649
+ """Create a num entry box.
1650
+
1651
+ label - the label definition (see [2])
1652
+ init - the init box, a constant numerical expression
1653
+ min - the min box, a constant numerical expression
1654
+ max - the max box, a constant numerical expression
1655
+ step - the step box, a constant numerical expression
1656
+
1657
+ returns the num entry box.
1658
+ """
1659
+ cdef fb.Box b = fb.boxNumEntry(label.encode('utf8'), init.ptr, min.ptr, max.ptr, step.ptr)
1660
+ return Box.from_ptr(b)
1661
+
1662
+
1663
+ def box_vbargraph(str label, Box min, Box max) -> Box:
1664
+ """Create a vertical bargraph box.
1665
+
1666
+ label - the label definition (see [2])
1667
+ min - the min box, a constant numerical expression
1668
+ max - the max box, a constant numerical expression
1669
+ x - the input box
1670
+
1671
+ returns the vertical bargraph box.
1672
+ """
1673
+ cdef fb.Box b = fb.boxVBargraph(label.encode('utf8'), min.ptr, max.ptr)
1674
+ return Box.from_ptr(b)
1675
+
1676
+ def box_vbargraph2(str label, Box min, Box max, Box x) -> Box:
1677
+ """Create a vertical bargraph box.
1678
+
1679
+ label - the label definition (see [2])
1680
+ min - the min box, a constant numerical expression
1681
+ max - the max box, a constant numerical expression
1682
+ x - the input box
1683
+
1684
+ returns the vertical bargraph box.
1685
+ """
1686
+ cdef fb.Box b = fb.boxVBargraph(label.encode('utf8'), min.ptr, max.ptr, x.ptr)
1687
+ return Box.from_ptr(b)
1688
+
1689
+ def box_hbargraph(str label, Box min, Box max) -> Box:
1690
+ """Create a horizontal bargraph box.
1691
+
1692
+ label - the label definition (see [2])
1693
+ min - the min box, a constant numerical expression
1694
+ max - the max box, a constant numerical expression
1695
+ x - the input box
1696
+
1697
+ returns the horizontal bargraph box.
1698
+ """
1699
+ cdef fb.Box b = fb.boxHBargraph(label.encode('utf8'), min.ptr, max.ptr)
1700
+ return Box.from_ptr(b)
1701
+
1702
+ def box_hbargraph2(str label, Box min, Box max, Box x) -> Box:
1703
+ """Create a horizontal bargraph box.
1704
+
1705
+ label - the label definition (see [2])
1706
+ min - the min box, a constant numerical expression
1707
+ max - the max box, a constant numerical expression
1708
+ x - the input box
1709
+
1710
+ returns the horizontal bargraph box.
1711
+ """
1712
+ cdef fb.Box b = fb.boxHBargraph(label.encode('utf8'), min.ptr, max.ptr, x.ptr)
1713
+ return Box.from_ptr(b)
1714
+
1715
+
1716
+ def box_vgroup(str label, Box group) -> Box:
1717
+ """Create a vertical group box.
1718
+
1719
+ label - the label definition (see [2])
1720
+ group - the group to be added
1721
+
1722
+ returns the vertical group box.
1723
+ """
1724
+ cdef fb.Box b = fb.boxVGroup(label.encode('utf8'), group.ptr)
1725
+ return Box.from_ptr(b)
1726
+
1727
+
1728
+ def box_hgroup(str label, Box group) -> Box:
1729
+ """Create a horizontal group box.
1730
+
1731
+ label - the label definition (see [2])
1732
+ group - the group to be added
1733
+
1734
+ returns the horizontal group box.
1735
+ """
1736
+ cdef fb.Box b = fb.boxHGroup(label.encode('utf8'), group.ptr)
1737
+ return Box.from_ptr(b)
1738
+
1739
+ def box_tgroup(str label, Box group) -> Box:
1740
+ """Create a tab group box.
1741
+
1742
+ label - the label definition (see [2])
1743
+ group - the group to be added
1744
+
1745
+ returns the tab group box.
1746
+ """
1747
+ cdef fb.Box b = fb.boxTGroup(label.encode('utf8'), group.ptr)
1748
+ return Box.from_ptr(b)
1749
+
1750
+ def box_attach_op() -> Box:
1751
+ """Create an attach box.
1752
+
1753
+ returns the attach box.
1754
+ """
1755
+ cdef fb.Box b = fb.boxAttach()
1756
+ return Box.from_ptr(b)
1757
+
1758
+
1759
+ def box_attach(Box b1, Box b2) -> Box:
1760
+ """Create an attach box.
1761
+
1762
+ The attach primitive takes two input boxes and produces one output box
1763
+ which is a copy of the first input. The role of attach is to force
1764
+ its second input boxes to be compiled with the first one.
1765
+
1766
+ returns the attach box.
1767
+ """
1768
+ cdef fb.Box b = fb.boxAttach(b1.ptr, b2.ptr)
1769
+ return Box.from_ptr(b)
1770
+
1771
+
1772
+ # cdef fb.Box box_prim2(fb.prim2 foo):
1773
+ # return fb.boxPrim2(foo)
1774
+
1775
+ def is_box_abstr(Box t) -> bool:
1776
+ """test if box is an abtraction."""
1777
+ return fb.isBoxAbstr(t.ptr)
1778
+
1779
+ def getparams_box_abstr(Box t) -> dict:
1780
+ cdef fb.Box x = NULL
1781
+ cdef fb.Box y = NULL
1782
+ if fb.isBoxAbstr(t.ptr, x, y):
1783
+ return dict(
1784
+ x=Box.from_ptr(x),
1785
+ y=Box.from_ptr(y),
1786
+ )
1787
+ else:
1788
+ return {}
1789
+
1790
+ def getparams_box_access(Box t) -> dict:
1791
+ cdef fb.Box exp = NULL
1792
+ cdef fb.Box id = NULL
1793
+ if fb.isBoxAccess(t.ptr, exp, id):
1794
+ return dict(
1795
+ exp=Box.from_ptr(exp),
1796
+ id=Box.from_ptr(id),
1797
+ )
1798
+ else:
1799
+ return {}
1800
+
1801
+ def is_box_appl(Box t) -> bool:
1802
+ """test if box is an application."""
1803
+ return fb.isBoxAppl(t.ptr)
1804
+
1805
+ def getparams_box_appl(Box t) -> dict:
1806
+ cdef fb.Box x = NULL
1807
+ cdef fb.Box y = NULL
1808
+ if fb.isBoxAppl(t.ptr, x, y):
1809
+ return dict(
1810
+ x=Box.from_ptr(x),
1811
+ y=Box.from_ptr(y),
1812
+ )
1813
+ else:
1814
+ return {}
1815
+
1816
+ def is_box_button(Box b) -> bool:
1817
+ """test if box is a button."""
1818
+ return fb.isBoxButton(b.ptr)
1819
+
1820
+ def getparams_box_button(Box b) -> dict:
1821
+ cdef fb.Box lbl = NULL
1822
+ if fb.isBoxButton(b.ptr, lbl):
1823
+ return dict(
1824
+ lbl=Box.from_ptr(lbl),
1825
+ )
1826
+ else:
1827
+ return {}
1828
+
1829
+ def is_box_case(Box b) -> bool:
1830
+ """test if box is a case."""
1831
+ return fb.isBoxCase(b.ptr)
1832
+
1833
+ def getparams_box_case(Box b) -> dict:
1834
+ cdef fb.Box rules = NULL
1835
+ if fb.isBoxCase(b.ptr, rules):
1836
+ return dict(
1837
+ rules=Box.from_ptr(rules),
1838
+ )
1839
+ else:
1840
+ return {}
1841
+
1842
+ def is_box_checkbox(Box b) -> bool:
1843
+ """test if box is a checkbox."""
1844
+ return fb.isBoxCheckbox(b.ptr)
1845
+
1846
+ def getparams_box_checkbox(Box b) -> dict:
1847
+ cdef fb.Box lbl = NULL
1848
+ if fb.isBoxCheckbox(b.ptr, lbl):
1849
+ return dict(
1850
+ lbl=Box.from_ptr(lbl),
1851
+ )
1852
+ else:
1853
+ return {}
1854
+
1855
+ def getparams_box_component(Box b) -> dict:
1856
+ cdef fb.Box filename = NULL
1857
+ if fb.isBoxComponent(b.ptr, filename):
1858
+ return dict(
1859
+ filename=Box.from_ptr(filename),
1860
+ )
1861
+ else:
1862
+ return {}
1863
+
1864
+ def is_box_cut(Box t) -> bool:
1865
+ """test if box is a cut."""
1866
+ return fb.isBoxCut(t.ptr)
1867
+
1868
+ def is_box_environment(Box b) -> bool:
1869
+ return fb.isBoxEnvironment(b.ptr)
1870
+
1871
+ def is_box_error(Box t) -> bool:
1872
+ """test if box is an error."""
1873
+ return fb.isBoxError(t.ptr)
1874
+
1875
+ def is_box_fconst(Box b) -> bool:
1876
+ """test if box is an fconst."""
1877
+ return fb.isBoxFConst(b.ptr)
1878
+
1879
+ def getparams_box_fconst(Box b) -> dict:
1880
+ cdef fb.Box type = NULL
1881
+ cdef fb.Box name = NULL
1882
+ cdef fb.Box file = NULL
1883
+ if fb.isBoxFConst(b.ptr, type, name, file):
1884
+ return dict(
1885
+ type=Box.from_ptr(type),
1886
+ name=Box.from_ptr(name),
1887
+ file=Box.from_ptr(file),
1888
+ )
1889
+ else:
1890
+ return {}
1891
+
1892
+ def is_box_ffun(Box b) -> bool:
1893
+ """test if box is an ffun."""
1894
+ return fb.isBoxFFun(b.ptr)
1895
+
1896
+ def getparams_box_ffun(Box b) -> dict:
1897
+ cdef fb.Box ff = NULL
1898
+ if fb.isBoxFFun(b.ptr, ff):
1899
+ return dict(
1900
+ ff=Box.from_ptr(ff),
1901
+ )
1902
+ else:
1903
+ return {}
1904
+
1905
+ def is_box_fvar(Box b) -> bool:
1906
+ """test if box is an fvar."""
1907
+ return fb.isBoxFVar(b.ptr)
1908
+
1909
+ def getparams_box_fvar(Box b) -> dict:
1910
+ cdef fb.Box type = NULL
1911
+ cdef fb.Box name = NULL
1912
+ cdef fb.Box file = NULL
1913
+ if fb.isBoxFVar(b.ptr, type, name, file):
1914
+ return dict(
1915
+ type=Box.from_ptr(type),
1916
+ name=Box.from_ptr(name),
1917
+ file=Box.from_ptr(file),
1918
+ )
1919
+ else:
1920
+ return {}
1921
+
1922
+ def is_box_hbargraph(Box b) -> bool:
1923
+ """test if box is a hbargraph."""
1924
+ return fb.isBoxHBargraph(b.ptr)
1925
+
1926
+ def getparams_box_hbargraph(Box b) -> dict:
1927
+ cdef fb.Box lbl = NULL
1928
+ cdef fb.Box min = NULL
1929
+ cdef fb.Box max = NULL
1930
+ if fb.isBoxHBargraph(b.ptr, lbl, min, max):
1931
+ return dict(
1932
+ lbl=Box.from_ptr(lbl),
1933
+ min=Box.from_ptr(min),
1934
+ max=Box.from_ptr(max),
1935
+ )
1936
+ else:
1937
+ return {}
1938
+
1939
+ def is_box_hgroup(Box b) -> bool:
1940
+ """test if box is an horizontal group."""
1941
+ return fb.isBoxHGroup(b.ptr)
1942
+
1943
+ def getparams_box_hgroup(Box b) -> dict:
1944
+ cdef fb.Box lbl = NULL
1945
+ cdef fb.Box x = NULL
1946
+ if fb.isBoxHGroup(b.ptr, lbl, x):
1947
+ return dict(
1948
+ lbl=Box.from_ptr(lbl),
1949
+ x=Box.from_ptr(x),
1950
+ )
1951
+ else:
1952
+ return {}
1953
+
1954
+ def is_box_hslider(Box b) -> bool:
1955
+ """test if box is an horizontal slider."""
1956
+ return fb.isBoxHSlider(b.ptr)
1957
+
1958
+ def getparams_box_hslider(Box b) -> dict:
1959
+ cdef fb.Box lbl = NULL
1960
+ cdef fb.Box cur = NULL
1961
+ cdef fb.Box min = NULL
1962
+ cdef fb.Box max = NULL
1963
+ cdef fb.Box step = NULL
1964
+ if fb.isBoxHSlider(b.ptr, lbl, cur, min, max, step):
1965
+ return dict(
1966
+ lbl=Box.from_ptr(lbl),
1967
+ cur=Box.from_ptr(cur),
1968
+ min=Box.from_ptr(min),
1969
+ max=Box.from_ptr(max),
1970
+ step=Box.from_ptr(step),
1971
+ )
1972
+ else:
1973
+ return {}
1974
+
1975
+ def is_box_ident(Box t) -> bool:
1976
+ """test if box is an indentifier."""
1977
+ return fb.isBoxIdent(t.ptr)
1978
+
1979
+ def get_box_id(Box t) -> str | None:
1980
+ cdef const char** cstr = <const char**> malloc(1024 * sizeof(char*))
1981
+ if fb.isBoxIdent(t.ptr, cstr):
1982
+ return cstr[0].decode()
1983
+
1984
+
1985
+ def getparams_box_inputs(Box t) -> dict:
1986
+ cdef fb.Box x = NULL
1987
+ if fb.isBoxInputs(t.ptr, x):
1988
+ return dict(
1989
+ x=Box.from_ptr(x),
1990
+ )
1991
+ else:
1992
+ return {}
1993
+
1994
+ def is_box_int(Box t) -> bool:
1995
+ """test if box is an int."""
1996
+ return fb.isBoxInt(t.ptr)
1997
+
1998
+ def getparams_box_int(Box t) -> dict:
1999
+ cdef int i = 0
2000
+ if fb.isBoxInt(t.ptr, &i):
2001
+ return dict(
2002
+ i=i,
2003
+ )
2004
+ else:
2005
+ return {}
2006
+
2007
+ def getparams_box_ipar(Box t) -> dict:
2008
+ cdef fb.Box x = NULL
2009
+ cdef fb.Box y = NULL
2010
+ cdef fb.Box z = NULL
2011
+ if fb.isBoxIPar(t.ptr, x, y, z):
2012
+ return dict(
2013
+ x=Box.from_ptr(x),
2014
+ y=Box.from_ptr(y),
2015
+ z=Box.from_ptr(z),
2016
+ )
2017
+ else:
2018
+ return {}
2019
+
2020
+ def getparams_box_iprod(Box t) -> dict:
2021
+ cdef fb.Box x = NULL
2022
+ cdef fb.Box y = NULL
2023
+ cdef fb.Box z = NULL
2024
+ if fb.isBoxIProd(t.ptr, x, y, z):
2025
+ return dict(
2026
+ x=Box.from_ptr(x),
2027
+ y=Box.from_ptr(y),
2028
+ z=Box.from_ptr(z),
2029
+ )
2030
+ else:
2031
+ return {}
2032
+
2033
+ def getparams_box_iseq(Box t) -> dict:
2034
+ cdef fb.Box x = NULL
2035
+ cdef fb.Box y = NULL
2036
+ cdef fb.Box z = NULL
2037
+ if fb.isBoxISeq(t.ptr, x, y, z):
2038
+ return dict(
2039
+ x=Box.from_ptr(x),
2040
+ y=Box.from_ptr(y),
2041
+ z=Box.from_ptr(z),
2042
+ )
2043
+ else:
2044
+ return {}
2045
+
2046
+ def getparams_box_isum(Box t) -> dict:
2047
+ cdef fb.Box x = NULL
2048
+ cdef fb.Box y = NULL
2049
+ cdef fb.Box z = NULL
2050
+ if fb.isBoxISum(t.ptr, x, y, z):
2051
+ return dict(
2052
+ x=Box.from_ptr(x),
2053
+ y=Box.from_ptr(y),
2054
+ z=Box.from_ptr(z),
2055
+ )
2056
+ else:
2057
+ return {}
2058
+
2059
+ def getparams_box_library(Box b) -> dict:
2060
+ cdef fb.Box filename = NULL
2061
+ if fb.isBoxLibrary(b.ptr, filename):
2062
+ return dict(
2063
+ filename=Box.from_ptr(filename),
2064
+ )
2065
+ else:
2066
+ return {}
2067
+
2068
+ def getparams_box_merge(Box t) -> dict:
2069
+ cdef fb.Box x = NULL
2070
+ cdef fb.Box y = NULL
2071
+ if fb.isBoxMerge(t.ptr, x, y):
2072
+ return dict(
2073
+ x=Box.from_ptr(x),
2074
+ y=Box.from_ptr(y),
2075
+ )
2076
+ else:
2077
+ return {}
2078
+
2079
+ def getparams_box_metadata(Box b) -> dict:
2080
+ cdef fb.Box exp = NULL
2081
+ cdef fb.Box mdlist = NULL
2082
+ if fb.isBoxMetadata(b.ptr, exp, mdlist):
2083
+ return dict(
2084
+ exp=Box.from_ptr(exp),
2085
+ mdlist=Box.from_ptr(mdlist),
2086
+ )
2087
+ else:
2088
+ return {}
2089
+
2090
+ def is_box_numentry(Box b) -> bool:
2091
+ """test if box is a numentry."""
2092
+ return fb.isBoxNumEntry(b.ptr)
2093
+
2094
+ def getparams_box_num_entry(Box b) -> dict:
2095
+ cdef fb.Box lbl = NULL
2096
+ cdef fb.Box cur = NULL
2097
+ cdef fb.Box min = NULL
2098
+ cdef fb.Box max = NULL
2099
+ cdef fb.Box step = NULL
2100
+ if fb.isBoxNumEntry(b.ptr, lbl, cur, min, max, step):
2101
+ return dict(
2102
+ lbl=Box.from_ptr(lbl),
2103
+ cur=Box.from_ptr(cur),
2104
+ min=Box.from_ptr(min),
2105
+ max=Box.from_ptr(max),
2106
+ step=Box.from_ptr(step),
2107
+ )
2108
+ else:
2109
+ return {}
2110
+
2111
+ def getparams_box_outputs(Box t) -> dict:
2112
+ cdef fb.Box x = NULL
2113
+ if fb.isBoxOutputs(t.ptr, x):
2114
+ return dict(
2115
+ x=Box.from_ptr(x),
2116
+ )
2117
+ else:
2118
+ return {}
2119
+
2120
+ def getparams_box_par(Box t) -> dict:
2121
+ cdef fb.Box x = NULL
2122
+ cdef fb.Box y = NULL
2123
+ if fb.isBoxPar(t.ptr, x, y):
2124
+ return dict(
2125
+ x=Box.from_ptr(x),
2126
+ y=Box.from_ptr(y),
2127
+ )
2128
+ else:
2129
+ return {}
2130
+
2131
+
2132
+
2133
+
2134
+ def is_box_prim0_(Box b) -> bool:
2135
+ cdef fb.prim0 p
2136
+ return fb.isBoxPrim0(b.ptr, &p)
2137
+
2138
+ def is_box_prim1_(Box b) -> bool:
2139
+ cdef fb.prim1 p
2140
+ return fb.isBoxPrim1(b.ptr, &p)
2141
+
2142
+ def is_box_prim2_(Box b) -> bool:
2143
+ cdef fb.prim2 p
2144
+ return fb.isBoxPrim2(b.ptr, &p)
2145
+
2146
+ def is_box_prim3_(Box b) -> bool:
2147
+ cdef fb.prim3 p
2148
+ return fb.isBoxPrim3(b.ptr, &p)
2149
+
2150
+ def is_box_prim4_(Box b) -> bool:
2151
+ cdef fb.prim4 p
2152
+ return fb.isBoxPrim4(b.ptr, &p)
2153
+
2154
+ def is_box_prim5_(Box b) -> bool:
2155
+ cdef fb.prim5 p
2156
+ return fb.isBoxPrim5(b.ptr, &p)
2157
+
2158
+
2159
+ def is_box_prim0(Box b) -> bool:
2160
+ return fb.isBoxPrim0(b.ptr)
2161
+
2162
+ def is_box_prim1(Box b) -> bool:
2163
+ return fb.isBoxPrim1(b.ptr)
2164
+
2165
+ def is_box_prim2(Box b) -> bool:
2166
+ return fb.isBoxPrim2(b.ptr)
2167
+
2168
+ def is_box_prim3(Box b) -> bool:
2169
+ return fb.isBoxPrim3(b.ptr)
2170
+
2171
+ def is_box_prim4(Box b) -> bool:
2172
+ return fb.isBoxPrim4(b.ptr)
2173
+
2174
+ def is_box_prim5(Box b) -> bool:
2175
+ return fb.isBoxPrim5(b.ptr)
2176
+
2177
+
2178
+ def is_box_real(Box t) -> bool:
2179
+ """test if box is a real or float."""
2180
+ return fb.isBoxReal(t.ptr)
2181
+
2182
+ def getparams_box_real(Box t) -> dict:
2183
+ cdef double r
2184
+ if fb.isBoxReal(t.ptr, &r):
2185
+ return dict(
2186
+ r=r,
2187
+ )
2188
+ else:
2189
+ return {}
2190
+
2191
+ def getparams_box_rec(Box t) -> dict:
2192
+ cdef fb.Box x = NULL
2193
+ cdef fb.Box y = NULL
2194
+ if fb.isBoxRec(t.ptr, x, y):
2195
+ return dict(
2196
+ x=Box.from_ptr(x),
2197
+ y=Box.from_ptr(y),
2198
+ )
2199
+ else:
2200
+ return {}
2201
+
2202
+ def getparams_box_route(Box b) -> dict:
2203
+ cdef fb.Box n = NULL
2204
+ cdef fb.Box m = NULL
2205
+ cdef fb.Box r = NULL
2206
+ if fb.isBoxRoute(b.ptr, n, m, r):
2207
+ return dict(
2208
+ n=Box.from_ptr(n),
2209
+ m=Box.from_ptr(m),
2210
+ r=Box.from_ptr(r),
2211
+ )
2212
+ else:
2213
+ return {}
2214
+
2215
+ def getparams_box_seq(Box t) -> dict:
2216
+ cdef fb.Box x = NULL
2217
+ cdef fb.Box y = NULL
2218
+ if fb.isBoxSeq(t.ptr, x, y):
2219
+ return dict(
2220
+ x=Box.from_ptr(x),
2221
+ y=Box.from_ptr(y),
2222
+ )
2223
+ else:
2224
+ return {}
2225
+
2226
+ def is_box_slot(Box t) -> bool:
2227
+ """test if box is a slot."""
2228
+ return fb.isBoxSlot(t.ptr)
2229
+
2230
+ def getparams_box_slot(Box t) -> dict:
2231
+ cdef int id = 0
2232
+ if fb.isBoxSlot(t.ptr, &id):
2233
+ return dict(
2234
+ id=id,
2235
+ )
2236
+ else:
2237
+ return {}
2238
+
2239
+ def is_box_soundfile(Box b) -> bool:
2240
+ """test if box is a soundfile."""
2241
+ return fb.isBoxSoundfile(b.ptr)
2242
+
2243
+ def getparams_box_soundfile(Box b) -> dict:
2244
+ cdef fb.Box label = NULL
2245
+ cdef fb.Box chan = NULL
2246
+ if fb.isBoxSoundfile(b.ptr, label, chan):
2247
+ return dict(
2248
+ label=Box.from_ptr(label),
2249
+ chan=Box.from_ptr(chan),
2250
+ )
2251
+ else:
2252
+ return {}
2253
+
2254
+ def getparams_box_split(Box t) -> dict:
2255
+ cdef fb.Box x = NULL
2256
+ cdef fb.Box y = NULL
2257
+ if fb.isBoxSplit(t.ptr, x, y):
2258
+ return dict(
2259
+ x=Box.from_ptr(x),
2260
+ y=Box.from_ptr(y),
2261
+ )
2262
+ else:
2263
+ return {}
2264
+
2265
+ def is_box_symbolic(Box t) -> bool:
2266
+ """test if box is symbolic."""
2267
+ return fb.isBoxSymbolic(t.ptr)
2268
+
2269
+ def getparams_box_symbolic(Box t) -> dict:
2270
+ cdef fb.Box slot = NULL
2271
+ cdef fb.Box body = NULL
2272
+ if fb.isBoxSymbolic(t.ptr, slot, body):
2273
+ return dict(
2274
+ slot=Box.from_ptr(slot),
2275
+ body=Box.from_ptr(body),
2276
+ )
2277
+ else:
2278
+ return {}
2279
+
2280
+ def is_box_tgroup(Box b) -> bool:
2281
+ """test if box is a tab group."""
2282
+ return fb.isBoxTGroup(b.ptr)
2283
+
2284
+ def getparams_box_tgroup(Box b) -> dict:
2285
+ cdef fb.Box lbl = NULL
2286
+ cdef fb.Box x = NULL
2287
+ if fb.isBoxTGroup(b.ptr, lbl, x):
2288
+ return dict(
2289
+ lbl=Box.from_ptr(lbl),
2290
+ x=Box.from_ptr(x),
2291
+ )
2292
+ else:
2293
+ return {}
2294
+
2295
+ def is_box_vbargraph(Box b) -> bool:
2296
+ """test if box is a vertical bargraph."""
2297
+ return fb.isBoxVBargraph(b.ptr)
2298
+
2299
+ def getparams_box_vbargraph(Box b) -> dict:
2300
+ cdef fb.Box lbl = NULL
2301
+ cdef fb.Box min = NULL
2302
+ cdef fb.Box max = NULL
2303
+ if fb.isBoxVBargraph(b.ptr, lbl, min, max):
2304
+ return dict(
2305
+ lbl=Box.from_ptr(lbl),
2306
+ min=Box.from_ptr(min),
2307
+ max=Box.from_ptr(max),
2308
+ )
2309
+ else:
2310
+ return {}
2311
+
2312
+ def is_box_vgroup(Box b) -> bool:
2313
+ """test if box is a vertical group."""
2314
+ return fb.isBoxVGroup(b.ptr)
2315
+
2316
+ def getparams_box_vgroup(Box b) -> dict:
2317
+ cdef fb.Box lbl = NULL
2318
+ cdef fb.Box x = NULL
2319
+ if fb.isBoxVGroup(b.ptr, lbl, x):
2320
+ return dict(
2321
+ lbl=Box.from_ptr(lbl),
2322
+ x=Box.from_ptr(x),
2323
+ )
2324
+ else:
2325
+ return {}
2326
+
2327
+ def is_box_vslider(Box b) -> bool:
2328
+ return fb.isBoxVSlider(b.ptr)
2329
+
2330
+ def getparams_box_vslider(Box b) -> dict:
2331
+ cdef fb.Box lbl = NULL
2332
+ cdef fb.Box cur = NULL
2333
+ cdef fb.Box min = NULL
2334
+ cdef fb.Box max = NULL
2335
+ cdef fb.Box step = NULL
2336
+ if fb.isBoxVSlider(b.ptr, lbl, cur, min, max, step):
2337
+ return dict(
2338
+ lbl=Box.from_ptr(lbl),
2339
+ cur=Box.from_ptr(cur),
2340
+ min=Box.from_ptr(min),
2341
+ max=Box.from_ptr(max),
2342
+ step=Box.from_ptr(step),
2343
+ )
2344
+ else:
2345
+ return {}
2346
+
2347
+ def is_box_waveform(Box b) -> bool:
2348
+ """test if box is a waveform."""
2349
+ return fb.isBoxWaveform(b.ptr)
2350
+
2351
+ def is_box_wire(Box t) -> bool:
2352
+ """test if box is a wire."""
2353
+ return fb.isBoxWire(t.ptr)
2354
+
2355
+ def getparams_box_with_local_def(Box t) -> dict:
2356
+ cdef fb.Box body = NULL
2357
+ cdef fb.Box ldef = NULL
2358
+ if fb.isBoxWithLocalDef(t.ptr, body, ldef):
2359
+ return dict(
2360
+ body=Box.from_ptr(body),
2361
+ ldef=Box.from_ptr(ldef),
2362
+ )
2363
+ else:
2364
+ return {}
2365
+
2366
+
2367
+ def dsp_to_boxes(str name_app, str dsp_content, *args) -> Box:
2368
+ """Compile a DSP source code as a string in a flattened box
2369
+
2370
+ name_app - the name of the Faust program
2371
+ dsp_content - the Faust program as a string
2372
+ argc - the number of parameters in argv array
2373
+ argv - the array of parameters
2374
+ inputs - the place to return the number of inputs of the resulting box
2375
+ outputs - the place to return the number of outputs of the resulting box
2376
+ error_msg - the error string to be filled
2377
+
2378
+ returns a flattened box on success, otherwise a null pointer.
2379
+ """
2380
+ cdef ParamArray params = ParamArray(args)
2381
+ cdef int inputs, outputs
2382
+ cdef string error_msg
2383
+ error_msg.reserve(4096)
2384
+ cdef fb.Box b = fb.DSPToBoxes(
2385
+ name_app.encode('utf8'),
2386
+ dsp_content.encode('utf8'),
2387
+ params.argc,
2388
+ params.argv,
2389
+ &inputs,
2390
+ &outputs,
2391
+ error_msg,
2392
+ )
2393
+ if not error_msg.empty():
2394
+ print(error_msg.decode())
2395
+ return
2396
+ return Box.from_ptr(b)
2397
+
2398
+
2399
+ def get_box_type(Box b) -> tuple[int, int] | None:
2400
+ """Return the number of inputs and outputs of a box
2401
+
2402
+ box - the box we want to know the number of inputs and outputs
2403
+ inputs - the place to return the number of inputs
2404
+ outputs - the place to return the number of outputs
2405
+
2406
+ returns true if type is defined, false if undefined.
2407
+ """
2408
+ cdef int inputs, outputs
2409
+ if fb.getBoxType(b.ptr, &inputs, &outputs):
2410
+ return (inputs, outputs)
2411
+
2412
+ def boxes_to_signals(Box b) -> SignalVector | None:
2413
+ """Compile a box expression in a list of signals in normal form
2414
+ (see simplifyToNormalForm in libfaust-signal.h)
2415
+
2416
+ box - the box expression
2417
+ error_msg - the error string to be filled
2418
+
2419
+ returns a list of signals in normal form on success, otherwise an empty list.
2420
+ """
2421
+ cdef string error_msg
2422
+ error_msg.reserve(4096)
2423
+ cdef fs.tvec vec = fb.boxesToSignals(b.ptr, error_msg)
2424
+ if not error_msg.empty():
2425
+ print(error_msg.decode())
2426
+ return
2427
+ return SignalVector.from_ptr(vec)
2428
+
2429
+
2430
+ def create_source_from_boxes(str name_app, Box box, str lang, *args) -> str:
2431
+ """Create source code in a target language from a box expression.
2432
+
2433
+ name_app - the name of the Faust program
2434
+ box - the box expression
2435
+ lang - the target source code's language which can be one of
2436
+ 'c', 'cpp', 'cmajor', 'codebox', 'csharp', 'dlang', 'fir',
2437
+ 'interp', 'java', 'jax','jsfx', 'julia', 'ocpp', 'rust' or 'wast'
2438
+ (depending of which of the corresponding backends are compiled in libfaust)
2439
+ argc - the number of parameters in argv array
2440
+ argv - the array of parameters
2441
+ error_msg - the error string to be filled
2442
+
2443
+ returns a string of source code on success, setting error_msg on error.
2444
+ """
2445
+ cdef ParamArray params = ParamArray(args)
2446
+ cdef string error_msg
2447
+ error_msg.reserve(4096)
2448
+ cdef string code = fb.createSourceFromBoxes(
2449
+ name_app.encode('utf8'),
2450
+ box.ptr,
2451
+ lang.encode('utf8'),
2452
+ params.argc,
2453
+ params.argv,
2454
+ error_msg)
2455
+ if not error_msg.empty():
2456
+ print(error_msg.decode())
2457
+ return
2458
+ return code.decode()
2459
+