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.
- cyfaust/CMakeLists.txt +93 -0
- cyfaust/__init__.py +0 -0
- cyfaust/__main__.py +819 -0
- cyfaust/box.pxd +46 -0
- cyfaust/box.pyx +2459 -0
- cyfaust/common.pxd +5 -0
- cyfaust/common.pyx +61 -0
- cyfaust/cyfaust.cpython-311-darwin.so +0 -0
- cyfaust/faust_box.pxd +298 -0
- cyfaust/faust_box_oo.pyx +66 -0
- cyfaust/faust_gui.pxd +261 -0
- cyfaust/faust_interp.pxd +160 -0
- cyfaust/faust_player.pxd +80 -0
- cyfaust/faust_signal.pxd +257 -0
- cyfaust/gui_statics.cpp +15 -0
- cyfaust/interp.pyx +673 -0
- cyfaust/player.cpp +32519 -0
- cyfaust/player.pyx +191 -0
- cyfaust/resources/architecture/AU/AUPublic/AUBase/AUBase.cpp +2327 -0
- cyfaust/resources/architecture/AU/AUPublic/AUBase/AUBase.h +1019 -0
- cyfaust/resources/architecture/AU/AUPublic/AUBase/AUDispatch.cpp +423 -0
- cyfaust/resources/architecture/AU/AUPublic/AUBase/AUDispatch.h +82 -0
- cyfaust/resources/architecture/AU/AUPublic/AUBase/AUInputElement.cpp +151 -0
- cyfaust/resources/architecture/AU/AUPublic/AUBase/AUInputElement.h +119 -0
- cyfaust/resources/architecture/AU/AUPublic/AUBase/AUOutputElement.cpp +62 -0
- cyfaust/resources/architecture/AU/AUPublic/AUBase/AUOutputElement.h +66 -0
- cyfaust/resources/architecture/AU/AUPublic/AUBase/AUPlugInDispatch.cpp +615 -0
- cyfaust/resources/architecture/AU/AUPublic/AUBase/AUPlugInDispatch.h +128 -0
- cyfaust/resources/architecture/AU/AUPublic/AUBase/AUScopeElement.cpp +512 -0
- cyfaust/resources/architecture/AU/AUPublic/AUBase/AUScopeElement.h +544 -0
- cyfaust/resources/architecture/AU/AUPublic/AUBase/ComponentBase.cpp +370 -0
- cyfaust/resources/architecture/AU/AUPublic/AUBase/ComponentBase.h +340 -0
- cyfaust/resources/architecture/AU/AUPublic/AUEffectBase/AUEffectBase.cpp +463 -0
- cyfaust/resources/architecture/AU/AUPublic/AUEffectBase/AUEffectBase.h +391 -0
- cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/AUInstrumentBase.cpp +837 -0
- cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/AUInstrumentBase.h +267 -0
- cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/AUMIDIBase.cpp +495 -0
- cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/AUMIDIBase.h +213 -0
- cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/LockFreeFIFO.h +168 -0
- cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/MIDIControlHandler.h +92 -0
- cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/MusicDeviceBase.cpp +354 -0
- cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/MusicDeviceBase.h +126 -0
- cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/SynthElement.cpp +419 -0
- cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/SynthElement.h +227 -0
- cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/SynthEvent.h +145 -0
- cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/SynthNote.cpp +138 -0
- cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/SynthNote.h +186 -0
- cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/SynthNoteList.cpp +93 -0
- cyfaust/resources/architecture/AU/AUPublic/AUInstrumentBase/SynthNoteList.h +232 -0
- cyfaust/resources/architecture/AU/AUPublic/Utility/AUBaseHelper.cpp +134 -0
- cyfaust/resources/architecture/AU/AUPublic/Utility/AUBaseHelper.h +80 -0
- cyfaust/resources/architecture/AU/AUPublic/Utility/AUBuffer.cpp +217 -0
- cyfaust/resources/architecture/AU/AUPublic/Utility/AUBuffer.h +267 -0
- cyfaust/resources/architecture/AU/AUPublic/Utility/AUMIDIDefs.h +136 -0
- cyfaust/resources/architecture/AU/AUPublic/Utility/AUSilentTimeout.h +93 -0
- cyfaust/resources/architecture/AU/English.lproj/InfoPlist.strings +0 -0
- cyfaust/resources/architecture/AU/FaustAU.exp +2 -0
- cyfaust/resources/architecture/AU/FaustAU.xcodeproj/project.pbxproj +968 -0
- cyfaust/resources/architecture/AU/FaustAU.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- cyfaust/resources/architecture/AU/FaustAUCustomView.plist +14 -0
- cyfaust/resources/architecture/AU/Info.plist +47 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAAtomic.h +305 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAAtomicStack.h +239 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAAudioChannelLayout.cpp +153 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAAudioChannelLayout.h +199 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAAutoDisposer.h +508 -0
- cyfaust/resources/architecture/AU/PublicUtility/CABufferList.cpp +264 -0
- cyfaust/resources/architecture/AU/PublicUtility/CABufferList.h +319 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAByteOrder.h +161 -0
- cyfaust/resources/architecture/AU/PublicUtility/CADebugMacros.cpp +88 -0
- cyfaust/resources/architecture/AU/PublicUtility/CADebugMacros.h +580 -0
- cyfaust/resources/architecture/AU/PublicUtility/CADebugPrintf.cpp +89 -0
- cyfaust/resources/architecture/AU/PublicUtility/CADebugPrintf.h +115 -0
- cyfaust/resources/architecture/AU/PublicUtility/CADebugger.cpp +77 -0
- cyfaust/resources/architecture/AU/PublicUtility/CADebugger.h +56 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAException.h +83 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAGuard.cpp +339 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAGuard.h +133 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAHostTimeBase.cpp +110 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAHostTimeBase.h +231 -0
- cyfaust/resources/architecture/AU/PublicUtility/CALogMacros.h +140 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAMath.h +68 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAMutex.cpp +345 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAMutex.h +163 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAReferenceCounted.h +87 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAStreamBasicDescription.cpp +795 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAStreamBasicDescription.h +409 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAThreadSafeList.h +255 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAVectorUnit.cpp +191 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAVectorUnit.h +100 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAVectorUnitTypes.h +59 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAXException.cpp +49 -0
- cyfaust/resources/architecture/AU/PublicUtility/CAXException.h +338 -0
- cyfaust/resources/architecture/AU/SectionPatternLight.tiff +0 -0
- cyfaust/resources/architecture/AU/Source/AUSource/FaustAU.h +38 -0
- cyfaust/resources/architecture/AU/Source/AUSource/FaustAU.r +153 -0
- cyfaust/resources/architecture/AU/Source/AUSource/FaustAUVersion.h +64 -0
- cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_Bargraph.h +18 -0
- cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_Bargraph.m +21 -0
- cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_Button.h +20 -0
- cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_Button.m +56 -0
- cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_CustomView.h +87 -0
- cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_CustomView.m +834 -0
- cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_CustomViewFactory.h +13 -0
- cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_CustomViewFactory.m +22 -0
- cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_Knob.h +81 -0
- cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_Knob.m +199 -0
- cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_Slider.h +18 -0
- cyfaust/resources/architecture/AU/Source/CocoaUI/FaustAU_Slider.m +21 -0
- cyfaust/resources/architecture/AU/version.plist +16 -0
- cyfaust/resources/architecture/VST/Info.plist +28 -0
- cyfaust/resources/architecture/VST/PkgInfo +1 -0
- cyfaust/resources/architecture/VST/README +11 -0
- cyfaust/resources/architecture/VST/VST.xcode/project.pbxproj +655 -0
- cyfaust/resources/architecture/alsa-console.cpp +246 -0
- cyfaust/resources/architecture/alsa-gtk.cpp +220 -0
- cyfaust/resources/architecture/alsa-qt.cpp +229 -0
- cyfaust/resources/architecture/api/DspFaust.cpp +612 -0
- cyfaust/resources/architecture/api/DspFaust.h +511 -0
- cyfaust/resources/architecture/api/README.md +237 -0
- cyfaust/resources/architecture/api/doc/Generic.md +38 -0
- cyfaust/resources/architecture/au-effect.cpp +487 -0
- cyfaust/resources/architecture/au-instrument.cpp +573 -0
- cyfaust/resources/architecture/bench.cpp +91 -0
- cyfaust/resources/architecture/c-jack-gtk.c +227 -0
- cyfaust/resources/architecture/ca-gtk.cpp +284 -0
- cyfaust/resources/architecture/ca-qt.cpp +424 -0
- cyfaust/resources/architecture/cpal.rs +195 -0
- cyfaust/resources/architecture/csound.cpp +245 -0
- cyfaust/resources/architecture/csvplot.cpp +227 -0
- cyfaust/resources/architecture/daisy/Makefile +14 -0
- cyfaust/resources/architecture/daisy/README.md +50 -0
- cyfaust/resources/architecture/daisy/ex_faust.cpp +173 -0
- cyfaust/resources/architecture/dssi.cpp +1262 -0
- cyfaust/resources/architecture/dummy-mem.cpp +186 -0
- cyfaust/resources/architecture/dummy.cpp +294 -0
- cyfaust/resources/architecture/faust/au/AUUI.h +404 -0
- cyfaust/resources/architecture/faust/audio/alsa-dsp.h +693 -0
- cyfaust/resources/architecture/faust/audio/android-dsp.h +583 -0
- cyfaust/resources/architecture/faust/audio/audio.h +115 -0
- cyfaust/resources/architecture/faust/audio/channels.h +122 -0
- cyfaust/resources/architecture/faust/audio/coreaudio-dsp.h +1543 -0
- cyfaust/resources/architecture/faust/audio/coreaudio-ios-dsp.h +743 -0
- cyfaust/resources/architecture/faust/audio/dummy-audio.h +255 -0
- cyfaust/resources/architecture/faust/audio/esp32-dsp.h +284 -0
- cyfaust/resources/architecture/faust/audio/fpe.h +164 -0
- cyfaust/resources/architecture/faust/audio/jack-dsp.h +534 -0
- cyfaust/resources/architecture/faust/audio/juce-dsp.h +119 -0
- cyfaust/resources/architecture/faust/audio/netjack-dsp.h +354 -0
- cyfaust/resources/architecture/faust/audio/oboe-dsp.h +308 -0
- cyfaust/resources/architecture/faust/audio/ofaudio-dsp.h +155 -0
- cyfaust/resources/architecture/faust/audio/opensles-android-dsp.h +631 -0
- cyfaust/resources/architecture/faust/audio/osc-dsp.h +120 -0
- cyfaust/resources/architecture/faust/audio/portaudio-dsp.h +236 -0
- cyfaust/resources/architecture/faust/audio/rtaudio-dsp.h +241 -0
- cyfaust/resources/architecture/faust/audio/samAudio.h +140 -0
- cyfaust/resources/architecture/faust/audio/teensy-dsp.h +171 -0
- cyfaust/resources/architecture/faust/dsp/cmajor-cpp-dsp.h +253 -0
- cyfaust/resources/architecture/faust/dsp/cmajorpatch-dsp.h +483 -0
- cyfaust/resources/architecture/faust/dsp/cpp-dsp-adapter.h +38 -0
- cyfaust/resources/architecture/faust/dsp/dsp-adapter.h +836 -0
- cyfaust/resources/architecture/faust/dsp/dsp-bench.h +611 -0
- cyfaust/resources/architecture/faust/dsp/dsp-checker.h +115 -0
- cyfaust/resources/architecture/faust/dsp/dsp-combiner.h +810 -0
- cyfaust/resources/architecture/faust/dsp/dsp-compute-adapter.h +159 -0
- cyfaust/resources/architecture/faust/dsp/dsp-multi.h +702 -0
- cyfaust/resources/architecture/faust/dsp/dsp-multifun.h +90 -0
- cyfaust/resources/architecture/faust/dsp/dsp-optimizer.h +511 -0
- cyfaust/resources/architecture/faust/dsp/dsp-tools.h +229 -0
- cyfaust/resources/architecture/faust/dsp/dsp.h +321 -0
- cyfaust/resources/architecture/faust/dsp/fastmath.cpp +301 -0
- cyfaust/resources/architecture/faust/dsp/faust-dynamic-engine.cpp +494 -0
- cyfaust/resources/architecture/faust/dsp/faust-dynamic-engine.h +386 -0
- cyfaust/resources/architecture/faust/dsp/faust-engine.h +75 -0
- cyfaust/resources/architecture/faust/dsp/faust-poly-engine.h +638 -0
- cyfaust/resources/architecture/faust/dsp/interpreter-dsp-c.h +288 -0
- cyfaust/resources/architecture/faust/dsp/interpreter-dsp.h +362 -0
- cyfaust/resources/architecture/faust/dsp/interpreter-machine-dsp.h +233 -0
- cyfaust/resources/architecture/faust/dsp/libfaust-box-c.h +817 -0
- cyfaust/resources/architecture/faust/dsp/libfaust-box.h +889 -0
- cyfaust/resources/architecture/faust/dsp/libfaust-c.h +116 -0
- cyfaust/resources/architecture/faust/dsp/libfaust-signal-c.h +649 -0
- cyfaust/resources/architecture/faust/dsp/libfaust-signal.h +731 -0
- cyfaust/resources/architecture/faust/dsp/llvm-dsp-adapter.h +160 -0
- cyfaust/resources/architecture/faust/dsp/llvm-dsp-c.h +524 -0
- cyfaust/resources/architecture/faust/dsp/llvm-dsp.h +575 -0
- cyfaust/resources/architecture/faust/dsp/llvm-machine-dsp.h +215 -0
- cyfaust/resources/architecture/faust/dsp/one-sample-dsp.h +477 -0
- cyfaust/resources/architecture/faust/dsp/poly-dsp.h +1079 -0
- cyfaust/resources/architecture/faust/dsp/poly-interpreter-dsp.h +143 -0
- cyfaust/resources/architecture/faust/dsp/poly-llvm-dsp.h +249 -0
- cyfaust/resources/architecture/faust/dsp/poly-wasm-dsp.h +257 -0
- cyfaust/resources/architecture/faust/dsp/proxy-dsp.h +108 -0
- cyfaust/resources/architecture/faust/dsp/proxy-osc-dsp.h +109 -0
- cyfaust/resources/architecture/faust/dsp/rnbo-dsp.h +187 -0
- cyfaust/resources/architecture/faust/dsp/sound-player.h +428 -0
- cyfaust/resources/architecture/faust/dsp/timed-dsp.h +279 -0
- cyfaust/resources/architecture/faust/dsp/wasm-dsp-imp.h +188 -0
- cyfaust/resources/architecture/faust/dsp/wasm-dsp.h +309 -0
- cyfaust/resources/architecture/faust/dsp/ysfx-dsp.h +188 -0
- cyfaust/resources/architecture/faust/export.h +61 -0
- cyfaust/resources/architecture/faust/gui/APIUI.h +726 -0
- cyfaust/resources/architecture/faust/gui/BelaOSCUI.h +170 -0
- cyfaust/resources/architecture/faust/gui/CGlue.h +667 -0
- cyfaust/resources/architecture/faust/gui/CInterface.h +142 -0
- cyfaust/resources/architecture/faust/gui/ControlSequenceUI.h +197 -0
- cyfaust/resources/architecture/faust/gui/ControlUI.h +137 -0
- cyfaust/resources/architecture/faust/gui/DaisyControlUI.h +283 -0
- cyfaust/resources/architecture/faust/gui/DaisyPatchInitControlUI.h +254 -0
- cyfaust/resources/architecture/faust/gui/DecoratorUI.h +115 -0
- cyfaust/resources/architecture/faust/gui/Esp32ControlUI.h +341 -0
- cyfaust/resources/architecture/faust/gui/Esp32Reader.h +102 -0
- cyfaust/resources/architecture/faust/gui/Esp32SensorUI.h +137 -0
- cyfaust/resources/architecture/faust/gui/FUI.h +147 -0
- cyfaust/resources/architecture/faust/gui/GTKUI.h +1414 -0
- cyfaust/resources/architecture/faust/gui/GUI.h +465 -0
- cyfaust/resources/architecture/faust/gui/JSONControl.h +48 -0
- cyfaust/resources/architecture/faust/gui/JSONUI.h +722 -0
- cyfaust/resources/architecture/faust/gui/JSONUIDecoder.h +589 -0
- cyfaust/resources/architecture/faust/gui/JuceGUI.h +2061 -0
- cyfaust/resources/architecture/faust/gui/JuceOSCUI.h +163 -0
- cyfaust/resources/architecture/faust/gui/JuceParameterUI.h +158 -0
- cyfaust/resources/architecture/faust/gui/JuceReader.h +103 -0
- cyfaust/resources/architecture/faust/gui/JuceStateUI.h +88 -0
- cyfaust/resources/architecture/faust/gui/LayoutUI.h +423 -0
- cyfaust/resources/architecture/faust/gui/LibsndfileReader.h +366 -0
- cyfaust/resources/architecture/faust/gui/MapUI.h +370 -0
- cyfaust/resources/architecture/faust/gui/MemoryReader.h +111 -0
- cyfaust/resources/architecture/faust/gui/MetaDataUI.h +357 -0
- cyfaust/resources/architecture/faust/gui/MidiUI.h +939 -0
- cyfaust/resources/architecture/faust/gui/OCVUI.h +688 -0
- cyfaust/resources/architecture/faust/gui/OSCUI.h +219 -0
- cyfaust/resources/architecture/faust/gui/PathBuilder.h +228 -0
- cyfaust/resources/architecture/faust/gui/PresetUI.h +337 -0
- cyfaust/resources/architecture/faust/gui/PrintCUI.h +152 -0
- cyfaust/resources/architecture/faust/gui/PrintUI.h +121 -0
- cyfaust/resources/architecture/faust/gui/QTUI.h +1891 -0
- cyfaust/resources/architecture/faust/gui/RosCI.h +493 -0
- cyfaust/resources/architecture/faust/gui/RosUI.h +488 -0
- cyfaust/resources/architecture/faust/gui/SaveUI.h +163 -0
- cyfaust/resources/architecture/faust/gui/SimpleParser.h +583 -0
- cyfaust/resources/architecture/faust/gui/SoundUI.h +217 -0
- cyfaust/resources/architecture/faust/gui/Soundfile.h +342 -0
- cyfaust/resources/architecture/faust/gui/Styles/Blue.qrc +5 -0
- cyfaust/resources/architecture/faust/gui/Styles/Blue.qss +177 -0
- cyfaust/resources/architecture/faust/gui/Styles/Default.qrc +5 -0
- cyfaust/resources/architecture/faust/gui/Styles/Default.qss +117 -0
- cyfaust/resources/architecture/faust/gui/Styles/Grey.qrc +5 -0
- cyfaust/resources/architecture/faust/gui/Styles/Grey.qss +174 -0
- cyfaust/resources/architecture/faust/gui/Styles/Salmon.qrc +5 -0
- cyfaust/resources/architecture/faust/gui/Styles/Salmon.qss +171 -0
- cyfaust/resources/architecture/faust/gui/UI.h +87 -0
- cyfaust/resources/architecture/faust/gui/ValueConverter.h +543 -0
- cyfaust/resources/architecture/faust/gui/WaveReader.h +364 -0
- cyfaust/resources/architecture/faust/gui/console.h +322 -0
- cyfaust/resources/architecture/faust/gui/httpdUI.h +372 -0
- cyfaust/resources/architecture/faust/gui/meta.h +39 -0
- cyfaust/resources/architecture/faust/gui/mspUI.h +580 -0
- cyfaust/resources/architecture/faust/gui/qrcodegen.h +269 -0
- cyfaust/resources/architecture/faust/gui/qrcodegen.impl.h +1025 -0
- cyfaust/resources/architecture/faust/gui/ring-buffer.h +414 -0
- cyfaust/resources/architecture/faust/midi/RtMidi.cpp +3054 -0
- cyfaust/resources/architecture/faust/midi/RtMidi.h +1034 -0
- cyfaust/resources/architecture/faust/midi/bela-midi.h +266 -0
- cyfaust/resources/architecture/faust/midi/daisy-midi.h +116 -0
- cyfaust/resources/architecture/faust/midi/esp32-midi.h +185 -0
- cyfaust/resources/architecture/faust/midi/gramophone-midi.h +107 -0
- cyfaust/resources/architecture/faust/midi/iplug2-midi.h +148 -0
- cyfaust/resources/architecture/faust/midi/jack-midi.h +247 -0
- cyfaust/resources/architecture/faust/midi/juce-midi.h +275 -0
- cyfaust/resources/architecture/faust/midi/midi.h +475 -0
- cyfaust/resources/architecture/faust/midi/rt-midi.h +315 -0
- cyfaust/resources/architecture/faust/midi/teensy-midi.h +89 -0
- cyfaust/resources/architecture/faust/misc.h +106 -0
- cyfaust/resources/architecture/faust/sound-file.h +132 -0
- cyfaust/resources/architecture/faust/unity/AudioPluginInterface.h +301 -0
- cyfaust/resources/architecture/faust/vst/faust.h +141 -0
- cyfaust/resources/architecture/faust/vst/voice.h +43 -0
- cyfaust/resources/architecture/faust/vst/vstui.h +524 -0
- cyfaust/resources/architecture/faustvst.cpp +3435 -0
- cyfaust/resources/architecture/faustvstqt.h +91 -0
- cyfaust/resources/architecture/gen-json.cpp +76 -0
- cyfaust/resources/architecture/jack-console.cpp +267 -0
- cyfaust/resources/architecture/jack-gtk-ros.cpp +139 -0
- cyfaust/resources/architecture/jack-gtk.cpp +282 -0
- cyfaust/resources/architecture/jack-internal.cpp +560 -0
- cyfaust/resources/architecture/jack-qt-chain-footer.cpp +87 -0
- cyfaust/resources/architecture/jack-qt-chain-header.cpp +92 -0
- cyfaust/resources/architecture/jack-qt.cpp +281 -0
- cyfaust/resources/architecture/jack.rs +171 -0
- cyfaust/resources/architecture/juce/README.md +84 -0
- cyfaust/resources/architecture/juce/juce-plugin.cpp +809 -0
- cyfaust/resources/architecture/juce/juce-standalone.cpp +413 -0
- cyfaust/resources/architecture/juce/plugin/plugin-llvm.jucer +184 -0
- cyfaust/resources/architecture/juce/plugin/plugin.jucer +159 -0
- cyfaust/resources/architecture/juce/standalone/standalone-llvm.jucer +216 -0
- cyfaust/resources/architecture/juce/standalone/standalone.jucer +191 -0
- cyfaust/resources/architecture/ladspa.cpp +543 -0
- cyfaust/resources/architecture/latexheader.tex +65 -0
- cyfaust/resources/architecture/lv2.cpp +2090 -0
- cyfaust/resources/architecture/lv2qtgui.h +62 -0
- cyfaust/resources/architecture/lv2ui.cpp +1966 -0
- cyfaust/resources/architecture/max-msp/README.md +109 -0
- cyfaust/resources/architecture/max-msp/faustgen-wrapper-poly.maxpat +184 -0
- cyfaust/resources/architecture/max-msp/faustgen-wrapper.maxpat +163 -0
- cyfaust/resources/architecture/max-msp/max-msp.cpp +734 -0
- cyfaust/resources/architecture/max-msp/max-msp64.cpp +789 -0
- cyfaust/resources/architecture/max-msp/py2max/README.md +277 -0
- cyfaust/resources/architecture/max-msp/py2max/py2max/__init__.py +3 -0
- cyfaust/resources/architecture/max-msp/py2max/py2max/common.py +7 -0
- cyfaust/resources/architecture/max-msp/py2max/py2max/core.py +1387 -0
- cyfaust/resources/architecture/max-msp/py2max/py2max/maxclassdb.py +318 -0
- cyfaust/resources/architecture/max-msp/py2max/py2max/utils.py +20 -0
- cyfaust/resources/architecture/max-msp/rnbo.py +1591 -0
- cyfaust/resources/architecture/max-msp/sndfile/sndfile.h +857 -0
- cyfaust/resources/architecture/max-msp/ui.js +230 -0
- cyfaust/resources/architecture/max-msp/wrapper-poly.maxpat +153 -0
- cyfaust/resources/architecture/max-msp/wrapper.maxpat +131 -0
- cyfaust/resources/architecture/minimal-bench.cpp +100 -0
- cyfaust/resources/architecture/minimal-effect.c +149 -0
- cyfaust/resources/architecture/minimal-effect.cpp +70 -0
- cyfaust/resources/architecture/minimal-fixed-point.cpp +195 -0
- cyfaust/resources/architecture/minimal-static.cpp +160 -0
- cyfaust/resources/architecture/minimal.c +103 -0
- cyfaust/resources/architecture/minimal.cpp +84 -0
- cyfaust/resources/architecture/minimal.rs +223 -0
- cyfaust/resources/architecture/module.cpp +91 -0
- cyfaust/resources/architecture/octave.cpp +471 -0
- cyfaust/resources/architecture/oscio-gtk.cpp +115 -0
- cyfaust/resources/architecture/oscio-qt.cpp +121 -0
- cyfaust/resources/architecture/owl.cpp +345 -0
- cyfaust/resources/architecture/pa-gtk.cpp +119 -0
- cyfaust/resources/architecture/pa-qt.cpp +261 -0
- cyfaust/resources/architecture/path-printer.cpp +100 -0
- cyfaust/resources/architecture/plot.cpp +128 -0
- cyfaust/resources/architecture/portaudio.rs +192 -0
- cyfaust/resources/architecture/puredata.cpp +636 -0
- cyfaust/resources/architecture/ra-qt.cpp +238 -0
- cyfaust/resources/architecture/sam/fast_pow2.h +69 -0
- cyfaust/resources/architecture/sam/fastexp.h +140 -0
- cyfaust/resources/architecture/sam/samFaustDSP.cpp +125 -0
- cyfaust/resources/architecture/sam/samFaustDSP.h +107 -0
- cyfaust/resources/architecture/scheduler.cpp +1391 -0
- cyfaust/resources/architecture/sndfile.cpp +291 -0
- cyfaust/resources/architecture/supercollider.cpp +611 -0
- cyfaust/resources/architecture/teensy/README.md +13 -0
- cyfaust/resources/architecture/teensy/teensy.cpp +214 -0
- cyfaust/resources/architecture/teensy/teensy.h +71 -0
- cyfaust/resources/architecture/thread.h +373 -0
- cyfaust/resources/architecture/vcvrack/README.md +78 -0
- cyfaust/resources/architecture/vcvrack/template/.gitignore +6 -0
- cyfaust/resources/architecture/vcvrack/template/Makefile +22 -0
- cyfaust/resources/architecture/vcvrack/template/res/FaustModule.svg +299 -0
- cyfaust/resources/architecture/vcvrack/template/src/FaustModule.cpp +942 -0
- cyfaust/resources/architecture/vst.cpp +947 -0
- cyfaust/resources/libraries/aanl.lib +900 -0
- cyfaust/resources/libraries/all.lib +36 -0
- cyfaust/resources/libraries/analyzers.lib +980 -0
- cyfaust/resources/libraries/basics.lib +2681 -0
- cyfaust/resources/libraries/compressors.lib +1341 -0
- cyfaust/resources/libraries/delays.lib +401 -0
- cyfaust/resources/libraries/demos.lib +1556 -0
- cyfaust/resources/libraries/dx7.lib +1036 -0
- cyfaust/resources/libraries/effect.lib +1645 -0
- cyfaust/resources/libraries/envelopes.lib +666 -0
- cyfaust/resources/libraries/examples/README.md +13 -0
- cyfaust/resources/libraries/examples/ambisonics/fourSourcesToOcto.dsp +20 -0
- cyfaust/resources/libraries/examples/ambisonics/oneSourceToStereo.dsp +12 -0
- cyfaust/resources/libraries/examples/analysis/FFT.dsp +26 -0
- cyfaust/resources/libraries/examples/analysis/dbmeter.dsp +19 -0
- cyfaust/resources/libraries/examples/analysis/spectralLevel.dsp +8 -0
- cyfaust/resources/libraries/examples/analysis/spectralTiltLab.dsp +20 -0
- cyfaust/resources/libraries/examples/analysis/vumeter.dsp +18 -0
- cyfaust/resources/libraries/examples/autodiff/delay/diff.dsp +2 -0
- cyfaust/resources/libraries/examples/autodiff/delay/gt.dsp +2 -0
- cyfaust/resources/libraries/examples/autodiff/gain/diff.dsp +7 -0
- cyfaust/resources/libraries/examples/autodiff/gain/gt.dsp +1 -0
- cyfaust/resources/libraries/examples/autodiff/gain_dc/diff.dsp +7 -0
- cyfaust/resources/libraries/examples/autodiff/gain_dc/gt.dsp +4 -0
- cyfaust/resources/libraries/examples/autodiff/gain_exp/diff.dsp +9 -0
- cyfaust/resources/libraries/examples/autodiff/gain_exp/gt.dsp +1 -0
- cyfaust/resources/libraries/examples/autodiff/gain_pow/diff.dsp +9 -0
- cyfaust/resources/libraries/examples/autodiff/gain_pow/gt.dsp +1 -0
- cyfaust/resources/libraries/examples/autodiff/gain_pow_trig/diff.dsp +12 -0
- cyfaust/resources/libraries/examples/autodiff/gain_pow_trig/gt.dsp +1 -0
- cyfaust/resources/libraries/examples/autodiff/gain_sq/diff.dsp +7 -0
- cyfaust/resources/libraries/examples/autodiff/gain_sq/gt.dsp +1 -0
- cyfaust/resources/libraries/examples/autodiff/mem/diff.dsp +1 -0
- cyfaust/resources/libraries/examples/autodiff/mem/gt.dsp +1 -0
- cyfaust/resources/libraries/examples/autodiff/noise.dsp +2 -0
- cyfaust/resources/libraries/examples/autodiff/noop.dsp +2 -0
- cyfaust/resources/libraries/examples/autodiff/one_zero/diff.dsp +2 -0
- cyfaust/resources/libraries/examples/autodiff/one_zero/gt.dsp +2 -0
- cyfaust/resources/libraries/examples/autodiff/ramp.dsp +1 -0
- cyfaust/resources/libraries/examples/autodiff/recursion/diff.dsp +2 -0
- cyfaust/resources/libraries/examples/autodiff/recursion/gt.dsp +1 -0
- cyfaust/resources/libraries/examples/autodiff/recursion/target.dsp +13 -0
- cyfaust/resources/libraries/examples/autodiff/tremolo/diff.dsp +14 -0
- cyfaust/resources/libraries/examples/autodiff/tremolo/diffable.lib +7 -0
- cyfaust/resources/libraries/examples/autodiff/tremolo/gt.dsp +11 -0
- cyfaust/resources/libraries/examples/delayEcho/echo.dsp +15 -0
- cyfaust/resources/libraries/examples/delayEcho/quadEcho.dsp +21 -0
- cyfaust/resources/libraries/examples/delayEcho/smoothDelay.dsp +26 -0
- cyfaust/resources/libraries/examples/delayEcho/stereoEcho.dsp +16 -0
- cyfaust/resources/libraries/examples/delayEcho/tapiir.dsp +44 -0
- cyfaust/resources/libraries/examples/dynamic/compressor.dsp +8 -0
- cyfaust/resources/libraries/examples/dynamic/distortion.dsp +8 -0
- cyfaust/resources/libraries/examples/dynamic/gateCompressor.dsp +10 -0
- cyfaust/resources/libraries/examples/dynamic/noiseGate.dsp +8 -0
- cyfaust/resources/libraries/examples/dynamic/volume.dsp +15 -0
- cyfaust/resources/libraries/examples/filtering/APF.dsp +13 -0
- cyfaust/resources/libraries/examples/filtering/BPF.dsp +13 -0
- cyfaust/resources/libraries/examples/filtering/DNN.dsp +25 -0
- cyfaust/resources/libraries/examples/filtering/HPF.dsp +13 -0
- cyfaust/resources/libraries/examples/filtering/LPF.dsp +13 -0
- cyfaust/resources/libraries/examples/filtering/bandFilter.dsp +44 -0
- cyfaust/resources/libraries/examples/filtering/cryBaby.dsp +4 -0
- cyfaust/resources/libraries/examples/filtering/diodeLadder.dsp +12 -0
- cyfaust/resources/libraries/examples/filtering/filterBank.dsp +6 -0
- cyfaust/resources/libraries/examples/filtering/graphicEqLab.dsp +10 -0
- cyfaust/resources/libraries/examples/filtering/highShelf.dsp +13 -0
- cyfaust/resources/libraries/examples/filtering/korg35HPF.dsp +13 -0
- cyfaust/resources/libraries/examples/filtering/korg35LPF.dsp +13 -0
- cyfaust/resources/libraries/examples/filtering/lfBoost.dsp +40 -0
- cyfaust/resources/libraries/examples/filtering/lowBoost.dsp +40 -0
- cyfaust/resources/libraries/examples/filtering/lowCut.dsp +40 -0
- cyfaust/resources/libraries/examples/filtering/lowShelf.dsp +13 -0
- cyfaust/resources/libraries/examples/filtering/moogHalfLadder.dsp +12 -0
- cyfaust/resources/libraries/examples/filtering/moogLadder.dsp +12 -0
- cyfaust/resources/libraries/examples/filtering/moogVCF.dsp +6 -0
- cyfaust/resources/libraries/examples/filtering/multibandFilter.dsp +14 -0
- cyfaust/resources/libraries/examples/filtering/notch.dsp +13 -0
- cyfaust/resources/libraries/examples/filtering/oberheim.dsp +14 -0
- cyfaust/resources/libraries/examples/filtering/oberheimBPF.dsp +13 -0
- cyfaust/resources/libraries/examples/filtering/oberheimBSF.dsp +13 -0
- cyfaust/resources/libraries/examples/filtering/oberheimHPF.dsp +13 -0
- cyfaust/resources/libraries/examples/filtering/oberheimLPF.dsp +13 -0
- cyfaust/resources/libraries/examples/filtering/parametricEqLab.dsp +10 -0
- cyfaust/resources/libraries/examples/filtering/parametricEqualizer.dsp +6 -0
- cyfaust/resources/libraries/examples/filtering/peakNotch.dsp +13 -0
- cyfaust/resources/libraries/examples/filtering/peakingEQ.dsp +13 -0
- cyfaust/resources/libraries/examples/filtering/sallenKey2ndOrder.dsp +14 -0
- cyfaust/resources/libraries/examples/filtering/sallenKey2ndOrderBPF.dsp +13 -0
- cyfaust/resources/libraries/examples/filtering/sallenKey2ndOrderHPF.dsp +13 -0
- cyfaust/resources/libraries/examples/filtering/sallenKey2ndOrderLPF.dsp +13 -0
- cyfaust/resources/libraries/examples/filtering/sallenKeyOnePole.dsp +13 -0
- cyfaust/resources/libraries/examples/filtering/sallenKeyOnePoleHPF.dsp +12 -0
- cyfaust/resources/libraries/examples/filtering/sallenKeyOnePoleLPF.dsp +12 -0
- cyfaust/resources/libraries/examples/filtering/spectralTilt.dsp +8 -0
- cyfaust/resources/libraries/examples/filtering/vcfWahLab.dsp +12 -0
- cyfaust/resources/libraries/examples/filtering/vocoder.dsp +8 -0
- cyfaust/resources/libraries/examples/filtering/wahPedal.dsp +6 -0
- cyfaust/resources/libraries/examples/gameaudio/bubble.dsp +42 -0
- cyfaust/resources/libraries/examples/gameaudio/door.dsp +58 -0
- cyfaust/resources/libraries/examples/gameaudio/fire.dsp +46 -0
- cyfaust/resources/libraries/examples/gameaudio/insects.dsp +148 -0
- cyfaust/resources/libraries/examples/gameaudio/rain.dsp +27 -0
- cyfaust/resources/libraries/examples/gameaudio/wind.dsp +23 -0
- cyfaust/resources/libraries/examples/generator/filterOsc.dsp +8 -0
- cyfaust/resources/libraries/examples/generator/noise.dsp +52 -0
- cyfaust/resources/libraries/examples/generator/noiseMetadata.dsp +74 -0
- cyfaust/resources/libraries/examples/generator/osc.dsp +17 -0
- cyfaust/resources/libraries/examples/generator/osci.dsp +17 -0
- cyfaust/resources/libraries/examples/generator/sawtoothLab.dsp +8 -0
- cyfaust/resources/libraries/examples/generator/virtualAnalog.dsp +8 -0
- cyfaust/resources/libraries/examples/generator/virtualAnalogLab.dsp +10 -0
- cyfaust/resources/libraries/examples/misc/UITester.dsp +71 -0
- cyfaust/resources/libraries/examples/misc/autopan.dsp +59 -0
- cyfaust/resources/libraries/examples/misc/capture.dsp +24 -0
- cyfaust/resources/libraries/examples/misc/drumkit.dsp +36 -0
- cyfaust/resources/libraries/examples/misc/guitarix.dsp +184 -0
- cyfaust/resources/libraries/examples/misc/matrix.dsp +17 -0
- cyfaust/resources/libraries/examples/misc/midiTester.dsp +122 -0
- cyfaust/resources/libraries/examples/misc/mixer.dsp +27 -0
- cyfaust/resources/libraries/examples/misc/statespace.dsp +39 -0
- cyfaust/resources/libraries/examples/misc/switcher.dsp +20 -0
- cyfaust/resources/libraries/examples/misc/tester.dsp +32 -0
- cyfaust/resources/libraries/examples/misc/tester2.dsp +31 -0
- cyfaust/resources/libraries/examples/old/README.md +5 -0
- cyfaust/resources/libraries/examples/old/freeverb.dsp +109 -0
- cyfaust/resources/libraries/examples/old/rewriting/Makefile +21 -0
- cyfaust/resources/libraries/examples/old/rewriting/fact.dsp +3 -0
- cyfaust/resources/libraries/examples/old/rewriting/fold.dsp +61 -0
- cyfaust/resources/libraries/examples/old/rewriting/mesh.dsp +43 -0
- cyfaust/resources/libraries/examples/old/rewriting/mesh.pd +37 -0
- cyfaust/resources/libraries/examples/old/rewriting/sample.pd +12 -0
- cyfaust/resources/libraries/examples/old/rewriting/serial.dsp +7 -0
- cyfaust/resources/libraries/examples/old/rewriting/sum.dsp +55 -0
- cyfaust/resources/libraries/examples/old/rewriting/test.pd +48 -0
- cyfaust/resources/libraries/examples/phasing/flanger.dsp +8 -0
- cyfaust/resources/libraries/examples/phasing/phaser.dsp +8 -0
- cyfaust/resources/libraries/examples/phasing/phaserFlangerLab.dsp +12 -0
- cyfaust/resources/libraries/examples/physicalModeling/brass.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/brassMIDI.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/churchBell.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/clarinet.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/clarinetMIDI.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/djembeMIDI.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/elecGuitarMIDI.dsp +10 -0
- cyfaust/resources/libraries/examples/physicalModeling/englishBell.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/NLFeks.dsp +91 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/NLFfm.dsp +70 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/README +125 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/bass.dsp +84 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/bass.h +91 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/blowBottle.dsp +102 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/bowed.dsp +114 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/brass.dsp +103 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/clarinet.dsp +110 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/flute.dsp +116 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/fluteStk.dsp +121 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/glassHarmonica.dsp +131 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/harpsi.dsp +90 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/harpsichord.h +185 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/instrument.h +114 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/modalBar.dsp +122 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/modalBar.h +48 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/audio-out.pd +33 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/bottle.pd +10 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/clarinets.pd +15 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/canon/audio-out.pd +33 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/canon/bass.pd +162 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/canon/canon.pd +55 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/canon/flute.pd +343 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/canon/pachelbel.mid +0 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/daisy/audio-out.pd +33 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/daisy/daisy.mid +0 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/daisy/daisy.pd +45 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/daisy/piano.pd +205 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/daisy/voiceForm.pd +340 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/take5/audio-out.pd +33 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/take5/blowHole.pd +330 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/take5/piano.pd +205 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/take5/take5.mid +0 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/take5/take5.pd +45 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/turkish-march/audio-out.pd +33 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/turkish-march/harpsi.pd +204 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/turkish-march/turkish-march.mid +0 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/turkish-march/turkish-march.pd +31 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/what-a-friend/audio-out.pd +33 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/what-a-friend/bass.pd +162 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/what-a-friend/modalBar.pd +258 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/what-a-friend/piano.pd +205 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/what-a-friend/what-a-friend.pd +52 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fancy/what-a-friend/what_a_friend.mid +0 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/flutes.pd +15 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/fm.pd +10 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/glassBare.pd +10 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/harpsichord-poly.pd +10 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/ironBare.pd +10 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/midi-in.pd +111 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/modal.pd +10 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/osc.pd +26 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/piano-poly.pd +10 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/plucked.pd +20 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/saxophone.pd +10 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/tibetan.pd +10 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/trumpet.pd +10 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/violin.pd +10 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/voiceSynth.pd +10 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/pd-patches/woodenBare.pd +10 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/phonemes.h +189 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/piano.dsp +255 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/piano.h +751 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/saxophony.dsp +114 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/sitar.dsp +48 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/tibetanBowl.dsp +155 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/tunedBar.dsp +123 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/uniBar.dsp +100 -0
- cyfaust/resources/libraries/examples/physicalModeling/faust-stk/voiceForm.dsp +125 -0
- cyfaust/resources/libraries/examples/physicalModeling/fds/1dDampedWaveEquation.dsp +43 -0
- cyfaust/resources/libraries/examples/physicalModeling/fds/2dKirchhoffThinPlate.dsp +75 -0
- cyfaust/resources/libraries/examples/physicalModeling/fds/BowedString.dsp +61 -0
- cyfaust/resources/libraries/examples/physicalModeling/fds/ControllableNonPhysicalString.dsp +72 -0
- cyfaust/resources/libraries/examples/physicalModeling/fds/HammeredString.dsp +74 -0
- cyfaust/resources/libraries/examples/physicalModeling/fds/PianoHammeredString.dsp +85 -0
- cyfaust/resources/libraries/examples/physicalModeling/fds/StiffString.dsp +54 -0
- cyfaust/resources/libraries/examples/physicalModeling/flute.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/fluteMIDI.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/frenchBell.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/germanBell.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/guitarMIDI.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/karplus.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/marimbaMIDI.dsp +10 -0
- cyfaust/resources/libraries/examples/physicalModeling/mi-faust/00_BasicOscillator/harmonicOscillator.dsp +58 -0
- cyfaust/resources/libraries/examples/physicalModeling/mi-faust/00_BasicOscillator/harmonicOscillator2.dsp +62 -0
- cyfaust/resources/libraries/examples/physicalModeling/mi-faust/00_BasicOscillator/harmonicOscillator3.dsp +65 -0
- cyfaust/resources/libraries/examples/physicalModeling/mi-faust/01_ParamControl/paramOsc.dsp +63 -0
- cyfaust/resources/libraries/examples/physicalModeling/mi-faust/02_AudioParamControl/audioParamOsc.dsp +63 -0
- cyfaust/resources/libraries/examples/physicalModeling/mi-faust/03_HammerTime/hammerOsc.dsp +71 -0
- cyfaust/resources/libraries/examples/physicalModeling/mi-faust/04_Gravity/bouncingOsc.dsp +64 -0
- cyfaust/resources/libraries/examples/physicalModeling/mi-faust/05_PluckedOscillator/pluckedOsc.dsp +57 -0
- cyfaust/resources/libraries/examples/physicalModeling/mi-faust/06_BowedOscillator/bowedOsc.dsp +65 -0
- cyfaust/resources/libraries/examples/physicalModeling/mi-faust/07_NonLinearOscillator/nlOsc.dsp +78 -0
- cyfaust/resources/libraries/examples/physicalModeling/mi-faust/08_TwoMassChain/2massChain.dsp +75 -0
- cyfaust/resources/libraries/examples/physicalModeling/mi-faust/09_TinyString/tinyString.dsp +101 -0
- cyfaust/resources/libraries/examples/physicalModeling/mi-faust/10_PluckedString/pluckedString.dsp +678 -0
- cyfaust/resources/libraries/examples/physicalModeling/mi-faust/11_BowedString/bowedString.dsp +671 -0
- cyfaust/resources/libraries/examples/physicalModeling/mi-faust/12_TriangleMesh/triangleMesh.dsp +448 -0
- cyfaust/resources/libraries/examples/physicalModeling/mi-faust/13_Construction/construction.dsp +1036 -0
- cyfaust/resources/libraries/examples/physicalModeling/mi-faust/14_Polyphonic/polyTriangle.dsp +79 -0
- cyfaust/resources/libraries/examples/physicalModeling/mi-faust/15_PhysicalLFO/physicalLFO.dsp +107 -0
- cyfaust/resources/libraries/examples/physicalModeling/modularInterpInstrMIDI.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/nylonGuitarMIDI.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/old/harpe.dsp +45 -0
- cyfaust/resources/libraries/examples/physicalModeling/old/karplus.dsp +34 -0
- cyfaust/resources/libraries/examples/physicalModeling/old/karplus32.dsp +47 -0
- cyfaust/resources/libraries/examples/physicalModeling/russianBell.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/standardBell.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/violin.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/violinMIDI.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/vocalBP.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/vocalBPMIDI.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/vocalFOF.dsp +8 -0
- cyfaust/resources/libraries/examples/physicalModeling/vocalFOFMIDI.dsp +8 -0
- cyfaust/resources/libraries/examples/pitchShifting/pitchShifter.dsp +20 -0
- cyfaust/resources/libraries/examples/psychoacoustic/harmonicExciter.dsp +10 -0
- cyfaust/resources/libraries/examples/quantizing/quantizedChords.dsp +49 -0
- cyfaust/resources/libraries/examples/reverb/dattorro.dsp +8 -0
- cyfaust/resources/libraries/examples/reverb/fdnRev.dsp +8 -0
- cyfaust/resources/libraries/examples/reverb/freeverb.dsp +8 -0
- cyfaust/resources/libraries/examples/reverb/greyhole.dsp +8 -0
- cyfaust/resources/libraries/examples/reverb/jprev.dsp +8 -0
- cyfaust/resources/libraries/examples/reverb/reverbDesigner.dsp +12 -0
- cyfaust/resources/libraries/examples/reverb/reverbTester.dsp +8 -0
- cyfaust/resources/libraries/examples/reverb/zitaRev.dsp +8 -0
- cyfaust/resources/libraries/examples/reverb/zitaRevFDN.dsp +8 -0
- cyfaust/resources/libraries/examples/smartKeyboard/acGuitar.dsp +100 -0
- cyfaust/resources/libraries/examples/smartKeyboard/associatedEffects/elecGuitarEffect.dsp +8 -0
- cyfaust/resources/libraries/examples/smartKeyboard/associatedEffects/myEffect.dsp +5 -0
- cyfaust/resources/libraries/examples/smartKeyboard/associatedEffects/reverb.dsp +5 -0
- cyfaust/resources/libraries/examples/smartKeyboard/bells.dsp +80 -0
- cyfaust/resources/libraries/examples/smartKeyboard/bowed.dsp +87 -0
- cyfaust/resources/libraries/examples/smartKeyboard/brass.dsp +82 -0
- cyfaust/resources/libraries/examples/smartKeyboard/clarinet.dsp +113 -0
- cyfaust/resources/libraries/examples/smartKeyboard/crazyGuiro.dsp +96 -0
- cyfaust/resources/libraries/examples/smartKeyboard/drums.dsp +74 -0
- cyfaust/resources/libraries/examples/smartKeyboard/dubDub.dsp +87 -0
- cyfaust/resources/libraries/examples/smartKeyboard/elecGuitar.dsp +67 -0
- cyfaust/resources/libraries/examples/smartKeyboard/fm.dsp +78 -0
- cyfaust/resources/libraries/examples/smartKeyboard/frog.dsp +74 -0
- cyfaust/resources/libraries/examples/smartKeyboard/harp.dsp +84 -0
- cyfaust/resources/libraries/examples/smartKeyboard/midiOnly.dsp +62 -0
- cyfaust/resources/libraries/examples/smartKeyboard/multiSynth.dsp +75 -0
- cyfaust/resources/libraries/examples/smartKeyboard/toy.dsp +71 -0
- cyfaust/resources/libraries/examples/smartKeyboard/trumpet.dsp +59 -0
- cyfaust/resources/libraries/examples/smartKeyboard/turenas.dsp +114 -0
- cyfaust/resources/libraries/examples/smartKeyboard/violin.dsp +91 -0
- cyfaust/resources/libraries/examples/smartKeyboard/violin2.dsp +84 -0
- cyfaust/resources/libraries/examples/smartKeyboard/vocal.dsp +43 -0
- cyfaust/resources/libraries/examples/spat/panpot.dsp +17 -0
- cyfaust/resources/libraries/examples/spat/spat.dsp +25 -0
- cyfaust/resources/libraries/fds.lib +535 -0
- cyfaust/resources/libraries/filter.lib +1710 -0
- cyfaust/resources/libraries/filters.lib +3125 -0
- cyfaust/resources/libraries/hoa.lib +1081 -0
- cyfaust/resources/libraries/instruments.lib +263 -0
- cyfaust/resources/libraries/interpolators.lib +675 -0
- cyfaust/resources/libraries/math.lib +602 -0
- cyfaust/resources/libraries/maths.lib +798 -0
- cyfaust/resources/libraries/maxmsp.lib +237 -0
- cyfaust/resources/libraries/mi.lib +528 -0
- cyfaust/resources/libraries/misceffects.lib +998 -0
- cyfaust/resources/libraries/music.lib +496 -0
- cyfaust/resources/libraries/noises.lib +487 -0
- cyfaust/resources/libraries/oscillator.lib +450 -0
- cyfaust/resources/libraries/oscillators.lib +1838 -0
- cyfaust/resources/libraries/phaflangers.lib +235 -0
- cyfaust/resources/libraries/physmodels.lib +3990 -0
- cyfaust/resources/libraries/platform.lib +59 -0
- cyfaust/resources/libraries/quantizers.lib +310 -0
- cyfaust/resources/libraries/reducemaps.lib +235 -0
- cyfaust/resources/libraries/reverbs.lib +686 -0
- cyfaust/resources/libraries/routes.lib +262 -0
- cyfaust/resources/libraries/sf.lib +53 -0
- cyfaust/resources/libraries/signals.lib +570 -0
- cyfaust/resources/libraries/soundfiles.lib +234 -0
- cyfaust/resources/libraries/spats.lib +173 -0
- cyfaust/resources/libraries/stdfaust.lib +38 -0
- cyfaust/resources/libraries/synths.lib +322 -0
- cyfaust/resources/libraries/tonestacks.lib +427 -0
- cyfaust/resources/libraries/tubes.lib +5039 -0
- cyfaust/resources/libraries/vaeffects.lib +984 -0
- cyfaust/resources/libraries/version.lib +22 -0
- cyfaust/resources/libraries/wdmodels.lib +2276 -0
- cyfaust/resources/libraries/webaudio.lib +402 -0
- cyfaust/signal.pxd +44 -0
- cyfaust/signal.pyx +1993 -0
- cyfaust-0.1.0.dist-info/METADATA +355 -0
- cyfaust-0.1.0.dist-info/RECORD +693 -0
- cyfaust-0.1.0.dist-info/WHEEL +5 -0
- cyfaust-0.1.0.dist-info/entry_points.txt +3 -0
- cyfaust-0.1.0.dist-info/licenses/LICENSE +26 -0
|
@@ -0,0 +1,1081 @@
|
|
|
1
|
+
//################################### hoa.lib ############################################
|
|
2
|
+
// Faust library for high order ambisonic. Its official prefix is `ho`.
|
|
3
|
+
//
|
|
4
|
+
// #### References
|
|
5
|
+
// * <https://github.com/grame-cncm/faustlibraries/blob/master/hoa.lib>
|
|
6
|
+
//########################################################################################
|
|
7
|
+
|
|
8
|
+
/************************************************************************
|
|
9
|
+
************************************************************************
|
|
10
|
+
FAUST library file
|
|
11
|
+
Copyright (C) 2003-2012 GRAME, Centre National de Creation Musicale
|
|
12
|
+
----------------------------------------------------------------------
|
|
13
|
+
This program is free software; you can redistribute it and/or modify
|
|
14
|
+
it under the terms of the GNU Lesser General Public License as
|
|
15
|
+
published by the Free Software Foundation; either version 2.1 of the
|
|
16
|
+
License, or (at your option) any later version.
|
|
17
|
+
|
|
18
|
+
This program is distributed in the hope that it will be useful,
|
|
19
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
21
|
+
GNU Lesser General Public License for more details.
|
|
22
|
+
|
|
23
|
+
You should have received a copy of the GNU Lesser General Public
|
|
24
|
+
License along with the GNU C Library; if not, write to the Free
|
|
25
|
+
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|
26
|
+
02111-1307 USA.
|
|
27
|
+
|
|
28
|
+
EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
|
|
29
|
+
larger FAUST program which directly or indirectly imports this library
|
|
30
|
+
file and still distribute the compiled code generated by the FAUST
|
|
31
|
+
compiler, or a modified version of this compiled code, under your own
|
|
32
|
+
copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
|
|
33
|
+
grants you the right to freely choose the license for the resulting
|
|
34
|
+
compiled code. In particular the resulting compiled code has no obligation
|
|
35
|
+
to be LGPL or GPL. For example you are free to choose a commercial or
|
|
36
|
+
closed source license or any other license if you decide so.
|
|
37
|
+
|
|
38
|
+
************************************************************************
|
|
39
|
+
************************************************************************/
|
|
40
|
+
|
|
41
|
+
ma = library("maths.lib");
|
|
42
|
+
si = library("signals.lib");
|
|
43
|
+
ba = library("basics.lib");
|
|
44
|
+
os = library("oscillators.lib");
|
|
45
|
+
ho = library("hoa.lib");
|
|
46
|
+
ro = library("routes.lib");
|
|
47
|
+
de = library("delays.lib");
|
|
48
|
+
|
|
49
|
+
declare name "High Order Ambisonics library";
|
|
50
|
+
declare version "1.4.0";
|
|
51
|
+
declare author "Pierre Guillot";
|
|
52
|
+
declare author "Eliott Paris";
|
|
53
|
+
declare author "Julien Colafrancesco";
|
|
54
|
+
declare author "Wargreen";
|
|
55
|
+
declare author "Alain Bonardi";
|
|
56
|
+
declare author "Paul Goutmann";
|
|
57
|
+
declare copyright "2012-2013 Guillot, Paris, Colafrancesco, CICM labex art H2H, U. Paris 8, 2019 Wargreen, 2022 Bonardi, Goutmann";
|
|
58
|
+
|
|
59
|
+
//============================Encoding/decoding Functions=================================
|
|
60
|
+
//========================================================================================
|
|
61
|
+
|
|
62
|
+
//----------------------`(ho.)encoder`---------------------------------
|
|
63
|
+
// Ambisonic encoder. Encodes a signal in the circular harmonics domain
|
|
64
|
+
// depending on an order of decomposition and an angle.
|
|
65
|
+
//
|
|
66
|
+
// #### Usage
|
|
67
|
+
//
|
|
68
|
+
// ```
|
|
69
|
+
// encoder(N, x, a) : _
|
|
70
|
+
// ```
|
|
71
|
+
//
|
|
72
|
+
// Where:
|
|
73
|
+
//
|
|
74
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
75
|
+
// * `x`: the signal
|
|
76
|
+
// * `a`: the angle
|
|
77
|
+
//----------------------------------------------------------------
|
|
78
|
+
encoder(0, x, a) = x;
|
|
79
|
+
encoder(N, x, a) = encoder(N-1, x, a), x*sin(N*a), x*cos(N*a);
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
//-------`(ho.)rEncoder`----------
|
|
83
|
+
// Ambisonic encoder in 2D including source rotation. A mono signal is encoded at a certain ambisonic order
|
|
84
|
+
// with two possible modes: either rotation with an angular speed, or static with a fixed angle (when speed is zero).
|
|
85
|
+
//
|
|
86
|
+
// #### Usage
|
|
87
|
+
//
|
|
88
|
+
// ```
|
|
89
|
+
// _ : rEncoder(N, sp, a, it) : _,_, ...
|
|
90
|
+
// ```
|
|
91
|
+
//
|
|
92
|
+
// Where:
|
|
93
|
+
//
|
|
94
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
95
|
+
// * `sp`: the azimuth speed expressed as angular speed (2PI/sec), positive or negative
|
|
96
|
+
// * `a`: the fixed azimuth when the rotation stops (sp = 0) in radians
|
|
97
|
+
// * `it` : interpolation time (in milliseconds) between the rotation and the fixed modes
|
|
98
|
+
//-----------------------------
|
|
99
|
+
rEncoder(N, sp, a, it) = thisEncoder
|
|
100
|
+
with {
|
|
101
|
+
basicEncoder(sig, angle) = ho.encoder(N, sig, angle);
|
|
102
|
+
thisEncoder = (_, rotationOrStaticAngle) : basicEncoder
|
|
103
|
+
with {
|
|
104
|
+
//converting the static angle from radians to [0; 1]
|
|
105
|
+
an = (a / (2 * ma.PI), 1) : fmod;
|
|
106
|
+
rotationOrStaticAngle = ((1-vn) * x + vn * an) * 2 * ma.PI;
|
|
107
|
+
//to manage the case where frequency is zero, smoothly switches from one mode to another//
|
|
108
|
+
vn = (sp == 0) : si.smooth(ba.tau2pole(it));
|
|
109
|
+
x = (os.phasor(1, sp), an, 1) : (+, _) : fmod;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
//-------`(ho.)stereoEncoder`----------
|
|
115
|
+
// Encoding of a stereo pair of channels with symetric angles (a/2, -a/2).
|
|
116
|
+
//
|
|
117
|
+
// #### Usage
|
|
118
|
+
//
|
|
119
|
+
// ```
|
|
120
|
+
// _,_ : stereoEncoder(N, a) : _,_, ...
|
|
121
|
+
// ```
|
|
122
|
+
//
|
|
123
|
+
// Where:
|
|
124
|
+
//
|
|
125
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
126
|
+
// * `a` : opening angle in radians, left channel at a/2 angle, right channel at -a/2 angle
|
|
127
|
+
//-----------------------------
|
|
128
|
+
stereoEncoder(N, a) = (leftEncoder, rightEncoder) :> si.bus(2*N+1)
|
|
129
|
+
with {
|
|
130
|
+
basicEncoder(sig, angle) = ho.encoder(N, sig, angle);
|
|
131
|
+
leftEncoder = (_, a / 2) : basicEncoder;
|
|
132
|
+
rightEncoder = (_, -a /2) : basicEncoder;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
//-------`(ho.)multiEncoder`----------
|
|
137
|
+
// Encoding of a set of P signals distributed on the unit circle according to a list of P speeds and P angles.
|
|
138
|
+
//
|
|
139
|
+
// #### Usage
|
|
140
|
+
//
|
|
141
|
+
// ```
|
|
142
|
+
// _,_, ... : multiEncoder(N, lspeed, langle, it) : _,_, ...
|
|
143
|
+
// ```
|
|
144
|
+
//
|
|
145
|
+
// Where:
|
|
146
|
+
//
|
|
147
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
148
|
+
// * `lspeed` : a list of P speeds in turns by second (one speed per input signal, positive or negative)
|
|
149
|
+
// * `langle` : a list of P angles in radians on the unit circle to localize the sources (one angle per input signal)
|
|
150
|
+
// * `it` : interpolation time (in milliseconds) between the rotation and the fixed modes.
|
|
151
|
+
//-----------------------------
|
|
152
|
+
multiEncoder(N, lspeed, langle, it) = par(i, P, thisEncoder(ba.take(i+1, lspeed), ba.take(i+1, langle), it)) :> si.bus(2*N+1)
|
|
153
|
+
with {
|
|
154
|
+
P = outputs(langle); //supposed to be the same as outputs(lspeed)
|
|
155
|
+
basicEncoder(sig, angle) = ho.encoder(N, sig, angle);
|
|
156
|
+
thisEncoder(sp, a, it) = (_, rotationOrStaticAngle) : basicEncoder
|
|
157
|
+
with {
|
|
158
|
+
//converting the static angle from radians to [0; 1]
|
|
159
|
+
an = (a / (2 * ma.PI), 1) : fmod;
|
|
160
|
+
rotationOrStaticAngle = ((1-vn) * x + vn * an) * 2 * ma.PI;
|
|
161
|
+
//to manage the case where frequency is zero, smoothly switches from one mode to another//
|
|
162
|
+
vn = (sp == 0) : si.smooth(ba.tau2pole(it));
|
|
163
|
+
x = (os.phasor(1, sp), an, 1) : (+, _) : fmod;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
//--------------------------`(ho.)decoder`--------------------------------
|
|
169
|
+
// Decodes an ambisonics sound field for a circular array of loudspeakers.
|
|
170
|
+
//
|
|
171
|
+
// #### Usage
|
|
172
|
+
//
|
|
173
|
+
// ```
|
|
174
|
+
// _ : decoder(N, P) : _
|
|
175
|
+
// ```
|
|
176
|
+
//
|
|
177
|
+
// Where:
|
|
178
|
+
//
|
|
179
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
180
|
+
// * `P`: the number of speakers (constant numerical expression)
|
|
181
|
+
//
|
|
182
|
+
// #### Note
|
|
183
|
+
//
|
|
184
|
+
// The number of loudspeakers must be greater or equal to 2n+1.
|
|
185
|
+
// It's preferable to use 2n+2 loudspeakers.
|
|
186
|
+
//-------------------------------------------------------------------
|
|
187
|
+
decoder(N, P) = par(i, 2*N+1, _) <: par(i, P, speaker(N, 2 * ma.PI*i/P))
|
|
188
|
+
with {
|
|
189
|
+
speaker(N,a) = /(2), par(i, 2*N, _), encoder(N, 2/P, a) : si.dot(2*N+1);
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
//-----------------------`(ho.)decoderStereo`------------------------
|
|
194
|
+
// Decodes an ambisonic sound field for stereophonic configuration.
|
|
195
|
+
// An "home made" ambisonic decoder for stereophonic restitution
|
|
196
|
+
// (30° - 330°): Sound field lose energy around 180°. You should
|
|
197
|
+
// use `inPhase` optimization with ponctual sources.
|
|
198
|
+
// #### Usage
|
|
199
|
+
//
|
|
200
|
+
// ```
|
|
201
|
+
// _ : decoderStereo(N) : _
|
|
202
|
+
// ```
|
|
203
|
+
//
|
|
204
|
+
// Where:
|
|
205
|
+
//
|
|
206
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
207
|
+
//--------------------------------------------------------------
|
|
208
|
+
decoderStereo(N) = decoder(N, P) <: (par(i, 2*N+2, gainLeft(360 * i / P)) :> _),
|
|
209
|
+
(par(i, 2*N+2, gainRight(360 * i / P)) :> _)
|
|
210
|
+
with {
|
|
211
|
+
P = 2*N+2;
|
|
212
|
+
|
|
213
|
+
gainLeft(a) = _ * sin(ratio_minus + ratio_cortex)
|
|
214
|
+
with {
|
|
215
|
+
ratio_minus = ma.PI*.5 * abs((30 + a) / 60 * ((a <= 30)) + (a - 330) / 60 * (a >= 330));
|
|
216
|
+
ratio_cortex= ma.PI*.5 * abs((120 + a) / 150 * (a > 30) * (a <= 180));
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
gainRight(a) = _ * sin(ratio_minus + ratio_cortex)
|
|
220
|
+
with {
|
|
221
|
+
ratio_minus = ma.PI*.5 * abs((390 - a) / 60 * (a >= 330) + (30 - a) / 60 * (a <= 30));
|
|
222
|
+
ratio_cortex= ma.PI*.5 * abs((180 - a) / 150 * (a < 330) * (a >= 180));
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
//-------`(ho.)iBasicDecoder`----------
|
|
228
|
+
// The irregular basic decoder is a simple decoder that projects the incoming ambisonic situation
|
|
229
|
+
// to the loudspeaker situation (P loudspeakers) whatever it is, without compensation.
|
|
230
|
+
// When there is a strong irregularity, there can be some discontinuity in the sound field.
|
|
231
|
+
//
|
|
232
|
+
// #### Usage
|
|
233
|
+
//
|
|
234
|
+
// ```
|
|
235
|
+
// _,_, ... : iBasicDecoder(N,la, direct, shift) : _,_, ...
|
|
236
|
+
// ```
|
|
237
|
+
//
|
|
238
|
+
// Where:
|
|
239
|
+
//
|
|
240
|
+
// * `N`: the ambisonic order (there are 2*N+1 inputs to this function)
|
|
241
|
+
// * `la` : the list of P angles in degrees, for instance (0, 85, 182, 263) for four loudspeakers
|
|
242
|
+
// * `direct`: 1 for direct mode, -1 for the indirect mode (changes the rotation direction)
|
|
243
|
+
// * `shift` : angular shift in degrees to easily adjust angles
|
|
244
|
+
//-----------------------------
|
|
245
|
+
iBasicDecoder(N, la, direct, shift) = (par(i, 2*N+1, _) <: par(i, P, speaker(N, ang(i))))
|
|
246
|
+
with {
|
|
247
|
+
P = outputs(la);
|
|
248
|
+
ang(i) = (ba.take(i+1, la) - direct * shift) * direct * ma.PI / 180.;
|
|
249
|
+
speaker(N,alpha) = /(2), par(i, 2*N, _), ho.encoder(N,2/P,alpha) : si.dot(2*N+1);
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
//-------`(ho.)circularScaledVBAP`----------
|
|
254
|
+
// The function provides a circular scaled VBAP with all loudspeakers and the virtual source on the unit-circle.
|
|
255
|
+
//
|
|
256
|
+
// #### Usage
|
|
257
|
+
//
|
|
258
|
+
// ```
|
|
259
|
+
// _ : circularScaledVBAP(l, t) : _,_, ...
|
|
260
|
+
// ```
|
|
261
|
+
//
|
|
262
|
+
// Where:
|
|
263
|
+
//
|
|
264
|
+
// * `l` : the list of angles of the loudspeakers in degrees, for instance (0, 85, 182, 263) for four loudspeakers
|
|
265
|
+
// * `t` : the current angle of the virtual source in degrees
|
|
266
|
+
//-----------------------------
|
|
267
|
+
circularScaledVBAP(l, t) = thisCircularVbap
|
|
268
|
+
with {
|
|
269
|
+
//modulo indexes between 1 and the number of elements of the list
|
|
270
|
+
modIndex(i, l) = ma.modulo(i, outputs(l)) + 1;
|
|
271
|
+
//
|
|
272
|
+
//pick up the ith angle with a 360 degree modulo
|
|
273
|
+
getElt(i, l) = ma.modulo(ba.take(modIndex(i, l), l), 360);
|
|
274
|
+
//
|
|
275
|
+
//function to compute the sinus of the difference between angles expressed in degrees
|
|
276
|
+
diffSin(u, v) = sin((v - u) * ma.PI / 180.);
|
|
277
|
+
//
|
|
278
|
+
//permutations to be used to compute scaledVBAPGain
|
|
279
|
+
p1(a, b, c, d) = (b, c, d, a);
|
|
280
|
+
p2(a, b, c, d) = (a, c, b, d);
|
|
281
|
+
//
|
|
282
|
+
//computation of the scaled VBAP gain of a pair
|
|
283
|
+
scaledVBAPGain(t1, t2, t) = ((diffSin(t2, t) <:(_, _, _)), (ma.signum(diffSin(t2, t1)) <: (_, _)), (diffSin(t, t1) <:(_, _, _))) : (*, *, *, *) : p1 : (_, _, (+ : sqrt <: (_, _))) : p2 : (/, /);
|
|
284
|
+
sVBAPGain(i, l, t) = scaledVBAPGain(getElt(i, l), getElt(i+1, l), t);
|
|
285
|
+
//
|
|
286
|
+
//computes the left and the right gains using the matrix inversion (VBAP)
|
|
287
|
+
leftGain(i, l, t) = sVBAPGain(i, l, t) : (_, !);
|
|
288
|
+
rightGain(i, l, t) = sVBAPGain(i, l, t) : (!, _);
|
|
289
|
+
//computation of boolean activePair that determines whether the pair of LS is active or not
|
|
290
|
+
//we have to distinguish leftGain >0 and rightGain >= 0
|
|
291
|
+
//if we put >=0 for both, two pairs will be simultaneously active when theta is one of the loudspeaker angles in the list
|
|
292
|
+
//if we put > 0 for both, all the pairs will be inactive when theta is one of the loudspeaker angles in the list
|
|
293
|
+
activePair(i, l, t) = (leftGain(i, l, t) > 0) * (rightGain(i, l, t) >= 0);
|
|
294
|
+
//
|
|
295
|
+
//computes the total gain for each loudspeaker
|
|
296
|
+
cumulatedGain(i, l, t) = rightGain(outputs(l)+i-1, l, t) * activePair(outputs(l)+i-1, l, t) + leftGain(i, l, t) * activePair(i, l, t);
|
|
297
|
+
//
|
|
298
|
+
thisCircularVbap = _ <: par(i, outputs(l), *(cumulatedGain(i, l, t)));
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
//-------`(ho.)imlsDecoder`----------
|
|
303
|
+
// Irregular decoder in 2D for an irregular configuration of P loudspeakers
|
|
304
|
+
// using 2D VBAP for compensation.
|
|
305
|
+
//
|
|
306
|
+
// #### Usage
|
|
307
|
+
//
|
|
308
|
+
// ```
|
|
309
|
+
// _,_, ... : imlsDecoder(N,la, direct, shift) : _,_, ...
|
|
310
|
+
// ```
|
|
311
|
+
//
|
|
312
|
+
// Where:
|
|
313
|
+
//
|
|
314
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
315
|
+
// * `la` : the list of P angles in degrees, for instance (0, 85, 182, 263) for four loudspeakers
|
|
316
|
+
// * `direct`: 1 for direct mode, -1 for the indirect mode (changes the rotation direction)
|
|
317
|
+
// * `shift` : angular shift in degrees to easily adjust angles
|
|
318
|
+
//-----------------------------
|
|
319
|
+
imlsDecoder(N, la, direct, shift) = si.bus(2*N+1) : iVBAPDecoder
|
|
320
|
+
with {
|
|
321
|
+
P = outputs(la);
|
|
322
|
+
//The VBAP decoder uses VBAP compensation: it balances the regular decoder output enabling to use irregular angular setup.
|
|
323
|
+
Q = max(2*N+2, P);
|
|
324
|
+
iVBAPDecoder = ho.decoder(N, Q) : par(i, Q, circularScaledVBAP(la, (i * 360 / Q - direct * shift) * direct)) :> si.bus(P);
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
//-------`(ho.)iDecoder`----------
|
|
329
|
+
// General decoder in 2D enabling an irregular multi-loudspeaker configuration
|
|
330
|
+
// and to switch between multi-channel and stereo.
|
|
331
|
+
//
|
|
332
|
+
// #### Usage
|
|
333
|
+
//
|
|
334
|
+
// ```
|
|
335
|
+
// _,_, ... : iDecoder(N, la, direct, st, g) : _,_, ...
|
|
336
|
+
// ```
|
|
337
|
+
//
|
|
338
|
+
// Where:
|
|
339
|
+
//
|
|
340
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
341
|
+
// * `la`: the list of angles in degrees
|
|
342
|
+
// * `direct`: 1 for direct mode, -1 for the indirect mode (changes the rotation direction)
|
|
343
|
+
// * `shift` : angular shift in degrees to easily adjust angles
|
|
344
|
+
// * `st`: 1 for stereo, 0 for multi-loudspeaker configuration. When 1, stereo sounds goes through the first two channels
|
|
345
|
+
// * `g` : gain between 0 and 1
|
|
346
|
+
//-----------------------------
|
|
347
|
+
iDecoder(N, la, direct, shift, st, g) = thisDecoder
|
|
348
|
+
with {
|
|
349
|
+
//p is the number of outputs
|
|
350
|
+
P = outputs(la);
|
|
351
|
+
ambi = 1 - st;
|
|
352
|
+
//
|
|
353
|
+
//for stereo decoding
|
|
354
|
+
paddedStereoDecoder(N, P) = (gDecoderStereo, (0 <: si.bus(P-2)))
|
|
355
|
+
with {
|
|
356
|
+
leftDispatcher = _<:(*(1-direct), *(direct));
|
|
357
|
+
rightDispatcher = _<:(*(direct), *(1-direct));
|
|
358
|
+
gDecoderStereo = ho.decoderStereo(N) : (*(g), *(g)) : (leftDispatcher, rightDispatcher) :> (_,_);
|
|
359
|
+
};
|
|
360
|
+
//
|
|
361
|
+
thisDecoder = si.bus(2*N+1) <: (si.bus(2*N+1), si.bus(2*N+1)) : (imlsDecoder(N, la, direct, shift), paddedStereoDecoder(N, P)) : (par(i, P, *(ambi)), *(st), *(st), si.bus(P-2)) :> si.bus(P) : par(i, P, *(g));
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
//============================Optimization Functions======================================
|
|
366
|
+
// Functions to weight the circular harmonics signals depending to the
|
|
367
|
+
// ambisonics optimization.
|
|
368
|
+
// It can be `basic` for no optimization, `maxRe` or `inPhase`.
|
|
369
|
+
//========================================================================================
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
//----------------`(ho.)optimBasic`-------------------------
|
|
373
|
+
// The basic optimization has no effect and should be used for a perfect
|
|
374
|
+
// circle of loudspeakers with one listener at the perfect center loudspeakers
|
|
375
|
+
// array.
|
|
376
|
+
//
|
|
377
|
+
// #### Usage
|
|
378
|
+
//
|
|
379
|
+
// ```
|
|
380
|
+
// _ : optimBasic(N) : _
|
|
381
|
+
// ```
|
|
382
|
+
//
|
|
383
|
+
// Where:
|
|
384
|
+
//
|
|
385
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
386
|
+
//-----------------------------------------------------
|
|
387
|
+
optimBasic(N) = par(i, 2*N+1, _);
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
//----------------`(ho.)optimMaxRe`-------------------------
|
|
391
|
+
// The maxRe optimization optimizes energy vector. It should be used for an
|
|
392
|
+
// auditory confined in the center of the loudspeakers array.
|
|
393
|
+
//
|
|
394
|
+
// #### Usage
|
|
395
|
+
//
|
|
396
|
+
// ```
|
|
397
|
+
// _ : optimMaxRe(N) : _
|
|
398
|
+
// ```
|
|
399
|
+
//
|
|
400
|
+
// Where:
|
|
401
|
+
//
|
|
402
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
403
|
+
//-----------------------------------------------------
|
|
404
|
+
optimMaxRe(N) = par(i, 2*N+1, optim(i, N, _))
|
|
405
|
+
with {
|
|
406
|
+
optim(i, N, _)= _ * cos(indexabs / (2*N+1) * ma.PI)
|
|
407
|
+
with {
|
|
408
|
+
numberOfharmonics = 2 * N + 1;
|
|
409
|
+
indexabs = (int)((i - 1) / 2 + 1);
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
//----------------`(ho.)optimInPhase`-------------------------
|
|
415
|
+
// The inPhase optimization optimizes energy vector and put all loudspeakers signals
|
|
416
|
+
// in phase. It should be used for an auditory.
|
|
417
|
+
//
|
|
418
|
+
// #### Usage
|
|
419
|
+
//
|
|
420
|
+
// ```
|
|
421
|
+
// _ : optimInPhase(N) : _
|
|
422
|
+
// ```
|
|
423
|
+
//
|
|
424
|
+
// Where:
|
|
425
|
+
//
|
|
426
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
427
|
+
//-----------------------------------------------------
|
|
428
|
+
optimInPhase(N) = par(i, 2*N+1, optim(i, N, _))
|
|
429
|
+
with {
|
|
430
|
+
optim(i, N, _)= _ * (fact(N)^2.) / (fact(N+indexabs) * fact(N-indexabs))
|
|
431
|
+
with {
|
|
432
|
+
indexabs = (int)((i - 1) / 2 + 1);
|
|
433
|
+
fact(0) = 1;
|
|
434
|
+
fact(n) = n * fact(n-1);
|
|
435
|
+
};
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
//-------`(ho.)optim`----------
|
|
440
|
+
// Ambisonic optimizer including the three elementary optimizers:
|
|
441
|
+
// `(ho).optimBasic`, `(ho).optimMaxRe` and `(ho.)optimInPhase`.
|
|
442
|
+
//
|
|
443
|
+
// #### Usage
|
|
444
|
+
//
|
|
445
|
+
// ```
|
|
446
|
+
// _,_, ... : optim(N, ot) : _,_, ...
|
|
447
|
+
// ```
|
|
448
|
+
//
|
|
449
|
+
// Where:
|
|
450
|
+
//
|
|
451
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
452
|
+
// * `ot` : optimization type (0 for `optimBasic`, 1 for `optimMaxRe`, 2 for `optimInPhase`)
|
|
453
|
+
//-----------------------------
|
|
454
|
+
optim(N, ot) = thisOptimizer
|
|
455
|
+
with {
|
|
456
|
+
optb = (ot == 0) : si.smoo;
|
|
457
|
+
optm = (ot == 1) : si.smoo;
|
|
458
|
+
opti = (ot == 2) : si.smoo;
|
|
459
|
+
thisOptimizer = ((si.bus(2*N+1) <: ((si.bus(2*N+1):ho.optimBasic(N)), (si.bus(2*N+1):ho.optimMaxRe(N)), (si.bus(2*N+1):ho.optimInPhase(N)))), ((optb <: si.bus(2*N+1)), (optm <: si.bus(2*N+1)), (opti <: si.bus(2*N+1)))) : ro.interleave(6*N+3, 2) : par(i, 6*N+3, *) :> si.bus(2*N+1);
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
//----------------`(ho.)wider`-------------------------
|
|
464
|
+
// Can be used to wide the diffusion of a localized sound. The order
|
|
465
|
+
// depending signals are weighted and appear in a logarithmic way to
|
|
466
|
+
// have linear changes.
|
|
467
|
+
//
|
|
468
|
+
// #### Usage
|
|
469
|
+
//
|
|
470
|
+
// ```
|
|
471
|
+
// _ : wider(N,w) : _
|
|
472
|
+
// ```
|
|
473
|
+
//
|
|
474
|
+
// Where:
|
|
475
|
+
//
|
|
476
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
477
|
+
// * `w`: the width value between 0 - 1
|
|
478
|
+
//-----------------------------------------------------
|
|
479
|
+
wider(N, w) = par(i, 2*N+1, perform(N, w, i, _))
|
|
480
|
+
with {
|
|
481
|
+
perform(N, w, i, _) = _ * (log(N+1) * (1 - w) + 1) * clipweight
|
|
482
|
+
with {
|
|
483
|
+
clipweight = weighter(N, w, i) * (weighter(N, w, i) > 0) * (weighter(N, w, i) <= 1) + (weighter(N, w, i) > 1)
|
|
484
|
+
with {
|
|
485
|
+
weighter(N, w, 0) = 1.;
|
|
486
|
+
weighter(N, w, i) = (((w * log(N+1)) - log(indexabs)) / (log(indexabs+1) - log(indexabs)))
|
|
487
|
+
with {
|
|
488
|
+
indexabs = (int)((i - 1) / 2 + 1);
|
|
489
|
+
};
|
|
490
|
+
};
|
|
491
|
+
};
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
//-------`(ho.)mirror`----------
|
|
496
|
+
// Mirroring effect on the sound field.
|
|
497
|
+
//
|
|
498
|
+
// #### Usage
|
|
499
|
+
//
|
|
500
|
+
// ```
|
|
501
|
+
// _,_, ... : mirror(N, fa) : _,_, ...
|
|
502
|
+
// ```
|
|
503
|
+
//
|
|
504
|
+
// Where:
|
|
505
|
+
//
|
|
506
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
507
|
+
// * `fa` : mirroring type (1 = original sound field, 0 = original+mirrored sound field, -1 = mirrored sound field)
|
|
508
|
+
//-----------------------------
|
|
509
|
+
mirror(N, fa) = (*(1), par(i, N, (*(fa), *(1))));
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
//----------------`(ho.)map`-------------------------
|
|
513
|
+
// It simulates the distance of the source by applying a gain
|
|
514
|
+
// on the signal and a wider processing on the soundfield.
|
|
515
|
+
//
|
|
516
|
+
// #### Usage
|
|
517
|
+
//
|
|
518
|
+
// ```
|
|
519
|
+
// map(N, x, r, a)
|
|
520
|
+
// ```
|
|
521
|
+
//
|
|
522
|
+
// Where:
|
|
523
|
+
//
|
|
524
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
525
|
+
// * `x`: the signal
|
|
526
|
+
// * `r`: the radius
|
|
527
|
+
// * `a`: the angle in radian
|
|
528
|
+
//-----------------------------------------------------
|
|
529
|
+
map(N, x, r, a) = encoder(N, x * volume(r), a) : wider(N, ouverture(r))
|
|
530
|
+
with {
|
|
531
|
+
volume(r) = 1. / (r * r * (r > 1) + (r <= 1));
|
|
532
|
+
ouverture(r) = r * (r < 1) + (r >= 1);
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
//----------------`(ho.)rotate`-------------------------
|
|
537
|
+
// Rotates the sound field.
|
|
538
|
+
//
|
|
539
|
+
// #### Usage
|
|
540
|
+
//
|
|
541
|
+
// ```
|
|
542
|
+
// _ : rotate(N, a) : _
|
|
543
|
+
// ```
|
|
544
|
+
//
|
|
545
|
+
// Where:
|
|
546
|
+
//
|
|
547
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
548
|
+
// * `a`: the angle in radian
|
|
549
|
+
//-----------------------------------------------------
|
|
550
|
+
rotate(N, a) = par(i, 2*N+1, _) <: par(i, 2*N+1, rotation(i, a))
|
|
551
|
+
with {
|
|
552
|
+
rotation(i, a) = (par(j, 2*N+1, gain1(i, j, a)), par(j, 2*N+1, gain2(i, j, a)), par(j, 2*N+1, gain3(i, j, a)) :> _)
|
|
553
|
+
with {
|
|
554
|
+
indexabs = (int)((i - 1) / 2 + 1);
|
|
555
|
+
gain1(i, j, a) = _ * cos(a * indexabs) * (j == i);
|
|
556
|
+
gain2(i, j, a) = _ * sin(a * indexabs) * (j-1 == i) * (j != 0) * (i%2 == 1);
|
|
557
|
+
gain3(i, j, a) = (_ * sin(a * indexabs)) * (j+1 == i) * (j != 0) * (i%2 == 0) * (-1);
|
|
558
|
+
};
|
|
559
|
+
};
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
//-------`(ho.)scope`----------
|
|
563
|
+
// Produces an XY pair of signals representing the ambisonic sound field.
|
|
564
|
+
//
|
|
565
|
+
// #### Usage
|
|
566
|
+
//
|
|
567
|
+
// ```
|
|
568
|
+
// _,_, ... : scope(N, rt) : _,_
|
|
569
|
+
// ```
|
|
570
|
+
//
|
|
571
|
+
// Where:
|
|
572
|
+
//
|
|
573
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
574
|
+
// * `rt` : refreshment time in milliseconds
|
|
575
|
+
//-----------------------------
|
|
576
|
+
scope(N, rt) = thisScope
|
|
577
|
+
with {
|
|
578
|
+
//Angle sweeping at a speed corresponding to refresh period between 0 and 2*PI
|
|
579
|
+
theta = os.phasor(1, 1/rt) * 2 * ma.PI;
|
|
580
|
+
//we get the vector of harmonic functions thanks to the encoding function//
|
|
581
|
+
harmonicsVector = ho.encoder(N, 1, theta);
|
|
582
|
+
//
|
|
583
|
+
normalizedVector(N) = si.bus(N) <: (si.bus(N), norm) : ro.interleave(N, 2) : par(i, N, /)
|
|
584
|
+
with {
|
|
585
|
+
norm = par(i, N, _ <:(_,_) : *) :> _ : sqrt <: ((_ == 0), (_ > 0), _) : (_,*) : + <: si.bus(N);
|
|
586
|
+
};
|
|
587
|
+
//building (2N+1) normalized vectors
|
|
588
|
+
inputVector = (*(0.5), par(i, (2*N), _)) : normalizedVector(2*N+1);
|
|
589
|
+
normalizedHarmonics = harmonicsVector : normalizedVector(2*N+1);
|
|
590
|
+
//
|
|
591
|
+
rho = (inputVector, normalizedHarmonics) : si.dot(2*N+1) ;
|
|
592
|
+
thisScope = (rho <: (ma.fabs, (_ >= 0))) : ((_ <: (_,_)), _) : (*(sin(theta)), *(cos(theta)), _) : (*(-1), _,_);
|
|
593
|
+
};
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
//============================Spatial Sound Processes ====================================
|
|
597
|
+
// We propose implementations of processes intricated to the ambisonic model.
|
|
598
|
+
// The process is implemented using as many instances as the number of harmonics at at certain order.
|
|
599
|
+
// The key control parameters of these instances are computed thanks to distribution functions
|
|
600
|
+
// (th functions below) and to a global driving factor.
|
|
601
|
+
//========================================================================================
|
|
602
|
+
|
|
603
|
+
//-------`(ho.).fxDecorrelation`----------
|
|
604
|
+
// Spatial ambisonic decorrelation in fx mode.
|
|
605
|
+
//
|
|
606
|
+
// `fxDecorrelation` applies decorrelations to spatial components already created.
|
|
607
|
+
// The decorrelation is defined for each #i spatial component among P=2\*N+1 at the ambisonic order `N`
|
|
608
|
+
// as a delay of 0 if factor `fa` is under a certain value 1-(i+1)/P and d\*F((i+1)/p) in the contrary case,
|
|
609
|
+
// where `d` is the maximum delay applied (in samples) and F is a distribution function for durations.
|
|
610
|
+
// The user can choose this delay time distribution among 22 different ones.
|
|
611
|
+
// The delay increases according to the index of ambisonic components.
|
|
612
|
+
// But it increases at each step and it is modulated by a threshold.
|
|
613
|
+
// Therefore, delays are progressively revealed when the factor increases:
|
|
614
|
+
//
|
|
615
|
+
// * when the factor is close to 0, only upper components are delayed;
|
|
616
|
+
// * when the factor increases, more and more components are delayed.
|
|
617
|
+
//
|
|
618
|
+
//H THRESHOLD DELAY
|
|
619
|
+
//0 1-1/P 0 OR DELAY*F(1/P)
|
|
620
|
+
//-1 1-2/P 0 OR DELAY*F(2/P)
|
|
621
|
+
//1 1-3/P 0 OR DELAY*F(3/P)
|
|
622
|
+
//-2 1-4/P 0 OR DELAY*F(4/P)
|
|
623
|
+
//2 1-5/P 0 OR DELAY*F(5/P)
|
|
624
|
+
//...
|
|
625
|
+
//-(N-1) 1-(P-3)/P 0 OR DELAY*F((P-3)/P)
|
|
626
|
+
//(N-1) 1-(P-2)/P 0 OR DELAY*F((P-2)/P)
|
|
627
|
+
//-N 1-(P-1)/P 0 OR DELAY*F((P-1)/P)
|
|
628
|
+
//N 1-P/P 0 OR DELAY*F(P/P)
|
|
629
|
+
//
|
|
630
|
+
//
|
|
631
|
+
// #### Usage
|
|
632
|
+
//
|
|
633
|
+
// ```
|
|
634
|
+
// _,_, ... : fxDecorrelation(N, d, wf, fa, fd, tf) : _,_, ...
|
|
635
|
+
// ```
|
|
636
|
+
//
|
|
637
|
+
// Where:
|
|
638
|
+
//
|
|
639
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
640
|
+
// * `d`: the maximum delay applied (in samples)
|
|
641
|
+
// * `wf`: window frequency (in Hz) for the overlapped delay
|
|
642
|
+
// * `fa`: decorrelation factor (between 0 and 1)
|
|
643
|
+
// * `fd`: feedback / level of reinjection (between 0 and 1)
|
|
644
|
+
// * `tf`: type of function of delay distribution (integer, between 0 and 21)
|
|
645
|
+
//-----------------------------
|
|
646
|
+
fxDecorrelation(N, d, wf, fa, fd, tf) = par(i, 2*N+1, gate(d, i, 2*N+1, fa, tf, wf, fd))
|
|
647
|
+
with {
|
|
648
|
+
gate(d, i, N, fa, tf, wf, fd) = _ <: fdOverlappedDelay(dur(d, i, N, fa, tf), 262144, wf, fd) * env1(fa, i, N), _ * env1c(fa, i, N) : +;
|
|
649
|
+
//
|
|
650
|
+
fdOverlappedDelay(nsamp, nmax, freq, fdbk) = (+ : de.sdelay(nmax, int(ma.SR / freq), nsamp)) ~ (*(fdbk));
|
|
651
|
+
//
|
|
652
|
+
env1(fa, i, N) = (fa > ((N-i-1)/N)) : si.smooth(ba.tau2pole(0.005));
|
|
653
|
+
env1c(fa, i, N) = 1 - env1(fa, i, N);
|
|
654
|
+
//
|
|
655
|
+
//computes the ith duration of the ith delay in samples with twenty two possibilities of distribution
|
|
656
|
+
elemdur(d, i, p, fa, tf, ind) = (tf == ind) * (fa > (1 - x)) * d * x * fa
|
|
657
|
+
with {
|
|
658
|
+
x = th(ind, i, p);
|
|
659
|
+
};
|
|
660
|
+
//duration in samples computed as a sum of the 22 cases//
|
|
661
|
+
dur(d, i, p, fa, tf) = sum(ind, 22, elemdur(d, i, p, fa, tf, ind)) : int;
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
//-------`(ho.).synDecorrelation`----------
|
|
665
|
+
// Spatial ambisonic decorrelation in syn mode.
|
|
666
|
+
//
|
|
667
|
+
// `synDecorrelation` generates spatial decorrelated components in ambisonics from one mono signal.
|
|
668
|
+
// The decorrelation is defined for each #i spatial component among P=2\*N+1 at the ambisonic order `N`
|
|
669
|
+
// as a delay of 0 if factor `fa` is under a certain value 1-(i+1)/P and d\*F((i+1)/p) in the contrary case,
|
|
670
|
+
// where `d` is the maximum delay applied (in samples) and F is a distribution function for durations.
|
|
671
|
+
// The user can choose this delay time distribution among 22 different ones.
|
|
672
|
+
// The delay increases according to the index of ambisonic components.
|
|
673
|
+
// But it increases at each step and it is modulated by a threshold.
|
|
674
|
+
// Therefore, delays are progressively revealed when the factor increases:
|
|
675
|
+
//
|
|
676
|
+
// * when the factor is close to 0, only upper components are delayed;
|
|
677
|
+
// * when the factor increases, more and more components are delayed.
|
|
678
|
+
//
|
|
679
|
+
// When the factor is between [0; 1/P], upper harmonics are progressively faded and the level of the H0 component is compensated
|
|
680
|
+
// to avoid source localization and to produce a large mono.
|
|
681
|
+
//
|
|
682
|
+
//H THRESHOLD DELAY
|
|
683
|
+
//0 1-1/P 0 OR DELAY*F(1/P)
|
|
684
|
+
//-1 1-2/P 0 OR DELAY*F(2/P)
|
|
685
|
+
//1 1-3/P 0 OR DELAY*F(3/P)
|
|
686
|
+
//-2 1-4/P 0 OR DELAY*F(4/P)
|
|
687
|
+
//2 1-5/P 0 OR DELAY*F(5/P)
|
|
688
|
+
//...
|
|
689
|
+
//-(N-1) 1-(P-3)/P 0 OR DELAY*F((P-3)/P)
|
|
690
|
+
//(N-1) 1-(P-2)/P 0 OR DELAY*F((P-2)/P)
|
|
691
|
+
//-N 1-(P-1)/P 0 OR DELAY*F((P-1)/P)
|
|
692
|
+
//N 1-P/P 0 OR DELAY*F(P/P)
|
|
693
|
+
//
|
|
694
|
+
//
|
|
695
|
+
// #### Usage
|
|
696
|
+
//
|
|
697
|
+
// ```
|
|
698
|
+
// _,_, ... : synDecorrelation(N, d, wf, fa, fd, tf) : _,_, ...
|
|
699
|
+
// ```
|
|
700
|
+
//
|
|
701
|
+
// Where:
|
|
702
|
+
//
|
|
703
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
704
|
+
// * `d`: the maximum delay applied (in samples)
|
|
705
|
+
// * `wf`: window frequency (in Hz) for the overlapped delay
|
|
706
|
+
// * `fa`: decorrelation factor (between 0 and 1)
|
|
707
|
+
// * `fd`: feedback / level of reinjection (between 0 and 1)
|
|
708
|
+
// * `tf`: type of function of delay distribution (integer, between 0 and 21)
|
|
709
|
+
//-----------------------------
|
|
710
|
+
synDecorrelation(N, d, wf, fa, fd, tf) = _ <: par(i, 2*N+1, crossFade(d, i, 2*N+1, fa, tf, wf, fd))
|
|
711
|
+
with {
|
|
712
|
+
crossFade(d, i, N, fa, tf, wf, fd) = _ <: fdOverlappedDelay(dur(d, i, N, fa, tf), 262144, wf, fd) * env1(fa, i, N), _ * env1c(fa, i, N) :> _ * env2(fa, i, N);
|
|
713
|
+
//
|
|
714
|
+
fdOverlappedDelay(nsamp, nmax, freq, fdbk) = (+ : de.sdelay(nmax, int(ma.SR / freq), nsamp)) ~ (*(fdbk));
|
|
715
|
+
//
|
|
716
|
+
env1(fa, i, N) = (fa > ((N-i-1)/N)) : si.smooth(ba.tau2pole(0.005));
|
|
717
|
+
env1c(fa, i, N) = 1 - env1(fa, i, N) ;
|
|
718
|
+
env2(fa, i, N) = ((i > 0) * N * min(fa, 1/N)) + ((i == 0) * (sqrt(N) * (1 - (N - sqrt(N)) * min(fa, 1/N)))) : si.smooth(ba.tau2pole(0.005));
|
|
719
|
+
//
|
|
720
|
+
//computes the ith duration of the ith delay in samples with twenty two possibilities of distribution
|
|
721
|
+
elemdur(d, i, p, fa, tf, ind) = (tf == ind) * fa * d * x
|
|
722
|
+
with {
|
|
723
|
+
x = th(ind, i, p);
|
|
724
|
+
};
|
|
725
|
+
//duration in samples computed as a sum of the 22 cases//
|
|
726
|
+
dur(d, i, p, fa, tf) = sum(ind, 22, elemdur(d, i, p, fa, tf, ind)) : int;
|
|
727
|
+
};
|
|
728
|
+
|
|
729
|
+
//-------`(ho.).fxRingMod`----------
|
|
730
|
+
// Spatial ring modulation in syn mode.
|
|
731
|
+
//
|
|
732
|
+
// `fxRingMod` applies ring modulation to spatial components already created.
|
|
733
|
+
// The ring modulation is defined for each spatial component among P=2\*n+1 at the ambisonic order `N`.
|
|
734
|
+
// For each spatial component #i, the result is either the original signal or a ring modulated signal
|
|
735
|
+
// according to a threshold that is i/P.
|
|
736
|
+
//
|
|
737
|
+
// The general process is drive by a factor `fa` between 0 and 1 and a modulation frequency `f0`.
|
|
738
|
+
// If `fa` is greater than theshold (P-i-1)/P, the ith ring modulator is on with carrier frequency of f0\*(i+1)/P.
|
|
739
|
+
// On the contrary, it provides the original signal.
|
|
740
|
+
//
|
|
741
|
+
// Therefore ring modulators are progressively revealed when `fa` increases.
|
|
742
|
+
//
|
|
743
|
+
//H THRESHOLD OUTPUT
|
|
744
|
+
//0 (P-1)/P ORIGINAL OR RING MODULATION BY F0*1/P
|
|
745
|
+
//-1 (P-2)/P ORIGINAL OR RING MODULATION BY F0*2/P
|
|
746
|
+
//1 (P-3)/P ORIGINAL OR RING MODULATION BY F0*3/P
|
|
747
|
+
//-2 (P-4)/P ORIGINAL OR RING MODULATION BY F0*4/P
|
|
748
|
+
//2 (P-5)/P ORIGINAL OR RING MODULATION BY F0*5/P
|
|
749
|
+
//...
|
|
750
|
+
//-(N-1) 3/P ORIGINAL OR RING MODULATION BY F0*(P-3)/P
|
|
751
|
+
//(N-1) 2/P ORIGINAL OR RING MODULATION BY F0*(P-2)/P
|
|
752
|
+
//-N 1/P ORIGINAL OR RING MODULATION BY F0*(P-1)/P
|
|
753
|
+
//N 0 ORIGINAL OR RING MODULATION BY F0*P/P=F0
|
|
754
|
+
//
|
|
755
|
+
//
|
|
756
|
+
// #### Usage
|
|
757
|
+
//
|
|
758
|
+
// ```
|
|
759
|
+
// _,_, ... : fxRingMod(N, f0, fa, tf) : _,_, ...
|
|
760
|
+
// ```
|
|
761
|
+
//
|
|
762
|
+
// Where:
|
|
763
|
+
//
|
|
764
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
765
|
+
// * `f0`: the maximum delay applied (in samples)
|
|
766
|
+
// * `fa`: decorrelation factor (between 0 and 1)
|
|
767
|
+
// * `tf`: type of function of delay distribution (integer, between 0 and 21)
|
|
768
|
+
//-----------------------------
|
|
769
|
+
fxRingMod(N, f0, fa, tf) = par(i, 2*N+1, gate_ringmod(f0, i, 2*N+1, fa, tf))
|
|
770
|
+
with {
|
|
771
|
+
//
|
|
772
|
+
env1(fa, i, N) = (fa > ((N-i-1)/N)) : si.smooth(ba.tau2pole(0.005));
|
|
773
|
+
env1c(fa, i, N) = 1 - env1(fa, i, N);
|
|
774
|
+
//
|
|
775
|
+
gate_ringmod(f, i, N, fa, tf) = _ <: _ * os.osccos(freq(f, i, N, tf)) * env1(fa, i, N), _ * env1c(fa, i, N) : +;
|
|
776
|
+
//
|
|
777
|
+
ringmodfreq(f, i, N, tf, ind) = (tf == ind) * f * x * coef
|
|
778
|
+
with {
|
|
779
|
+
x = th(ind, i, N);
|
|
780
|
+
coef = min(1, max(N * (fa - (N - i - 1) / N), 0));
|
|
781
|
+
};
|
|
782
|
+
//
|
|
783
|
+
freq(f, i, N, tf) = sum(ind, 22, ringmodfreq(f, i, N, tf, ind)) : int;
|
|
784
|
+
};
|
|
785
|
+
|
|
786
|
+
//-------`(ho.).synRingMod`----------
|
|
787
|
+
// Spatial ring modulation in syn mode.
|
|
788
|
+
//
|
|
789
|
+
// `synRingMod` generates spatial components in ambisonics from one mono signal thanks to ring modulation.
|
|
790
|
+
// The ring modulation is defined for each spatial component among P=2\*n+1 at the ambisonic order `N`.
|
|
791
|
+
// For each spatial component #i, the result is either the original signal or a ring modulated signal
|
|
792
|
+
// according to a threshold that is i/P.
|
|
793
|
+
//
|
|
794
|
+
// The general process is drive by a factor `fa` between 0 and 1 and a modulation frequency `f0`.
|
|
795
|
+
// If `fa` is greater than theshold (P-i-1)/P, the ith ring modulator is on with carrier frequency of f0\*(i+1)/P.
|
|
796
|
+
// On the contrary, it provides the original signal.
|
|
797
|
+
//
|
|
798
|
+
// Therefore ring modulators are progressively revealed when `fa` increases.
|
|
799
|
+
// When the factor is between [0; 1/P], upper harmonics are progressively faded and the level of the H0 component is compensated
|
|
800
|
+
// to avoid source localization and to produce a large mono.
|
|
801
|
+
//
|
|
802
|
+
//H THRESHOLD OUTPUT
|
|
803
|
+
//0 (P-1)/P ORIGINAL OR RING MODULATION BY F0*1/P
|
|
804
|
+
//-1 (P-2)/P ORIGINAL OR RING MODULATION BY F0*2/P
|
|
805
|
+
//1 (P-3)/P ORIGINAL OR RING MODULATION BY F0*3/P
|
|
806
|
+
//-2 (P-4)/P ORIGINAL OR RING MODULATION BY F0*4/P
|
|
807
|
+
//2 (P-5)/P ORIGINAL OR RING MODULATION BY F0*5/P
|
|
808
|
+
//...
|
|
809
|
+
//-(N-1) 3/P ORIGINAL OR RING MODULATION BY F0*(P-3)/P
|
|
810
|
+
//(N-1) 2/P ORIGINAL OR RING MODULATION BY F0*(P-2)/P
|
|
811
|
+
//-N 1/P ORIGINAL OR RING MODULATION BY F0*(P-1)/P
|
|
812
|
+
//N 0 ORIGINAL OR RING MODULATION BY F0*P/P=F0
|
|
813
|
+
//
|
|
814
|
+
//
|
|
815
|
+
// #### Usage
|
|
816
|
+
//
|
|
817
|
+
// ```
|
|
818
|
+
// _,_, ... : synRingMod(N, f0, fa, tf) : _,_, ...
|
|
819
|
+
// ```
|
|
820
|
+
//
|
|
821
|
+
// Where:
|
|
822
|
+
//
|
|
823
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
824
|
+
// * `f0`: the maximum delay applied (in samples)
|
|
825
|
+
// * `fa`: decorrelation factor (between 0 and 1)
|
|
826
|
+
// * `tf`: type of function of delay distribution (integer, between 0 and 21)
|
|
827
|
+
//-----------------------------
|
|
828
|
+
synRingMod(N, f0, fa, tf) = _ <: par(i, 2*N+1, crossfade_ringmod(f0, i, 2*N+1, fa, tf))
|
|
829
|
+
with {
|
|
830
|
+
//
|
|
831
|
+
env1(fa, i, N) = (fa > ((N-i-1)/N)) : si.smooth(ba.tau2pole(0.005));
|
|
832
|
+
env1c(fa, i, N) = 1 - env1(fa, i, N);
|
|
833
|
+
env2(fa, i, N) = ((i > 0) * N * min(fa, 1/N)) + ((i == 0) * (sqrt(N) * (1 - (N - sqrt(N)) * min(fa, 1/N)))) : si.smooth(ba.tau2pole(0.005));
|
|
834
|
+
//
|
|
835
|
+
crossfade_ringmod(f, i, N, fa, tf) = _ <: _ * os.osccos(freq(f, i, N, tf)) * env1(fa, i, N), _ * env1c(fa, i, N) :> _ * env2(fa, i, N);
|
|
836
|
+
//
|
|
837
|
+
ringmodfreq(f, i, N, tf, ind) = (tf == ind) * f * x * coef
|
|
838
|
+
with {
|
|
839
|
+
x = th(ind, i, N);
|
|
840
|
+
coef = min(1, max(N * (fa - (N - i - 1) / N), 0));
|
|
841
|
+
};
|
|
842
|
+
//
|
|
843
|
+
freq(f, i, N, tf) = sum(ind, 22, ringmodfreq(f, i, N, tf, ind)) : int;
|
|
844
|
+
};
|
|
845
|
+
|
|
846
|
+
|
|
847
|
+
//TYPES OF DISTRIBUTIONS: 22 EASING FUNCTIONS FROM [0, 1] to [0,1]
|
|
848
|
+
//(i+1)/p belongs to [0, 1] and its image by any function in the list also belongs to the interval
|
|
849
|
+
|
|
850
|
+
th(0, i, p) = (i+1) / p;
|
|
851
|
+
th(1, i, p) = ((i+1) / p)^2;
|
|
852
|
+
th(2, i, p) = sin(ma.PI * 0.5 * (i+1) / p);
|
|
853
|
+
th(3, i, p) = log10(1 + (i+1) / p) / log10(2);
|
|
854
|
+
th(4, i, p) = sqrt((i+1) / p);
|
|
855
|
+
th(5, i, p) = 1 - cos(ma.PI * 0.5 * (i+1) / p);
|
|
856
|
+
th(6, i, p) = (1 - cos(ma.PI * (i+1) / p)) * 0.5;
|
|
857
|
+
th(7, i, p) = 1 - (1 - (i+1) / p )^2;
|
|
858
|
+
th(8, i, p) = ((i+1) / p < 0.5) * 2 * ((i+1) / p)^2 + ((i+1) / p >= 0.5) * (1 - (-2 * (i+1) / p + 2)^2 * 0.5);
|
|
859
|
+
th(9, i, p) = ((i+1) / p)^3;
|
|
860
|
+
th(10, i, p) = 1 - (1 - (i+1) / p)^3;
|
|
861
|
+
th(11, i, p) = ((i+1) / p < 0.5) * 4 * ((i+1) / p)^3 + ((i+1) / p >= 0.5) * (1 - (-2 * (i+1) / p + 2)^3 * 0.5);
|
|
862
|
+
th(12, i, p) = ((i+1) / p)^4;
|
|
863
|
+
th(13, i, p) = 1 - (1 - (i+1) / p)^4;
|
|
864
|
+
th(14, i, p) = ((i+1) / p < 0.5) * 8 * ((i+1) / p)^4 + ((i+1) / p >= 0.5) * (1 - (-2 * (i+1) / p + 2)^4 * 0.5);
|
|
865
|
+
th(15, i, p) = ((i+1) / p)^5;
|
|
866
|
+
th(16, i, p) = 1 - (1 - (i+1) / p)^5;
|
|
867
|
+
th(17, i, p) = ((i+1) / p < 0.5) * 16 * ((i+1) / p)^5 + ((i+1) / p >= 0.5) * (1 - (-2 * (i+1) / p + 2)^5 * 0.5);
|
|
868
|
+
th(18, i, p) = 2^(10 * (i+1) / p - 10);
|
|
869
|
+
th(19, i, p) = ((i+1) / p < 1) * (1 - 2^(-10 * (i+1) / p)) + ((i+1) / p == 1);
|
|
870
|
+
th(20, i, p) = 1 - sqrt(1 - ((i+1) / p)^2);
|
|
871
|
+
th(21, i, p) = sqrt(1 - ((i+1) / p - 1)^2);
|
|
872
|
+
|
|
873
|
+
|
|
874
|
+
//========================================================================================
|
|
875
|
+
//============================3D Functions================================================
|
|
876
|
+
//========================================================================================
|
|
877
|
+
//========================================================================================
|
|
878
|
+
|
|
879
|
+
//----------------------`(ho.)encoder3D`---------------------------------
|
|
880
|
+
// Ambisonic encoder. Encodes a signal in the circular harmonics domain
|
|
881
|
+
// depending on an order of decomposition, an angle and an elevation.
|
|
882
|
+
//
|
|
883
|
+
// #### Usage
|
|
884
|
+
//
|
|
885
|
+
// ```
|
|
886
|
+
// encoder3D(N, x, a, e) : _
|
|
887
|
+
// ```
|
|
888
|
+
//
|
|
889
|
+
// Where:
|
|
890
|
+
//
|
|
891
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
892
|
+
// * `x`: the signal
|
|
893
|
+
// * `a`: the angle
|
|
894
|
+
// * `e`: the elevation
|
|
895
|
+
//----------------------------------------------------------------
|
|
896
|
+
encoder3D(N, x, theta, phi) = par(i, (N+1) * (N+1), x * y(degree(i), order(i), theta, phi))
|
|
897
|
+
with {
|
|
898
|
+
// The degree l of the harmonic[l, m]
|
|
899
|
+
degree(index) = int(sqrt(index));
|
|
900
|
+
// The order m of the harmonic[l, m]
|
|
901
|
+
order(index) = int(index - int(degree(index) * int(degree(index) + 1)));
|
|
902
|
+
|
|
903
|
+
// The spherical harmonics
|
|
904
|
+
y(l, m, theta, phi) = e(m, theta2) * k(l, m) * p(l, m, cos(phi + ma.PI * 0.5))
|
|
905
|
+
with {
|
|
906
|
+
//theta2 enables a continuous movement of elevation (when phi becomes greater than Pi/2)
|
|
907
|
+
theta2 = theta + (1 - int(fmod(fmod(phi / ma.PI - 0.5, 2) + 2, 2))) * ma.PI;
|
|
908
|
+
//
|
|
909
|
+
// The associated Legendre polynomial
|
|
910
|
+
// If l = 0 => p = 1
|
|
911
|
+
// If l = m => p = -1 * (2 * (l-1) + 1) * sqrt(1 - cphi*cphi) * p(l-1, l-1, cphi)
|
|
912
|
+
// If l = m+1 => p = phi * (2 * (l-1) + 1) * p(l-1, l-1, cphi)
|
|
913
|
+
// Else => p = (cphi * (2 * (l-1) + 1) * p(l-1, abs(m), cphi) - ((l-1) + abs(m)) * p(l-2, abs(m), cphi)) / ((l-1) - abs(m) + 1)
|
|
914
|
+
p(l, m, cphi) = pcalcul(((l != 0) & (l == abs(m))) + ((l != 0) & (l == abs(m)+1)) * 2 + ((l != 0) & (l != abs(m)) & (l != abs(m)+1)) * 3, l, m, cphi)
|
|
915
|
+
with {
|
|
916
|
+
pcalcul(0, l, m, cphi) = 1;
|
|
917
|
+
pcalcul(1, l, m, cphi) = -1 * (2 * (l-1) + 1) * sqrt(1 - cphi*cphi) * p(l-1, l-1, cphi);
|
|
918
|
+
pcalcul(2, l, m, cphi) = cphi * (2 * (l-1) + 1) * p(l-1, l-1, cphi);
|
|
919
|
+
pcalcul(s, l, m, cphi) = (cphi * (2 * (l-1) + 1) * p(l-1, abs(m), cphi) - ((l-1) + abs(m)) * p(l-2, abs(m), cphi)) / ((l-1) - abs(m) + 1);
|
|
920
|
+
};
|
|
921
|
+
|
|
922
|
+
// The exponential imaginary
|
|
923
|
+
// If m > 0 => e^i*m*theta = cos(m * theta)
|
|
924
|
+
// If m < 0 => e^i*m*theta = sin(-m * theta)
|
|
925
|
+
// If m = 0 => e^i*m*theta = 1
|
|
926
|
+
e(m, theta) = ecalcul((m > 0) * 2 + (m < 0), m, theta)
|
|
927
|
+
with {
|
|
928
|
+
ecalcul(2, m, theta) = cos(m * theta);
|
|
929
|
+
ecalcul(1, m, theta) = sin(abs(m) * theta);
|
|
930
|
+
ecalcul(s, m, theta) = 1;
|
|
931
|
+
};
|
|
932
|
+
|
|
933
|
+
// The normalization
|
|
934
|
+
// If m = 0 => k(l, m) = 1
|
|
935
|
+
// If m != 0 => k(l, m) = sqrt((l - abs(m))! / l + abs(m))!) * sqrt(2)
|
|
936
|
+
k(l, m) = kcalcul((m != 0), l, m)
|
|
937
|
+
with {
|
|
938
|
+
kcalcul(0, l, m) = 1;
|
|
939
|
+
kcalcul(1, l, m) = sqrt(2) / sqrtFactQuotient(l+abs(m), l-abs(m))
|
|
940
|
+
with {
|
|
941
|
+
//factorial quotient fq(n, p)=n! / p! = n(n-1)...(p+1) when n > p
|
|
942
|
+
//enables factor simplification
|
|
943
|
+
//and considering the square root of a product as a product of square roots
|
|
944
|
+
sqrtFactQuotient(n, p) = sqrtProd(n-p, p)
|
|
945
|
+
with {
|
|
946
|
+
//sqrtProd(n, p) computes the product sqrt(p+1) x sqrt(p+2) x ... x sqrt(n)
|
|
947
|
+
//to enable factorial quotient simplification
|
|
948
|
+
sqrtProd(1, p) = sqrt(p+1);
|
|
949
|
+
sqrtProd(n, p) = sqrt(p+n) * sqrtProd(n-1, p);
|
|
950
|
+
};
|
|
951
|
+
};
|
|
952
|
+
};
|
|
953
|
+
};
|
|
954
|
+
};
|
|
955
|
+
|
|
956
|
+
|
|
957
|
+
//-------`(ho.)rEncoder3D`----------
|
|
958
|
+
// Ambisonic encoder in 3D including source rotation. A mono signal is encoded at at certain ambisonic order
|
|
959
|
+
// with two possible modes: either rotation with 2 angular speeds (azimuth and elevation), or static with a fixed pair of angles.
|
|
960
|
+
//
|
|
961
|
+
// `rEncoder3D` is a standard Faust function.
|
|
962
|
+
//
|
|
963
|
+
// #### Usage
|
|
964
|
+
//
|
|
965
|
+
// ```
|
|
966
|
+
// _ : rEncoder3D(N, azsp, elsp, az, el, it) : _,_, ...
|
|
967
|
+
// ```
|
|
968
|
+
//
|
|
969
|
+
// Where:
|
|
970
|
+
//
|
|
971
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
972
|
+
// * `azsp`: the azimuth speed expressed as angular speed (2PI/sec), positive or negative
|
|
973
|
+
// * `elsp`: the elevation speed expressed as angular speed (2PI/sec), positive or negative
|
|
974
|
+
// * `az`: the fixed azimuth when the azimuth rotation stops (azsp = 0) in radians
|
|
975
|
+
// * `el`: the fixed elevation when the elevation rotation stops (elsp = 0) in radians
|
|
976
|
+
// * `it` : interpolation time (in milliseconds) between the rotation and the fixed modes
|
|
977
|
+
//-----------------------------
|
|
978
|
+
rEncoder3D(N, azsp, elsp, az, el, it) = this3DEncoder
|
|
979
|
+
with {
|
|
980
|
+
basic3DEncoder(sig, ang1, ang2) = encoder3D(N, sig, ang1, ang2);
|
|
981
|
+
this3DEncoder = (_, rotationOrStaticAzim, rotationOrStaticElev) : basic3DEncoder
|
|
982
|
+
with {
|
|
983
|
+
x1 = (os.phasor(1, azsp), az, 1) : (+, _) : fmod : *(2 * ma.PI);
|
|
984
|
+
vn1 = (azsp == 0) : si.smooth(ba.tau2pole(it));
|
|
985
|
+
rotationOrStaticAzim = (1-vn1) * x1 + vn1 * az;
|
|
986
|
+
x2 = (os.phasor(1, elsp), el, 1) : (+, _) : fmod : *(2 * ma.PI);
|
|
987
|
+
vn2 = (elsp == 0) : si.smooth(ba.tau2pole(it));
|
|
988
|
+
rotationOrStaticElev = (1-vn2) * x2 + vn2 * el;
|
|
989
|
+
};
|
|
990
|
+
};
|
|
991
|
+
|
|
992
|
+
|
|
993
|
+
//----------------`(ho.)optimBasic3D`-------------------------
|
|
994
|
+
// The basic optimization has no effect and should be used for a perfect
|
|
995
|
+
// sphere of loudspeakers with one listener at the perfect center loudspeakers
|
|
996
|
+
// array.
|
|
997
|
+
//
|
|
998
|
+
// #### Usage
|
|
999
|
+
//
|
|
1000
|
+
// ```
|
|
1001
|
+
// _ : optimBasic3D(N) : _
|
|
1002
|
+
// ```
|
|
1003
|
+
//
|
|
1004
|
+
// Where:
|
|
1005
|
+
//
|
|
1006
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
1007
|
+
//-----------------------------------------------------
|
|
1008
|
+
optimBasic3D(N) = par(i, (N+1) * (N+1), _);
|
|
1009
|
+
|
|
1010
|
+
|
|
1011
|
+
//----------------`(ho.)optimMaxRe3D`-------------------------
|
|
1012
|
+
// The maxRe optimization optimize energy vector. It should be used for an
|
|
1013
|
+
// auditory confined in the center of the loudspeakers array.
|
|
1014
|
+
//
|
|
1015
|
+
// #### Usage
|
|
1016
|
+
//
|
|
1017
|
+
// ```
|
|
1018
|
+
// _ : optimMaxRe3D(N) : _
|
|
1019
|
+
// ```
|
|
1020
|
+
//
|
|
1021
|
+
// Where:
|
|
1022
|
+
//
|
|
1023
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
1024
|
+
//-----------------------------------------------------
|
|
1025
|
+
optimMaxRe3D(N) = par(i, (N+1) * (N+1), MaxRe(N, degree(i), _))
|
|
1026
|
+
with {
|
|
1027
|
+
// The degree l of the harmonic[l, m]
|
|
1028
|
+
degree(index) = int(sqrt(index));
|
|
1029
|
+
MaxRe(N, l, _)= _ * cos(l / (2*N+2) * ma.PI);
|
|
1030
|
+
};
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
//----------------`(ho.)optimInPhase3D`-------------------------
|
|
1034
|
+
// The inPhase Optimization optimizes energy vector and put all loudspeakers signals
|
|
1035
|
+
// in phase. It should be used for an auditory.
|
|
1036
|
+
//
|
|
1037
|
+
// #### Usage
|
|
1038
|
+
//
|
|
1039
|
+
// ```
|
|
1040
|
+
// _ : optimInPhase3D(N) : _
|
|
1041
|
+
// ```
|
|
1042
|
+
//
|
|
1043
|
+
// Where:
|
|
1044
|
+
//
|
|
1045
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
1046
|
+
//-----------------------------------------------------
|
|
1047
|
+
optimInPhase3D(N) = par(i, (N+1) * (N+1), InPhase(N, degree(i), _))
|
|
1048
|
+
with {
|
|
1049
|
+
// The degree l of the harmonic[l, m]
|
|
1050
|
+
degree(index) = int(sqrt(index));
|
|
1051
|
+
InPhase(N, l, _)= _ * (fact(N) * fact(N)) / (fact(N - l) * fact(N + l))
|
|
1052
|
+
with {
|
|
1053
|
+
fact(0) = 1;
|
|
1054
|
+
fact(n) = n * fact(n-1);
|
|
1055
|
+
};
|
|
1056
|
+
};
|
|
1057
|
+
|
|
1058
|
+
|
|
1059
|
+
//-------`(ho.)optim3D`----------
|
|
1060
|
+
// Ambisonic optimizer including the three elementary optimizers:
|
|
1061
|
+
// `(ho).optimBasic3D`, `(ho).optimMaxRe3D` and `(ho.)optimInPhase3D`.
|
|
1062
|
+
//
|
|
1063
|
+
// #### Usage
|
|
1064
|
+
//
|
|
1065
|
+
// ```
|
|
1066
|
+
// _,_, ... : optim3D(N, ot) : _,_, ...
|
|
1067
|
+
// ```
|
|
1068
|
+
//
|
|
1069
|
+
// Where:
|
|
1070
|
+
//
|
|
1071
|
+
// * `N`: the ambisonic order (constant numerical expression)
|
|
1072
|
+
// * `ot` : optimization type (0 for optimBasic, 1 for optimMaxRe, 2 for optimInPhase)
|
|
1073
|
+
//-----------------------------
|
|
1074
|
+
optim3D(N, ot) = thisOptimizer
|
|
1075
|
+
with {
|
|
1076
|
+
optb = (ot == 0) : si.smoo;
|
|
1077
|
+
optm = (ot == 1) : si.smoo;
|
|
1078
|
+
opti = (ot == 2) : si.smoo;
|
|
1079
|
+
bus3D = si.bus((N+1)*(N+1));
|
|
1080
|
+
thisOptimizer = ((bus3D <: ((bus3D:ho.optimBasic3D(N)), (bus3D:ho.optimMaxRe3D(N)), (bus3D:ho.optimInPhase3D(N)))), ((optb <: bus3D), (optm <: bus3D), (opti <: bus3D))) : ro.interleave(3*(N+1)*(N+1), 2) : par(i, 3*(N+1)*(N+1), *) :> bus3D;
|
|
1081
|
+
};
|