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,1838 @@
|
|
|
1
|
+
//############################## oscillators.lib ######################################
|
|
2
|
+
// This library contains a collection of sound generators. Its official prefix is `os`.
|
|
3
|
+
//
|
|
4
|
+
// The oscillators library is organized into 9 sections:
|
|
5
|
+
//
|
|
6
|
+
// * [Wave-Table-Based Oscillators](#wave-table-based-oscillators)
|
|
7
|
+
// * [Low Frequency Oscillators](#low-frequency-oscillators)
|
|
8
|
+
// * [Low Frequency Sawtooths](#low-frequency-sawtooths)
|
|
9
|
+
// * [Alias-Suppressed Sawtooth](#alias-suppressed-sawtooth)
|
|
10
|
+
// * [Alias-Suppressed Pulse, Square, and Impulse Trains](#alias-suppressed-pulse-square-and-impulse-trains)
|
|
11
|
+
// * [Filter-Based Oscillators](#filter-based-oscillators)
|
|
12
|
+
// * [Waveguide-Resonator-Based Oscillators](#waveguide-resonator-based-oscillators)
|
|
13
|
+
// * [Casio CZ Oscillators](#casio-cz-oscillators)
|
|
14
|
+
// * [PolyBLEP-Based Oscillators](#polyblep-based-oscillators)
|
|
15
|
+
//
|
|
16
|
+
// #### References
|
|
17
|
+
// * <https://github.com/grame-cncm/faustlibraries/blob/master/oscillators.lib>
|
|
18
|
+
//########################################################################################
|
|
19
|
+
|
|
20
|
+
/************************************************************************
|
|
21
|
+
************************************************************************
|
|
22
|
+
FAUST library file, GRAME section
|
|
23
|
+
|
|
24
|
+
Except where noted otherwise, Copyright (C) 2003-2017 by GRAME,
|
|
25
|
+
Centre National de Creation Musicale.
|
|
26
|
+
----------------------------------------------------------------------
|
|
27
|
+
GRAME LICENSE
|
|
28
|
+
|
|
29
|
+
This program is free software; you can redistribute it and/or modify
|
|
30
|
+
it under the terms of the GNU Lesser General Public License as
|
|
31
|
+
published by the Free Software Foundation; either version 2.1 of the
|
|
32
|
+
License, or (at your option) any later version.
|
|
33
|
+
|
|
34
|
+
This program is distributed in the hope that it will be useful,
|
|
35
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
36
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
37
|
+
GNU Lesser General Public License for more details.
|
|
38
|
+
|
|
39
|
+
You should have received a copy of the GNU Lesser General Public
|
|
40
|
+
License along with the GNU C Library; if not, write to the Free
|
|
41
|
+
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|
42
|
+
02111-1307 USA.
|
|
43
|
+
|
|
44
|
+
EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
|
|
45
|
+
larger FAUST program which directly or indirectly imports this library
|
|
46
|
+
file and still distribute the compiled code generated by the FAUST
|
|
47
|
+
compiler, or a modified version of this compiled code, under your own
|
|
48
|
+
copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
|
|
49
|
+
grants you the right to freely choose the license for the resulting
|
|
50
|
+
compiled code. In particular the resulting compiled code has no obligation
|
|
51
|
+
to be LGPL or GPL. For example you are free to choose a commercial or
|
|
52
|
+
closed source license or any other license if you decide so.
|
|
53
|
+
************************************************************************
|
|
54
|
+
************************************************************************/
|
|
55
|
+
|
|
56
|
+
ma = library("maths.lib");
|
|
57
|
+
ba = library("basics.lib");
|
|
58
|
+
fi = library("filters.lib");
|
|
59
|
+
si = library("signals.lib");
|
|
60
|
+
|
|
61
|
+
declare name "Faust Oscillator Library";
|
|
62
|
+
declare version "1.4.0";
|
|
63
|
+
|
|
64
|
+
// This library contains platform specific constants
|
|
65
|
+
pl = library("platform.lib");
|
|
66
|
+
|
|
67
|
+
//=========================Wave-Table-Based Oscillators===================================
|
|
68
|
+
// Oscillators based on mathematical functions.
|
|
69
|
+
//========================================================================================
|
|
70
|
+
|
|
71
|
+
//-----------------------`(os.)sinwaveform`------------------------
|
|
72
|
+
// Sine waveform ready to use with a `rdtable`.
|
|
73
|
+
//
|
|
74
|
+
// #### Usage
|
|
75
|
+
//
|
|
76
|
+
// ```
|
|
77
|
+
// sinwaveform(tablesize) : _
|
|
78
|
+
// ```
|
|
79
|
+
//
|
|
80
|
+
// Where:
|
|
81
|
+
//
|
|
82
|
+
// * `tablesize`: the table size
|
|
83
|
+
//------------------------------------------------------------
|
|
84
|
+
sinwaveform(tablesize) =
|
|
85
|
+
sin(float(ba.period(tablesize)) * (2.0 * ma.PI) / float(tablesize));
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
//-----------------------`(os.)coswaveform`------------------------
|
|
89
|
+
// Cosine waveform ready to use with a `rdtable`.
|
|
90
|
+
//
|
|
91
|
+
// #### Usage
|
|
92
|
+
//
|
|
93
|
+
// ```
|
|
94
|
+
// coswaveform(tablesize) : _
|
|
95
|
+
// ```
|
|
96
|
+
//
|
|
97
|
+
// Where:
|
|
98
|
+
//
|
|
99
|
+
// * `tablesize`: the table size
|
|
100
|
+
//------------------------------------------------------------
|
|
101
|
+
coswaveform(tablesize) =
|
|
102
|
+
cos(float(ba.period(tablesize)) * (2.0 * ma.PI) / float(tablesize));
|
|
103
|
+
|
|
104
|
+
// Possibly faster version using integer arithmetic
|
|
105
|
+
phasor_env(freq, N) = environment {
|
|
106
|
+
|
|
107
|
+
//——————— GLOBAL PARAMS
|
|
108
|
+
nbits = 31;
|
|
109
|
+
tablesize = 1<<N;
|
|
110
|
+
accuracy = int(nbits - N);
|
|
111
|
+
mask = (1<<nbits)-1;
|
|
112
|
+
inc(step) = int(tablesize * step * (1<<accuracy));
|
|
113
|
+
|
|
114
|
+
//——————— LAMBDA DSP CASE
|
|
115
|
+
lambda(inc_op) = (inc_op : &(mask)) ~ _ : >>(accuracy) : /(tablesize);
|
|
116
|
+
|
|
117
|
+
//——————— MINIMAL CASE
|
|
118
|
+
hsp(0,0) = lambda(+(inc(freq/ma.SR)'));
|
|
119
|
+
|
|
120
|
+
//——————— GENERAL CASE
|
|
121
|
+
hsp(reset,phase) = lambda(select2(hard_reset,+(inc(freq/ma.SR)),inc(phase)))
|
|
122
|
+
with {
|
|
123
|
+
hard_reset = (1-1')|reset;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
declare phasor_env author "Pierre Mascarade Relaño, Maxime Sirbu, Stéphane Letz";
|
|
127
|
+
|
|
128
|
+
// Generic phasor with `reset` and `phase` parameters to be specialised in concrete use-cases.
|
|
129
|
+
phasor_imp(freq, reset, phase) = (select2(hard_reset, +(freq/ma.SR), phase) : ma.decimal) ~ _
|
|
130
|
+
with {
|
|
131
|
+
hard_reset = (1-1')|reset; // To correctly start at `phase` at the first sample
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
// Possibly faster version using integer arithmetic
|
|
135
|
+
// phasor_imp(freq, reset, phase) = phasor_env(freq, 16).hsp(reset, phase);
|
|
136
|
+
|
|
137
|
+
// Version to be used with tables
|
|
138
|
+
phasor_table(tablesize, freq, reset, phase) = phasor_imp(freq, reset, phase) : *(float(tablesize));
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
//-----------------------`(os.)phasor`------------------------
|
|
142
|
+
// A simple phasor to be used with a `rdtable`.
|
|
143
|
+
// `phasor` is a standard Faust function.
|
|
144
|
+
//
|
|
145
|
+
// #### Usage
|
|
146
|
+
//
|
|
147
|
+
// ```
|
|
148
|
+
// phasor(tablesize,freq) : _
|
|
149
|
+
// ```
|
|
150
|
+
//
|
|
151
|
+
// Where:
|
|
152
|
+
//
|
|
153
|
+
// * `tablesize`: the table size
|
|
154
|
+
// * `freq`: the frequency in Hz
|
|
155
|
+
//------------------------------------------------------------
|
|
156
|
+
phasor(tablesize, freq) = phasor_table(tablesize, freq, 0, 0);
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
//-----------------------`(os.)hs_phasor`------------------------
|
|
160
|
+
// Hardsyncing phasor to be used with a `rdtable`.
|
|
161
|
+
//
|
|
162
|
+
// #### Usage
|
|
163
|
+
//
|
|
164
|
+
// ```
|
|
165
|
+
// hs_phasor(tablesize,freq,reset) : _
|
|
166
|
+
// ```
|
|
167
|
+
//
|
|
168
|
+
// Where:
|
|
169
|
+
//
|
|
170
|
+
// * `tablesize`: the table size
|
|
171
|
+
// * `freq`: the frequency in Hz
|
|
172
|
+
// * `reset`: a reset signal, reset phase to 0 when equal to 1
|
|
173
|
+
//---------------------------------------------------------
|
|
174
|
+
declare hs_phasor author "Mike Olsen, revised by Stéphane Letz";
|
|
175
|
+
|
|
176
|
+
hs_phasor(tablesize, freq, reset) = phasor_table(tablesize, freq, reset, 0);
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
//-----------------------`(os.)hsp_phasor`------------------------
|
|
180
|
+
// Hardsyncing phasor with selectable phase to be used with a `rdtable`.
|
|
181
|
+
//
|
|
182
|
+
// #### Usage
|
|
183
|
+
//
|
|
184
|
+
// ```
|
|
185
|
+
// hsp_phasor(tablesize,freq,reset,phase)
|
|
186
|
+
// ```
|
|
187
|
+
//
|
|
188
|
+
// Where:
|
|
189
|
+
//
|
|
190
|
+
// * `tablesize`: the table size
|
|
191
|
+
// * `freq`: the frequency in Hz
|
|
192
|
+
// * `reset`: reset the oscillator to phase when equal to 1
|
|
193
|
+
// * `phase`: phase between 0 and 1
|
|
194
|
+
//---------------------------------------------------------
|
|
195
|
+
declare hsp_phasor author "Christophe Lebreton, revised by Stéphane Letz";
|
|
196
|
+
|
|
197
|
+
hsp_phasor(tablesize, freq, reset, phase) = phasor_table(tablesize, freq, reset, phase);
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
//-----------------------`(os.)oscsin`------------------------
|
|
201
|
+
// Sine wave oscillator.
|
|
202
|
+
// `oscsin` is a standard Faust function.
|
|
203
|
+
//
|
|
204
|
+
// #### Usage
|
|
205
|
+
//
|
|
206
|
+
// ```
|
|
207
|
+
// oscsin(freq) : _
|
|
208
|
+
// ```
|
|
209
|
+
//
|
|
210
|
+
// Where:
|
|
211
|
+
//
|
|
212
|
+
// * `freq`: the frequency in Hz
|
|
213
|
+
//------------------------------------------------------------
|
|
214
|
+
oscsin(freq) = rdtable(tablesize, sinwaveform(tablesize), int(phasor(tablesize,freq)))
|
|
215
|
+
with {
|
|
216
|
+
tablesize = pl.tablesize;
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
//-----------------------`(os.)hs_oscsin`------------------------
|
|
221
|
+
// Sin lookup table with hardsyncing phase.
|
|
222
|
+
//
|
|
223
|
+
// #### Usage
|
|
224
|
+
//
|
|
225
|
+
// ```
|
|
226
|
+
// hs_oscsin(freq,reset) : _
|
|
227
|
+
// ```
|
|
228
|
+
//
|
|
229
|
+
// Where:
|
|
230
|
+
//
|
|
231
|
+
// * `freq`: the frequency in Hz
|
|
232
|
+
// * `reset`: reset the oscillator to 0 when equal to 1
|
|
233
|
+
//---------------------------------------------------------
|
|
234
|
+
declare hs_oscsin author "Mike Olsen";
|
|
235
|
+
|
|
236
|
+
hs_oscsin(freq,reset) = rdtable(tablesize, sinwaveform(tablesize), int(hs_phasor(tablesize,freq,reset)))
|
|
237
|
+
with {
|
|
238
|
+
tablesize = pl.tablesize;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
//-----------------------`(os.)osccos`------------------------
|
|
243
|
+
// Cosine wave oscillator.
|
|
244
|
+
//
|
|
245
|
+
// #### Usage
|
|
246
|
+
//
|
|
247
|
+
// ```
|
|
248
|
+
// osccos(freq) : _
|
|
249
|
+
// ```
|
|
250
|
+
//
|
|
251
|
+
// Where:
|
|
252
|
+
//
|
|
253
|
+
// * `freq`: the frequency in Hz
|
|
254
|
+
//------------------------------------------------------------
|
|
255
|
+
osccos(freq) = rdtable(tablesize, coswaveform(tablesize), int(phasor(tablesize,freq)))
|
|
256
|
+
with {
|
|
257
|
+
tablesize = pl.tablesize;
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
//-----------------------`(os.)hs_osccos`------------------------
|
|
262
|
+
// Cos lookup table with hardsyncing phase.
|
|
263
|
+
//
|
|
264
|
+
// #### Usage
|
|
265
|
+
//
|
|
266
|
+
// ```
|
|
267
|
+
// hs_osccos(freq,reset) : _
|
|
268
|
+
// ```
|
|
269
|
+
//
|
|
270
|
+
// Where:
|
|
271
|
+
//
|
|
272
|
+
// * `freq`: the frequency in Hz
|
|
273
|
+
// * `reset`: reset the oscillator to 0 when equal to 1
|
|
274
|
+
//---------------------------------------------------------
|
|
275
|
+
declare hs_osccos author "Stéphane Letz";
|
|
276
|
+
|
|
277
|
+
hs_osccos(freq,reset) = rdtable(tablesize, coswaveform(tablesize), int(hs_phasor(tablesize,freq,reset)))
|
|
278
|
+
with {
|
|
279
|
+
tablesize = pl.tablesize;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
//-----------------------`(os.)oscp`------------------------
|
|
284
|
+
// A sine wave generator with controllable phase.
|
|
285
|
+
//
|
|
286
|
+
// #### Usage
|
|
287
|
+
//
|
|
288
|
+
// ```
|
|
289
|
+
// oscp(freq,phase) : _
|
|
290
|
+
// ```
|
|
291
|
+
//
|
|
292
|
+
// Where:
|
|
293
|
+
//
|
|
294
|
+
// * `freq`: the frequency in Hz
|
|
295
|
+
// * `phase`: the phase in radian
|
|
296
|
+
//------------------------------------------------------------
|
|
297
|
+
oscp(freq,phase) = oscsin(freq) * cos(phase) + osccos(freq) * sin(phase);
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
//-----------------------`(os.)osci`------------------------
|
|
301
|
+
// Interpolated phase sine wave oscillator.
|
|
302
|
+
//
|
|
303
|
+
// #### Usage
|
|
304
|
+
//
|
|
305
|
+
// ```
|
|
306
|
+
// osci(freq) : _
|
|
307
|
+
// ```
|
|
308
|
+
//
|
|
309
|
+
// Where:
|
|
310
|
+
//
|
|
311
|
+
// * `freq`: the frequency in Hz
|
|
312
|
+
//------------------------------------------------------------
|
|
313
|
+
osci(freq) = s1 + d * (s2 - s1)
|
|
314
|
+
with {
|
|
315
|
+
tablesize = pl.tablesize;
|
|
316
|
+
i = int(phasor(tablesize,freq));
|
|
317
|
+
d = ma.decimal(phasor(tablesize,freq));
|
|
318
|
+
s1 = rdtable(tablesize+1,sinwaveform(tablesize),i);
|
|
319
|
+
s2 = rdtable(tablesize+1,sinwaveform(tablesize),i+1);
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
//-----------------------`(os.)osc`------------------------
|
|
324
|
+
// Default sine wave oscillator (same as [oscsin](#oscsin)).
|
|
325
|
+
// `osc` is a standard Faust function.
|
|
326
|
+
//
|
|
327
|
+
// #### Usage
|
|
328
|
+
//
|
|
329
|
+
// ```
|
|
330
|
+
// osc(freq) : _
|
|
331
|
+
// ```
|
|
332
|
+
//
|
|
333
|
+
// Where:
|
|
334
|
+
//
|
|
335
|
+
// * `freq`: the frequency in Hz
|
|
336
|
+
//------------------------------------------------------------
|
|
337
|
+
osc = oscsin;
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
//-----------------------`(os.)m_oscsin`------------------------
|
|
341
|
+
// Sine wave oscillator based on the `sin` mathematical function.
|
|
342
|
+
//
|
|
343
|
+
// #### Usage
|
|
344
|
+
//
|
|
345
|
+
// ```
|
|
346
|
+
// m_oscsin(freq) : _
|
|
347
|
+
// ```
|
|
348
|
+
//
|
|
349
|
+
// Where:
|
|
350
|
+
//
|
|
351
|
+
// * `freq`: the frequency in Hz
|
|
352
|
+
//------------------------------------------------------------
|
|
353
|
+
m_oscsin(freq) = lf_sawpos(freq) : *(2*ma.PI) : sin;
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
//-----------------------`(os.)m_osccos`------------------------
|
|
357
|
+
// Sine wave oscillator based on the `sin` mathematical function.
|
|
358
|
+
//
|
|
359
|
+
// #### Usage
|
|
360
|
+
//
|
|
361
|
+
// ```
|
|
362
|
+
// m_osccos(freq) : _
|
|
363
|
+
// ```
|
|
364
|
+
//
|
|
365
|
+
// Where:
|
|
366
|
+
//
|
|
367
|
+
// * `freq`: the frequency in Hz
|
|
368
|
+
//------------------------------------------------------------
|
|
369
|
+
m_osccos(freq) = lf_sawpos(freq) : *(2*ma.PI) : cos;
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
// end GRAME section
|
|
373
|
+
//########################################################################################
|
|
374
|
+
/************************************************************************
|
|
375
|
+
FAUST library file, jos section
|
|
376
|
+
|
|
377
|
+
Except where noted otherwise, The Faust functions below in this
|
|
378
|
+
section are Copyright (C) 2003-2022 by Julius O. Smith III <jos@ccrma.stanford.edu>
|
|
379
|
+
([jos](http://ccrma.stanford.edu/~jos/)), and released under the
|
|
380
|
+
(MIT-style) [STK-4.3](#stk-4.3-license) license.
|
|
381
|
+
|
|
382
|
+
The MarkDown comments in this section are Copyright 2016-2017 by Romain
|
|
383
|
+
Michon and Julius O. Smith III, and are released under the
|
|
384
|
+
[CCA4I](https://creativecommons.org/licenses/by/4.0/) license (TODO: if/when Romain agrees)
|
|
385
|
+
|
|
386
|
+
************************************************************************/
|
|
387
|
+
|
|
388
|
+
//===============================Low Frequency Oscillators===============================
|
|
389
|
+
// Low Frequency Oscillators (LFOs) have prefix `lf_`
|
|
390
|
+
// (no aliasing suppression, since it is inaudible at LF).
|
|
391
|
+
// Use `sawN` and its derivatives for audio oscillators with suppressed aliasing.
|
|
392
|
+
//==================================================================
|
|
393
|
+
|
|
394
|
+
//--------`(os.)lf_imptrain`----------
|
|
395
|
+
// Unit-amplitude low-frequency impulse train.
|
|
396
|
+
// `lf_imptrain` is a standard Faust function.
|
|
397
|
+
|
|
398
|
+
// #### Usage
|
|
399
|
+
//
|
|
400
|
+
// ```
|
|
401
|
+
// lf_imptrain(freq) : _
|
|
402
|
+
// ```
|
|
403
|
+
|
|
404
|
+
// Where:
|
|
405
|
+
//
|
|
406
|
+
// * `freq`: frequency in Hz
|
|
407
|
+
//------------------------------------------------------------
|
|
408
|
+
lf_imptrain(freq) = lf_sawpos(freq)<:-(mem)<0; // definition below
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
//--------`(os.)lf_pulsetrainpos`----------
|
|
412
|
+
// Unit-amplitude nonnegative LF pulse train, duty cycle between 0 and 1.
|
|
413
|
+
//
|
|
414
|
+
//
|
|
415
|
+
// #### Usage
|
|
416
|
+
//
|
|
417
|
+
// ```
|
|
418
|
+
// lf_pulsetrainpos(freq, duty) : _
|
|
419
|
+
// ```
|
|
420
|
+
//
|
|
421
|
+
// Where:
|
|
422
|
+
//
|
|
423
|
+
// * `freq`: frequency in Hz
|
|
424
|
+
// * `duty`: duty cycle between 0 and 1
|
|
425
|
+
//------------------------------------------------------------
|
|
426
|
+
lf_pulsetrainpos(freq,duty) = float(lf_sawpos(freq) <= duty);
|
|
427
|
+
|
|
428
|
+
//pulsetrainpos = lf_pulsetrainpos; // for backward compatibility
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
//--------`(os.)lf_pulsetrain`----------
|
|
432
|
+
// Unit-amplitude zero-mean LF pulse train, duty cycle between 0 and 1.
|
|
433
|
+
//
|
|
434
|
+
// #### Usage
|
|
435
|
+
//
|
|
436
|
+
// ```
|
|
437
|
+
// lf_pulsetrain(freq,duty) : _
|
|
438
|
+
// ```
|
|
439
|
+
//
|
|
440
|
+
// Where:
|
|
441
|
+
//
|
|
442
|
+
// * `freq`: frequency in Hz
|
|
443
|
+
// * `duty`: duty cycle between 0 and 1
|
|
444
|
+
//------------------------------------------------------------
|
|
445
|
+
lf_pulsetrain(freq,duty) = 2.0*lf_pulsetrainpos(freq,duty) - 1.0;
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
//--------`(os.)lf_squarewavepos`----------
|
|
449
|
+
// Positive LF square wave in [0,1]
|
|
450
|
+
//
|
|
451
|
+
// #### Usage
|
|
452
|
+
//
|
|
453
|
+
// ```
|
|
454
|
+
// lf_squarewavepos(freq) : _
|
|
455
|
+
// ```
|
|
456
|
+
//
|
|
457
|
+
// Where:
|
|
458
|
+
//
|
|
459
|
+
// * `freq`: frequency in Hz
|
|
460
|
+
//------------------------------------------------------------
|
|
461
|
+
lf_squarewavepos(freq) = lf_pulsetrainpos(freq,0.5);
|
|
462
|
+
// squarewavepos = lf_squarewavepos; // for backward compatibility
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
//--------`(os.)lf_squarewave`----------
|
|
466
|
+
// Zero-mean unit-amplitude LF square wave.
|
|
467
|
+
// `lf_squarewave` is a standard Faust function.
|
|
468
|
+
//
|
|
469
|
+
// #### Usage
|
|
470
|
+
//
|
|
471
|
+
// ```
|
|
472
|
+
// lf_squarewave(freq) : _
|
|
473
|
+
// ```
|
|
474
|
+
//
|
|
475
|
+
// Where:
|
|
476
|
+
//
|
|
477
|
+
// * `freq`: frequency in Hz
|
|
478
|
+
//------------------------------------------------------------
|
|
479
|
+
lf_squarewave(freq) = 2.0*lf_squarewavepos(freq) - 1.0;
|
|
480
|
+
// squarewave = lf_squarewave; // for backward compatibility
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
//--------`(os.)lf_trianglepos`----------
|
|
484
|
+
// Positive unit-amplitude LF positive triangle wave.
|
|
485
|
+
//
|
|
486
|
+
// #### Usage
|
|
487
|
+
//
|
|
488
|
+
// ```
|
|
489
|
+
// lf_trianglepos(freq) : _
|
|
490
|
+
// ```
|
|
491
|
+
//
|
|
492
|
+
// Where:
|
|
493
|
+
//
|
|
494
|
+
// * `freq`: frequency in Hz
|
|
495
|
+
//------------------------------------------------------------
|
|
496
|
+
lf_trianglepos(freq) = 1.0-abs(saw1(freq)); // saw1 defined below
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
//----------`(os.)lf_triangle`----------
|
|
500
|
+
// Positive unit-amplitude LF triangle wave.
|
|
501
|
+
// `lf_triangle` is a standard Faust function.
|
|
502
|
+
//
|
|
503
|
+
// #### Usage
|
|
504
|
+
//
|
|
505
|
+
// ```
|
|
506
|
+
// lf_triangle(freq) : _
|
|
507
|
+
// ```
|
|
508
|
+
//
|
|
509
|
+
// Where:
|
|
510
|
+
//
|
|
511
|
+
// * `freq`: frequency in Hz
|
|
512
|
+
//------------------------------------------------------------
|
|
513
|
+
declare lf_triangle author "Bart Brouns";
|
|
514
|
+
declare lf_triangle licence "STK-4.3";
|
|
515
|
+
|
|
516
|
+
lf_triangle(freq) = 2.0*lf_trianglepos(freq) - 1.0;
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
//================== Low Frequency Sawtooths ====================
|
|
520
|
+
// Sawtooth waveform oscillators for virtual analog synthesis et al.
|
|
521
|
+
// The 'simple' versions (`lf_rawsaw`, `lf_sawpos` and `saw1`), are mere samplings of
|
|
522
|
+
// the ideal continuous-time ("analog") waveforms. While simple, the
|
|
523
|
+
// aliasing due to sampling is quite audible. The differentiated
|
|
524
|
+
// polynomial waveform family (`saw2`, `sawN`, and derived functions)
|
|
525
|
+
// do some extra processing to suppress aliasing (not audible for
|
|
526
|
+
// very low fundamental frequencies). According to Lehtonen et al.
|
|
527
|
+
// (JASA 2012), the aliasing of `saw2` should be inaudible at fundamental
|
|
528
|
+
// frequencies below 2 kHz or so, for a 44.1 kHz sampling rate and 60 dB SPL
|
|
529
|
+
// presentation level; fundamentals 415 and below required no aliasing
|
|
530
|
+
// suppression (i.e., `saw1` is ok).
|
|
531
|
+
//=====================================================================
|
|
532
|
+
|
|
533
|
+
//-----------------`(os.)lf_rawsaw`--------------------
|
|
534
|
+
// Simple sawtooth waveform oscillator between 0 and period in samples.
|
|
535
|
+
//
|
|
536
|
+
// #### Usage
|
|
537
|
+
//
|
|
538
|
+
// ```
|
|
539
|
+
// lf_rawsaw(periodsamps) : _
|
|
540
|
+
// ```
|
|
541
|
+
//
|
|
542
|
+
// Where:
|
|
543
|
+
//
|
|
544
|
+
// * `periodsamps`: number of periods per samples
|
|
545
|
+
//---------------------------------------------------------
|
|
546
|
+
lf_rawsaw(periodsamps) = (_,periodsamps : fmod) ~ +(1.0);
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
//-----------------`(os.)lf_sawpos`--------------------
|
|
550
|
+
// Simple sawtooth waveform oscillator between 0 and 1.
|
|
551
|
+
//
|
|
552
|
+
// #### Usage
|
|
553
|
+
//
|
|
554
|
+
// ```
|
|
555
|
+
// lf_sawpos(freq) : _
|
|
556
|
+
// ```
|
|
557
|
+
//
|
|
558
|
+
// Where:
|
|
559
|
+
//
|
|
560
|
+
// * `freq`: frequency in Hz
|
|
561
|
+
//
|
|
562
|
+
//---------------------------------------------------------
|
|
563
|
+
declare lf_sawpos author "Bart Brouns, revised by Stéphane Letz";
|
|
564
|
+
declare lf_sawpos licence "STK-4.3";
|
|
565
|
+
|
|
566
|
+
lf_sawpos(freq) = phasor_imp(freq, 0, 0);
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
//-----------------`(os.)lf_sawpos_phase`--------------------
|
|
570
|
+
// Simple sawtooth waveform oscillator between 0 and 1
|
|
571
|
+
// with phase control.
|
|
572
|
+
//
|
|
573
|
+
// #### Usage
|
|
574
|
+
//
|
|
575
|
+
// ```
|
|
576
|
+
// lf_sawpos_phase(freq, phase) : _
|
|
577
|
+
// ```
|
|
578
|
+
//
|
|
579
|
+
// Where:
|
|
580
|
+
//
|
|
581
|
+
// * `freq`: frequency in Hz
|
|
582
|
+
// * `phase`: phase between 0 and 1
|
|
583
|
+
//---------------------------------------------------------
|
|
584
|
+
declare lf_sawpos_phase author "Bart Brouns, revised by Stéphane Letz";
|
|
585
|
+
declare lf_sawpos_phase licence "STK-4.3";
|
|
586
|
+
|
|
587
|
+
lf_sawpos_phase(freq,phase) = phasor_imp(freq, 0, phase);
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
//-----------------`(os.)lf_sawpos_reset`--------------------
|
|
591
|
+
// Simple sawtooth waveform oscillator between 0 and 1
|
|
592
|
+
// with reset.
|
|
593
|
+
//
|
|
594
|
+
// #### Usage
|
|
595
|
+
//
|
|
596
|
+
// ```
|
|
597
|
+
// lf_sawpos_reset(freq,reset) : _
|
|
598
|
+
// ```
|
|
599
|
+
//
|
|
600
|
+
// Where:
|
|
601
|
+
//
|
|
602
|
+
// * `freq`: frequency in Hz
|
|
603
|
+
// * `reset`: reset the oscillator to 0 when equal to 1
|
|
604
|
+
//
|
|
605
|
+
//---------------------------------------------------------
|
|
606
|
+
declare lf_sawpos_reset author "Bart Brouns, revised by Stéphane Letz";
|
|
607
|
+
declare lf_sawpos_reset licence "STK-4.3";
|
|
608
|
+
|
|
609
|
+
lf_sawpos_reset(freq,reset) = phasor_imp(freq, reset, 0);
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
//-----------------`(os.)lf_sawpos_phase_reset`--------------------
|
|
613
|
+
// Simple sawtooth waveform oscillator between 0 and 1
|
|
614
|
+
// with phase control and reset.
|
|
615
|
+
//
|
|
616
|
+
// #### Usage
|
|
617
|
+
//
|
|
618
|
+
// ```
|
|
619
|
+
// lf_sawpos_phase_reset(freq,phase,reset) : _
|
|
620
|
+
// ```
|
|
621
|
+
//
|
|
622
|
+
// Where:
|
|
623
|
+
//
|
|
624
|
+
// * `freq`: frequency in Hz
|
|
625
|
+
// * `phase`: phase between 0 and 1
|
|
626
|
+
// * `reset`: reset the oscillator to phase when equal to 1
|
|
627
|
+
//
|
|
628
|
+
//---------------------------------------------------------
|
|
629
|
+
declare lf_sawpos_phase_reset author "Bart Brouns, revised by Stéphane Letz";
|
|
630
|
+
declare lf_sawpos_phase_reset licence "STK-4.3";
|
|
631
|
+
|
|
632
|
+
lf_sawpos_phase_reset(freq,phase,reset) = phasor_imp(freq, reset, phase);
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
//-----------------`(os.)lf_saw`--------------------
|
|
636
|
+
// Simple sawtooth waveform oscillator between -1 and 1.
|
|
637
|
+
// `lf_saw` is a standard Faust function.
|
|
638
|
+
//
|
|
639
|
+
// #### Usage
|
|
640
|
+
//
|
|
641
|
+
// ```
|
|
642
|
+
// lf_saw(freq) : _
|
|
643
|
+
// ```
|
|
644
|
+
//
|
|
645
|
+
// Where:
|
|
646
|
+
//
|
|
647
|
+
// * `freq`: frequency in Hz
|
|
648
|
+
//---------------------------------------------------------
|
|
649
|
+
declare saw1 author "Bart Brouns";
|
|
650
|
+
declare saw1 licence "STK-4.3";
|
|
651
|
+
|
|
652
|
+
saw1(freq) = 2.0 * lf_sawpos(freq) - 1.0;
|
|
653
|
+
lf_saw(freq) = saw1(freq);
|
|
654
|
+
|
|
655
|
+
//================== Alias-Suppressed Sawtooth ====================
|
|
656
|
+
//-----------------`(os.)sawN`--------------------
|
|
657
|
+
// Alias-Suppressed Sawtooth Audio-Frequency Oscillator using Nth-order polynomial transitions
|
|
658
|
+
// to reduce aliasing.
|
|
659
|
+
//
|
|
660
|
+
// `sawN(N,freq)`, `sawNp(N,freq,phase)`, `saw2dpw(freq)`, `saw2(freq)`, `saw3(freq)`,
|
|
661
|
+
// `saw4(freq)`, `sawtooth(freq)`, `saw2f2(freq)`, `saw2f4(freq)`
|
|
662
|
+
//
|
|
663
|
+
// #### Usage
|
|
664
|
+
//
|
|
665
|
+
// ```
|
|
666
|
+
// sawN(N,freq) : _ // Nth-order aliasing-suppressed sawtooth using DPW method (see below)
|
|
667
|
+
// sawNp(N,freq,phase) : _ // sawN with phase offset feature
|
|
668
|
+
// saw2dpw(freq) : _ // saw2 using DPW
|
|
669
|
+
// saw2ptr(freq) : _ // saw2 using the faster, stateless PTR method
|
|
670
|
+
// saw2(freq) : _ // DPW method, but subject to change if a better method emerges
|
|
671
|
+
// saw3(freq) : _ // sawN(3)
|
|
672
|
+
// saw4(freq) : _ // sawN(4)
|
|
673
|
+
// sawtooth(freq) : _ // saw2
|
|
674
|
+
// saw2f2(freq) : _ // saw2dpw with 2nd-order droop-correction filtering
|
|
675
|
+
// saw2f4(freq) : _ // saw2dpw with 4th-order droop-correction filtering
|
|
676
|
+
// ```
|
|
677
|
+
//
|
|
678
|
+
// Where:
|
|
679
|
+
//
|
|
680
|
+
// * `N`: polynomial order, a constant numerical expression between 1 and 4
|
|
681
|
+
// * `freq`: frequency in Hz
|
|
682
|
+
// * `phase`: phase between 0 and 1
|
|
683
|
+
//
|
|
684
|
+
// #### Method
|
|
685
|
+
// Differentiated Polynomial Wave (DPW).
|
|
686
|
+
//
|
|
687
|
+
// ##### Reference
|
|
688
|
+
// "Alias-Suppressed Oscillators based on Differentiated Polynomial Waveforms",
|
|
689
|
+
// Vesa Valimaki, Juhan Nam, Julius Smith, and Jonathan Abel,
|
|
690
|
+
// IEEE Tr. Audio, Speech, and Language Processing (IEEE-ASLP),
|
|
691
|
+
// Vol. 18, no. 5, pp 786-798, May 2010.
|
|
692
|
+
// 10.1109/TASL.2009.2026507.
|
|
693
|
+
//
|
|
694
|
+
// #### Notes
|
|
695
|
+
// The polynomial order `N` is limited to 4 because noise has been
|
|
696
|
+
// observed at very low `freq` values. (LFO sawtooths should of course
|
|
697
|
+
// be generated using `lf_sawpos` instead.)
|
|
698
|
+
//-----------------------------------------------------------------
|
|
699
|
+
declare sawN author "Julius O. Smith III";
|
|
700
|
+
declare sawN license "STK-4.3";
|
|
701
|
+
// --- sawN for N = 1 to 4 ---
|
|
702
|
+
// Orders 5 and 6 have noise at low fundamentals: MAX_SAW_ORDER = 6; MAX_SAW_ORDER_NEXTPOW2 = 8;
|
|
703
|
+
MAX_SAW_ORDER = 4;
|
|
704
|
+
MAX_SAW_ORDER_NEXTPOW2 = 8; // par cannot handle the case of 0 elements
|
|
705
|
+
sawN(N,freq) = saw1l : poly(Nc) : D(Nc-1) : gate(Nc-1)
|
|
706
|
+
with {
|
|
707
|
+
Nc = max(1,min(N,MAX_SAW_ORDER));
|
|
708
|
+
clippedFreq = max(20.0,abs(freq)); // use lf_sawpos(freq) for LFOs (freq < 20 Hz)
|
|
709
|
+
saw1l = 2*lf_sawpos(clippedFreq) - 1; // zero-mean, amplitude +/- 1
|
|
710
|
+
poly(1,x) = x;
|
|
711
|
+
poly(2,x) = x*x;
|
|
712
|
+
poly(3,x) = x*x*x - x;
|
|
713
|
+
poly(4,x) = x*x*(x*x - 2.0);
|
|
714
|
+
poly(5,x) = x*(7.0/3 + x*x*(-10.0/3.0 + x*x));
|
|
715
|
+
poly(6,x) = x*x*(7.0 + x*x*(-5.0 + x*x));
|
|
716
|
+
p0n = float(ma.SR)/clippedFreq; // period in samples
|
|
717
|
+
diff1(x) = (x - x')/(2.0/p0n);
|
|
718
|
+
diff(N) = seq(n,N,diff1); // N diff1s in series
|
|
719
|
+
factorial(0) = 1;
|
|
720
|
+
factorial(i) = i * factorial(i-1);
|
|
721
|
+
D(0) = _;
|
|
722
|
+
D(i) = diff(i)/factorial(i+1);
|
|
723
|
+
gate(N) = *(1@(N)); // delayed step for blanking startup glitch
|
|
724
|
+
};
|
|
725
|
+
|
|
726
|
+
//------------------`(os.)sawNp`--------------------------------
|
|
727
|
+
// Same as `(os.)sawN` but with a controllable waveform phase.
|
|
728
|
+
//
|
|
729
|
+
// #### Usage
|
|
730
|
+
//
|
|
731
|
+
// ```
|
|
732
|
+
// sawNp(N,freq,phase) : _
|
|
733
|
+
// ```
|
|
734
|
+
//
|
|
735
|
+
// where
|
|
736
|
+
//
|
|
737
|
+
// * `N`: waveform interpolation polynomial order 1 to 4 (constant integer expression)
|
|
738
|
+
// * `freq`: frequency in Hz
|
|
739
|
+
// * `phase`: waveform phase as a fraction of one period (rounded to nearest sample)
|
|
740
|
+
//
|
|
741
|
+
// #### Implementation Notes
|
|
742
|
+
//
|
|
743
|
+
// The phase offset is implemented by delaying `sawN(N,freq)` by
|
|
744
|
+
// `round(phase*ma.SR/freq)` samples, for up to 8191 samples.
|
|
745
|
+
// The minimum sawtooth frequency that can be delayed a whole period
|
|
746
|
+
// is therefore `ma.SR/8191`, which is well below audibility for normal
|
|
747
|
+
// audio sampling rates.
|
|
748
|
+
//
|
|
749
|
+
//-----------------------------------------------------------------
|
|
750
|
+
declare sawNp author "Julius O. Smith III";
|
|
751
|
+
declare sawNp license "STK-4.3";
|
|
752
|
+
// --- sawNp for N = 1 to 4 ---
|
|
753
|
+
// Phase offset = delay (max 8191 samples is more than one period of audio):
|
|
754
|
+
sawNp(N,freq,phase) = sawN(N,freq) : @(max(0,min(8191,int(0.5+phase*ma.SR/freq))));
|
|
755
|
+
|
|
756
|
+
//------------------`(os.)saw2, (os.)saw3, (os.)saw4`--------------
|
|
757
|
+
// Alias-Suppressed Sawtooth Audio-Frequency Oscillators of order 2, 3, 4.
|
|
758
|
+
//
|
|
759
|
+
// #### Usage
|
|
760
|
+
//
|
|
761
|
+
// ```
|
|
762
|
+
// saw2(freq) : _
|
|
763
|
+
// saw3(freq) : _
|
|
764
|
+
// saw4(freq) : _
|
|
765
|
+
// ```
|
|
766
|
+
//
|
|
767
|
+
// where
|
|
768
|
+
//
|
|
769
|
+
// * `freq`: frequency in Hz
|
|
770
|
+
//
|
|
771
|
+
// ##### References
|
|
772
|
+
// See `sawN` above.
|
|
773
|
+
//
|
|
774
|
+
// #### Implementation Notes
|
|
775
|
+
//
|
|
776
|
+
// Presently, only `saw2` uses the PTR method, while `saw3` and `saw4` use DPW.
|
|
777
|
+
// This is because PTR has been implemented and tested for the 2nd-order case only.
|
|
778
|
+
//
|
|
779
|
+
//------------------------------------------------------------------
|
|
780
|
+
saw2 = saw2ptr; // "faustlibraries choice"
|
|
781
|
+
saw3 = sawN(3); // only choice available right now
|
|
782
|
+
saw4 = sawN(4); // only choice available right now
|
|
783
|
+
|
|
784
|
+
//---------------------------`(os.)saw2ptr`---------------------------
|
|
785
|
+
// Alias-Suppressed Sawtooth Audio-Frequency Oscillator
|
|
786
|
+
// using Polynomial Transition Regions (PTR) for order 2.
|
|
787
|
+
//
|
|
788
|
+
// #### Usage
|
|
789
|
+
//
|
|
790
|
+
// ```
|
|
791
|
+
// saw2ptr(freq) : _
|
|
792
|
+
// ```
|
|
793
|
+
//
|
|
794
|
+
// where
|
|
795
|
+
//
|
|
796
|
+
// * `freq`: frequency in Hz
|
|
797
|
+
//
|
|
798
|
+
// ##### Implementation
|
|
799
|
+
//
|
|
800
|
+
// Polynomial Transition Regions (PTR) method for aliasing suppression.
|
|
801
|
+
//
|
|
802
|
+
// ##### References
|
|
803
|
+
//
|
|
804
|
+
// * Kleimola, J.; Valimaki, V., "Reducing Aliasing from Synthetic Audio
|
|
805
|
+
// Signals Using Polynomial Transition Regions," in Signal Processing
|
|
806
|
+
// Letters, IEEE , vol.19, no.2, pp.67-70, Feb. 2012
|
|
807
|
+
// * <https://aaltodoc.aalto.fi/bitstream/handle/123456789/7747/publication6.pdf?sequence=9>
|
|
808
|
+
// * <http://research.spa.aalto.fi/publications/papers/spl-ptr/>
|
|
809
|
+
//
|
|
810
|
+
// ##### Notes
|
|
811
|
+
//
|
|
812
|
+
// Method PTR may be preferred because it requires less
|
|
813
|
+
// computation and is stateless which means that the frequency `freq`
|
|
814
|
+
// can be modulated arbitrarily fast over time without filtering
|
|
815
|
+
// artifacts. For this reason, `saw2` is presently defined as `saw2ptr`.
|
|
816
|
+
//
|
|
817
|
+
//--------------------------------------------------------
|
|
818
|
+
declare saw2ptr author "Julius O. Smith III";
|
|
819
|
+
declare saw2ptr license "STK-4.3";
|
|
820
|
+
// specialized reimplementation:
|
|
821
|
+
saw2ptr(freq) = y with { // newer PTR version (stateless - freq can vary at any speed)
|
|
822
|
+
p0 = float(ma.SR)/float(max(ma.EPSILON,abs(freq))); // period in samples
|
|
823
|
+
t0 = 1.0/p0; // phase increment
|
|
824
|
+
p = ((_<:(-(1)<:_,_),_) <: selector1,selector2) ~(+(t0)):!,_;
|
|
825
|
+
selector1 = select2(<(0)); // for feedback
|
|
826
|
+
selector2 = select2(<(0), (_<:_,(*(1-p0):+(1)):+), _); // for output
|
|
827
|
+
y = 2*p-1;
|
|
828
|
+
};
|
|
829
|
+
|
|
830
|
+
//----------------------`(os.)saw2dpw`---------------------
|
|
831
|
+
// Alias-Suppressed Sawtooth Audio-Frequency Oscillator
|
|
832
|
+
// using the Differentiated Polynomial Waveform (DWP) method.
|
|
833
|
+
//
|
|
834
|
+
// #### Usage
|
|
835
|
+
//
|
|
836
|
+
// ```
|
|
837
|
+
// saw2dpw(freq) : _
|
|
838
|
+
// ```
|
|
839
|
+
//
|
|
840
|
+
// where
|
|
841
|
+
//
|
|
842
|
+
// * `freq`: frequency in Hz
|
|
843
|
+
//
|
|
844
|
+
// This is the original Faust `saw2` function using the DPW method.
|
|
845
|
+
// Since `saw2` is now defined as `saw2ptr`, the DPW version
|
|
846
|
+
// is now available as `saw2dwp`.
|
|
847
|
+
//--------------------------------------------------------
|
|
848
|
+
declare saw2dpw author "Julius O. Smith III";
|
|
849
|
+
declare saw2dpw license "STK-4.3";
|
|
850
|
+
saw2dpw(freq) = saw1(freq) <: * <: -(mem) : *(0.25'*ma.SR/freq);
|
|
851
|
+
|
|
852
|
+
//------------------`(os.)sawtooth`--------------------------------
|
|
853
|
+
// Alias-suppressed aliasing-suppressed sawtooth oscillator, presently defined as `saw2`.
|
|
854
|
+
// `sawtooth` is a standard Faust function.
|
|
855
|
+
//
|
|
856
|
+
// #### Usage
|
|
857
|
+
//
|
|
858
|
+
// ```
|
|
859
|
+
// sawtooth(freq) : _
|
|
860
|
+
// ```
|
|
861
|
+
//
|
|
862
|
+
// with
|
|
863
|
+
//
|
|
864
|
+
// * `freq`: frequency in Hz
|
|
865
|
+
//--------------------------------------------------------
|
|
866
|
+
sawtooth = saw2; // default choice for sawtooth signal - see also sawN
|
|
867
|
+
|
|
868
|
+
//------------------`(os.)saw2f2, (os.)saw2f4`--------------------------------
|
|
869
|
+
// Alias-Suppressed Sawtooth Audio-Frequency Oscillator with Order 2 or 4 Droop Correction Filtering.
|
|
870
|
+
//
|
|
871
|
+
// #### Usage
|
|
872
|
+
//
|
|
873
|
+
// ```
|
|
874
|
+
// saw2f2(freq) : _
|
|
875
|
+
// saw2f4(freq) : _
|
|
876
|
+
// ```
|
|
877
|
+
//
|
|
878
|
+
// with
|
|
879
|
+
//
|
|
880
|
+
// * `freq`: frequency in Hz
|
|
881
|
+
//
|
|
882
|
+
// In return for aliasing suppression, there is some attenuation near half the sampling rate.
|
|
883
|
+
// This can be considered as beneficial, or it can be compensated with a high-frequency boost.
|
|
884
|
+
// The boost filter is second-order for `saw2f2` and fourth-order for `saw2f4`, and both are designed
|
|
885
|
+
// for the DWP case and therefore use `saw2dpw`.
|
|
886
|
+
// See Figure 4(b) in the DPW reference for a plot of the slight droop in the DPW case.
|
|
887
|
+
//--------------------------------------------------------
|
|
888
|
+
declare saw2f2 author "Julius O. Smith III";
|
|
889
|
+
declare saw2f2 license "STK-4.3";
|
|
890
|
+
// --- Correction-filtered versions of saw2: saw2f2, saw2f4 -----
|
|
891
|
+
saw2f2 = saw2dpw : cf2 with {
|
|
892
|
+
cf2 = fi.tf2(1.155704605878911, 0.745184288225518,0.040305967265900,
|
|
893
|
+
0.823765146386639, 0.117420665547108);
|
|
894
|
+
};
|
|
895
|
+
declare saw2f4 author "Julius O. Smith III";
|
|
896
|
+
declare saw2f4 license "STK-4.3";
|
|
897
|
+
saw2f4 = saw2dpw : cf4 with {
|
|
898
|
+
cf4 = fi.iir((1.155727435125014, 2.285861038554662,
|
|
899
|
+
1.430915027294021, 0.290713280893317, 0.008306401748854),
|
|
900
|
+
(2.156834679164532, 1.559532244409321, 0.423036498118354,
|
|
901
|
+
0.032080681130972));
|
|
902
|
+
};
|
|
903
|
+
|
|
904
|
+
//=========Alias-Suppressed Pulse, Square, and Impulse Trains============
|
|
905
|
+
// Alias-Suppressed Pulse, Square and Impulse Trains.
|
|
906
|
+
//
|
|
907
|
+
// `pulsetrainN`, `pulsetrain`, `squareN`, `square`, `imptrainN`, `imptrain`,
|
|
908
|
+
// `triangleN`, `triangle`
|
|
909
|
+
//
|
|
910
|
+
// All are zero-mean and meant to oscillate in the audio frequency range.
|
|
911
|
+
// Use simpler sample-rounded `lf_*` versions above for LFOs.
|
|
912
|
+
//
|
|
913
|
+
// #### Usage
|
|
914
|
+
//
|
|
915
|
+
// ```
|
|
916
|
+
// pulsetrainN(N,freq,duty) : _
|
|
917
|
+
// pulsetrain(freq, duty) : _ // = pulsetrainN(2)
|
|
918
|
+
//
|
|
919
|
+
// squareN(N,freq) : _
|
|
920
|
+
// square : _ // = squareN(2)
|
|
921
|
+
//
|
|
922
|
+
// imptrainN(N,freq) : _
|
|
923
|
+
// imptrain : _ // = imptrainN(2)
|
|
924
|
+
//
|
|
925
|
+
// triangleN(N,freq) : _
|
|
926
|
+
// triangle : _ // = triangleN(2)
|
|
927
|
+
// ```
|
|
928
|
+
//
|
|
929
|
+
// Where:
|
|
930
|
+
//
|
|
931
|
+
// * `N`: polynomial order, a constant numerical expression
|
|
932
|
+
// * `freq`: frequency in Hz
|
|
933
|
+
//====================================================================
|
|
934
|
+
|
|
935
|
+
|
|
936
|
+
//------------------`(os.)impulse`--------------------------------
|
|
937
|
+
// One-time impulse generated when the Faust process is started.
|
|
938
|
+
// `impulse` is a standard Faust function.
|
|
939
|
+
//
|
|
940
|
+
// #### Usage
|
|
941
|
+
//
|
|
942
|
+
// ```
|
|
943
|
+
// impulse : _
|
|
944
|
+
// ```
|
|
945
|
+
//--------------------------------------------------------
|
|
946
|
+
impulse = 1-1';
|
|
947
|
+
|
|
948
|
+
|
|
949
|
+
//------------------`(os.)pulsetrainN`--------------------------------
|
|
950
|
+
// Alias-suppressed pulse train oscillator.
|
|
951
|
+
//
|
|
952
|
+
// #### Usage
|
|
953
|
+
//
|
|
954
|
+
// ```
|
|
955
|
+
// pulsetrainN(N,freq,duty) : _
|
|
956
|
+
// ```
|
|
957
|
+
//
|
|
958
|
+
// Where:
|
|
959
|
+
//
|
|
960
|
+
// * `N`: order, as a constant numerical expression
|
|
961
|
+
// * `freq`: frequency in Hz
|
|
962
|
+
// * `duty`: duty cycle between 0 and 1
|
|
963
|
+
|
|
964
|
+
//--------------------------------------------------------
|
|
965
|
+
pulsetrainN(N,freq,duty) = diffdel(sawN(N,freqC),del) with {
|
|
966
|
+
// non-interpolated-delay version: diffdel(x,del) = x - x@int(del+0.5);
|
|
967
|
+
// linearly interpolated delay version (sounds good to me):
|
|
968
|
+
diffdel(x,del) = x-x@int(del)*(1-ma.frac(del))-x@(int(del)+1)*ma.frac(del);
|
|
969
|
+
// Third-order Lagrange interpolated-delay version (see filters.lib):
|
|
970
|
+
// diffdel(x,del) = x - fdelay3(DELPWR2,max(1,min(DELPWR2-2,ddel)));
|
|
971
|
+
DELPWR2 = 2048; // Needs to be a power of 2 when fdelay*() used above.
|
|
972
|
+
delmax = DELPWR2-1; // arbitrary upper limit on diff delay (duty=0.5)
|
|
973
|
+
SRmax = 96000.0; // assumed upper limit on sampling rate
|
|
974
|
+
fmin = SRmax / float(2.0*delmax); // 23.4 Hz (audio freqs only)
|
|
975
|
+
freqC = max(freq,fmin); // clip frequency at lower limit
|
|
976
|
+
period = (float(ma.SR) / freqC); // actual period
|
|
977
|
+
ddel = duty * period; // desired delay
|
|
978
|
+
del = max(0,min(delmax,ddel));
|
|
979
|
+
};
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
//------------------`(os.)pulsetrain`--------------------------------
|
|
983
|
+
// Alias-suppressed pulse train oscillator. Based on `pulsetrainN(2)`.
|
|
984
|
+
// `pulsetrain` is a standard Faust function.
|
|
985
|
+
//
|
|
986
|
+
// #### Usage
|
|
987
|
+
//
|
|
988
|
+
// ```
|
|
989
|
+
// pulsetrain(freq,duty) : _
|
|
990
|
+
// ```
|
|
991
|
+
//
|
|
992
|
+
// Where:
|
|
993
|
+
//
|
|
994
|
+
// * `freq`: frequency in Hz
|
|
995
|
+
// * `duty`: duty cycle between 0 and 1
|
|
996
|
+
//--------------------------------------------------------
|
|
997
|
+
pulsetrain = pulsetrainN(2);
|
|
998
|
+
|
|
999
|
+
|
|
1000
|
+
//------------------`(os.)squareN`--------------------------------
|
|
1001
|
+
// Alias-suppressed square wave oscillator.
|
|
1002
|
+
//
|
|
1003
|
+
// #### Usage
|
|
1004
|
+
//
|
|
1005
|
+
// ```
|
|
1006
|
+
// squareN(N,freq) : _
|
|
1007
|
+
// ```
|
|
1008
|
+
//
|
|
1009
|
+
// Where:
|
|
1010
|
+
//
|
|
1011
|
+
// * `N`: order, as a constant numerical expression
|
|
1012
|
+
// * `freq`: frequency in Hz
|
|
1013
|
+
//--------------------------------------------------------
|
|
1014
|
+
squareN(N,freq) = pulsetrainN(N,freq,0.5);
|
|
1015
|
+
|
|
1016
|
+
|
|
1017
|
+
//------------------`(os.)square`--------------------------------
|
|
1018
|
+
// Alias-suppressed square wave oscillator. Based on `squareN(2)`.
|
|
1019
|
+
// `square` is a standard Faust function.
|
|
1020
|
+
//
|
|
1021
|
+
// #### Usage
|
|
1022
|
+
//
|
|
1023
|
+
// ```
|
|
1024
|
+
// square(freq) : _
|
|
1025
|
+
// ```
|
|
1026
|
+
//
|
|
1027
|
+
// Where:
|
|
1028
|
+
//
|
|
1029
|
+
// * `freq`: frequency in Hz
|
|
1030
|
+
//--------------------------------------------------------
|
|
1031
|
+
square = squareN(2);
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
//------------------`(os.)imptrainN`--------------------------------
|
|
1035
|
+
// Alias-suppressed impulse train generator.
|
|
1036
|
+
//
|
|
1037
|
+
// #### Usage
|
|
1038
|
+
//
|
|
1039
|
+
// ```
|
|
1040
|
+
// imptrainN(N,freq) : _
|
|
1041
|
+
// ```
|
|
1042
|
+
//
|
|
1043
|
+
// Where:
|
|
1044
|
+
//
|
|
1045
|
+
// * `N`: order, as a constant numerical expression
|
|
1046
|
+
// * `freq`: frequency in Hz
|
|
1047
|
+
//--------------------------------------------------------
|
|
1048
|
+
imptrainN(N,freq) = impulse + 0.5*ma.diffn(sawN(N,freq));
|
|
1049
|
+
|
|
1050
|
+
|
|
1051
|
+
//------------------`(os.)imptrain`--------------------------------
|
|
1052
|
+
// Alias-suppressed impulse train generator. Based on `imptrainN(2)`.
|
|
1053
|
+
// `imptrain` is a standard Faust function.
|
|
1054
|
+
//
|
|
1055
|
+
// #### Usage
|
|
1056
|
+
//
|
|
1057
|
+
// ```
|
|
1058
|
+
// imptrain(freq) : _
|
|
1059
|
+
// ```
|
|
1060
|
+
//
|
|
1061
|
+
// Where:
|
|
1062
|
+
//
|
|
1063
|
+
// * `freq`: frequency in Hz
|
|
1064
|
+
//--------------------------------------------------------
|
|
1065
|
+
imptrain = imptrainN(2); // default based on saw2
|
|
1066
|
+
|
|
1067
|
+
|
|
1068
|
+
//------------------`(os.)triangleN`--------------------------------
|
|
1069
|
+
// Alias-suppressed triangle wave oscillator.
|
|
1070
|
+
//
|
|
1071
|
+
// #### Usage
|
|
1072
|
+
//
|
|
1073
|
+
// ```
|
|
1074
|
+
// triangleN(N,freq) : _
|
|
1075
|
+
// ```
|
|
1076
|
+
//
|
|
1077
|
+
// Where:
|
|
1078
|
+
//
|
|
1079
|
+
// * `N`: order, as a constant numerical expression
|
|
1080
|
+
// * `freq`: frequency in Hz
|
|
1081
|
+
//--------------------------------------------------------
|
|
1082
|
+
triangleN(N,freq) = squareN(N,freq) : fi.pole(p) : *(gain) with {
|
|
1083
|
+
gain = 4.0*freq/ma.SR; // for aproximate unit peak amplitude
|
|
1084
|
+
p = 0.999;
|
|
1085
|
+
};
|
|
1086
|
+
|
|
1087
|
+
|
|
1088
|
+
//------------------`(os.)triangle`--------------------------------
|
|
1089
|
+
// Alias-suppressed triangle wave oscillator. Based on `triangleN(2)`.
|
|
1090
|
+
// `triangle` is a standard Faust function.
|
|
1091
|
+
//
|
|
1092
|
+
// #### Usage
|
|
1093
|
+
//
|
|
1094
|
+
// ```
|
|
1095
|
+
// triangle(freq) : _
|
|
1096
|
+
// ```
|
|
1097
|
+
//
|
|
1098
|
+
// Where:
|
|
1099
|
+
//
|
|
1100
|
+
// * `freq`: frequency in Hz
|
|
1101
|
+
//--------------------------------------------------------
|
|
1102
|
+
triangle = triangleN(2); // default based on saw2
|
|
1103
|
+
|
|
1104
|
+
|
|
1105
|
+
//===============================Filter-Based Oscillators=================================
|
|
1106
|
+
// Filter-Based Oscillators.
|
|
1107
|
+
//
|
|
1108
|
+
// #### Usage
|
|
1109
|
+
//
|
|
1110
|
+
// ```
|
|
1111
|
+
// osc[b|rq|rs|rc|s](freq), where freq = frequency in Hz.
|
|
1112
|
+
// ```
|
|
1113
|
+
//
|
|
1114
|
+
// #### References
|
|
1115
|
+
//
|
|
1116
|
+
// * <http://lac.linuxaudio.org/2012/download/lac12-slides-jos.pdf>
|
|
1117
|
+
// * <https://ccrma.stanford.edu/~jos/pdf/lac12-paper-jos.pdf>
|
|
1118
|
+
//========================================================================================
|
|
1119
|
+
|
|
1120
|
+
//--------------------------`(os.)oscb`--------------------------------
|
|
1121
|
+
// Sinusoidal oscillator based on the biquad.
|
|
1122
|
+
//
|
|
1123
|
+
// #### Usage
|
|
1124
|
+
//
|
|
1125
|
+
// ```
|
|
1126
|
+
// oscb(freq) : _
|
|
1127
|
+
// ```
|
|
1128
|
+
//
|
|
1129
|
+
// Where:
|
|
1130
|
+
//
|
|
1131
|
+
// * `freq`: frequency in Hz
|
|
1132
|
+
//------------------------------------------------------------
|
|
1133
|
+
oscb(f) = impulse : fi.tf2(1,0,0,a1,1)
|
|
1134
|
+
with {
|
|
1135
|
+
a1 = -2*cos(2*ma.PI*f/ma.SR);
|
|
1136
|
+
};
|
|
1137
|
+
|
|
1138
|
+
|
|
1139
|
+
//--------------------------`(os.)oscrq`---------------------------
|
|
1140
|
+
// Sinusoidal (sine and cosine) oscillator based on 2D vector rotation,
|
|
1141
|
+
// = undamped "coupled-form" resonator
|
|
1142
|
+
// = lossless 2nd-order normalized ladder filter.
|
|
1143
|
+
//
|
|
1144
|
+
// #### Usage
|
|
1145
|
+
//
|
|
1146
|
+
// ```
|
|
1147
|
+
// oscrq(freq) : _,_
|
|
1148
|
+
// ```
|
|
1149
|
+
//
|
|
1150
|
+
// Where:
|
|
1151
|
+
//
|
|
1152
|
+
// * `freq`: frequency in Hz
|
|
1153
|
+
//
|
|
1154
|
+
// #### Reference
|
|
1155
|
+
//
|
|
1156
|
+
// * <https://ccrma.stanford.edu/~jos/pasp/Normalized_Scattering_Junctions.html>
|
|
1157
|
+
//------------------------------------------------------------
|
|
1158
|
+
oscrq(f) = impulse : fi.nlf2(f,1); // sine and cosine outputs
|
|
1159
|
+
|
|
1160
|
+
//--------------------------`(os.)oscrs`---------------------------
|
|
1161
|
+
// Sinusoidal (sine) oscillator based on 2D vector rotation,
|
|
1162
|
+
// = undamped "coupled-form" resonator
|
|
1163
|
+
// = lossless 2nd-order normalized ladder filter.
|
|
1164
|
+
//
|
|
1165
|
+
// #### Usage
|
|
1166
|
+
//
|
|
1167
|
+
// ```
|
|
1168
|
+
// oscrs(freq) : _
|
|
1169
|
+
// ```
|
|
1170
|
+
//
|
|
1171
|
+
// Where:
|
|
1172
|
+
//
|
|
1173
|
+
// * `freq`: frequency in Hz
|
|
1174
|
+
//
|
|
1175
|
+
// #### Reference
|
|
1176
|
+
//
|
|
1177
|
+
// * <https://ccrma.stanford.edu/~jos/pasp/Normalized_Scattering_Junctions.html>
|
|
1178
|
+
//------------------------------------------------------------
|
|
1179
|
+
oscrs(f) = impulse : fi.nlf2(f,1) : _,!; // sine
|
|
1180
|
+
|
|
1181
|
+
//--------------------------`(os.)oscrc`---------------------------
|
|
1182
|
+
// Sinusoidal (cosine) oscillator based on 2D vector rotation,
|
|
1183
|
+
// = undamped "coupled-form" resonator
|
|
1184
|
+
// = lossless 2nd-order normalized ladder filter.
|
|
1185
|
+
//
|
|
1186
|
+
// #### Usage
|
|
1187
|
+
//
|
|
1188
|
+
// ```
|
|
1189
|
+
// oscrc(freq) : _
|
|
1190
|
+
// ```
|
|
1191
|
+
//
|
|
1192
|
+
// Where:
|
|
1193
|
+
//
|
|
1194
|
+
// * `freq`: frequency in Hz
|
|
1195
|
+
//
|
|
1196
|
+
// #### Reference
|
|
1197
|
+
//
|
|
1198
|
+
// * <https://ccrma.stanford.edu/~jos/pasp/Normalized_Scattering_Junctions.html>
|
|
1199
|
+
//------------------------------------------------------------
|
|
1200
|
+
oscrc(f) = impulse : fi.nlf2(f,1) : !,_; // cosine
|
|
1201
|
+
|
|
1202
|
+
oscrp(f,p) = oscrq(f) : *(cos(p)), *(sin(p)) : + ; // p=0 for sine, p=PI/2 for cosine, etc.
|
|
1203
|
+
|
|
1204
|
+
oscr = oscrs; // default = sine (starts without a pop)
|
|
1205
|
+
|
|
1206
|
+
//--------------------------`(os.)oscs`--------------------------------
|
|
1207
|
+
// Sinusoidal oscillator based on the state variable filter
|
|
1208
|
+
// = undamped "modified-coupled-form" resonator
|
|
1209
|
+
// = "magic circle" algorithm used in graphics.
|
|
1210
|
+
//
|
|
1211
|
+
// #### Usage
|
|
1212
|
+
//
|
|
1213
|
+
// ```
|
|
1214
|
+
// oscs(freq) : _
|
|
1215
|
+
// ```
|
|
1216
|
+
//
|
|
1217
|
+
// Where:
|
|
1218
|
+
//
|
|
1219
|
+
// * `freq`: frequency in Hz
|
|
1220
|
+
//------------------------------------------------------------
|
|
1221
|
+
oscs(f) = (*(-1) : sint(wn) : sintp(wn,impulse)) ~ _
|
|
1222
|
+
with {
|
|
1223
|
+
wn = 2*ma.PI*f/ma.SR; // approximate
|
|
1224
|
+
// wn = 2*sin(PI*f/SR); // exact
|
|
1225
|
+
sint(x) = *(x) : + ~ _ ; // frequency-scaled integrator
|
|
1226
|
+
sintp(x,y) = *(x) : +(y): + ~ _; // same + state input
|
|
1227
|
+
};
|
|
1228
|
+
|
|
1229
|
+
//-----------------`(os.)quadosc`--------------------
|
|
1230
|
+
// Sinusoidal oscillator based on QuadOsc by Martin Vicanek.
|
|
1231
|
+
//
|
|
1232
|
+
// #### Usage
|
|
1233
|
+
//
|
|
1234
|
+
// ```
|
|
1235
|
+
// quadosc(freq) : _
|
|
1236
|
+
// ```
|
|
1237
|
+
//
|
|
1238
|
+
// where
|
|
1239
|
+
//
|
|
1240
|
+
// * `freq`: frequency in Hz
|
|
1241
|
+
//
|
|
1242
|
+
// #### Reference
|
|
1243
|
+
// * <https://vicanek.de/articles/QuadOsc.pdf>
|
|
1244
|
+
//------------------------------------------------------------
|
|
1245
|
+
// Authors:
|
|
1246
|
+
// Dario Sanfilippo <sanfilippo.dario@gmail.com>
|
|
1247
|
+
// and Oleg Nesterov (jos ed.)
|
|
1248
|
+
quadosc(f) = tick ~ (_,_)
|
|
1249
|
+
with {
|
|
1250
|
+
k1 = tan(f * ma.PI / ma.SR);
|
|
1251
|
+
k2 = 2 * k1 / (1 + k1 * k1);
|
|
1252
|
+
tick(u_0,v_0) = u_1,v_1
|
|
1253
|
+
with {
|
|
1254
|
+
tmp = u_0 - k1 * v_0;
|
|
1255
|
+
v_1 = v_0 + k2 * tmp;
|
|
1256
|
+
u_1 = tmp - k1 * v_1 : select2(1',1);
|
|
1257
|
+
};
|
|
1258
|
+
};
|
|
1259
|
+
|
|
1260
|
+
|
|
1261
|
+
//================ Waveguide-Resonator-Based Oscillators ================
|
|
1262
|
+
// Sinusoidal oscillator based on the waveguide resonator `wgr`.
|
|
1263
|
+
//=======================================================================
|
|
1264
|
+
|
|
1265
|
+
//-----------------`(os.)oscwc`--------------------
|
|
1266
|
+
// Sinusoidal oscillator based on the waveguide resonator `wgr`. Unit-amplitude
|
|
1267
|
+
// cosine oscillator.
|
|
1268
|
+
//
|
|
1269
|
+
// #### Usage
|
|
1270
|
+
//
|
|
1271
|
+
// ```
|
|
1272
|
+
// oscwc(freq) : _
|
|
1273
|
+
// ```
|
|
1274
|
+
//
|
|
1275
|
+
// Where:
|
|
1276
|
+
//
|
|
1277
|
+
// * `freq`: frequency in Hz
|
|
1278
|
+
//
|
|
1279
|
+
// #### Reference
|
|
1280
|
+
//
|
|
1281
|
+
// * <https://ccrma.stanford.edu/~jos/pasp/Digital_Waveguide_Oscillator.html>
|
|
1282
|
+
//------------------------------------------------------------
|
|
1283
|
+
oscwc(fr) = impulse : fi.wgr(fr,1) : _,!; // cosine (cheapest at 1 mpy/sample)
|
|
1284
|
+
|
|
1285
|
+
//-----------------`(os.)oscws`--------------------
|
|
1286
|
+
// Sinusoidal oscillator based on the waveguide resonator `wgr`. Unit-amplitude
|
|
1287
|
+
// sine oscillator.
|
|
1288
|
+
//
|
|
1289
|
+
// #### Usage
|
|
1290
|
+
//
|
|
1291
|
+
// ```
|
|
1292
|
+
// oscws(freq) : _
|
|
1293
|
+
// ```
|
|
1294
|
+
//
|
|
1295
|
+
// Where:
|
|
1296
|
+
//
|
|
1297
|
+
// * `freq`: frequency in Hz
|
|
1298
|
+
//
|
|
1299
|
+
// #### Reference
|
|
1300
|
+
//
|
|
1301
|
+
// * <https://ccrma.stanford.edu/~jos/pasp/Digital_Waveguide_Oscillator.html>
|
|
1302
|
+
//------------------------------------------------------------
|
|
1303
|
+
oscws(fr) = impulse : fi.wgr(fr,1) : !,_; // sine (needs a 2nd scaling mpy)
|
|
1304
|
+
|
|
1305
|
+
//-----------------`(os.)oscq`--------------------
|
|
1306
|
+
// Sinusoidal oscillator based on the waveguide resonator `wgr`.
|
|
1307
|
+
// Unit-amplitude cosine and sine (quadrature) oscillator.
|
|
1308
|
+
//
|
|
1309
|
+
// #### Usage
|
|
1310
|
+
//
|
|
1311
|
+
// ```
|
|
1312
|
+
// oscq(freq) : _,_
|
|
1313
|
+
// ```
|
|
1314
|
+
//
|
|
1315
|
+
// Where:
|
|
1316
|
+
//
|
|
1317
|
+
// * `freq`: frequency in Hz
|
|
1318
|
+
//
|
|
1319
|
+
// #### Reference
|
|
1320
|
+
//
|
|
1321
|
+
// * <https://ccrma.stanford.edu/~jos/pasp/Digital_Waveguide_Oscillator.html>
|
|
1322
|
+
//------------------------------------------------------------
|
|
1323
|
+
oscq(fr) = impulse : fi.wgr(fr,1); // phase quadrature outputs
|
|
1324
|
+
|
|
1325
|
+
//-----------------`(os.)oscw`--------------------
|
|
1326
|
+
// Sinusoidal oscillator based on the waveguide resonator `wgr`.
|
|
1327
|
+
// Unit-amplitude cosine oscillator (default).
|
|
1328
|
+
//
|
|
1329
|
+
// #### Usage
|
|
1330
|
+
//
|
|
1331
|
+
// ```
|
|
1332
|
+
// oscw(freq) : _
|
|
1333
|
+
// ```
|
|
1334
|
+
//
|
|
1335
|
+
// Where:
|
|
1336
|
+
//
|
|
1337
|
+
// * `freq`: frequency in Hz
|
|
1338
|
+
//
|
|
1339
|
+
// #### Reference
|
|
1340
|
+
//
|
|
1341
|
+
// * <https://ccrma.stanford.edu/~jos/pasp/Digital_Waveguide_Oscillator.html>
|
|
1342
|
+
//------------------------------------------------------------
|
|
1343
|
+
oscw = oscwc;
|
|
1344
|
+
|
|
1345
|
+
// end jos section
|
|
1346
|
+
//########################################################################################
|
|
1347
|
+
/************************************************************************
|
|
1348
|
+
FAUST library file, further contributions section
|
|
1349
|
+
|
|
1350
|
+
All contributions below should indicate both the contributor and terms
|
|
1351
|
+
of license. If no such indication is found, "git blame" will say who
|
|
1352
|
+
last edited each line, and that person can be emailed to inquire about
|
|
1353
|
+
license disposition, if their license choice is not already indicated
|
|
1354
|
+
elsewhere among the libraries. It is expected that all software will be
|
|
1355
|
+
released under LGPL, STK-4.3, MIT, BSD, or a similar FOSS license.
|
|
1356
|
+
************************************************************************/
|
|
1357
|
+
|
|
1358
|
+
//===================== Casio CZ Oscillators ==========================
|
|
1359
|
+
// Oscillators that mimic some of the Casio CZ oscillators.
|
|
1360
|
+
//
|
|
1361
|
+
// There are two sets:
|
|
1362
|
+
//
|
|
1363
|
+
// * a set with an index parameter
|
|
1364
|
+
//
|
|
1365
|
+
// * a set with a res parameter
|
|
1366
|
+
//
|
|
1367
|
+
// The "index oscillators" outputs a sine wave at index=0 and gets brighter with a higher index.
|
|
1368
|
+
// There are two versions of the "index oscillators":
|
|
1369
|
+
//
|
|
1370
|
+
// * with P appended to the name: is phase aligned with `fund:sin`
|
|
1371
|
+
//
|
|
1372
|
+
// * without P appended to the name: has the phase of the original CZ oscillators
|
|
1373
|
+
//
|
|
1374
|
+
// The "res oscillators" have a resonant frequency.
|
|
1375
|
+
// "res" is the frequency of resonance as a factor of the fundamental pitch.
|
|
1376
|
+
//=====================================================================
|
|
1377
|
+
|
|
1378
|
+
//----------`(os.)CZsaw`----------
|
|
1379
|
+
// Oscillator that mimics the Casio CZ saw oscillator.
|
|
1380
|
+
// `CZsaw` is a standard Faust function.
|
|
1381
|
+
//
|
|
1382
|
+
// #### Usage
|
|
1383
|
+
//
|
|
1384
|
+
// ```
|
|
1385
|
+
// CZsaw(fund,index) : _
|
|
1386
|
+
// ```
|
|
1387
|
+
//
|
|
1388
|
+
// Where:
|
|
1389
|
+
//
|
|
1390
|
+
// * `fund`: a saw-tooth waveform between 0 and 1 that the oscillator slaves to
|
|
1391
|
+
// * `index`: the brightness of the oscillator, 0 to 1. 0 = sine-wave, 1 = saw-wave
|
|
1392
|
+
//------------------------------------------------------------
|
|
1393
|
+
declare CZsaw author "Bart Brouns";
|
|
1394
|
+
declare CZsaw licence "STK-4.3";
|
|
1395
|
+
|
|
1396
|
+
// CZ oscillators by Mike Moser-Booth:
|
|
1397
|
+
// <https://forum.pdpatchrepo.info/topic/5992/casio-cz-oscillators>
|
|
1398
|
+
// Ported from pd to Faust by Bart Brouns
|
|
1399
|
+
|
|
1400
|
+
CZsaw(fund, index) = CZ.sawChooseP(fund, index, 0);
|
|
1401
|
+
|
|
1402
|
+
//----------`(os.)CZsawP`----------
|
|
1403
|
+
// Oscillator that mimics the Casio CZ saw oscillator,
|
|
1404
|
+
// with it's phase aligned to `fund:sin`.
|
|
1405
|
+
// `CZsawP` is a standard Faust function.
|
|
1406
|
+
//
|
|
1407
|
+
// #### Usage
|
|
1408
|
+
//
|
|
1409
|
+
// ```
|
|
1410
|
+
// CZsawP(fund,index) : _
|
|
1411
|
+
// ```
|
|
1412
|
+
//
|
|
1413
|
+
// Where:
|
|
1414
|
+
//
|
|
1415
|
+
// * `fund`: a saw-tooth waveform between 0 and 1 that the oscillator slaves to
|
|
1416
|
+
// * `index`: the brightness of the oscillator, 0 to 1. 0 = sine-wave, 1 = saw-wave
|
|
1417
|
+
//------------------------------------------------------------
|
|
1418
|
+
declare CZsawP author "Bart Brouns";
|
|
1419
|
+
declare CZsawP licence "STK-4.3";
|
|
1420
|
+
|
|
1421
|
+
// CZ oscillators by Mike Moser-Booth:
|
|
1422
|
+
// <https://forum.pdpatchrepo.info/topic/5992/casio-cz-oscillators>
|
|
1423
|
+
// Ported from pd to Faust by Bart Brouns
|
|
1424
|
+
|
|
1425
|
+
CZsawP(fund, index) = CZ.sawChooseP(fund, index, 1);
|
|
1426
|
+
|
|
1427
|
+
//----------`(os.)CZsquare`----------
|
|
1428
|
+
// Oscillator that mimics the Casio CZ square oscillator
|
|
1429
|
+
// `CZsquare` is a standard Faust function.
|
|
1430
|
+
//
|
|
1431
|
+
// #### Usage
|
|
1432
|
+
//
|
|
1433
|
+
// ```
|
|
1434
|
+
// CZsquare(fund,index) : _
|
|
1435
|
+
// ```
|
|
1436
|
+
//
|
|
1437
|
+
// Where:
|
|
1438
|
+
//
|
|
1439
|
+
// * `fund`: a saw-tooth waveform between 0 and 1 that the oscillator slaves to
|
|
1440
|
+
// * `index`: the brightness of the oscillator, 0 to 1. 0 = sine-wave, 1 = square-wave
|
|
1441
|
+
//------------------------------------------------------------
|
|
1442
|
+
declare CZsquare author "Bart Brouns";
|
|
1443
|
+
declare CZsquare licence "STK-4.3";
|
|
1444
|
+
|
|
1445
|
+
// CZ oscillators by Mike Moser-Booth:
|
|
1446
|
+
// <https://forum.pdpatchrepo.info/topic/5992/casio-cz-oscillators>
|
|
1447
|
+
// Ported from pd to Faust by Bart Brouns
|
|
1448
|
+
|
|
1449
|
+
CZsquare(fund, index) = CZ.squareChooseP(fund, index, 0);
|
|
1450
|
+
|
|
1451
|
+
//----------`(os.)CZsquareP`----------
|
|
1452
|
+
// Oscillator that mimics the Casio CZ square oscillator,
|
|
1453
|
+
// with it's phase aligned to `fund:sin`.
|
|
1454
|
+
// `CZsquareP` is a standard Faust function.
|
|
1455
|
+
//
|
|
1456
|
+
// #### Usage
|
|
1457
|
+
//
|
|
1458
|
+
// ```
|
|
1459
|
+
// CZsquareP(fund,index) : _
|
|
1460
|
+
// ```
|
|
1461
|
+
//
|
|
1462
|
+
// Where:
|
|
1463
|
+
//
|
|
1464
|
+
// * `fund`: a saw-tooth waveform between 0 and 1 that the oscillator slaves to
|
|
1465
|
+
// * `index`: the brightness of the oscillator, 0 to 1. 0 = sine-wave, 1 = square-wave
|
|
1466
|
+
//------------------------------------------------------------
|
|
1467
|
+
declare CZsquareP author "Bart Brouns";
|
|
1468
|
+
declare CZsquareP licence "STK-4.3";
|
|
1469
|
+
|
|
1470
|
+
// CZ oscillators by Mike Moser-Booth:
|
|
1471
|
+
// <https://forum.pdpatchrepo.info/topic/5992/casio-cz-oscillators>
|
|
1472
|
+
// Ported from pd to Faust by Bart Brouns
|
|
1473
|
+
|
|
1474
|
+
CZsquareP(fund, index) = CZ.squareChooseP(fund, index, 1);
|
|
1475
|
+
|
|
1476
|
+
//----------`(os.)CZpulse`----------
|
|
1477
|
+
// Oscillator that mimics the Casio CZ pulse oscillator.
|
|
1478
|
+
// `CZpulse` is a standard Faust function.
|
|
1479
|
+
//
|
|
1480
|
+
// #### Usage
|
|
1481
|
+
//
|
|
1482
|
+
// ```
|
|
1483
|
+
// CZpulse(fund,index) : _
|
|
1484
|
+
// ```
|
|
1485
|
+
//
|
|
1486
|
+
// Where:
|
|
1487
|
+
//
|
|
1488
|
+
// * `fund`: a saw-tooth waveform between 0 and 1 that the oscillator slaves to
|
|
1489
|
+
// * `index`: the brightness of the oscillator, 0 gives a sine-wave, 1 is closer to a pulse
|
|
1490
|
+
//------------------------------------------------------------
|
|
1491
|
+
declare CZpulse author "Bart Brouns";
|
|
1492
|
+
declare CZpulse licence "STK-4.3";
|
|
1493
|
+
|
|
1494
|
+
// CZ oscillators by Mike Moser-Booth:
|
|
1495
|
+
// <https://forum.pdpatchrepo.info/topic/5992/casio-cz-oscillators>
|
|
1496
|
+
// Ported from pd to Faust by Bart Brouns
|
|
1497
|
+
|
|
1498
|
+
CZpulse(fund, index) = CZ.pulseChooseP(fund, index, 0);
|
|
1499
|
+
|
|
1500
|
+
//----------`(os.)CZpulseP`----------
|
|
1501
|
+
// Oscillator that mimics the Casio CZ pulse oscillator,
|
|
1502
|
+
// with it's phase aligned to `fund:sin`.
|
|
1503
|
+
// `CZpulseP` is a standard Faust function.
|
|
1504
|
+
//
|
|
1505
|
+
// #### Usage
|
|
1506
|
+
//
|
|
1507
|
+
// ```
|
|
1508
|
+
// CZpulseP(fund,index) : _
|
|
1509
|
+
// ```
|
|
1510
|
+
//
|
|
1511
|
+
// Where:
|
|
1512
|
+
//
|
|
1513
|
+
// * `fund`: a saw-tooth waveform between 0 and 1 that the oscillator slaves to
|
|
1514
|
+
// * `index`: the brightness of the oscillator, 0 gives a sine-wave, 1 is closer to a pulse
|
|
1515
|
+
//------------------------------------------------------------
|
|
1516
|
+
declare CZpulseP author "Bart Brouns";
|
|
1517
|
+
declare CZpulseP licence "STK-4.3";
|
|
1518
|
+
|
|
1519
|
+
// CZ oscillators by Mike Moser-Booth:
|
|
1520
|
+
// <https://forum.pdpatchrepo.info/topic/5992/casio-cz-oscillators>
|
|
1521
|
+
// Ported from pd to Faust by Bart Brouns
|
|
1522
|
+
|
|
1523
|
+
CZpulseP(fund, index) = CZ.pulseChooseP(fund, index, 1);
|
|
1524
|
+
|
|
1525
|
+
//----------`(os.)CZsinePulse`----------
|
|
1526
|
+
// Oscillator that mimics the Casio CZ sine/pulse oscillator.
|
|
1527
|
+
// `CZsinePulse` is a standard Faust function.
|
|
1528
|
+
//
|
|
1529
|
+
// #### Usage
|
|
1530
|
+
//
|
|
1531
|
+
// ```
|
|
1532
|
+
// CZsinePulse(fund,index) : _
|
|
1533
|
+
// ```
|
|
1534
|
+
//
|
|
1535
|
+
// Where:
|
|
1536
|
+
//
|
|
1537
|
+
// * `fund`: a saw-tooth waveform between 0 and 1 that the oscillator slaves to
|
|
1538
|
+
// * `index`: the brightness of the oscillator, 0 gives a sine-wave, 1 is a sine minus a pulse
|
|
1539
|
+
//------------------------------------------------------------
|
|
1540
|
+
declare CZsinePulse author "Bart Brouns";
|
|
1541
|
+
declare CZsinePulse licence "STK-4.3";
|
|
1542
|
+
|
|
1543
|
+
// CZ oscillators by Mike Moser-Booth:
|
|
1544
|
+
// <https://forum.pdpatchrepo.info/topic/5992/casio-cz-oscillators>
|
|
1545
|
+
// Ported from pd to Faust by Bart Brouns
|
|
1546
|
+
|
|
1547
|
+
CZsinePulse(fund, index) = CZ.sinePulseChooseP(fund, index, 0);
|
|
1548
|
+
|
|
1549
|
+
//----------`(os.)CZsinePulseP`----------
|
|
1550
|
+
// Oscillator that mimics the Casio CZ sine/pulse oscillator,
|
|
1551
|
+
// with it's phase aligned to `fund:sin`.
|
|
1552
|
+
// `CZsinePulseP` is a standard Faust function.
|
|
1553
|
+
//
|
|
1554
|
+
// #### Usage
|
|
1555
|
+
//
|
|
1556
|
+
// ```
|
|
1557
|
+
// CZsinePulseP(fund,index) : _
|
|
1558
|
+
// ```
|
|
1559
|
+
//
|
|
1560
|
+
// Where:
|
|
1561
|
+
//
|
|
1562
|
+
// * `fund`: a saw-tooth waveform between 0 and 1 that the oscillator slaves to
|
|
1563
|
+
// * `index`: the brightness of the oscillator, 0 gives a sine-wave, 1 is a sine minus a pulse
|
|
1564
|
+
//------------------------------------------------------------
|
|
1565
|
+
declare CZsinePulseP author "Bart Brouns";
|
|
1566
|
+
declare CZsinePulseP licence "STK-4.3";
|
|
1567
|
+
|
|
1568
|
+
// CZ oscillators by Mike Moser-Booth:
|
|
1569
|
+
// <https://forum.pdpatchrepo.info/topic/5992/casio-cz-oscillators>
|
|
1570
|
+
// Ported from pd to Faust by Bart Brouns
|
|
1571
|
+
|
|
1572
|
+
CZsinePulseP(fund, index) = CZ.sinePulseChooseP(fund, index, 1);
|
|
1573
|
+
|
|
1574
|
+
//----------`(os.)CZhalfSine`----------
|
|
1575
|
+
// Oscillator that mimics the Casio CZ half sine oscillator.
|
|
1576
|
+
// `CZhalfSine` is a standard Faust function.
|
|
1577
|
+
//
|
|
1578
|
+
// #### Usage
|
|
1579
|
+
//
|
|
1580
|
+
// ```
|
|
1581
|
+
// CZhalfSine(fund,index) : _
|
|
1582
|
+
// ```
|
|
1583
|
+
//
|
|
1584
|
+
// Where:
|
|
1585
|
+
//
|
|
1586
|
+
// * `fund`: a saw-tooth waveform between 0 and 1 that the oscillator slaves to
|
|
1587
|
+
// * `index`: the brightness of the oscillator, 0 gives a sine-wave, 1 is somewhere between a saw and a square
|
|
1588
|
+
//------------------------------------------------------------
|
|
1589
|
+
declare CZhalfSine author "Bart Brouns";
|
|
1590
|
+
declare CZhalfSine licence "STK-4.3";
|
|
1591
|
+
|
|
1592
|
+
// CZ oscillators by Mike Moser-Booth:
|
|
1593
|
+
// <https://forum.pdpatchrepo.info/topic/5992/casio-cz-oscillators>
|
|
1594
|
+
// Ported from pd to Faust by Bart Brouns
|
|
1595
|
+
|
|
1596
|
+
CZhalfSine(fund, index) = CZ.halfSineChooseP(fund, index, 0);
|
|
1597
|
+
|
|
1598
|
+
//----------`(os.)CZhalfSineP`----------
|
|
1599
|
+
// Oscillator that mimics the Casio CZ half sine oscillator,
|
|
1600
|
+
// with it's phase aligned to `fund:sin`.
|
|
1601
|
+
// `CZhalfSineP` is a standard Faust function.
|
|
1602
|
+
//
|
|
1603
|
+
// #### Usage
|
|
1604
|
+
//
|
|
1605
|
+
// ```
|
|
1606
|
+
// CZhalfSineP(fund,index) : _
|
|
1607
|
+
// ```
|
|
1608
|
+
//
|
|
1609
|
+
// Where:
|
|
1610
|
+
//
|
|
1611
|
+
// * `fund`: a saw-tooth waveform between 0 and 1 that the oscillator slaves to
|
|
1612
|
+
// * `index`: the brightness of the oscillator, 0 gives a sine-wave, 1 is somewhere between a saw and a square
|
|
1613
|
+
//------------------------------------------------------------
|
|
1614
|
+
declare CZhalfSineP author "Bart Brouns";
|
|
1615
|
+
declare CZhalfSineP licence "STK-4.3";
|
|
1616
|
+
|
|
1617
|
+
// CZ oscillators by Mike Moser-Booth:
|
|
1618
|
+
// <https://forum.pdpatchrepo.info/topic/5992/casio-cz-oscillators>
|
|
1619
|
+
// Ported from pd to Faust by Bart Brouns
|
|
1620
|
+
|
|
1621
|
+
CZhalfSineP(fund, index) = CZ.halfSineChooseP(fund, index, 1);
|
|
1622
|
+
|
|
1623
|
+
//----------`(os.)CZresSaw`----------
|
|
1624
|
+
// Oscillator that mimics the Casio CZ resonant sawtooth oscillator.
|
|
1625
|
+
// `CZresSaw` is a standard Faust function.
|
|
1626
|
+
//
|
|
1627
|
+
// #### Usage
|
|
1628
|
+
//
|
|
1629
|
+
// ```
|
|
1630
|
+
// CZresSaw(fund,res) : _
|
|
1631
|
+
// ```
|
|
1632
|
+
//
|
|
1633
|
+
// Where:
|
|
1634
|
+
//
|
|
1635
|
+
// * `fund`: a saw-tooth waveform between 0 and 1 that the oscillator slaves to
|
|
1636
|
+
// * `res`: the frequency of resonance as a factor of the fundamental pitch.
|
|
1637
|
+
//------------------------------------------------------------
|
|
1638
|
+
declare CZresSaw author "Bart Brouns";
|
|
1639
|
+
declare CZresSaw licence "STK-4.3";
|
|
1640
|
+
|
|
1641
|
+
// CZ oscillators by Mike Moser-Booth:
|
|
1642
|
+
// <https://forum.pdpatchrepo.info/topic/5992/casio-cz-oscillators>
|
|
1643
|
+
// Ported from pd to Faust by Bart Brouns
|
|
1644
|
+
|
|
1645
|
+
CZresSaw(fund,res) = CZ.resSaw(fund,res);
|
|
1646
|
+
|
|
1647
|
+
//----------`(os.)CZresTriangle`----------
|
|
1648
|
+
// Oscillator that mimics the Casio CZ resonant triangle oscillator.
|
|
1649
|
+
// `CZresTriangle` is a standard Faust function.
|
|
1650
|
+
//
|
|
1651
|
+
// #### Usage
|
|
1652
|
+
//
|
|
1653
|
+
// ```
|
|
1654
|
+
// CZresTriangle(fund,res) : _
|
|
1655
|
+
// ```
|
|
1656
|
+
//
|
|
1657
|
+
// Where:
|
|
1658
|
+
//
|
|
1659
|
+
// * `fund`: a saw-tooth waveform between 0 and 1 that the oscillator slaves to
|
|
1660
|
+
// * `res`: the frequency of resonance as a factor of the fundamental pitch.
|
|
1661
|
+
//------------------------------------------------------------
|
|
1662
|
+
declare CZresTriangle author "Bart Brouns";
|
|
1663
|
+
declare CZresTriangle licence "STK-4.3";
|
|
1664
|
+
|
|
1665
|
+
// CZ oscillators by Mike Moser-Booth:
|
|
1666
|
+
// <https://forum.pdpatchrepo.info/topic/5992/casio-cz-oscillators>
|
|
1667
|
+
// Ported from pd to Faust by Bart Brouns
|
|
1668
|
+
|
|
1669
|
+
CZresTriangle(fund,res) = CZ.resTriangle(fund,res);
|
|
1670
|
+
|
|
1671
|
+
//----------`(os.)CZresTrap`----------
|
|
1672
|
+
// Oscillator that mimics the Casio CZ resonant trapeze oscillator
|
|
1673
|
+
// `CZresTrap` is a standard Faust function.
|
|
1674
|
+
//
|
|
1675
|
+
// #### Usage
|
|
1676
|
+
//
|
|
1677
|
+
// ```
|
|
1678
|
+
// CZresTrap(fund,res) : _
|
|
1679
|
+
// ```
|
|
1680
|
+
//
|
|
1681
|
+
// Where:
|
|
1682
|
+
//
|
|
1683
|
+
// * `fund`: a saw-tooth waveform between 0 and 1 that the oscillator slaves to
|
|
1684
|
+
// * `res`: the frequency of resonance as a factor of the fundamental pitch.
|
|
1685
|
+
//------------------------------------------------------------
|
|
1686
|
+
declare CZresTrap author "Bart Brouns";
|
|
1687
|
+
declare CZresTrap licence "STK-4.3";
|
|
1688
|
+
|
|
1689
|
+
// CZ oscillators by Mike Moser-Booth:
|
|
1690
|
+
// <https://forum.pdpatchrepo.info/topic/5992/casio-cz-oscillators>
|
|
1691
|
+
// Ported from pd to Faust by Bart Brouns
|
|
1692
|
+
|
|
1693
|
+
CZresTrap(fund, res) = CZ.resTrap(fund, res);
|
|
1694
|
+
|
|
1695
|
+
CZ = environment {
|
|
1696
|
+
|
|
1697
|
+
saw(fund, index) = sawChooseP(fund, index, 0);
|
|
1698
|
+
sawP(fund, index) = sawChooseP(fund, index, 1);
|
|
1699
|
+
sawChooseP(fund, index, p) =
|
|
1700
|
+
(((FUND(fund,align,p)*((.5-INDEX)/INDEX)),(-1*FUND(fund,align,p)+1)*((.5-INDEX)/(1-INDEX))):min+FUND(fund,align,p))*2*ma.PI:cos
|
|
1701
|
+
with {
|
|
1702
|
+
INDEX = (.5-(index*.5)):max(0.01):min(0.5);
|
|
1703
|
+
align = si.interpolate(index, 0.75, 0.5);
|
|
1704
|
+
};
|
|
1705
|
+
|
|
1706
|
+
square(fund, index) = squareChooseP(fund, index, 0);
|
|
1707
|
+
squareP(fund, index) = squareChooseP(fund, index, 1);
|
|
1708
|
+
squareChooseP(fund, index, p) = (FUND(fund,align,p)>=0.5), (ma.decimal((FUND(fund,align,p)*2)+1)<:_-min(_,(-1*_+1)*((INDEX)/(1-INDEX)))) :+ *ma.PI:cos
|
|
1709
|
+
with {
|
|
1710
|
+
INDEX = (index:pow(0.25)):max(0):min(1);
|
|
1711
|
+
align = si.interpolate(INDEX, -0.25, 0);
|
|
1712
|
+
};
|
|
1713
|
+
|
|
1714
|
+
pulse(fund, index) = pulseChooseP(fund, index, 0);
|
|
1715
|
+
pulseP(fund, index) = pulseChooseP(fund, index, 1);
|
|
1716
|
+
pulseChooseP(fund, index, p) = ((FUND(fund,align,p)-min(FUND(fund,align,p),((-1*FUND(fund,align,p)+1)*(INDEX/(1-INDEX)))))*2*ma.PI):cos
|
|
1717
|
+
with {
|
|
1718
|
+
INDEX = index:min(0.99):max(0);
|
|
1719
|
+
align = si.interpolate(index, -0.25, 0.0);
|
|
1720
|
+
};
|
|
1721
|
+
|
|
1722
|
+
sinePulse(fund, index) = sinePulseChooseP(fund, index, 0);
|
|
1723
|
+
sinePulseP(fund, index) = sinePulseChooseP(fund, index, 1);
|
|
1724
|
+
sinePulseChooseP(fund, index, p) = (min(FUND(fund,align,p)*((0.5-INDEX)/INDEX),(-1*FUND(fund,align,p)+1)*((.5-INDEX)/(1-INDEX)))+FUND(fund,align,p))*4*ma.PI:cos
|
|
1725
|
+
with {
|
|
1726
|
+
INDEX = ((index*-0.49)+0.5);
|
|
1727
|
+
align = si.interpolate(index, -0.125, -0.25);
|
|
1728
|
+
};
|
|
1729
|
+
|
|
1730
|
+
halfSine(fund, index) = halfSineChooseP(fund, index, 0);
|
|
1731
|
+
halfSineP(fund, index) = halfSineChooseP(fund, index, 1);
|
|
1732
|
+
halfSineChooseP(fund, index, p) = (select2(FUND(fund,align,p)<.5, .5*(FUND(fund,align,p)-.5)/INDEX+.5, FUND(fund,align,p)):min(1))*2*ma.PI:cos
|
|
1733
|
+
with {
|
|
1734
|
+
INDEX = (.5-(index*0.5)):min(.5):max(.01);
|
|
1735
|
+
align = si.interpolate(index:min(0.975), -0.25, -0.5);
|
|
1736
|
+
};
|
|
1737
|
+
|
|
1738
|
+
FUND =
|
|
1739
|
+
case {
|
|
1740
|
+
(fund,align,0) => fund;
|
|
1741
|
+
(fund,align,1) => (fund+align) : ma.frac; // align phase with fund
|
|
1742
|
+
};
|
|
1743
|
+
resSaw(fund,res) = (((-1*(1-fund))*((cos((ma.decimal((max(1,res)*fund)+1))*2*ma.PI)*-.5)+.5))*2)+1;
|
|
1744
|
+
resTriangle(fund,res) = select2(fund<.5, 2-(fund*2), fund*2)*INDEX*2-1
|
|
1745
|
+
with {
|
|
1746
|
+
INDEX = ((fund*(res:max(1)))+1:ma.decimal)*2*ma.PI:cos*.5+.5;
|
|
1747
|
+
};
|
|
1748
|
+
resTrap(fund, res) = (((1-fund)*2):min(1)*sin(ma.decimal(fund*(res:max(1)))*2*ma.PI));
|
|
1749
|
+
};
|
|
1750
|
+
|
|
1751
|
+
//===============================PolyBLEP-Based Oscillators=================================
|
|
1752
|
+
|
|
1753
|
+
//----------`(os.)polyblep`----------
|
|
1754
|
+
// PolyBLEP residual function, used for smoothing steps in the audio signal.
|
|
1755
|
+
//
|
|
1756
|
+
// #### Usage
|
|
1757
|
+
//
|
|
1758
|
+
// ```
|
|
1759
|
+
// polyblep(Q,phase) : _
|
|
1760
|
+
// ```
|
|
1761
|
+
//
|
|
1762
|
+
// Where:
|
|
1763
|
+
//
|
|
1764
|
+
// * `Q`: smoothing factor between 0 and 0.5. Determines how far from the ends of the phase interval the quadratic function is used.
|
|
1765
|
+
// * `phase`: normalised phase (between 0 and 1)
|
|
1766
|
+
//------------------------------------------------------------
|
|
1767
|
+
declare polyblep author "Jacek Wieczorek";
|
|
1768
|
+
|
|
1769
|
+
polyblep(Q, phase) = (0, L(phase / Q), R((phase - 1) / Q)) : select3(sel)
|
|
1770
|
+
with {
|
|
1771
|
+
sel = (phase < Q) + 2*(phase > 1 - Q);
|
|
1772
|
+
L(x) = 2*x - x*x - 1; // Used near the left end of the interval
|
|
1773
|
+
R(x) = 2*x + x*x + 1; // Used near the right end of the interval
|
|
1774
|
+
};
|
|
1775
|
+
|
|
1776
|
+
//----------`(os.)polyblep_saw`----------
|
|
1777
|
+
// Sawtooth oscillator with suppressed aliasing (using `polyblep`).
|
|
1778
|
+
//
|
|
1779
|
+
// #### Usage
|
|
1780
|
+
//
|
|
1781
|
+
// ```
|
|
1782
|
+
// polyblep_saw(freq) : _
|
|
1783
|
+
// ```
|
|
1784
|
+
//
|
|
1785
|
+
// Where:
|
|
1786
|
+
//
|
|
1787
|
+
// * `freq`: frequency in Hz
|
|
1788
|
+
//------------------------------------------------------------
|
|
1789
|
+
declare polyblep_saw author "Jacek Wieczorek";
|
|
1790
|
+
|
|
1791
|
+
polyblep_saw(freq) = naive - polyblep(Q , phase)
|
|
1792
|
+
with {
|
|
1793
|
+
phase = phasor(1, freq);
|
|
1794
|
+
naive = 2 * phase - 1;
|
|
1795
|
+
Q = freq / ma.SR;
|
|
1796
|
+
};
|
|
1797
|
+
|
|
1798
|
+
//----------`(os.)polyblep_square`----------
|
|
1799
|
+
// Square wave oscillator with suppressed aliasing (using `polyblep`).
|
|
1800
|
+
//
|
|
1801
|
+
// #### Usage
|
|
1802
|
+
//
|
|
1803
|
+
// ```
|
|
1804
|
+
// polyblep_square(freq) : _
|
|
1805
|
+
// ```
|
|
1806
|
+
//
|
|
1807
|
+
// Where:
|
|
1808
|
+
//
|
|
1809
|
+
// * `freq`: frequency in Hz
|
|
1810
|
+
//------------------------------------------------------------
|
|
1811
|
+
declare polyblep_square author "Jacek Wieczorek";
|
|
1812
|
+
|
|
1813
|
+
polyblep_square(freq) = naive - polyblep(Q, phase) + polyblep(Q, ma.modulo(phase + 0.5, 1))
|
|
1814
|
+
with {
|
|
1815
|
+
phase = phasor(1, freq);
|
|
1816
|
+
naive = 2 * (phase * 2 : int) - 1;
|
|
1817
|
+
Q = freq / ma.SR;
|
|
1818
|
+
};
|
|
1819
|
+
|
|
1820
|
+
//----------`(os.)polyblep_triangle`----------
|
|
1821
|
+
// Triangle wave oscillator with suppressed aliasing (using `polyblep`).
|
|
1822
|
+
//
|
|
1823
|
+
// #### Usage
|
|
1824
|
+
//
|
|
1825
|
+
// ```
|
|
1826
|
+
// polyblep_triangle(freq) : _
|
|
1827
|
+
// ```
|
|
1828
|
+
//
|
|
1829
|
+
// Where:
|
|
1830
|
+
//
|
|
1831
|
+
// * `freq`: frequency in Hz
|
|
1832
|
+
//------------------------------------------------------------
|
|
1833
|
+
declare polyblep_triangle author "Jacek Wieczorek";
|
|
1834
|
+
|
|
1835
|
+
polyblep_triangle(freq) = polyblep_square(freq) : fi.pole(0.999) : *(4 * freq / ma.SR);
|
|
1836
|
+
|
|
1837
|
+
// end further contributions section
|
|
1838
|
+
//########################################################################################
|