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/signal.pyx ADDED
@@ -0,0 +1,1993 @@
1
+ # distutils: language = c++
2
+
3
+ from libcpp.string cimport string
4
+
5
+ from . cimport faust_signal as fs
6
+
7
+ from .common cimport ParamArray
8
+ from .common import ParamArray
9
+
10
+
11
+ def sig_or_float(var: Signal | float) -> Signal:
12
+ if isinstance(var, float):
13
+ return Signal.from_real(var)
14
+ elif isinstance(var, Signal):
15
+ assert is_sig_real(var), "signal is not a float Signal"
16
+ return var
17
+ raise TypeError("argument must be an float or a sigReal")
18
+
19
+ def sig_or_int(var: Signal | int) -> Signal:
20
+ if isinstance(var, int):
21
+ return Signal.from_int(var)
22
+ elif isinstance(var, Signal):
23
+ assert is_sig_int(var), "signal is not an int Signal"
24
+ return var
25
+ raise TypeError("argument must be an int")
26
+
27
+
28
+ class signal_context:
29
+ def __enter__(self):
30
+ # Create global compilation context, has to be done first.
31
+ fs.createLibContext()
32
+ def __exit__(self, type, value, traceback):
33
+ # Destroy global compilation context, has to be done last.
34
+ fs.destroyLibContext()
35
+
36
+
37
+ cdef class SignalVector:
38
+ """wraps tvec: a std::vector<CTree*>"""
39
+ # cdef vector[fs.Signal] ptr
40
+ # cdef bint ptr_owner
41
+
42
+ def __cinit__(self):
43
+ self.ptr_owner = False
44
+
45
+ def __iter__(self):
46
+ for i in self.ptr:
47
+ yield Signal.from_ptr(i)
48
+
49
+ @staticmethod
50
+ cdef SignalVector from_ptr(fs.tvec ptr):
51
+ """Wrap a fs.tvec instance."""
52
+ cdef SignalVector sv = SignalVector.__new__(SignalVector)
53
+ sv.ptr = ptr
54
+ return sv
55
+
56
+ cdef add_ptr(self, fs.Signal sig):
57
+ self.ptr.push_back(sig)
58
+
59
+ def add(self, Signal sig):
60
+ self.ptr.push_back(sig.ptr)
61
+
62
+ def create_source(self, name_app: str, lang, *args) -> str:
63
+ """Create source code in a target language from a signal expression."""
64
+ return create_source_from_signals(name_app, self, lang, *args)
65
+
66
+ def simplify_to_normal_form(self) -> SignalVector:
67
+ """Simplify a signal list to its normal form.
68
+
69
+ returns the signal vector in normal form.
70
+ """
71
+ return simplify_to_normal_form2(self)
72
+
73
+
74
+
75
+ cdef class Interval:
76
+ """wraps fs.Interval struct/class"""
77
+ cdef fs.Interval *ptr
78
+
79
+ def __dealloc__(self):
80
+ if self.ptr:
81
+ del self.ptr
82
+
83
+ def __cinit__(self, double lo, double hi, int lsb):
84
+ self.ptr = new fs.Interval(lo, hi, lsb)
85
+
86
+ @staticmethod
87
+ cdef Interval from_ptr(fs.Interval* ptr):
88
+ """Wrap Interval from pointer"""
89
+ cdef Interval ival = Interval.__new__(Interval)
90
+ ival.ptr = ptr
91
+ return ival
92
+
93
+ @property
94
+ def low(self) -> float:
95
+ return self.ptr.fLo
96
+
97
+ @property
98
+ def high(self) -> float:
99
+ return self.ptr.fHi
100
+
101
+ @property
102
+ def lsb(self) -> float:
103
+ return self.ptr.fLSB
104
+
105
+
106
+ cdef class Signal:
107
+ """faust Signal wrapper.
108
+ """
109
+ # cdef fs.Signal ptr
110
+
111
+ def __cinit__(self):
112
+ self.ptr = NULL
113
+
114
+ @staticmethod
115
+ cdef Signal from_ptr(fs.Signal ptr, bint ptr_owner=False):
116
+ """Wrap Signal from pointer"""
117
+ cdef Signal sig = Signal.__new__(Signal)
118
+ sig.ptr = ptr
119
+ return sig
120
+
121
+ @staticmethod
122
+ def from_input(int idx) -> Signal:
123
+ """Create signal from int"""
124
+ return sig_input(idx)
125
+
126
+ @staticmethod
127
+ def from_int(int value) -> Signal:
128
+ """Create signal from int"""
129
+ return sig_int(value)
130
+
131
+ @staticmethod
132
+ def from_float(float value) -> Signal:
133
+ """Create signal from float"""
134
+ return sig_real(value)
135
+
136
+ from_real = from_float
137
+
138
+ @staticmethod
139
+ def from_soundfile(str label) -> Signal:
140
+ """Create signal from soundfile."""
141
+ return sig_soundfile(label)
142
+
143
+ @staticmethod
144
+ def from_button(str label) -> Signal:
145
+ """Create a button signal."""
146
+ return sig_button(label)
147
+
148
+ @staticmethod
149
+ def from_checkbox(str label) -> Signal:
150
+ """Create a checkbox signal."""
151
+ return sig_checkbox(label)
152
+
153
+ @staticmethod
154
+ def from_vslider(str label, init: float | Signal, min: float | Signal,
155
+ max: float | Signal, step: float | Signal) -> Signal:
156
+ """Create a vertical slider signal."""
157
+ _init = sig_or_float(init)
158
+ _min = sig_or_float(min)
159
+ _max = sig_or_float(max)
160
+ _step = sig_or_float(step)
161
+ return sig_vslider(label, _init, _min, _max, _step)
162
+
163
+ @staticmethod
164
+ def from_hslider(str label, init: float | Signal, min: float | Signal,
165
+ max: float | Signal, step: float | Signal) -> Signal:
166
+ """Create a horizontal slider signal."""
167
+ _init = sig_or_float(init)
168
+ _min = sig_or_float(min)
169
+ _max = sig_or_float(max)
170
+ _step = sig_or_float(step)
171
+ return sig_hslider(label, _init, _min, _max, _step)
172
+
173
+ @staticmethod
174
+ def from_numentry(str label, init: float | Signal, min: float | Signal,
175
+ max: float | Signal, step: float | Signal) -> Signal:
176
+ """Create a num entry signal."""
177
+ _init = sig_or_float(init)
178
+ _min = sig_or_float(min)
179
+ _max = sig_or_float(max)
180
+ _step = sig_or_float(step)
181
+ return sig_numentry(label, _init, _min, _max, _step)
182
+
183
+ @staticmethod
184
+ def from_read_only_table(n: int | Signal, Signal init, ridx: int | Signal):
185
+ """Create a read-only table.
186
+
187
+ n - the table size, a constant numerical expression (see [1])
188
+ init - the table content
189
+ ridx - the read index (an int between 0 and n-1)
190
+
191
+ returns the table signal.
192
+ """
193
+ _n = sig_or_int(n)
194
+ _ridx = sig_or_int(ridx)
195
+ return sig_readonly_table(_n, init, _ridx)
196
+
197
+ @staticmethod
198
+ def from_write_read_table(int n, Signal init, int widx, Signal wsig, int ridx):
199
+ """Create a read-write-only table.
200
+
201
+ n - the table size, a constant numerical expression (see [1])
202
+ init - the table content
203
+ widx - the write index (an integer between 0 and n-1)
204
+ wsig - the input of the table
205
+ ridx - the read index (an int between 0 and n-1)
206
+
207
+ returns the table signal.
208
+ """
209
+ _n = sig_or_int(n)
210
+ _widx = sig_or_int(widx)
211
+ _ridx = sig_or_int(ridx)
212
+ return sig_write_read_table(_n, init, _widx, wsig, _ridx)
213
+
214
+
215
+ def create_source(self, name_app: str, lang, *args) -> str:
216
+ """Create source code in a target language from a signal expression."""
217
+ return create_source_from_signals(name_app, lang, *args)
218
+
219
+ def simplify_to_normal_form(self) -> Signal:
220
+ """Simplify a signal to its normal form."""
221
+ cdef fs.Signal s = fs.simplifyToNormalForm(self.ptr)
222
+ return Signal.from_ptr(s)
223
+
224
+ def to_string(self, shared: bool = False, max_size: int = 256) -> str:
225
+ """retur this signal printed as a string."""
226
+ return print_signal(self, shared, max_size)
227
+
228
+ def print(self, shared: bool = False, max_size: int = 256):
229
+ """Print this signal."""
230
+ print(print_signal(self, shared, max_size))
231
+
232
+ def ffname(self) -> str:
233
+ """Return the name parameter of a foreign function."""
234
+ return ffname(self)
235
+
236
+ def ffarity(self) -> int:
237
+ """Return the arity of a foreign function."""
238
+ return ffarity(self)
239
+
240
+ # def get_interval(self) -> Interval:
241
+ # """Get the signal interval."""
242
+ # cdef fs.Interval *ival = <fs.Interval*>fs.getSigInterval(self.ptr)
243
+ # return Interval.from_ptr(ival)
244
+
245
+ # def set_interval(self, Interval iv):
246
+ # """Set the signal interval."""
247
+ # fs.setSigInterval(self.ptr, iv.ptr)
248
+
249
+ def attach(self, Signal other) -> Signal:
250
+ """Create an attached signal from another signal
251
+
252
+ The attach primitive takes two input signals and produces
253
+ one output signal which is a copy of the first input.
254
+
255
+ The role of attach is to force the other input signal to be
256
+ compiled with this one.
257
+ """
258
+ return sig_attach(self, other)
259
+
260
+ def vbargraph(self, str label, min: float | Signal, max: float | Signal) -> Signal:
261
+ """Create a vertical bargraph signal from this signal"""
262
+ _min = sig_or_float(min)
263
+ _max = sig_or_float(max)
264
+ return sig_vbargraph(label, _min, _max, self)
265
+
266
+ def hbargraph(self, str label, min: float | Signal, max: float | Signal) -> Signal:
267
+ """Create a horizontal bargraph signal from this signal"""
268
+ _min = sig_or_float(min)
269
+ _max = sig_or_float(max)
270
+ return sig_hbargraph(label, _min, _max, self)
271
+
272
+ def int_cast(self) -> Signal:
273
+ """Create a casted signal.
274
+
275
+ s - the signal to be casted in integer
276
+
277
+ returns the casted signal.
278
+ """
279
+ return sig_int_cast(self)
280
+
281
+
282
+ def float_cast(self) -> Signal:
283
+ """Create a casted signal.
284
+
285
+ s - the signal to be casted as float/double value (depends of -single or -double compilation parameter)
286
+
287
+ returns the casted signal.
288
+ """
289
+ return sig_float_cast(self)
290
+
291
+
292
+ def select2(self, Signal s1, Signal s2) -> Signal:
293
+ """Create a selector between two signals.
294
+
295
+ selector - when 0 at time t returns s1[t], otherwise returns s2[t]
296
+ (selector is automatically wrapped with sigIntCast)
297
+ s1 - first signal to be selected
298
+ s2 - second signal to be selected
299
+
300
+ returns the selected signal depending of the selector value at each time t.
301
+ """
302
+ return sig_select2(self, s1, s2)
303
+
304
+
305
+ def select3(self, Signal s1, Signal s2, Signal s3) -> Signal:
306
+ """Create a selector between three signals.
307
+
308
+ selector - when 0 at time t returns s1[t], when 1 at time t returns s2[t], otherwise returns s3[t]
309
+ (selector is automatically wrapped with sigIntCast)
310
+ s1 - first signal to be selected
311
+ s2 - second signal to be selected
312
+ s3 - third signal to be selected
313
+
314
+ returns the selected signal depending of the selector value at each time t.
315
+ """
316
+ return sig_select3(self, s1, s2, s3)
317
+
318
+
319
+ def recursion(self) -> Signal:
320
+ """Create a recursive signal.
321
+
322
+ Use sigSelf() to refer to the recursive signal inside
323
+ the sigRecursion expression.
324
+
325
+ s - the signal to recurse on.
326
+
327
+ returns the signal with a recursion.
328
+ """
329
+ return sig_recursion(self)
330
+
331
+
332
+ def self_rec(self) -> Signal:
333
+ """Create a recursive signal inside the sigRecursion expression.
334
+
335
+ returns the recursive signal.
336
+ """
337
+ return sig_self()
338
+
339
+ def self_n(self, int id) -> Signal:
340
+ """Create a recursive signal inside the sigRecursionN expression.
341
+
342
+ id - the recursive signal index (starting from 0, up to the number of outputs signals in the recursive block)
343
+
344
+ returns the recursive signal.
345
+ """
346
+ return sig_self_n(id)
347
+
348
+ def recursion_n(self, SignalVector rf) -> SignalVector:
349
+ """Create a recursive block of signals.
350
+
351
+ Use sigSelfN() to refer to the recursive signal inside
352
+ the sigRecursionN expression.
353
+
354
+ rf - the list of signals to recurse on.
355
+
356
+ returns the list of signals with recursions.
357
+ """
358
+ return sig_self_n(rf)
359
+
360
+
361
+ def __add__(self, Signal other) -> Signal:
362
+ """Add this signal to another."""
363
+ return sig_add(self, other)
364
+
365
+ def __radd__(self, Signal other) -> Signal:
366
+ """Reverse add this signal to another."""
367
+ return sig_add(self, other)
368
+
369
+ def __sub__(self, Signal other) -> Signal:
370
+ """Subtract this box from another."""
371
+ return sig_sub(self, other)
372
+
373
+ def __rsub__(self, Signal other) -> Signal:
374
+ """Subtract this box from another."""
375
+ return sig_sub(self, other)
376
+
377
+ def __mul__(self, Signal other) -> Signal:
378
+ """Multiply this box with another."""
379
+ return sig_mul(self, other)
380
+
381
+ def __rmul__(self, Signal other) -> Signal:
382
+ """Reverse multiply this box with another."""
383
+ return sig_mul(self, other)
384
+
385
+ def __div__(self, Signal other) -> Signal:
386
+ """Divide this box with another."""
387
+ return sig_div(self, other)
388
+
389
+ def __rdiv__(self, Signal other) -> Signal:
390
+ """Reverse divide this box with another."""
391
+ return sig_div(self, other)
392
+
393
+ def __eq__(self, Signal other):
394
+ """Compare for equality with another signal."""
395
+ return sig_eq(self, other)
396
+
397
+ def __ne__(self, Signal other):
398
+ """Assert this box is not equal with another signal."""
399
+ return sig_ne(self, other)
400
+
401
+ def __gt__(self, Signal other):
402
+ """Is this box greater than another signal."""
403
+ return sig_gt(self, other)
404
+
405
+ def __ge__(self, Signal other):
406
+ """Is this box greater than or equal from another signal."""
407
+ return sig_ge(self, other)
408
+
409
+ def __lt__(self, Signal other):
410
+ """Is this box lesser than another signal."""
411
+ return sig_lt(self, other)
412
+
413
+ def __le__(self, Signal other):
414
+ """Is this box lesser than or equal from another signal."""
415
+ return sig_le(self, other)
416
+
417
+ def __and__(self, Signal other):
418
+ """logical and with another signal."""
419
+ return sig_and(self, other)
420
+
421
+ def __or__(self, Signal other):
422
+ """logical or with another signal."""
423
+ return sig_or(self, other)
424
+
425
+ def __xor__(self, Signal other):
426
+ """logical xor with another signal."""
427
+ return sig_xor(self, other)
428
+
429
+ # TODO: check sigRem = modulo if this is correct
430
+ def __mod__(self, Signal other):
431
+ """modulo of other Signal"""
432
+ return sig_rem(self, other)
433
+
434
+ def __lshift__(self, Signal other):
435
+ """bitwise left-shift"""
436
+ return sig_leftshift(self, other)
437
+
438
+ def __rshift__(self, Signal other):
439
+ """bitwise right-shift"""
440
+ return sig_lrightshift(self, other)
441
+
442
+ # nullary funcs
443
+
444
+ def abs(self) -> Signal:
445
+ return sig_abs(self)
446
+
447
+ def acos(self) -> Signal:
448
+ return sig_acos(self)
449
+
450
+ def tan(self) -> Signal:
451
+ return sig_tan(self)
452
+
453
+ def sqrt(self) -> Signal:
454
+ return sig_sqrt(self)
455
+
456
+ def sin(self) -> Signal:
457
+ return sig_sin(self)
458
+
459
+ def rint(self) -> Signal:
460
+ return sig_rint(self)
461
+
462
+ def log(self) -> Signal:
463
+ return sig_log(self)
464
+
465
+ def log10(self) -> Signal:
466
+ return sig_log10(self)
467
+
468
+ def floor(self) -> Signal:
469
+ return sig_floor(self)
470
+
471
+ def exp(self) -> Signal:
472
+ return sig_exp(self)
473
+
474
+ def exp10(self) -> Signal:
475
+ return sig_exp10(self)
476
+
477
+ def cos(self) -> Signal:
478
+ return sig_cos(self)
479
+
480
+ def ceil(self) -> Signal:
481
+ return sig_ceil(self)
482
+
483
+ def atan(self) -> Signal:
484
+ return sig_atan(self)
485
+
486
+ def asin(self) -> Signal:
487
+ return sig_asin(self)
488
+
489
+
490
+ # binary funcs
491
+
492
+ def delay(self, d: Signal | int) -> Signal:
493
+ _d = sig_or_int(d)
494
+ return sig_delay(self, _d)
495
+
496
+ def remainder(self, Signal y) -> Signal:
497
+ return sig_remainder(self, y)
498
+
499
+ def pow(self, Signal y) -> Signal:
500
+ return sig_pow(self, y)
501
+
502
+ def min(self, Signal y) -> Signal:
503
+ return sig_min(self, y)
504
+
505
+ def max(self, Signal y) -> Signal:
506
+ return sig_max(self, y)
507
+
508
+ def fmod(self, Signal y) -> Signal:
509
+ return sig_fmod(self, y)
510
+
511
+
512
+
513
+ # boolean funcs ---------------------
514
+
515
+
516
+ def is_int(self) -> bool:
517
+ cdef int i
518
+ return fs.isSigInt(self.ptr, &i)
519
+
520
+ def is_float(self) -> bool:
521
+ cdef double f
522
+ return fs.isSigReal(self.ptr, &f)
523
+
524
+ def is_input(self) -> bool:
525
+ cdef int i
526
+ return fs.isSigInput(self.ptr, &i)
527
+
528
+ def is_output(self) -> bool:
529
+ cdef int i
530
+ cdef fs.Signal t0 = NULL
531
+ return fs.isSigOutput(self.ptr, &i, t0)
532
+
533
+ def is_delay1(self) -> bool:
534
+ cdef fs.Signal t0 = NULL
535
+ return fs.isSigDelay1(self.ptr, t0)
536
+
537
+ def is_delay(self) -> bool:
538
+ cdef fs.Signal t0 = NULL
539
+ cdef fs.Signal t1 = NULL
540
+ return fs.isSigDelay(self.ptr, t0, t1)
541
+
542
+ def is_prefix(self) -> bool:
543
+ cdef fs.Signal t0 = NULL
544
+ cdef fs.Signal t1 = NULL
545
+ return fs.isSigPrefix(self.ptr, t0, t1)
546
+
547
+ def is_read_table(self) -> bool:
548
+ cdef fs.Signal t = NULL
549
+ cdef fs.Signal i = NULL
550
+ return fs.isSigRDTbl(self.ptr, t, t)
551
+
552
+ def is_write_table(self) -> bool:
553
+ cdef fs.Signal id = NULL
554
+ cdef fs.Signal t = NULL
555
+ cdef fs.Signal i = NULL
556
+ cdef fs.Signal s = NULL
557
+ return fs.isSigWRTbl(self.ptr, id, t, i, s)
558
+
559
+ def is_gen(self) -> bool:
560
+ cdef fs.Signal x = NULL
561
+ return fs.isSigGen(self.ptr, x)
562
+
563
+ def is_doc_constant_tbl(self) -> bool:
564
+ cdef fs.Signal n = NULL
565
+ cdef fs.Signal sig = NULL
566
+ return fs.isSigDocConstantTbl(self.ptr, n, sig)
567
+
568
+ def is_doc_write_tbl(self) -> bool:
569
+ cdef fs.Signal n = NULL
570
+ cdef fs.Signal sig = NULL
571
+ cdef fs.Signal widx = NULL
572
+ cdef fs.Signal wsig = NULL
573
+ return fs.isSigDocWriteTbl(self.ptr, n, sig, widx, wsig)
574
+
575
+ def is_doc_access_tbl(self) -> bool:
576
+ cdef fs.Signal tbl = NULL
577
+ cdef fs.Signal ridx = NULL
578
+ return fs.isSigDocAccessTbl(self.ptr, tbl, ridx)
579
+
580
+ def is_select2(self) -> bool:
581
+ cdef fs.Signal selector = NULL
582
+ cdef fs.Signal s1 = NULL
583
+ cdef fs.Signal s2 = NULL
584
+ return fs.isSigSelect2(self.ptr, selector, s1, s2)
585
+
586
+ def is_assert_bounds(self) -> bool:
587
+ cdef fs.Signal s1 = NULL
588
+ cdef fs.Signal s2 = NULL
589
+ cdef fs.Signal s3 = NULL
590
+ return fs.isSigAssertBounds(self.ptr, s1, s2, s3)
591
+
592
+ def is_highest(self) -> bool:
593
+ cdef fs.Signal s = NULL
594
+ return fs.isSigHighest(self.ptr, s)
595
+
596
+ def is_lowest(self) -> bool:
597
+ cdef fs.Signal s = NULL
598
+ return fs.isSigLowest(self.ptr, s)
599
+
600
+ def is_bin_op(self) -> bool:
601
+ cdef int op = 0
602
+ cdef fs.Signal x = NULL
603
+ cdef fs.Signal y = NULL
604
+ return fs.isSigBinOp(self.ptr, &op, x, y)
605
+
606
+ def is_ffun(self) -> bool:
607
+ cdef fs.Signal ff = NULL
608
+ cdef fs.Signal largs = NULL
609
+ return fs.isSigFFun(self.ptr, ff, largs)
610
+
611
+ def is_fconst(self) -> bool:
612
+ cdef fs.Signal type = NULL
613
+ cdef fs.Signal name = NULL
614
+ cdef fs.Signal file = NULL
615
+ return fs.isSigFConst(self.ptr, type, name, file)
616
+
617
+ def is_fvar(self) -> bool:
618
+ cdef fs.Signal type = NULL
619
+ cdef fs.Signal name = NULL
620
+ cdef fs.Signal file = NULL
621
+ return fs.isSigFVar(self.ptr, type, name, file)
622
+
623
+ def is_proj(self) -> bool:
624
+ cdef int i = 0
625
+ cdef fs.Signal rgroup = NULL
626
+ return fs.isProj(self.ptr, &i, rgroup)
627
+
628
+ def is_rec(self) -> bool:
629
+ cdef fs.Signal var = NULL
630
+ cdef fs.Signal body = NULL
631
+ return fs.isRec(self.ptr, var, body)
632
+
633
+ def is_int_cast(self) -> bool:
634
+ cdef fs.Signal x = NULL
635
+ return fs.isSigIntCast(self.ptr, x)
636
+
637
+ def is_float_cast(self) -> bool:
638
+ cdef fs.Signal x = NULL
639
+ return fs.isSigFloatCast(self.ptr, x)
640
+
641
+ def is_button(self) -> bool:
642
+ cdef fs.Signal lbl = NULL
643
+ return fs.isSigButton(self.ptr, lbl)
644
+
645
+ def is_checkbox(self) -> bool:
646
+ cdef fs.Signal lbl = NULL
647
+ return fs.isSigCheckbox(self.ptr, lbl)
648
+
649
+ def is_waveform(self) -> bool:
650
+ return fs.isSigWaveform(self.ptr)
651
+
652
+ def is_hslider(self) -> bool:
653
+ cdef fs.Signal lbl = NULL
654
+ cdef fs.Signal init = NULL
655
+ cdef fs.Signal min = NULL
656
+ cdef fs.Signal max = NULL
657
+ cdef fs.Signal step = NULL
658
+ return fs.isSigHSlider(self.ptr, lbl, init, min, max, step)
659
+
660
+ def is_vslider(self) -> bool:
661
+ cdef fs.Signal lbl = NULL
662
+ cdef fs.Signal init = NULL
663
+ cdef fs.Signal min = NULL
664
+ cdef fs.Signal max = NULL
665
+ cdef fs.Signal step = NULL
666
+ return fs.isSigVSlider(self.ptr, lbl, init, min, max, step)
667
+
668
+ def is_num_entry(self) -> bool:
669
+ cdef fs.Signal lbl = NULL
670
+ cdef fs.Signal init = NULL
671
+ cdef fs.Signal min = NULL
672
+ cdef fs.Signal max = NULL
673
+ cdef fs.Signal step = NULL
674
+ return fs.isSigNumEntry(self.ptr, lbl, init, min, max, step)
675
+
676
+ def is_hbargraph(self) -> bool:
677
+ cdef fs.Signal lbl = NULL
678
+ cdef fs.Signal min = NULL
679
+ cdef fs.Signal max = NULL
680
+ cdef fs.Signal x = NULL
681
+ return fs.isSigHBargraph(self.ptr, lbl, min, max, x)
682
+
683
+ def is_vbargraph(self) -> bool:
684
+ cdef fs.Signal lbl = NULL
685
+ cdef fs.Signal min = NULL
686
+ cdef fs.Signal max = NULL
687
+ cdef fs.Signal x = NULL
688
+ return fs.isSigVBargraph(self.ptr, lbl, min, max, x)
689
+
690
+ def is_attach(self) -> bool:
691
+ cdef fs.Signal s0 = NULL
692
+ cdef fs.Signal s1 = NULL
693
+ return fs.isSigAttach(self.ptr, s0, s1)
694
+
695
+ def is_enable(self) -> bool:
696
+ cdef fs.Signal s0 = NULL
697
+ cdef fs.Signal s1 = NULL
698
+ return fs.isSigEnable(self.ptr, s0, s1)
699
+
700
+ def is_control(self) -> bool:
701
+ cdef fs.Signal s0 = NULL
702
+ cdef fs.Signal s1 = NULL
703
+ return fs.isSigControl(self.ptr, s0, s1)
704
+
705
+ def is_soundfile(self) -> bool:
706
+ cdef fs.Signal label = NULL
707
+ return fs.isSigSoundfile(self.ptr, label)
708
+
709
+ def is_soundfile_length(self) -> bool:
710
+ cdef fs.Signal sf = NULL
711
+ cdef fs.Signal part = NULL
712
+ return fs.isSigSoundfileLength(self.ptr, sf, part)
713
+
714
+ def is_soundfile_rate(self) -> bool:
715
+ cdef fs.Signal sf = NULL
716
+ cdef fs.Signal part = NULL
717
+ return fs.isSigSoundfileLength(self.ptr, sf, part)
718
+
719
+ def is_soundfile_buffer(self) -> bool:
720
+ cdef fs.Signal sf = NULL
721
+ cdef fs.Signal chan = NULL
722
+ cdef fs.Signal part = NULL
723
+ cdef fs.Signal ridx = NULL
724
+ return fs.isSigSoundfileBuffer(self.ptr, sf, chan, part, ridx)
725
+
726
+
727
+
728
+
729
+ def ffname(Signal s) -> str:
730
+ """Return the name parameter of a foreign function.
731
+
732
+ s - the signal
733
+ returns the name
734
+ """
735
+ return fs.ffname(s.ptr).decode()
736
+
737
+
738
+ def ffarity(Signal s) -> int:
739
+ """Return the arity of a foreign function.
740
+
741
+ s - the signal
742
+ returns the name
743
+ """
744
+ return fs.ffarity(s.ptr)
745
+
746
+
747
+ def print_signal(Signal sig, bint shared, int max_size) -> str:
748
+ """Print the signal.
749
+
750
+ sig - the signal to be printed
751
+ shared - whether the identical sub signals are printed as identifiers
752
+ max_size - the maximum number of characters to be printed (possibly needed for big expressions in non shared mode)
753
+
754
+ returns the printed signal as a string
755
+ """
756
+ return fs.printSignal(sig.ptr, shared, max_size).decode()
757
+
758
+ def create_lib_context():
759
+ """Create global compilation context, has to be done first.
760
+ """
761
+ fs.createLibContext()
762
+
763
+ def destroy_lib_context():
764
+ """Destroy global compilation context, has to be done last.
765
+ """
766
+ fs.destroyLibContext()
767
+
768
+ # def get_sig_interval(Signal s) -> Interval:
769
+ # """Get the signal interval.
770
+
771
+ # s - the signal
772
+
773
+ # returns the signal interval
774
+ # """
775
+ # cdef fs.Interval ival = fs.getSigInterval(s.ptr)
776
+ # return Interval.from_ptr(ival)
777
+
778
+ # def set_sig_interval(Signal s, Interval inter):
779
+ # """Set the signal interval.
780
+
781
+ # s - the signal
782
+
783
+ # inter - the signal interval
784
+ # """
785
+ # fs.setSigInterval(s.ptr, inter.ptr)
786
+
787
+ def is_nil(Signal s) -> bool:
788
+ """Check if a signal is nil.
789
+
790
+ s - the signal
791
+
792
+ returns true if the signal is nil, otherwise false.
793
+ """
794
+ return fs.isNil(s.ptr)
795
+
796
+
797
+ def tree2str(Signal s):
798
+ """Convert a signal (such as the label of a UI) to a string.
799
+
800
+ s - the signal to convert
801
+
802
+ returns a string representation of a signal.
803
+ """
804
+ return fs.tree2str(s.ptr).decode()
805
+
806
+
807
+ # cdef void* getUserData(fs.Signal s):
808
+ # """Return the xtended type of a signal.
809
+
810
+ # s - the signal whose xtended type to return
811
+
812
+ # returns a pointer to xtended type if it exists, otherwise nullptr.
813
+ # """
814
+ # return <void*>fs.getUserData(s)
815
+
816
+
817
+ def xtended_arity(Signal s) -> int:
818
+ """Return the arity of the xtended signal.
819
+
820
+ s - the xtended signal
821
+
822
+ returns the arity of the xtended signal.
823
+ """
824
+ return fs.xtendedArity(s.ptr)
825
+
826
+
827
+ def xtended_name(Signal s):
828
+ """Return the name of the xtended signal.
829
+
830
+ s - the xtended signal
831
+
832
+ returns the name of the xtended signal.
833
+ """
834
+ return fs.xtendedName(s.ptr).decode()
835
+
836
+
837
+ def sig_int(int n) -> Signal:
838
+ """Constant integer : for all t, x(t) = n.
839
+
840
+ n - the integer
841
+
842
+ returns the integer signal.
843
+ """
844
+ cdef fs.Signal s = fs.sigInt(n)
845
+ return Signal.from_ptr(s)
846
+
847
+
848
+ def sig_real(float n) -> Signal:
849
+ """Constant real : for all t, x(t) = n.
850
+
851
+ n - the float/double value (depends of -single or -double compilation parameter)
852
+
853
+ returns the float/double signal.
854
+ """
855
+ cdef fs.Signal s = fs.sigReal(n)
856
+ return Signal.from_ptr(s)
857
+
858
+ sig_float = sig_real
859
+
860
+ def sig_input(int idx) -> Signal:
861
+ """Create an input.
862
+
863
+ idx - the input index
864
+
865
+ returns the input signal.
866
+ """
867
+ cdef fs.Signal s = fs.sigInput(idx)
868
+ return Signal.from_ptr(s)
869
+
870
+
871
+ def sig_delay(Signal s, Signal d) -> Signal:
872
+ """Create a delayed signal.
873
+
874
+ s - the signal to be delayed
875
+ d - the delay signal that doesn't have to be fixed but must be bounded and cannot be negative
876
+
877
+ returns the delayed signal.
878
+ """
879
+ cdef fs.Signal _s = fs.sigDelay(s.ptr, d.ptr)
880
+ return Signal.from_ptr(_s)
881
+
882
+
883
+ def sig_delay1(Signal s) -> Signal:
884
+ """Create a one sample delayed signal.
885
+
886
+ s - the signal to be delayed
887
+
888
+ returns the delayed signal.
889
+ """
890
+ cdef fs.Signal _s = fs.sigDelay1(s.ptr)
891
+ return Signal.from_ptr(_s)
892
+
893
+
894
+ def sig_int_cast(Signal s) -> Signal:
895
+ """Create a casted signal.
896
+
897
+ s - the signal to be casted in integer
898
+
899
+ returns the casted signal.
900
+ """
901
+ cdef fs.Signal _s = fs.sigIntCast(s.ptr)
902
+ return Signal.from_ptr(_s)
903
+
904
+
905
+ def sig_float_cast(Signal s) -> Signal:
906
+ """Create a casted signal.
907
+
908
+ s - the signal to be casted as float/double value (depends of -single or -double compilation parameter)
909
+
910
+ returns the casted signal.
911
+ """
912
+ cdef fs.Signal _s = fs.sigFloatCast(s.ptr)
913
+ return Signal.from_ptr(_s)
914
+
915
+
916
+ def sig_readonly_table(Signal n, Signal init, Signal ridx) -> Signal:
917
+ """Create a read only table.
918
+
919
+ n - the table size, a constant numerical expression (see [1])
920
+ init - the table content
921
+ ridx - the read index (an int between 0 and n-1)
922
+
923
+ returns the table signal.
924
+ """
925
+ cdef fs.Signal s = fs.sigReadOnlyTable(n.ptr, init.ptr, ridx.ptr)
926
+ return Signal.from_ptr(s)
927
+
928
+
929
+ def sig_write_read_table(Signal n, Signal init, Signal widx, Signal wsig, Signal ridx) -> Signal:
930
+ """Create a read/write table.
931
+
932
+ n - the table size, a constant numerical expression (see [1])
933
+ init - the table content
934
+ widx - the write index (an integer between 0 and n-1)
935
+ wsig - the input of the table
936
+ ridx - the read index (an integer between 0 and n-1)
937
+
938
+ returns the table signal.
939
+ """
940
+ cdef fs.Signal s = fs.sigWriteReadTable(
941
+ n.ptr, init.ptr, widx.ptr, wsig.ptr, ridx.ptr)
942
+ return Signal.from_ptr(s)
943
+
944
+
945
+ def sig_waveform_int(int[:] view not None) -> Signal:
946
+ """Create a waveform from a memoryview of ints
947
+
948
+ view - memorview of ints
949
+
950
+ returns the waveform signal.
951
+ """
952
+ cdef size_t i, n
953
+ cdef fs.tvec wfv
954
+ n = view.shape[0]
955
+ for i in range(n):
956
+ wfv.push_back(fs.sigInt(view[i]))
957
+ cdef fs.Signal wf = fs.sigWaveform(wfv)
958
+ return Signal.from_ptr(wf)
959
+
960
+ def sig_waveform_float(float[:] view not None) -> Signal:
961
+ """Create a waveform from a memoryview of floats
962
+
963
+ view - memorview of floats
964
+
965
+ returns the waveform signal.
966
+ """
967
+ cdef size_t i, n
968
+ cdef fs.tvec wfv
969
+ n = view.shape[0]
970
+ for i in range(n):
971
+ wfv.push_back(fs.sigReal(view[i]))
972
+ cdef fs.Signal wf = fs.sigWaveform(wfv)
973
+ return Signal.from_ptr(wf)
974
+
975
+
976
+ def sig_soundfile(*paths) -> Signal:
977
+ """Create a soundfile block.
978
+
979
+ label - of form "label[url:{'path1''path2''path3'}]"
980
+ to describe a list of soundfiles
981
+
982
+ returns the soundfile block.
983
+ """
984
+ ps = "".join(repr(p) for p in paths)
985
+ label = f"label[url:{ps}]"
986
+ cdef fs.Signal s = fs.sigSoundfile(label.encode('utf8'))
987
+ return Signal.from_ptr(s)
988
+
989
+ def sig_soundfile_length(Signal sf, Signal part) -> Signal:
990
+ """Create the length signal of a given soundfile in frames.
991
+
992
+ sf - the soundfile
993
+ part - in the [0..255] range to select a given sound number,
994
+ a constant numerical expression (see [1])
995
+
996
+ returns the soundfile length signal.
997
+ """
998
+ cdef fs.Signal s = fs.sigSoundfileLength(sf.ptr, part.ptr)
999
+ return Signal.from_ptr(s)
1000
+
1001
+ def sig_soundfile_rate(Signal sf, Signal part) -> Signal:
1002
+ """Create the rate signal of a given soundfile in Hz.
1003
+
1004
+ sf - the soundfile
1005
+ part - in the [0..255] range to select a given sound number, a constant numerical expression (see [1])
1006
+
1007
+ returns the soundfile rate signal.
1008
+ """
1009
+ cdef fs.Signal s = fs.sigSoundfileRate(sf.ptr, part.ptr)
1010
+ return Signal.from_ptr(s)
1011
+
1012
+
1013
+ def sig_soundfile_buffer(Signal sf, Signal chan, Signal part, Signal ridx) -> Signal:
1014
+ """Create the buffer signal of a given soundfile.
1015
+
1016
+ sf - the soundfile
1017
+ chan - an integer to select a given channel, a constant numerical expression (see [1])
1018
+ part - in the [0..255] range to select a given sound number, a constant numerical expression (see [1])
1019
+ ridx - the read index (an integer between 0 and the selected sound length)
1020
+
1021
+ returns the soundfile buffer signal.
1022
+ """
1023
+ cdef fs.Signal s = fs.sigSoundfileBuffer(sf.ptr, chan.ptr, part.ptr, ridx.ptr)
1024
+ return Signal.from_ptr(s)
1025
+
1026
+ def sig_select2(Signal selector, Signal s1, Signal s2) -> Signal:
1027
+ """Create a selector between two signals.
1028
+
1029
+ selector - when 0 at time t returns s1[t], otherwise returns s2[t]
1030
+ (selector is automatically wrapped with sigIntCast)
1031
+ s1 - first signal to be selected
1032
+ s2 - second signal to be selected
1033
+
1034
+ returns the selected signal depending of the selector value at each time t.
1035
+ """
1036
+ cdef fs.Signal s = fs.sigSelect2(selector.ptr, s1.ptr, s2.ptr)
1037
+ return Signal.from_ptr(s)
1038
+
1039
+
1040
+ def sig_select3(Signal selector, Signal s1, Signal s2, Signal s3) -> Signal:
1041
+ """Create a selector between three signals.
1042
+
1043
+ selector - when 0 at time t returns s1[t], when 1 at time t returns s2[t], otherwise returns s3[t]
1044
+ (selector is automatically wrapped with sigIntCast)
1045
+ s1 - first signal to be selected
1046
+ s2 - second signal to be selected
1047
+ s3 - third signal to be selected
1048
+
1049
+ returns the selected signal depending of the selector value at each time t.
1050
+ """
1051
+ cdef fs.Signal s = fs.sigSelect3(selector.ptr, s1.ptr, s2.ptr, s3.ptr)
1052
+ return Signal.from_ptr(s)
1053
+
1054
+
1055
+ def sig_fconst(fs.SType type, str name, str file) -> Signal:
1056
+ """Create a foreign constant signal.
1057
+
1058
+ type - the foreign constant type of SType
1059
+ name - the foreign constant name
1060
+ file - the include file where the foreign constant is defined
1061
+
1062
+ returns the foreign constant signal.
1063
+ """
1064
+ cdef fs.Signal s = fs.sigFConst(
1065
+ type,
1066
+ name.encode('utf8'),
1067
+ file.encode('utf8'))
1068
+ return Signal.from_ptr(s)
1069
+
1070
+
1071
+ def sig_fvar(fs.SType type, str name, str file) -> Signal:
1072
+ """Create a foreign variable signal.
1073
+
1074
+ type - the foreign variable type of SType
1075
+ name - the foreign variable name
1076
+ file - the include file where the foreign variable is defined
1077
+
1078
+ returns the foreign variable signal.
1079
+ """
1080
+ cdef fs.Signal s = fs.sigFVar(
1081
+ type,
1082
+ name.encode('utf8'),
1083
+ file.encode('utf8'))
1084
+ return Signal.from_ptr(s)
1085
+
1086
+
1087
+ def sig_bin_op(fs.SOperator op, Signal x, Signal y) -> Signal:
1088
+ """Generic binary mathematical functions.
1089
+
1090
+ op - the operator in SOperator set
1091
+ x - first signal
1092
+ y - second signal
1093
+
1094
+ returns the result signal of op(x, y).
1095
+ """
1096
+ cdef fs.Signal s = fs.sigBinOp(op, x.ptr, y.ptr)
1097
+ return Signal.from_ptr(s)
1098
+
1099
+
1100
+ # -----------------------------------------------
1101
+ # Specific binary mathematical functions.
1102
+ # x - first signal
1103
+ # y - second signal
1104
+ # returns the result signal of fun(x,y).
1105
+
1106
+ def sig_add(Signal x, Signal y) -> Signal:
1107
+ cdef fs.Signal s = fs.sigAdd(x.ptr, y.ptr)
1108
+ return Signal.from_ptr(s)
1109
+
1110
+ def sig_sub(Signal x, Signal y) -> Signal:
1111
+ cdef fs.Signal s = fs.sigSub(x.ptr, y.ptr)
1112
+ return Signal.from_ptr(s)
1113
+
1114
+ def sig_mul(Signal x, Signal y) -> Signal:
1115
+ cdef fs.Signal s = fs.sigMul(x.ptr, y.ptr)
1116
+ return Signal.from_ptr(s)
1117
+
1118
+ def sig_div(Signal x, Signal y) -> Signal:
1119
+ cdef fs.Signal s = fs.sigDiv(x.ptr, y.ptr)
1120
+ return Signal.from_ptr(s)
1121
+
1122
+ def sig_rem(Signal x, Signal y) -> Signal:
1123
+ cdef fs.Signal s = fs.sigRem(x.ptr, y.ptr)
1124
+ return Signal.from_ptr(s)
1125
+
1126
+ def sig_leftshift(Signal x, Signal y) -> Signal:
1127
+ cdef fs.Signal s = fs.sigLeftShift(x.ptr, y.ptr)
1128
+ return Signal.from_ptr(s)
1129
+
1130
+ def sig_lrightshift(Signal x, Signal y) -> Signal:
1131
+ cdef fs.Signal s = fs.sigLRightShift(x.ptr, y.ptr)
1132
+ return Signal.from_ptr(s)
1133
+
1134
+ def sig_arightshift(Signal x, Signal y) -> Signal:
1135
+ cdef fs.Signal s = fs.sigARightShift(x.ptr, y.ptr)
1136
+ return Signal.from_ptr(s)
1137
+
1138
+ def sig_gt(Signal x, Signal y) -> Signal:
1139
+ cdef fs.Signal s = fs.sigGT(x.ptr, y.ptr)
1140
+ return Signal.from_ptr(s)
1141
+
1142
+ def sig_lt(Signal x, Signal y) -> Signal:
1143
+ cdef fs.Signal s = fs.sigLT(x.ptr, y.ptr)
1144
+ return Signal.from_ptr(s)
1145
+
1146
+ def sig_ge(Signal x, Signal y) -> Signal:
1147
+ cdef fs.Signal s = fs.sigGE(x.ptr, y.ptr)
1148
+ return Signal.from_ptr(s)
1149
+
1150
+ def sig_le(Signal x, Signal y) -> Signal:
1151
+ cdef fs.Signal s = fs.sigLE(x.ptr, y.ptr)
1152
+ return Signal.from_ptr(s)
1153
+
1154
+ def sig_eq(Signal x, Signal y) -> Signal:
1155
+ cdef fs.Signal s = fs.sigEQ(x.ptr, y.ptr)
1156
+ return Signal.from_ptr(s)
1157
+
1158
+ def sig_ne(Signal x, Signal y) -> Signal:
1159
+ cdef fs.Signal s = fs.sigNE(x.ptr, y.ptr)
1160
+ return Signal.from_ptr(s)
1161
+
1162
+ def sig_and(Signal x, Signal y) -> Signal:
1163
+ cdef fs.Signal s = fs.sigAND(x.ptr, y.ptr)
1164
+ return Signal.from_ptr(s)
1165
+
1166
+ def sig_or(Signal x, Signal y) -> Signal:
1167
+ cdef fs.Signal s = fs.sigOR(x.ptr, y.ptr)
1168
+ return Signal.from_ptr(s)
1169
+
1170
+ def sig_xor(Signal x, Signal y) -> Signal:
1171
+ cdef fs.Signal s = fs.sigXOR(x.ptr, y.ptr)
1172
+ return Signal.from_ptr(s)
1173
+
1174
+
1175
+ # -----------------------------------------------
1176
+ # Extended unary mathematical functions
1177
+
1178
+ def sig_abs(Signal x) -> Signal:
1179
+ cdef fs.Signal s = fs.sigAbs(x.ptr)
1180
+ return Signal.from_ptr(s)
1181
+
1182
+ def sig_acos(Signal x) -> Signal:
1183
+ cdef fs.Signal s = fs.sigAcos(x.ptr)
1184
+ return Signal.from_ptr(s)
1185
+
1186
+ def sig_tan(Signal x) -> Signal:
1187
+ cdef fs.Signal s = fs.sigTan(x.ptr)
1188
+ return Signal.from_ptr(s)
1189
+
1190
+ def sig_sqrt(Signal x) -> Signal:
1191
+ cdef fs.Signal s = fs.sigSqrt(x.ptr)
1192
+ return Signal.from_ptr(s)
1193
+
1194
+ def sig_sin(Signal x) -> Signal:
1195
+ cdef fs.Signal s = fs.sigSin(x.ptr)
1196
+ return Signal.from_ptr(s)
1197
+
1198
+ def sig_rint(Signal x) -> Signal:
1199
+ cdef fs.Signal s = fs.sigRint(x.ptr)
1200
+ return Signal.from_ptr(s)
1201
+
1202
+ def sig_log(Signal x) -> Signal:
1203
+ cdef fs.Signal s = fs.sigLog(x.ptr)
1204
+ return Signal.from_ptr(s)
1205
+
1206
+ def sig_log10(Signal x) -> Signal:
1207
+ cdef fs.Signal s = fs.sigLog10(x.ptr)
1208
+ return Signal.from_ptr(s)
1209
+
1210
+ def sig_floor(Signal x) -> Signal:
1211
+ cdef fs.Signal s = fs.sigFloor(x.ptr)
1212
+ return Signal.from_ptr(s)
1213
+
1214
+ def sig_exp(Signal x) -> Signal:
1215
+ cdef fs.Signal s = fs.sigExp(x.ptr)
1216
+ return Signal.from_ptr(s)
1217
+
1218
+ def sig_exp10(Signal x) -> Signal:
1219
+ cdef fs.Signal s = fs.sigExp10(x.ptr)
1220
+ return Signal.from_ptr(s)
1221
+
1222
+ def sig_cos(Signal x) -> Signal:
1223
+ cdef fs.Signal s = fs.sigCos(x.ptr)
1224
+ return Signal.from_ptr(s)
1225
+
1226
+ def sig_ceil(Signal x) -> Signal:
1227
+ cdef fs.Signal s = fs.sigCeil(x.ptr)
1228
+ return Signal.from_ptr(s)
1229
+
1230
+ def sig_atan(Signal x) -> Signal:
1231
+ cdef fs.Signal s = fs.sigAtan(x.ptr)
1232
+ return Signal.from_ptr(s)
1233
+
1234
+ def sig_asin(Signal x) -> Signal:
1235
+ cdef fs.Signal s = fs.sigAsin(x.ptr)
1236
+ return Signal.from_ptr(s)
1237
+
1238
+ # -----------------------------------------------
1239
+ # Extended binary mathematical functions.
1240
+
1241
+ def sig_remainder(Signal x, Signal y) -> Signal:
1242
+ cdef fs.Signal s = fs.sigRemainder(x.ptr, y.ptr)
1243
+ return Signal.from_ptr(s)
1244
+
1245
+ def sig_pow(Signal x, Signal y) -> Signal:
1246
+ cdef fs.Signal s = fs.sigPow(x.ptr, y.ptr)
1247
+ return Signal.from_ptr(s)
1248
+
1249
+ def sig_min(Signal x, Signal y) -> Signal:
1250
+ cdef fs.Signal s = fs.sigMin(x.ptr, y.ptr)
1251
+ return Signal.from_ptr(s)
1252
+
1253
+ def sig_max(Signal x, Signal y) -> Signal:
1254
+ cdef fs.Signal s = fs.sigMax(x.ptr, y.ptr)
1255
+ return Signal.from_ptr(s)
1256
+
1257
+ def sig_fmod(Signal x, Signal y) -> Signal:
1258
+ cdef fs.Signal s = fs.sigFmod(x.ptr, y.ptr)
1259
+ return Signal.from_ptr(s)
1260
+
1261
+ def sig_atan2(Signal x, Signal y) -> Signal:
1262
+ cdef fs.Signal s = fs.sigAtan2(x.ptr, y.ptr)
1263
+ return Signal.from_ptr(s)
1264
+
1265
+
1266
+ # -----------------------------------------------
1267
+
1268
+ def sig_self() -> Signal:
1269
+ """Create a recursive signal inside the sigRecursion expression.
1270
+
1271
+ returns the recursive signal.
1272
+ """
1273
+ cdef fs.Signal s = fs.sigSelf()
1274
+ return Signal.from_ptr(s)
1275
+
1276
+ def sig_recursion(Signal s) -> Signal:
1277
+ """Create a recursive signal. Use sigSelf() to refer to the
1278
+ recursive signal inside the sigRecursion expression.
1279
+
1280
+ s - the signal to recurse on.
1281
+
1282
+ returns the signal with a recursion.
1283
+ """
1284
+ cdef fs.Signal _s = fs.sigRecursion(s.ptr)
1285
+ return Signal.from_ptr(_s)
1286
+
1287
+ def sig_self_n(int id) -> Signal:
1288
+ """Create a recursive signal inside the sigRecursionN expression.
1289
+
1290
+ id - the recursive signal index (starting from 0, up to the number of outputs signals in the recursive block)
1291
+
1292
+ returns the recursive signal.
1293
+ """
1294
+ cdef fs.Signal s = fs.sigSelfN(id)
1295
+ return Signal.from_ptr(s)
1296
+
1297
+ def sig_recursion_n(SignalVector rf) -> SignalVector:
1298
+ """Create a recursive block of signals.
1299
+
1300
+ Use sigSelfN() to refer to the recursive signal inside
1301
+ the sigRecursionN expression.
1302
+
1303
+ rf - the list of signals to recurse on.
1304
+
1305
+ returns the list of signals with recursions.
1306
+ """
1307
+ cdef fs.tvec rv = fs.sigRecursionN(rf.ptr)
1308
+ return SignalVector.from_ptr(rv)
1309
+
1310
+
1311
+ def sig_button(str label) -> Signal:
1312
+ """Create a button signal.
1313
+
1314
+ label - the label definition (see [2])
1315
+
1316
+ returns the button signal.
1317
+ """
1318
+ cdef fs.Signal s = fs.sigButton(label.encode('utf8'))
1319
+ return Signal.from_ptr(s)
1320
+
1321
+
1322
+ def sig_checkbox(str label) -> Signal:
1323
+ """Create a checkbox signal.
1324
+
1325
+ label - the label definition (see [2])
1326
+
1327
+ returns the checkbox signal.
1328
+ """
1329
+ cdef fs.Signal s = fs.sigCheckbox(label.encode('utf8'))
1330
+ return Signal.from_ptr(s)
1331
+
1332
+
1333
+ def sig_vslider(str label, Signal init, Signal min, Signal max, Signal step) -> Signal:
1334
+ """Create a vertical slider signal.
1335
+
1336
+ label - the label definition (see [2])
1337
+ init - the init signal, a constant numerical expression (see [1])
1338
+ min - the min signal, a constant numerical expression (see [1])
1339
+ max - the max signal, a constant numerical expression (see [1])
1340
+ step - the step signal, a constant numerical expression (see [1])
1341
+
1342
+ returns the vertical slider signal.
1343
+ """
1344
+ cdef fs.Signal s = fs.sigVSlider(
1345
+ label.encode('utf8'),
1346
+ init.ptr,
1347
+ min.ptr,
1348
+ max.ptr,
1349
+ step.ptr,
1350
+ )
1351
+ return Signal.from_ptr(s)
1352
+
1353
+
1354
+ def sig_hslider(str label, Signal init, Signal min, Signal max, Signal step) -> Signal:
1355
+ """Create an horizontal slider signal.
1356
+
1357
+ label - the label definition (see [2])
1358
+ init - the init signal, a constant numerical expression (see [1])
1359
+ min - the min signal, a constant numerical expression (see [1])
1360
+ max - the max signal, a constant numerical expression (see [1])
1361
+ step - the step signal, a constant numerical expression (see [1])
1362
+
1363
+ returns the horizontal slider signal.
1364
+ """
1365
+ cdef fs.Signal s = fs.sigHSlider(
1366
+ label.encode('utf8'),
1367
+ init.ptr,
1368
+ min.ptr,
1369
+ max.ptr,
1370
+ step.ptr,
1371
+ )
1372
+ return Signal.from_ptr(s)
1373
+
1374
+
1375
+ def sig_numentry(str label, Signal init, Signal min, Signal max, Signal step) -> Signal:
1376
+ """Create a num entry signal.
1377
+
1378
+ label - the label definition (see [2])
1379
+ init - the init signal, a constant numerical expression (see [1])
1380
+ min - the min signal, a constant numerical expression (see [1])
1381
+ max - the max signal, a constant numerical expression (see [1])
1382
+ step - the step signal, a constant numerical expression (see [1])
1383
+
1384
+ returns the num entry signal.
1385
+ """
1386
+ cdef fs.Signal s = fs.sigNumEntry(
1387
+ label.encode('utf8'),
1388
+ init.ptr,
1389
+ min.ptr,
1390
+ max.ptr,
1391
+ step.ptr,
1392
+ )
1393
+ return Signal.from_ptr(s)
1394
+
1395
+
1396
+ def sig_vbargraph(str label, Signal min, Signal max, Signal s):
1397
+ """Create a vertical bargraph signal.
1398
+
1399
+ label - the label definition (see [2])
1400
+ min - the min signal, a constant numerical expression (see [1])
1401
+ max - the max signal, a constant numerical expression (see [1])
1402
+ s - the input signal
1403
+
1404
+ returns the vertical bargraph signal.
1405
+ """
1406
+ cdef fs.Signal _s = fs.sigVBargraph(
1407
+ label.encode('utf8'),
1408
+ min.ptr,
1409
+ max.ptr,
1410
+ s.ptr,
1411
+ )
1412
+ return Signal.from_ptr(_s)
1413
+
1414
+
1415
+ def sig_hbargraph(str label, Signal min, Signal max, Signal s):
1416
+ """Create an horizontal bargraph signal.
1417
+
1418
+ label - the label definition (see [2])
1419
+ min - the min signal, a constant numerical expression (see [1])
1420
+ max - the max signal, a constant numerical expression (see [1])
1421
+ s - the input signal
1422
+
1423
+ returns the horizontal bargraph signal.
1424
+ """
1425
+ cdef fs.Signal _s = fs.sigHBargraph(
1426
+ label.encode('utf8'),
1427
+ min.ptr,
1428
+ max.ptr,
1429
+ s.ptr,
1430
+ )
1431
+ return Signal.from_ptr(_s)
1432
+
1433
+
1434
+
1435
+ def sig_attach(Signal s1, Signal s2) -> Signal:
1436
+ """Create an attach signal.
1437
+
1438
+ The attach primitive takes two input signals and produces one output signal
1439
+ which is a copy of the first input. The role of attach is to force
1440
+ its second input signal to be compiled with the first one.
1441
+
1442
+ s1 - the first signal
1443
+ s2 - the second signal
1444
+
1445
+ returns the attach signal.
1446
+ """
1447
+ cdef fs.Signal s = fs.sigAttach(s1.ptr, s2.ptr)
1448
+ return Signal.from_ptr(s)
1449
+
1450
+
1451
+
1452
+
1453
+ # Test each signal and fill additional signal specific parameters.
1454
+ # returns true and fill the specific parameters if the signal is of a given type, false otherwise
1455
+
1456
+ def is_sig_int(Signal t) -> dict:
1457
+ cdef int i = 0
1458
+ if fs.isSigInt(t.ptr, &i):
1459
+ return dict(i=i)
1460
+ else:
1461
+ return {}
1462
+
1463
+ def is_sig_float(Signal t) -> dict:
1464
+ cdef double r = 0.0
1465
+ if fs.isSigReal(t.ptr, &r):
1466
+ return dict(r=r)
1467
+ else:
1468
+ return {}
1469
+
1470
+ is_sig_real = is_sig_float
1471
+
1472
+ def is_sig_input(Signal t) -> dict:
1473
+ cdef int i = 0
1474
+ if fs.isSigInput(t.ptr, &i):
1475
+ return dict(i=i)
1476
+ else:
1477
+ return {}
1478
+
1479
+ def is_sig_output(Signal t) -> dict:
1480
+ cdef int i = 0
1481
+ cdef fs.Signal t0 = NULL
1482
+ if fs.isSigOutput(t.ptr, &i, t0):
1483
+ return dict(i=i, t0=Signal.from_ptr(t0))
1484
+ else:
1485
+ return {}
1486
+
1487
+ def is_sig_delay1(Signal t) -> dict:
1488
+ cdef fs.Signal t0 = NULL
1489
+ if fs.isSigDelay1(t.ptr, t0):
1490
+ return dict(t0=Signal.from_ptr(t0))
1491
+ else:
1492
+ return {}
1493
+
1494
+ def is_sig_delay(Signal t) -> dict:
1495
+ cdef fs.Signal t0 = NULL
1496
+ cdef fs.Signal t1 = NULL
1497
+ if fs.isSigDelay(t.ptr, t0, t1):
1498
+ return dict(
1499
+ t0=Signal.from_ptr(t0),
1500
+ t1=Signal.from_ptr(t1),
1501
+ )
1502
+ else:
1503
+ return {}
1504
+
1505
+
1506
+ def is_sig_prefix(Signal t) -> dict:
1507
+ cdef fs.Signal t0 = NULL
1508
+ cdef fs.Signal t1 = NULL
1509
+ if fs.isSigPrefix(t.ptr, t0, t1):
1510
+ return dict(
1511
+ t0=Signal.from_ptr(t0),
1512
+ t1=Signal.from_ptr(t1),
1513
+ )
1514
+ else:
1515
+ return {}
1516
+
1517
+
1518
+ def is_sig_readonly_table(Signal s) -> dict:
1519
+ cdef fs.Signal t = NULL
1520
+ cdef fs.Signal i = NULL
1521
+ if fs.isSigRDTbl(s.ptr, t, i):
1522
+ return dict(
1523
+ t=Signal.from_ptr(t),
1524
+ i=Signal.from_ptr(i),
1525
+ )
1526
+ else:
1527
+ return {}
1528
+
1529
+
1530
+ def is_sig_read_write_table(Signal u) -> dict:
1531
+ cdef fs.Signal id = NULL
1532
+ cdef fs.Signal t = NULL
1533
+ cdef fs.Signal i = NULL
1534
+ cdef fs.Signal s = NULL
1535
+ if fs.isSigWRTbl(u.ptr, id, t, i, s):
1536
+ return dict(
1537
+ id=Signal.from_ptr(id),
1538
+ t=Signal.from_ptr(t),
1539
+ i=Signal.from_ptr(i),
1540
+ s=Signal.from_ptr(s),
1541
+ )
1542
+ else:
1543
+ return {}
1544
+
1545
+
1546
+ def is_sig_gen(Signal t) -> dict:
1547
+ cdef fs.Signal x = NULL
1548
+ if fs.isSigGen(t.ptr, x):
1549
+ return dict(x=Signal.from_ptr(x))
1550
+ else:
1551
+ return {}
1552
+
1553
+
1554
+ def is_sig_doc_constant_tbl(Signal t) -> dict:
1555
+ cdef fs.Signal n = NULL
1556
+ cdef fs.Signal sig = NULL
1557
+ if fs.isSigDocConstantTbl(t.ptr, n, sig):
1558
+ return dict(
1559
+ n=Signal.from_ptr(n),
1560
+ sig=Signal.from_ptr(sig),
1561
+ )
1562
+ else:
1563
+ return {}
1564
+
1565
+
1566
+ def is_sig_doc_write_tbl(Signal t) -> dict:
1567
+ cdef fs.Signal n = NULL
1568
+ cdef fs.Signal sig = NULL
1569
+ cdef fs.Signal widx = NULL
1570
+ cdef fs.Signal wsig = NULL
1571
+ if fs.isSigDocWriteTbl(t.ptr, n, sig, widx, wsig):
1572
+ return dict(
1573
+ n=Signal.from_ptr(n),
1574
+ sig=Signal.from_ptr(sig),
1575
+ widx=Signal.from_ptr(widx),
1576
+ wsig=Signal.from_ptr(wsig),
1577
+ )
1578
+ else:
1579
+ return {}
1580
+
1581
+
1582
+ def is_sig_doc_access_tbl(Signal t) -> dict:
1583
+ cdef fs.Signal tbl = NULL
1584
+ cdef fs.Signal ridx = NULL
1585
+ if fs.isSigDocAccessTbl(t.ptr, tbl, ridx):
1586
+ return dict(
1587
+ n=Signal.from_ptr(tbl),
1588
+ widx=Signal.from_ptr(ridx),
1589
+ )
1590
+ else:
1591
+ return {}
1592
+
1593
+
1594
+ def is_sig_select2(Signal t) -> dict:
1595
+ cdef fs.Signal selector = NULL
1596
+ cdef fs.Signal s1 = NULL
1597
+ cdef fs.Signal s2 = NULL
1598
+ if fs.isSigSelect2(t.ptr, selector, s1, s2):
1599
+ return dict(
1600
+ selector=Signal.from_ptr(selector),
1601
+ s1=Signal.from_ptr(s1),
1602
+ s2=Signal.from_ptr(s2),
1603
+ )
1604
+ else:
1605
+ return {}
1606
+
1607
+
1608
+ def is_sig_assert_bounds(Signal t) -> dict:
1609
+ cdef fs.Signal s1 = NULL
1610
+ cdef fs.Signal s2 = NULL
1611
+ cdef fs.Signal s3 = NULL
1612
+ if fs.isSigAssertBounds(t.ptr, s1, s2, s3):
1613
+ return dict(
1614
+ s1=Signal.from_ptr(s1),
1615
+ s2=Signal.from_ptr(s2),
1616
+ s3=Signal.from_ptr(s3),
1617
+ )
1618
+ else:
1619
+ return {}
1620
+
1621
+
1622
+ def is_sig_highest(Signal t) -> dict:
1623
+ cdef fs.Signal s = NULL
1624
+ if fs.isSigHighest(t.ptr, s):
1625
+ return dict(s=Signal.from_ptr(s))
1626
+ else:
1627
+ return {}
1628
+
1629
+ def is_sig_lowest(Signal t) -> dict:
1630
+ cdef fs.Signal s = NULL
1631
+ if fs.isSigLowest(t.ptr, s):
1632
+ return dict(s=Signal.from_ptr(s))
1633
+ else:
1634
+ return {}
1635
+
1636
+
1637
+ def is_sig_bin_op(Signal s) -> dict:
1638
+ cdef int op = 0
1639
+ cdef fs.Signal x = NULL
1640
+ cdef fs.Signal y = NULL
1641
+ if fs.isSigBinOp(s.ptr, &op, x, y):
1642
+ return dict(
1643
+ op=op,
1644
+ x=Signal.from_ptr(x),
1645
+ y=Signal.from_ptr(y),
1646
+ )
1647
+ else:
1648
+ return {}
1649
+
1650
+
1651
+ def is_sig_ffun(Signal s) -> dict:
1652
+ cdef fs.Signal ff = NULL
1653
+ cdef fs.Signal largs = NULL
1654
+ if fs.isSigFFun(s.ptr, ff, largs):
1655
+ return dict(
1656
+ ff=Signal.from_ptr(ff),
1657
+ largs=Signal.from_ptr(largs),
1658
+ )
1659
+ else:
1660
+ return {}
1661
+
1662
+
1663
+ def is_sig_fconst(Signal s) -> dict:
1664
+ cdef fs.Signal type = NULL
1665
+ cdef fs.Signal name = NULL
1666
+ cdef fs.Signal file = NULL
1667
+ if fs.isSigFConst(s.ptr, type, name, file):
1668
+ return dict(
1669
+ type=Signal.from_ptr(type),
1670
+ name=Signal.from_ptr(name),
1671
+ file=Signal.from_ptr(file),
1672
+ )
1673
+ else:
1674
+ return {}
1675
+
1676
+
1677
+ def is_sig_fvar(Signal s) -> dict:
1678
+ cdef fs.Signal type = NULL
1679
+ cdef fs.Signal name = NULL
1680
+ cdef fs.Signal file = NULL
1681
+ if fs.isSigFVar(s.ptr, type, name, file):
1682
+ return dict(
1683
+ type=Signal.from_ptr(type),
1684
+ name=Signal.from_ptr(name),
1685
+ file=Signal.from_ptr(file),
1686
+ )
1687
+ else:
1688
+ return {}
1689
+
1690
+
1691
+ def is_proj(Signal s) -> dict:
1692
+ cdef int i = 0
1693
+ cdef fs.Signal rgroup = NULL
1694
+ if fs.isProj(s.ptr, &i, rgroup):
1695
+ return dict(
1696
+ i=i,
1697
+ rgroup=Signal.from_ptr(rgroup),
1698
+ )
1699
+ else:
1700
+ return {}
1701
+
1702
+
1703
+
1704
+ def is_rec(Signal s) -> dict:
1705
+ cdef fs.Signal var = NULL
1706
+ cdef fs.Signal body = NULL
1707
+ if fs.isRec(s.ptr, var, body):
1708
+ return dict(
1709
+ var=Signal.from_ptr(var),
1710
+ body=Signal.from_ptr(body),
1711
+ )
1712
+ else:
1713
+ return {}
1714
+
1715
+
1716
+ def is_sig_int_cast(Signal s) -> dict:
1717
+ cdef fs.Signal x = NULL
1718
+ if fs.isSigIntCast(s.ptr, x):
1719
+ return dict(
1720
+ x=Signal.from_ptr(x),
1721
+ )
1722
+ else:
1723
+ return {}
1724
+
1725
+
1726
+ def is_sig_float_cast(Signal s) -> dict:
1727
+ cdef fs.Signal x = NULL
1728
+ if fs.isSigFloatCast(s.ptr, x):
1729
+ return dict(
1730
+ x=Signal.from_ptr(x),
1731
+ )
1732
+ else:
1733
+ return {}
1734
+
1735
+
1736
+ def is_sig_button(Signal s) -> dict:
1737
+ cdef fs.Signal lbl = NULL
1738
+ if fs.isSigButton(s.ptr, lbl):
1739
+ return dict(
1740
+ lbl=Signal.from_ptr(lbl),
1741
+ )
1742
+ else:
1743
+ return {}
1744
+
1745
+ def is_sig_checkbox(Signal s) -> dict:
1746
+ cdef fs.Signal lbl = NULL
1747
+ if fs.isSigCheckbox(s.ptr, lbl):
1748
+ return dict(
1749
+ lbl=Signal.from_ptr(lbl),
1750
+ )
1751
+ else:
1752
+ return {}
1753
+
1754
+
1755
+ def is_sig_waveform(Signal s) -> bool:
1756
+ return fs.isSigWaveform(s.ptr)
1757
+
1758
+
1759
+ def is_sig_hslider(Signal u) -> dict:
1760
+ cdef fs.Signal lbl = NULL
1761
+ cdef fs.Signal init = NULL
1762
+ cdef fs.Signal min = NULL
1763
+ cdef fs.Signal max = NULL
1764
+ cdef fs.Signal step = NULL
1765
+ if fs.isSigHSlider(u.ptr, lbl, init, min, max, step):
1766
+ return dict(
1767
+ lbl=Signal.from_ptr(lbl),
1768
+ init=Signal.from_ptr(init),
1769
+ min=Signal.from_ptr(min),
1770
+ max=Signal.from_ptr(max),
1771
+ step=Signal.from_ptr(step),
1772
+ )
1773
+ else:
1774
+ return {}
1775
+
1776
+ def is_sig_vslider(Signal u) -> dict:
1777
+ cdef fs.Signal lbl = NULL
1778
+ cdef fs.Signal init = NULL
1779
+ cdef fs.Signal min = NULL
1780
+ cdef fs.Signal max = NULL
1781
+ cdef fs.Signal step = NULL
1782
+ if fs.isSigVSlider(u.ptr, lbl, init, min, max, step):
1783
+ return dict(
1784
+ lbl=Signal.from_ptr(lbl),
1785
+ init=Signal.from_ptr(init),
1786
+ min=Signal.from_ptr(min),
1787
+ max=Signal.from_ptr(max),
1788
+ step=Signal.from_ptr(step),
1789
+ )
1790
+ else:
1791
+ return {}
1792
+
1793
+ def is_sig_numentry(Signal u) -> dict:
1794
+ cdef fs.Signal lbl = NULL
1795
+ cdef fs.Signal init = NULL
1796
+ cdef fs.Signal min = NULL
1797
+ cdef fs.Signal max = NULL
1798
+ cdef fs.Signal step = NULL
1799
+ if fs.isSigNumEntry(u.ptr, lbl, init, min, max, step):
1800
+ return dict(
1801
+ lbl=Signal.from_ptr(lbl),
1802
+ init=Signal.from_ptr(init),
1803
+ min=Signal.from_ptr(min),
1804
+ max=Signal.from_ptr(max),
1805
+ step=Signal.from_ptr(step),
1806
+ )
1807
+ else:
1808
+ return {}
1809
+
1810
+
1811
+ def is_sig_hbargraph(Signal s) -> dict:
1812
+ cdef fs.Signal lbl = NULL
1813
+ cdef fs.Signal min = NULL
1814
+ cdef fs.Signal max = NULL
1815
+ cdef fs.Signal x = NULL
1816
+ if fs.isSigHBargraph(s.ptr, lbl, min, max, x):
1817
+ return dict(
1818
+ lbl=Signal.from_ptr(lbl),
1819
+ min=Signal.from_ptr(min),
1820
+ max=Signal.from_ptr(max),
1821
+ x=Signal.from_ptr(x),
1822
+ )
1823
+ else:
1824
+ return {}
1825
+
1826
+ def is_sig_vbargraph(Signal s) -> dict:
1827
+ cdef fs.Signal lbl = NULL
1828
+ cdef fs.Signal min = NULL
1829
+ cdef fs.Signal max = NULL
1830
+ cdef fs.Signal x = NULL
1831
+ if fs.isSigVBargraph(s.ptr, lbl, min, max, x):
1832
+ return dict(
1833
+ lbl=Signal.from_ptr(lbl),
1834
+ min=Signal.from_ptr(min),
1835
+ max=Signal.from_ptr(max),
1836
+ x=Signal.from_ptr(x),
1837
+ )
1838
+ else:
1839
+ return {}
1840
+
1841
+
1842
+ def is_sig_attach(Signal s) -> dict:
1843
+ cdef fs.Signal s0 = NULL
1844
+ cdef fs.Signal s1 = NULL
1845
+ if fs.isSigAttach(s.ptr, s0, s1):
1846
+ return dict(
1847
+ s0=Signal.from_ptr(s0),
1848
+ s1=Signal.from_ptr(s1),
1849
+ )
1850
+ else:
1851
+ return {}
1852
+
1853
+ def is_sig_enable(Signal s) -> dict:
1854
+ cdef fs.Signal s0 = NULL
1855
+ cdef fs.Signal s1 = NULL
1856
+ if fs.isSigEnable(s.ptr, s0, s1):
1857
+ return dict(
1858
+ s0=Signal.from_ptr(s0),
1859
+ s1=Signal.from_ptr(s1),
1860
+ )
1861
+ else:
1862
+ return {}
1863
+
1864
+ def is_sig_control(Signal s) -> dict:
1865
+ cdef fs.Signal s0 = NULL
1866
+ cdef fs.Signal s1 = NULL
1867
+ if fs.isSigControl(s.ptr, s0, s1):
1868
+ return dict(
1869
+ s0=Signal.from_ptr(s0),
1870
+ s1=Signal.from_ptr(s1),
1871
+ )
1872
+ else:
1873
+ return {}
1874
+
1875
+
1876
+ def is_sig_soundfile(Signal s) -> dict:
1877
+ cdef fs.Signal label = NULL
1878
+ if fs.isSigSoundfile(s.ptr, label):
1879
+ return dict(
1880
+ label=Signal.from_ptr(label),
1881
+ )
1882
+ else:
1883
+ return {}
1884
+
1885
+
1886
+ def is_sig_soundfile_length(Signal s) -> dict:
1887
+ cdef fs.Signal sf = NULL
1888
+ cdef fs.Signal part = NULL
1889
+ if fs.isSigSoundfileLength(s.ptr, sf, part):
1890
+ return dict(
1891
+ sf=Signal.from_ptr(sf),
1892
+ part=Signal.from_ptr(part),
1893
+ )
1894
+ else:
1895
+ return {}
1896
+
1897
+ def is_sig_soundfile_rate(Signal s) -> dict:
1898
+ cdef fs.Signal sf = NULL
1899
+ cdef fs.Signal part = NULL
1900
+ if fs.isSigSoundfileRate(s.ptr, sf, part):
1901
+ return dict(
1902
+ sf=Signal.from_ptr(sf),
1903
+ part=Signal.from_ptr(part),
1904
+ )
1905
+ else:
1906
+ return {}
1907
+
1908
+
1909
+ def is_sig_soundfile_buffer(Signal s) -> dict:
1910
+ cdef fs.Signal sf = NULL
1911
+ cdef fs.Signal chan = NULL
1912
+ cdef fs.Signal part = NULL
1913
+ cdef fs.Signal ridx = NULL
1914
+ if fs.isSigSoundfileBuffer(s.ptr, sf, chan, part, ridx):
1915
+ return dict(
1916
+ sf=Signal.from_ptr(sf),
1917
+ chan=Signal.from_ptr(chan),
1918
+ part=Signal.from_ptr(part),
1919
+ ridx=Signal.from_ptr(ridx),
1920
+ )
1921
+ else:
1922
+ return {}
1923
+
1924
+
1925
+ def simplify_to_normal_form(Signal s) -> Signal:
1926
+ """Simplify a signal to its normal form, where:
1927
+
1928
+ - all possible optimisations, simplications, and compile time computations have been done
1929
+ - the mathematical functions (primitives and binary functions), delay, select2, soundfile primitive...
1930
+ are properly typed (arguments and result)
1931
+ - signal cast are properly done when needed
1932
+
1933
+ sig - the signal to be processed
1934
+
1935
+ returns the signal in normal form.
1936
+ """
1937
+ cdef fs.Signal _s = fs.simplifyToNormalForm(s.ptr)
1938
+ return Signal.from_ptr(_s)
1939
+
1940
+
1941
+
1942
+
1943
+
1944
+ def simplify_to_normal_form2(SignalVector vec) -> SignalVector:
1945
+ """Simplify a signal list to its normal form, where:
1946
+
1947
+ - all possible optimisations, simplications, and compile time computations have been done
1948
+ - the mathematical functions (primitives and binary functions), delay, select2, soundfile primitive...
1949
+ are properly typed (arguments and result)
1950
+ - signal cast are properly done when needed
1951
+
1952
+ siglist - the signal list to be processed
1953
+
1954
+ returns the signal vector in normal form.
1955
+ """
1956
+ cdef fs.tvec sv = fs.simplifyToNormalForm2(vec.ptr)
1957
+ return SignalVector.from_ptr(sv)
1958
+
1959
+
1960
+
1961
+ def create_source_from_signals(str name_app, SignalVector osigs, str lang, *args) -> str:
1962
+ """Create source code in a target language from a vector of output signals.
1963
+
1964
+ name_app - the name of the Faust program
1965
+ osigs - the vector of output signals (that will internally be converted
1966
+ in normal form (see simplifyToNormalForm)
1967
+ lang - the target source code's language which can be one of 'c',
1968
+ 'cpp', 'cmajor', 'codebox', 'csharp', 'dlang', 'fir', 'interp', 'java', 'jax',
1969
+ 'jsfx', 'julia', 'ocpp', 'rust' or 'wast'
1970
+ (depending of which of the corresponding backends are compiled in libfaust)
1971
+ argc - the number of parameters in argv array
1972
+ argv - the array of parameters
1973
+ error_msg - the error string to be filled
1974
+
1975
+ returns a string of source code on success, setting error_msg on error.
1976
+ """
1977
+ cdef ParamArray params = ParamArray(args)
1978
+ cdef string error_msg
1979
+ error_msg.reserve(4096)
1980
+ cdef string code = fs.createSourceFromSignals(
1981
+ name_app.encode('utf8'),
1982
+ osigs.ptr,
1983
+ lang.encode('utf8'),
1984
+ params.argc,
1985
+ params.argv,
1986
+ error_msg,
1987
+ )
1988
+ if not error_msg.empty():
1989
+ print(error_msg.decode())
1990
+ return
1991
+ return code.decode()
1992
+
1993
+