├── .clang-format ├── .github └── workflows │ └── build.yml ├── .gitignore ├── .gitmodules ├── 3rdparty └── Pd │ └── pd-0.54.1 │ ├── LICENSE.txt │ ├── m_pd.h │ ├── pd.dll │ └── x64 │ └── pd.dll ├── AUTHORS.txt ├── COPYING.txt ├── DEVELOPERS.md ├── Doxyfile ├── LICENSE.txt ├── Makefile ├── MaxPackage ├── ReadMe.md ├── docs │ ├── sdt.bouncing~.maxref.xml │ ├── sdt.breaking~.maxref.xml │ ├── sdt.bubble~.maxref.xml │ ├── sdt.crumpling~.maxref.xml │ ├── sdt.dcmotor~.maxref.xml │ ├── sdt.demix~.maxref.xml │ ├── sdt.envelope~.maxref.xml │ ├── sdt.explosion~.maxref.xml │ ├── sdt.fluidflow~.maxref.xml │ ├── sdt.friction~.maxref.xml │ ├── sdt.impact~.maxref.xml │ ├── sdt.inertial.maxref.xml │ ├── sdt.modal.maxref.xml │ ├── sdt.motor~.maxref.xml │ ├── sdt.myo~.maxref.xml │ ├── sdt.pitchshift~.maxref.xml │ ├── sdt.pitch~.maxref.xml │ ├── sdt.reverb~.maxref.xml │ ├── sdt.rolling~.maxref.xml │ ├── sdt.scraping~.maxref.xml │ ├── sdt.spectralfeats~.maxref.xml │ ├── sdt.windcavity~.maxref.xml │ ├── sdt.windflow~.maxref.xml │ ├── sdt.windkarman~.maxref.xml │ └── sdt.zerox~.maxref.xml ├── extras │ └── SDT-Overview.maxpat ├── help │ ├── sdt.bouncing~.maxhelp │ ├── sdt.breaking~.maxhelp │ ├── sdt.bubble~.maxhelp │ ├── sdt.crumpling~.maxhelp │ ├── sdt.dcmotor~.maxhelp │ ├── sdt.demix~.maxhelp │ ├── sdt.envelope~.maxhelp │ ├── sdt.explosion~.maxhelp │ ├── sdt.fluidflow~.maxhelp │ ├── sdt.friction~.maxhelp │ ├── sdt.impact~.maxhelp │ ├── sdt.inertial.maxhelp │ ├── sdt.modal.maxhelp │ ├── sdt.motor~.maxhelp │ ├── sdt.myo~.maxhelp │ ├── sdt.pitchshift~.maxhelp │ ├── sdt.pitch~.maxhelp │ ├── sdt.reverb~.maxhelp │ ├── sdt.rolling~.maxhelp │ ├── sdt.scraping~.maxhelp │ ├── sdt.spectralfeats~.maxhelp │ ├── sdt.windcavity~.maxhelp │ ├── sdt.windflow~.maxhelp │ ├── sdt.windkarman~.maxhelp │ └── sdt.zerox~.maxhelp ├── icon.png ├── interfaces │ ├── sdt-obj-dlookup.json │ └── sdt-obj-qlookup.json ├── media │ ├── SDT_obj1_int_obj2.png │ ├── airImpact.png │ ├── beatbox.wav │ ├── enginemodel.png │ ├── explosiondiagram.png │ ├── fourstrokegraphs.png │ ├── friedlander.png │ ├── liquids.png │ ├── opentubemodes.png │ ├── scrapingRubbingRolling2.png │ ├── sdt.friction.bristle.png │ ├── sdttaxonomy.png │ └── vortexstreet.png ├── package-info.json ├── patchers │ ├── 1.instantiateModels.maxpat │ ├── 2.designingImpacts.maxpat │ ├── 3.controllingfriction.maxpat │ ├── 4.compoundinteractions.maxpat │ ├── Blenders.maxpat │ ├── Dripping.maxpat │ ├── Filling.maxpat │ ├── Friction6modes.maxpat │ ├── FridgeHum.maxpat │ ├── Gushing.maxpat │ ├── Impact6modes.maxpat │ ├── Photocopier.maxpat │ ├── Rolling.maxpat │ ├── Shooting.maxpat │ ├── Transportation.maxpat │ ├── Whipping.maxpat │ ├── basicFriction.maxpat │ ├── basicImpact.maxpat │ ├── blowing.maxpat │ └── rubbingScraping.maxpat └── source │ └── SDT_on_GitHub_readme.txt ├── Pd ├── VERSION ├── bouncing~-help.pd ├── breaking~-help.pd ├── bubble~-help.pd ├── crumpling~-help.pd ├── dcmotor~-help.pd ├── demix~-help.pd ├── envelope~-help.pd ├── explosion~-help.pd ├── fluidflow~-help.pd ├── friction~-help.pd ├── impact~-help.pd ├── motor~-help.pd ├── myo~-help.pd ├── pitchshift~-help.pd ├── pitch~-help.pd ├── reverb~-help.pd ├── rolling~-help.pd ├── scraping~-help.pd ├── sdtOSC-help.pd ├── spectralfeats~-help.pd ├── windcavity~-help.pd ├── windflow~-help.pd ├── windkarman~-help.pd └── zerox~-help.pd ├── README.md ├── src ├── Max │ ├── SDTCommonMax.c │ ├── SDTCommonMax.h │ ├── SDT_fileusage.c │ ├── SDT_fileusage.h │ ├── sdt.OSC.c │ ├── sdt.bouncing~.c │ ├── sdt.breaking~.c │ ├── sdt.bubble~.c │ ├── sdt.crumpling~.c │ ├── sdt.dcmotor~.c │ ├── sdt.demix~.c │ ├── sdt.envelope~.c │ ├── sdt.explosion~.c │ ├── sdt.fluidflow~.c │ ├── sdt.friction~.c │ ├── sdt.impact~.c │ ├── sdt.inertial.c │ ├── sdt.modal.c │ ├── sdt.motor~.c │ ├── sdt.myo~.c │ ├── sdt.pitchshift~.c │ ├── sdt.pitch~.c │ ├── sdt.reverb~.c │ ├── sdt.rolling~.c │ ├── sdt.scraping~.c │ ├── sdt.spectralfeats~.c │ ├── sdt.windcavity~.c │ ├── sdt.windflow~.c │ ├── sdt.windkarman~.c │ └── sdt.zerox~.c ├── Pd │ ├── SDT.c │ ├── SDTCommonPd.c │ ├── SDTCommonPd.h │ ├── bouncing~.c │ ├── breaking~.c │ ├── bubble~.c │ ├── crumpling~.c │ ├── dcmotor~.c │ ├── demix~.c │ ├── envelope~.c │ ├── explosion~.c │ ├── fluidflow~.c │ ├── friction~.c │ ├── impact~.c │ ├── inertial.c │ ├── modal.c │ ├── motor~.c │ ├── myo~.c │ ├── pitchshift~.c │ ├── pitch~.c │ ├── reverb~.c │ ├── rolling~.c │ ├── scraping~.c │ ├── sdtOSC.c │ ├── spectralfeats~.c │ ├── windcavity~.c │ ├── windflow~.c │ ├── windkarman~.c │ └── zerox~.c └── SDT │ ├── OSC │ ├── SDTOSC.c │ ├── SDTOSC.h │ ├── SDTOSCAnalysis.c │ ├── SDTOSCAnalysis.h │ ├── SDTOSCCommon.c │ ├── SDTOSCCommon.h │ ├── SDTOSCControl.c │ ├── SDTOSCControl.h │ ├── SDTOSCDCMotor.c │ ├── SDTOSCDCMotor.h │ ├── SDTOSCDemix.c │ ├── SDTOSCDemix.h │ ├── SDTOSCEffects.c │ ├── SDTOSCEffects.h │ ├── SDTOSCFilters.c │ ├── SDTOSCFilters.h │ ├── SDTOSCGases.c │ ├── SDTOSCGases.h │ ├── SDTOSCInteractors.c │ ├── SDTOSCInteractors.h │ ├── SDTOSCLiquids.c │ ├── SDTOSCLiquids.h │ ├── SDTOSCMotor.c │ ├── SDTOSCMotor.h │ ├── SDTOSCProjects.c │ ├── SDTOSCProjects.h │ ├── SDTOSCResonators.c │ └── SDTOSCResonators.h │ ├── SDTAnalysis.c │ ├── SDTAnalysis.h │ ├── SDTCommon.c │ ├── SDTCommon.h │ ├── SDTCommonMacros.h │ ├── SDTComplex.c │ ├── SDTComplex.h │ ├── SDTControl.c │ ├── SDTControl.h │ ├── SDTDCMotor.c │ ├── SDTDCMotor.h │ ├── SDTDemix.c │ ├── SDTDemix.h │ ├── SDTEffects.c │ ├── SDTEffects.h │ ├── SDTFFT.c │ ├── SDTFFT.h │ ├── SDTFilters.c │ ├── SDTFilters.h │ ├── SDTGases.c │ ├── SDTGases.h │ ├── SDTInteractors.c │ ├── SDTInteractors.h │ ├── SDTJSON.c │ ├── SDTJSON.h │ ├── SDTLiquids.c │ ├── SDTLiquids.h │ ├── SDTMemoryTrack.c │ ├── SDTMemoryTrack.h │ ├── SDTMotor.c │ ├── SDTMotor.h │ ├── SDTOscillators.c │ ├── SDTOscillators.h │ ├── SDTProjects.c │ ├── SDTProjects.h │ ├── SDTResonators.c │ ├── SDTResonators.h │ ├── SDTStructs.c │ └── SDTStructs.h ├── templates ├── Info.def ├── Max7External.mxo │ └── Contents │ │ ├── Info.plist │ │ └── PkgInfo ├── SDT.framework │ ├── Headers │ ├── Resources │ ├── SDT │ └── Versions │ │ ├── A │ │ └── Resources │ │ │ ├── English.lproj │ │ │ └── InfoPlist.strings │ │ │ └── Info.plist │ │ └── Current └── header.html └── tests ├── SDTTestUtils.c ├── SDTTestUtils.h ├── TestSDTAnalysis.c ├── TestSDTCommon.c └── TestSDTOSCAnalysis.c /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: Google 2 | ForEachMacros: 3 | - FOR_RANDOM_ITER_INT 4 | - FOR_RANDOM_ITER_FLOAT 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # System files and directories 2 | .DS_Store 3 | *.o 4 | *.pd_linux 5 | *.so 6 | doc 7 | *.dll 8 | *.def 9 | *.mxe 10 | *.mxe64 11 | *.mxo 12 | *.framework 13 | .idea 14 | .vscode 15 | .vs 16 | CMakeLists.txt 17 | 18 | # Outputs 19 | *.o 20 | *.pd_linux 21 | *.so 22 | *.dll 23 | !pd.dll 24 | *.def 25 | !Info.def 26 | *.mxe 27 | *.mxe64 28 | doc 29 | oscdoc 30 | .build* 31 | 32 | # Other files 33 | *.json 34 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "3rdparty/json-parser"] 2 | path = 3rdparty/json-parser 3 | url = https://github.com/json-parser/json-parser.git 4 | [submodule "3rdparty/json-builder"] 5 | path = 3rdparty/json-builder 6 | url = https://github.com/ChromaticIsobar/json-builder.git 7 | [submodule "3rdparty/doxygen-awesome-css"] 8 | path = 3rdparty/doxygen-awesome-css 9 | url = https://github.com/jothepro/doxygen-awesome-css.git 10 | [submodule "3rdparty/cutest"] 11 | path = 3rdparty/cutest 12 | url = https://github.com/ennorehling/cutest.git 13 | [submodule "3rdparty/max-sdk-base"] 14 | path = 3rdparty/max-sdk-base 15 | url = https://github.com/ChromaticIsobar/max-sdk-base.git 16 | [submodule "3rdparty/MacOSX-SDKs"] 17 | path = 3rdparty/MacOSX-SDKs 18 | url = https://github.com/phracker/MacOSX-SDKs.git 19 | -------------------------------------------------------------------------------- /3rdparty/Pd/pd-0.54.1/LICENSE.txt: -------------------------------------------------------------------------------- 1 | This software is copyrighted by Miller Puckette and others. The following 2 | terms (the "Standard Improved BSD License") apply to all files associated with 3 | the software unless explicitly disclaimed in individual files: 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above 12 | copyright notice, this list of conditions and the following 13 | disclaimer in the documentation and/or other materials provided 14 | with the distribution. 15 | 3. The name of the author may not be used to endorse or promote 16 | products derived from this software without specific prior 17 | written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY 20 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 22 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 25 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 | THE POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /3rdparty/Pd/pd-0.54.1/pd.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkAT-VG/SDT/0509de418e7bebc8b37866b3b4458e0acc8cf1f4/3rdparty/Pd/pd-0.54.1/pd.dll -------------------------------------------------------------------------------- /3rdparty/Pd/pd-0.54.1/x64/pd.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkAT-VG/SDT/0509de418e7bebc8b37866b3b4458e0acc8cf1f4/3rdparty/Pd/pd-0.54.1/x64/pd.dll -------------------------------------------------------------------------------- /AUTHORS.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | Sound Design Toolkit (SDT) 3 | -- 4 | https://github.com/SkAT-VG/SDT 5 | ------------------------------------------------------------------------------- 6 | 7 | Authors and contributors (either programmers or designers) in alphabetical 8 | order: 9 | 10 | Federico Avanzini (federico.avanzini@di.unimi.it) 11 | Stefano Baldan (singintime@gmail.com) 12 | Nicola Bernardini 13 | Gianpaolo Borin 14 | Carlo Drioli (carlo.drioli@uniud.it) 15 | Stefano Delle Monache (s.dellemonache@tudelft.nl) 16 | Delphine Devallez 17 | Federico Fontana (federico.fontana@uniud.it) 18 | Laura Ottaviani 19 | Stefano Papetti (stefano.papetti@zhdk.ch) 20 | Pietro Polotti (pietro.polotti@conts.it) 21 | Matthias Rath 22 | Davide Rocchesso (davide.rocchesso@unipa.it) 23 | Stefania Serafin (sts@create.aau.dk) 24 | Marco Tiraboschi (marco.tiraboschi@unimi.it) 25 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | Sound Design Toolkit (SDT) 3 | -- 4 | https://github.com/SkAT-VG/SDT 5 | ------------------------------------------------------------------------------- 6 | 7 | Copyright (C) 2001 - 2024 with the authors (see AUTHORS.txt) 8 | 9 | 10 | This file is part of the Sound Design Toolkit (SDT). 11 | 12 | The SDT is free software: you can redistribute it and/or modify 13 | it under the terms of the GNU General Public License as published by 14 | the Free Software Foundation, either version 3 of the License, or 15 | (at your option) any later version. 16 | 17 | The SDT is distributed in the hope that it will be useful, 18 | but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | GNU General Public License for more details. 21 | 22 | You should have received a copy of the GNU General Public License 23 | along with the SDT. If not, see . 24 | 25 | The official SDT distribution contains copy of the GNU General Public License 26 | in the file COPYING.txt 27 | -------------------------------------------------------------------------------- /MaxPackage/ReadMe.md: -------------------------------------------------------------------------------- 1 | # Sound Design Toolkit (SDT): package for Max 2 | 3 | 4 | ## Overview 5 | The **Sound Design Toolkit** (**SDT**) is an open-source (GPLv3) framework for 6 | ecologically founded sound synthesis and design. Think of it as a virtual 7 | Foley-box! 8 | It can simulate various acoustic phenomena arising from solid interactions 9 | (e.g. collision, rubbing, rolling, scraping), liquids (e.g. dripping, streaming 10 | water), gasses (e.g. explosions, blowing wind), and machines (e.g. combustion 11 | engines, electric motors). 12 | The library consists of physically informed sound synthesis models, audio 13 | processing algorithms and analysis routines. 14 | 15 | The SDT is mainly aimed at research and education in *Sonic Interaction Design* 16 | (SID), but it's been successfully used in musical contexts as well. 17 | 18 | The SDT sound synthesis algorithms have been implemented according to three main 19 | points: 20 | 1. auditory perceptual relevance; 21 | 2. cartoonification, i.e. simplification and exaggeration of the underlying 22 | physics in order to increase both computational efficiency and perceptual 23 | clarity; 24 | 3. parametric temporal control, which ensures appropriate, natural and 25 | expressive articulations of sonic processes. 26 | 27 | 28 | ## Minimum system requirements 29 | - Cycling '74 Max 7. 30 | - Mac: OS X 10.7 (for Max 7) or 10.11.6 (for Max 8). 31 | - Windows: Windows 7 or above. 32 | 33 | 34 | ## Installation 35 | If you downloaded the SDT Max *package* available as release assets of the main 36 | repository at https://github.com/SkAT-VG/SDT/releases, you need to perform a few 37 | steps to install it: 38 | 1. Copy the `MaxPackage` folder to your Max packages folder. This is usually 39 | found in your user folder, under Documents/Max # (where # is your Max version). 40 | 2. Rename it as `SoundDesignToolkit`. 41 | 42 | 43 | ## Implementation 44 | In addition to this Max *package*, the SDT also comes in different flavors: 45 | **C library** and **API** (suited to programmers of interactive media), and 46 | **Pure Data** externals and patches for Mac, Windows and Linux. 47 | For more details please refer to the universal SDT distribution, available at 48 | https://github.com/SkAT-VG/SDT 49 | 50 | 51 | ## Authors / Acknowledgements 52 | The Sound Design Toolkit package for Max was developed by: 53 | Stefano Delle Monache, Stefano Baldan, Stefano Papetti, and Marco Tiraboschi. 54 | 55 | The SDT library was developed through the years with the contribution of the 56 | following EU-projects: 57 | - 2001-2003 'SOb' http://www.soundobject.org/ 58 | - 2006-2009 'CLOSED' http://closed.ircam.fr/ 59 | - 2008-2011 'NIW' http://www.soundobject.org/niw/ 60 | - 2014-2016 'SkAT-VG' http://www.skatvg.eu/ 61 | 62 | 63 | ## Contact: 64 | SoundDesignToolkit@gmail.com 65 | https://www.facebook.com/SDT.Max.Pd 66 | -------------------------------------------------------------------------------- /MaxPackage/docs/sdt.bouncing~.maxref.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | [solids, control] Control algorithm to render bouncing sounds. 8 | 9 | 10 | 11 | sdt.bouncing~ generates a sequence of velocity events 12 | meant to drive a point-mass hitting a resonator. 13 | 14 | N.B. It must be used as a control layer for the structure formed by 15 | sdt.inertial ↔ sdt.impact~ ↔ sdt.modal. 16 | 17 | 18 | It takes three control parameters: 19 | initial height of the falling object (m), shape irregularity and 20 | restitution coefficient. 21 | Output: signal representing the impact velocity (m/s). 22 | 23 | 24 | 25 | 26 | Sound Design Toolkit 27 | 28 | 29 | 37 | 38 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | Inlet 0: Bang triggers a bouncing event. 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | Restitution coefficient of the bounce [0., 1.]. 67 | Restitution coefficient of the bounce, between 0. and 1. 68 | 69 | 70 | 71 | Initial height (m) of the object being dropped. 72 | 73 | 74 | 75 | 76 | Object shape irregularity [0., 1.]. 77 | Deviation from a spherical shape 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /MaxPackage/docs/sdt.breaking~.maxref.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | [solids, control] Control algorithm to render breaking sounds. 8 | 9 | 10 | 11 | sdt.breaking~ generates a sequence of velocity and fragmentation events 12 | meant to drive a point-mass hitting a resonator. 13 | 14 | N.B. It must be used as a control layer for the structure formed by 15 | sdt.inertial ↔ sdt.impact~ ↔ sdt.modal. 16 | 17 | 18 | It takes four control parameters: 19 | stored energy of the process, crushing energy spent by each micro-impact, 20 | granularity and fragmentation. 21 | 22 | It outputs two signals: 23 | Outlet 0: impact velocity (m/s) [0., 1.]; 24 | Outlet 1: fragment size, as fraction of the whole object [0., 1.]. 25 | 26 | 27 | 28 | Sound Design Toolkit 29 | 30 | 31 | 39 | 40 | 50 | 51 | 57 | 58 | 59 | 60 | 61 | 62 | Inlet 0: Bang triggers a breaking event. 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | Stored energy. 72 | Global energy of the process. Typical interval [0.0001, 1000.]. 73 | 74 | 75 | 76 | Energy of micro-impacts [0., 1.]. 77 | 78 | 79 | 80 | 81 | Granularity [0., 1.]. 82 | 83 | 84 | 85 | 86 | Fragmentation: tendency to break into smaller pieces [0., 1.]. 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /MaxPackage/docs/sdt.bubble~.maxref.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | [liquids] Bubble popping sound. 8 | 9 | 10 | 11 | sdt.bubble~ simulates a single spherical bubble collapsing. Indeed an exponentially decaying sinusoidal oscillator. 12 | It takes two control parameters: the bubble radius and the pitch rise factor. 13 | 14 | 15 | 16 | 17 | Sound Design Toolkit 18 | 19 | 20 | 28 | 29 | 36 | 37 | 43 | 44 | 45 | 46 | 47 | 50 | 51 | Inlet 0: Bang triggers a bubble event. 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | Bubble radius (mm) [0.15, 150.]. 61 | 62 | 63 | 64 | 65 | Pitch rise factor [0., 3.]. Simulates the rise in pitch occurring when a bubble shrinks before collapsing. 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /MaxPackage/docs/sdt.crumpling~.maxref.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | [solids, control] Control algorithm to render a granular, crumpling/crushing sound. 8 | 9 | 10 | 11 | sdt.crumpling~ generates a stochastic series of velocity and fragmentation events 12 | meant to drive a point-mass hitting a resonator. 13 | This results in a granular, crumpling/crushing sound. 14 | 15 | N.B. It must be used as a control layer for the structure formed by 16 | sdt.inertial ↔ sdt.impact~ ↔ sdt.modal. 17 | 18 | 19 | It takes three control parameters: 20 | crushing energy, granularity, and fragmentation 21 | . 22 | It outputs two signals: 23 | Outlet 0: impact velocity (m/s) [0., 1.]; 24 | Outlet 1: fragment size, as fraction of the whole object [0., 1.]. 25 | 26 | 27 | 28 | 29 | Sound Design Toolkit 30 | 31 | 32 | 40 | 41 | 51 | 52 | 58 | 59 | 73 | 74 | 75 | 76 | 77 | Energy of micro-impacts [0., 1.]. 78 | 79 | 80 | 81 | 82 | Granularity [0., 1.]. 83 | 84 | 85 | 86 | 87 | Fragmentation: tendency to break into smaller pieces [0., 1.]. 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /MaxPackage/docs/sdt.demix~.maxref.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Transient / tonal / residual component separator. 8 | 9 | 10 | 11 | sdt.demix~ first separates an audio signal in its residual (noisy) and non-residual components. 12 | The latter is then further separated into transients (percussive) and tonal (harmonic) components. 13 | 14 | 15 | It takes three control parameters: 16 | the analysis window overlap factor, 17 | the noise threshold, that is the amount of signal classified as residual, 18 | and the tonal threshold, that is the amount of non-residual signal classified as tonal. 19 | 20 | It outputs three signals representing the mentioned components. 21 | 22 | 23 | 24 | 25 | Sound Design Toolkit 26 | 27 | 28 | 36 | 37 | 52 | 53 | 54 | 55 | 56 | Window size in samples (defaults to 1024) 57 | 58 | 59 | 60 | Smoothing kernel radius (defaults to 2.) 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | Input signal. 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | Window overlap ratio [0.5, 1.]. 78 | 79 | 80 | 81 | 82 | Threshold for classifying a signal as residual (noisy) [0., 1.]. 83 | 84 | 85 | 86 | 87 | Threshold for classifying the non-residual signal as harmonic (tonal) [0., 1.]. 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /MaxPackage/docs/sdt.envelope~.maxref.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Envelope follower with settable attack and release times. 8 | 9 | 10 | 11 | sdt.envelope~ is an envelope follower with settable attack and release times based on a one-pole lowpass filter. 12 | 13 | 14 | 15 | 16 | Sound Design Toolkit 17 | 18 | 19 | 27 | 28 | 35 | 36 | 42 | 43 | 57 | 58 | 59 | 60 | 61 | Attack (ms). 62 | 63 | 64 | 65 | 66 | Release (ms). 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /MaxPackage/docs/sdt.inertial.maxref.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | [solids, object] Point-mass inertial object. 8 | 9 | 10 | 11 | sdt.inertial Simulates a simple point-mass whose displacement and velocity can be set. 12 | Mostly used as exciter for modal resonators. 13 | 14 | 15 | 16 | 17 | Sound Design Toolkit 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | A strike message followed by a list of two float arguments resets displacement and 29 | velocity of the point-mass to the given values. 30 | 31 | 32 | The strike message followed by a list of two float arguments forcedly sets the displacement and 33 | velocity of the point-mass. 34 | Displacement = 0. typically results in immediate contact with a second object. 35 | Velocity towards a second object must be negative. 36 | 37 | 38 | 39 | 40 | 46 | 47 | 48 | 49 | 50 | Mandatory: Unique name for the point-mass. 51 | 52 | 53 | 54 | 55 | 56 | 57 | Mass (kg). 58 | 59 | 60 | 61 | Fraction of the whole object [0., 1.]. Used by control algorithms (e.g. sdt.breaking~) to simulate fragmentation. 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /MaxPackage/docs/sdt.modal.maxref.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | [solids, object] Modal resonator object. 8 | 9 | 10 | 11 | sdt.modal is a resonator implemented according to modal synthesis: i.e. a set of parallel mass–spring–damper mechanical oscillators, each of which represents a mode of resonance of the object. 12 | 13 | 14 | 15 | 16 | Sound Design Toolkit 17 | 18 | 19 | 26 | 27 | 33 | 34 | 35 | 36 | 37 | Mandatory: Unique name for the resonator. 38 | 39 | 40 | 41 | Mandatory: Number of available modes. 42 | 43 | 44 | 45 | Mandatory: Number of available pickup points. 46 | 47 | 48 | 49 | 61 | 62 | 63 | 64 | 65 | Frequency of each mode (Hz). 66 | 67 | 68 | 69 | 70 | Decay of each mode (s). 71 | 72 | 73 | 74 | 75 | Fraction of the whole object [0., 1.]. Used by control algorithms (e.g. sdt.breaking~) to simulate fragmentation. 76 | 77 | 78 | 79 | 80 | Number of currently active modes (maximum = argument Modes). 81 | 82 | 83 | 84 | 85 | Modal weights for each pickup (kg^-1), starting from pickup0, pickup1, ..., pickupN. 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /MaxPackage/docs/sdt.pitchshift~.maxref.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Frequency domain pitch shifter. 8 | 9 | 10 | 11 | sdt.pitchshift~ takes two control parameters: the window overlap ratio, between 0.5 and 0.9, 12 | and the pitch shifting ratio, from 0.125 to 8. 13 | 14 | 15 | 16 | 17 | Sound Design Toolkit 18 | 19 | 20 | 28 | 29 | 36 | 37 | 38 | 39 | 40 | Window size, in samples (defaults to 4096). 41 | 42 | 43 | 44 | 58 | 59 | 60 | 61 | 62 | Window overlap ratio [0.5, 0.9]. 63 | 64 | 65 | 66 | 67 | Pitch shifting ratio [0.125, 8.]. 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /MaxPackage/docs/sdt.pitch~.maxref.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Fundamental frequency (f0) estimator. 8 | 9 | 10 | 11 | sdt.pitch~ estimates the fundamental frequency (f0) and pitch clarity of the incoming signal. 12 | Based on the Normalized Square Difference Function (NSDF). 13 | It outputs the estimated pitch (Hz) (leftmost outlet) and a pitch clarity value [0., 1.] (rightmost outlet). 14 | 15 | 16 | For voice-driven applications, sdt.pitch~ can be coupled with the skewness descriptor 17 | available in sdt.spectralfeats~, so as to have a higher level representation of the phonation vocal activity. 18 | For better results, a vocal sound should be pre-processed with sdt.demix~ in order to feed 19 | sdt.pitch~ and sdt.spectralfeats~ with the harmonic component only. 20 | 21 | 22 | 23 | 24 | Sound Design Toolkit 25 | 26 | 27 | 35 | 36 | 47 | 48 | 49 | 50 | 51 | Window size, in samples. Default is 4096. 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | Input signal. 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | Window overlap ratio [0., 1.]. 70 | 71 | 72 | 73 | 74 | Peak tolerance [0., 1.]. 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /MaxPackage/docs/sdt.reverb~.maxref.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | A computationally efficient yet maximally diffusive reverb. 8 | 9 | 10 | 11 | sdt.reverb~ implements a Feedback Delay Network (FDN) reverberator. 12 | Useful to enhance the texturization of acoustic elements, such as turbulence and scattering. 13 | The reverberation effect is parametrized according to the room size in the three dimensions (width, height, depth), the shape 14 | deviation from a rectangular room, the global reverberation time, and the reverberation time at 1 kHz. 15 | 16 | 17 | 18 | 19 | Sound Design Toolkit 20 | 21 | 22 | 35 | 36 | 43 | 44 | 45 | 46 | 47 | Maximum length of delay lines, in samples (default to 44100). 48 | 49 | 50 | 51 | 63 | 64 | 65 | 66 | 67 | Room width (m). 68 | 69 | 70 | 71 | 72 | Room height (m). 73 | 74 | 75 | 76 | 77 | Room width (m). 78 | 79 | 80 | 81 | 82 | Shape deviation from a rectangular room [0., 1.]. 83 | 84 | 85 | 86 | 87 | Global reverberation time (s). 88 | 89 | 90 | 91 | 92 | Reverberation time at 1 kHz (s). 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /MaxPackage/docs/sdt.spectralfeats~.maxref.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Spectral analyzer extracting several audio descriptors. 8 | 9 | 10 | 11 | sdt.spectralfeats~ provides statistical moments (sets of parameters) of the spectrum and 12 | other spectral information: 13 | * spectral magnitude 14 | * spectral centroid 15 | * spectral spread 16 | * spectral skewness 17 | * spectral kurtosis 18 | * spectral flatness 19 | * spectral flux 20 | * whitened and rectified spectral flux (onset function). 21 | The output is a list of messages in the form a qualified pair, in which the first element is the name of the descriptor 22 | and the second element is the corresponding extracted value. 23 | To be used with the route object. 24 | 25 | 26 | 27 | 28 | Sound Design Toolkit 29 | 30 | 31 | 44 | 45 | 52 | 53 | 54 | 55 | 56 | Window size in samples 57 | Window size in samples (defaults to 1024). 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | Input signal. 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | Lower frequency threshold (Hz), 0 for DC . 75 | 76 | 77 | 78 | 79 | Upper frequency threshold (Hz), 0 for Nyquist. 80 | 81 | 82 | 83 | 84 | Window overlap ratio [0., 1.]. 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /MaxPackage/docs/sdt.windcavity~.maxref.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | [gases] Sound of airflows passing through cavities, such as tunnels, pipes, valves, etc. 8 | 9 | 10 | 11 | sdt.wincavity~ simulates howling phenomena caused by air turbulences inside resonant cylindrical cavities. 12 | It takes three control parameters: the wind speed, the length and diameter of the cavity. 13 | 14 | 15 | 16 | 17 | Sound Design Toolkit 18 | 19 | 20 | 33 | 34 | 41 | 42 | 43 | 44 | 45 | Buffer length, in samples (default 48000). 46 | 47 | 48 | 49 | 50 | 51 | 52 | 55 | Wind speed [0., 1.]. 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | Diameter of the cavity (m). 64 | 65 | 66 | 67 | 68 | Length of the cavity (m). 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /MaxPackage/docs/sdt.windflow~.maxref.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | [gases] Wind sound. 8 | 9 | 10 | 11 | sdt.windflow~ simulates the noise caused by air turbulences. 12 | Turbulence arises when an airflow hits a surface, whose irregularities cause random change of direction of air molecules. 13 | The resulting sound is modeled as a white noise filtered by a non-resonant lowpass filter. 14 | The cutoff frequency of the filter is empirically set to 800 Hz, and the resulting output is modulated in amplitude according 15 | to the airflow speed. 16 | 17 | 18 | 19 | 20 | Sound Design Toolkit 21 | 22 | 23 | 31 | 32 | 39 | 40 | 46 | 47 | 48 | 49 | 50 | 53 | 54 | Wind speed [0., 1.]. 55 | 56 | 57 | 58 | 59 | 60 | 61 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /MaxPackage/docs/sdt.windkarman~.maxref.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | [gases] Howling / whistling wind sound. 8 | 9 | 10 | 11 | sdt.windkarman~ simulates Kármán vortices caused by airflows across thin obstacles, such as a tree branch or a suspended wire. 12 | Whistling / howling is produced by the repeating pattern of swirling vortices caused by the unsteady separation of airflow around the object. 13 | It takes two control parameters: the wind speed, and the diameter of the obstacle. 14 | 15 | 16 | 17 | 18 | Sound Design Toolkit 19 | 20 | 21 | 29 | 30 | 37 | 38 | 44 | 45 | 46 | 47 | 48 | Wind speed [0., 1.]. 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | Size of the obstacle (mm). 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /MaxPackage/docs/sdt.zerox~.maxref.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Zero crossings detector and counter. 8 | 9 | 10 | 11 | sdt.zerox~ returns the normalized zero crossing rate of an input signal [0., 1.]. 12 | This can be used as a rough estimation of noisiness. 13 | 14 | 15 | 16 | 17 | Sound Design Toolkit 18 | 19 | 20 | 28 | 29 | 36 | 37 | 38 | 39 | 40 | Analysis window length, in samples (defaults to 4096). 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | Input signal. 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | Window overlap ratio [0., 1.]. 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /MaxPackage/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkAT-VG/SDT/0509de418e7bebc8b37866b3b4458e0acc8cf1f4/MaxPackage/icon.png -------------------------------------------------------------------------------- /MaxPackage/media/SDT_obj1_int_obj2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkAT-VG/SDT/0509de418e7bebc8b37866b3b4458e0acc8cf1f4/MaxPackage/media/SDT_obj1_int_obj2.png -------------------------------------------------------------------------------- /MaxPackage/media/airImpact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkAT-VG/SDT/0509de418e7bebc8b37866b3b4458e0acc8cf1f4/MaxPackage/media/airImpact.png -------------------------------------------------------------------------------- /MaxPackage/media/beatbox.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkAT-VG/SDT/0509de418e7bebc8b37866b3b4458e0acc8cf1f4/MaxPackage/media/beatbox.wav -------------------------------------------------------------------------------- /MaxPackage/media/enginemodel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkAT-VG/SDT/0509de418e7bebc8b37866b3b4458e0acc8cf1f4/MaxPackage/media/enginemodel.png -------------------------------------------------------------------------------- /MaxPackage/media/explosiondiagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkAT-VG/SDT/0509de418e7bebc8b37866b3b4458e0acc8cf1f4/MaxPackage/media/explosiondiagram.png -------------------------------------------------------------------------------- /MaxPackage/media/fourstrokegraphs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkAT-VG/SDT/0509de418e7bebc8b37866b3b4458e0acc8cf1f4/MaxPackage/media/fourstrokegraphs.png -------------------------------------------------------------------------------- /MaxPackage/media/friedlander.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkAT-VG/SDT/0509de418e7bebc8b37866b3b4458e0acc8cf1f4/MaxPackage/media/friedlander.png -------------------------------------------------------------------------------- /MaxPackage/media/liquids.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkAT-VG/SDT/0509de418e7bebc8b37866b3b4458e0acc8cf1f4/MaxPackage/media/liquids.png -------------------------------------------------------------------------------- /MaxPackage/media/opentubemodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkAT-VG/SDT/0509de418e7bebc8b37866b3b4458e0acc8cf1f4/MaxPackage/media/opentubemodes.png -------------------------------------------------------------------------------- /MaxPackage/media/scrapingRubbingRolling2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkAT-VG/SDT/0509de418e7bebc8b37866b3b4458e0acc8cf1f4/MaxPackage/media/scrapingRubbingRolling2.png -------------------------------------------------------------------------------- /MaxPackage/media/sdt.friction.bristle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkAT-VG/SDT/0509de418e7bebc8b37866b3b4458e0acc8cf1f4/MaxPackage/media/sdt.friction.bristle.png -------------------------------------------------------------------------------- /MaxPackage/media/sdttaxonomy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkAT-VG/SDT/0509de418e7bebc8b37866b3b4458e0acc8cf1f4/MaxPackage/media/sdttaxonomy.png -------------------------------------------------------------------------------- /MaxPackage/media/vortexstreet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkAT-VG/SDT/0509de418e7bebc8b37866b3b4458e0acc8cf1f4/MaxPackage/media/vortexstreet.png -------------------------------------------------------------------------------- /MaxPackage/package-info.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Sound Design Toolkit", 3 | "author": "Stefano Delle Monache, Stefano Baldan, Stefano Papetti, Marco Tiraboschi", 4 | "description": "A framework for ecologically founded sound synthesis and design. Think of it as a virtual Foley-box!", 5 | "displayname": "Sound Design Toolkit", 6 | "extensible": 0, 7 | "homepatcher": "SDT-Overview.maxpat", 8 | "max_version_max": "none", 9 | "max_version_min": "7.1", 10 | "os": { 11 | "macintosh": { 12 | "platform": [ 13 | "x64", 14 | "aarch64" 15 | ], 16 | "min_version": "11.0.x" 17 | }, 18 | "windows": { 19 | "platform": [ 20 | "x64" 21 | ], 22 | "min_version": "7" 23 | } 24 | }, 25 | "package_extra": { 26 | "copyright": "Copyright (c) 2001 - 2023" 27 | }, 28 | "tags": [ 29 | "physics-based sound synthesis", 30 | "procedural audio", 31 | "sonic interaction design", 32 | "sound processing", 33 | "sound analysis" 34 | ], 35 | "version": "3.1.0", 36 | "website": "https://github.com/SkAT-VG/SDT" 37 | } -------------------------------------------------------------------------------- /MaxPackage/source/SDT_on_GitHub_readme.txt: -------------------------------------------------------------------------------- 1 | https://github.com/SkAT-VG/SDT 2 | 3 | -------------------------------------------------------------------------------- /Pd/VERSION: -------------------------------------------------------------------------------- 1 | 0.97.0 -------------------------------------------------------------------------------- /Pd/bouncing~-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 245 182 822 614 10; 2 | #X declare -lib SDT; 3 | #X obj 195 536 dac~; 4 | #X text 145 589 Args: object ID; 5 | #X text 438 588 Args: object ID \, n. of modes \, n. of pickups; 6 | #X text 214 399 Args: 1st obj ID \, 2nd obj ID \, n. of outlets; 7 | #X msg 598 9 Sound Design Toolkit \; (C) 2001 - 2024 \; \; Project 8 | SOb - soundobject.org \; Project CLOSED - closed.ircam.fr \; Project 9 | NIW - soundobject.org/niw \; Project SkAT-VG - skatvg.eu; 10 | #X obj 307 97 vsl 15 128 0 1 0 0 empty restitution empty 0 -9 0 10 11 | -262144 -1 -1 10160 1; 12 | #X obj 459 97 vsl 15 128 0 1 0 0 empty irregularity empty 0 -9 0 10 13 | -262144 -1 -1 3175 1; 14 | #X obj 168 96 vsl 15 128 0 10 0 0 empty height empty 0 -9 0 10 -262144 15 | -1 -1 1270 1; 16 | #X floatatom 459 233 5 0 0 0 - - -; 17 | #X floatatom 307 233 5 0 0 0 - - -; 18 | #X floatatom 168 233 5 0 0 0 - - -; 19 | #X obj 657 173 loadbang; 20 | #X obj 48 325 *~ -1; 21 | #X obj 228 428 vsl 30 64 100 10000 0 0 empty empty empty 0 -9 0 10 22 | -262144 -1 -1 0 1; 23 | #X obj 195 503 *~ 100; 24 | #X obj 48 96 bng 32 250 50 0 empty empty empty 17 7 0 10 -262144 -1 25 | -1; 26 | #X text 127 60 Object height (m); 27 | #X msg 168 252 height \$1; 28 | #X text 253 59 Restitution coefficient; 29 | #X msg 307 252 restitution \$1; 30 | #X msg 459 252 irregularity \$1; 31 | #X text 414 60 Object irregularity; 32 | #X text 46 61 Drop!; 33 | #X obj 48 295 bouncing~; 34 | #X obj 12 373 r bo; 35 | #X msg 596 199 \; hammerbo mass 0.01 \; hammerbo fragmentSize 1 \; 36 | objectbo freqs 500 1300 1700 \; objectbo decays 0.01 0.005 0.0025 \; 37 | objectbo pickup 0 100 100 100 \; objectbo activeModes 3 \; objectbo 38 | fragmentSize 1 \; bo stiffness 1e+07 \; bo dissipation 0.001 \; bo 39 | shape 1.5 \; bo contact0 0 \; bo contact1 0 \; height 1 \; restitution 40 | 0.8 \; irregularity 0.25 \;; 41 | #X obj 10 588 inertial hammerbo; 42 | #X obj 298 588 modal objectbo 3 1; 43 | #X obj 298 561 r objectbo; 44 | #X obj 10 561 r hammerbo; 45 | #X obj 12 399 impact~ hammerbo objectbo 2; 46 | #X text 48 4 bouncing~ - Generates a stochastic sequence of impacts 47 | to form a bouncing sound, f 79; 48 | #X obj 712 97 declare -lib SDT; 49 | #X obj 596 148 r pd-dsp-started; 50 | #X connect 5 0 9 0; 51 | #X connect 6 0 8 0; 52 | #X connect 7 0 10 0; 53 | #X connect 8 0 20 0; 54 | #X connect 9 0 19 0; 55 | #X connect 10 0 17 0; 56 | #X connect 11 0 25 0; 57 | #X connect 12 0 30 1; 58 | #X connect 13 0 14 1; 59 | #X connect 14 0 0 0; 60 | #X connect 14 0 0 1; 61 | #X connect 15 0 23 0; 62 | #X connect 17 0 23 0; 63 | #X connect 19 0 23 0; 64 | #X connect 20 0 23 0; 65 | #X connect 23 0 12 0; 66 | #X connect 24 0 30 0; 67 | #X connect 28 0 27 0; 68 | #X connect 29 0 26 0; 69 | #X connect 30 1 14 0; 70 | #X connect 33 0 25 0; 71 | -------------------------------------------------------------------------------- /Pd/breaking~-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 521 48 823 626 10; 2 | #X declare -lib SDT; 3 | #X obj 195 536 dac~; 4 | #X text 145 589 Args: object ID; 5 | #X text 438 588 Args: object ID \, n. of modes \, n. of pickups; 6 | #X text 214 399 Args: 1st obj ID \, 2nd obj ID \, n. of outlets; 7 | #X msg 598 9 Sound Design Toolkit \; (C) 2001 - 2024 \; \; Project 8 | SOb - soundobject.org \; Project CLOSED - closed.ircam.fr \; Project 9 | NIW - soundobject.org/niw \; Project SkAT-VG - skatvg.eu; 10 | #X obj 377 97 vsl 15 128 0.001 0.1 0 0 empty granularity empty 0 -9 11 | 0 10 -262144 -1 -1 6286 1; 12 | #X obj 489 97 vsl 15 128 0 1 0 0 empty fragmentation empty 0 -9 0 10 13 | -262144 -1 -1 6350 1; 14 | #X obj 248 96 vsl 15 128 0 10 0 0 empty crushingEnergy empty 0 -9 0 15 | 10 -262144 -1 -1 6350 1; 16 | #X floatatom 489 233 5 0 0 0 - - -; 17 | #X floatatom 377 233 5 0 0 0 - - -; 18 | #X floatatom 248 233 5 0 0 0 - - -; 19 | #X msg 248 252 crushingEnergy \$1; 20 | #X msg 377 252 granularity \$1; 21 | #X msg 489 252 fragmentation \$1; 22 | #X text 373 59 granularity; 23 | #X text 484 60 fragmentation; 24 | #X text 245 60 crushing energy; 25 | #X obj 677 173 loadbang; 26 | #X obj 48 325 *~ -1; 27 | #X obj 234 428 vsl 30 64 100 10000 0 0 empty empty empty 0 -9 0 10 28 | -262144 -1 -1 0 1; 29 | #X obj 120 97 vsl 15 128 0 1000 0 0 empty storedEnergy empty 0 -9 0 30 | 10 -262144 -1 -1 3175 1; 31 | #X floatatom 120 234 5 0 0 0 - - -; 32 | #X text 117 61 stored energy; 33 | #X obj 10 561 r hammerbr; 34 | #X obj 298 561 r objectbr; 35 | #X obj 10 588 inertial hammerbr; 36 | #X obj 298 588 modal objectbr 3 1; 37 | #X obj 12 373 r br; 38 | #X msg 120 253 storedEnergy \$1; 39 | #X obj 48 96 bng 32 250 50 0 empty empty empty 17 7 0 10 -262144 -1 40 | -1; 41 | #X text 46 61 Break!; 42 | #X obj 12 399 impact~ hammerbr objectbr 2; 43 | #X obj 48 295 breaking~; 44 | #X obj 195 503 *~ 1000; 45 | #X msg 616 199 \; hammerbr mass 0.01 \; hammerbr fragmentSize 1 \; 46 | objectbr freqs 500 1300 1700 \; objectbr decays 0.03 0.02 0.01 \; objectbr 47 | pickup 0 100 100 100 \; objectbr activeModes 3 \; objectbr fragmentSize 48 | 1 \; br stiffness 1e+07 \; br dissipation 0.001 \; br shape 1.5 \; 49 | br contact0 0 \; br contact1 0 \; storedEnergy 250 \; crushingEnergy 50 | 5 \; granularity 0.05 \; fragmentation 0.5 \;; 51 | #X text 48 4 breaking~ - Generates a stochastic sequence of impacts 52 | to form a breaking sound, f 79; 53 | #X obj 712 97 declare -lib SDT; 54 | #X obj 616 154 r pd-dsp-started; 55 | #X connect 5 0 9 0; 56 | #X connect 6 0 8 0; 57 | #X connect 7 0 10 0; 58 | #X connect 8 0 13 0; 59 | #X connect 9 0 12 0; 60 | #X connect 10 0 11 0; 61 | #X connect 11 0 32 0; 62 | #X connect 12 0 32 0; 63 | #X connect 13 0 32 0; 64 | #X connect 17 0 34 0; 65 | #X connect 18 0 31 1; 66 | #X connect 19 0 33 1; 67 | #X connect 20 0 21 0; 68 | #X connect 21 0 28 0; 69 | #X connect 23 0 25 0; 70 | #X connect 24 0 26 0; 71 | #X connect 27 0 31 0; 72 | #X connect 28 0 32 0; 73 | #X connect 29 0 32 0; 74 | #X connect 31 1 33 0; 75 | #X connect 32 0 18 0; 76 | #X connect 32 1 31 2; 77 | #X connect 32 1 31 5; 78 | #X connect 33 0 0 0; 79 | #X connect 33 0 0 1; 80 | #X connect 37 0 34 0; 81 | -------------------------------------------------------------------------------- /Pd/bubble~-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 599 372 554 440 10; 2 | #X declare -lib SDT; 3 | #X obj 9 384 bubble~; 4 | #X msg 179 343 radius \$1; 5 | #X msg 317 343 riseFactor \$1; 6 | #X obj 9 411 dac~; 7 | #X obj 9 155 bng 32 250 50 0 empty empty empty 17 7 0 10 -262144 -1 8 | -1; 9 | #X floatatom 317 299 5 0 0 0 - - -; 10 | #X obj 179 157 vsl 15 128 0.15 150 1 0 empty radius empty 0 -9 0 10 11 | -262144 -1 -1 6447 1; 12 | #X obj 317 157 vsl 15 128 0 3 0 0 empty riseFactor empty 0 -9 0 10 13 | -262144 -1 -1 423 1; 14 | #X floatatom 179 298 5 0 0 0 - - -; 15 | #X obj 179 319 * 0.001; 16 | #X msg 327 7 Sound Design Toolkit \; (C) 2001 - 2024 \; \; Project 17 | SOb - soundobject.org \; Project CLOSED - closed.ircam.fr \; Project 18 | NIW - soundobject.org/niw \; Project SkAT-VG - skatvg.eu; 19 | #X text 46 4 bubble~ - Bubble model; 20 | #X text 7 135 Press to trigger a bubble; 21 | #X text 176 136 Bubble radius (mm); 22 | #X text 313 136 Rise factor; 23 | #X obj 484 175 loadbang; 24 | #X msg 438 201 \; radius 5 \; riseFactor 0.1 \;; 25 | #X obj 442 95 declare -lib SDT; 26 | #X obj 438 152 r pd-dsp-started; 27 | #X connect 0 0 3 0; 28 | #X connect 0 0 3 1; 29 | #X connect 1 0 0 0; 30 | #X connect 2 0 0 0; 31 | #X connect 4 0 0 0; 32 | #X connect 5 0 2 0; 33 | #X connect 6 0 8 0; 34 | #X connect 7 0 5 0; 35 | #X connect 8 0 9 0; 36 | #X connect 9 0 1 0; 37 | #X connect 15 0 16 0; 38 | #X connect 18 0 16 0; 39 | -------------------------------------------------------------------------------- /Pd/crumpling~-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 243 92 771 638 10; 2 | #X declare -lib SDT; 3 | #X obj 195 536 dac~; 4 | #X text 145 589 Args: object ID; 5 | #X text 438 588 Args: object ID \, n. of modes \, n. of pickups; 6 | #X text 214 399 Args: 1st obj ID \, 2nd obj ID \, n. of outlets; 7 | #X msg 538 9 Sound Design Toolkit \; (C) 2001 - 2024 \; \; Project 8 | SOb - soundobject.org \; Project CLOSED - closed.ircam.fr \; Project 9 | NIW - soundobject.org/niw \; Project SkAT-VG - skatvg.eu; 10 | #X obj 177 97 vsl 15 128 0.001 0.1 0 0 empty granularity empty 0 -9 11 | 0 10 -262144 -1 -1 1155 1; 12 | #X obj 289 97 vsl 15 128 0 1 0 0 empty fragmentation empty 0 -9 0 10 13 | -262144 -1 -1 6350 1; 14 | #X obj 48 96 vsl 15 128 0 10 0 0 empty crushingEnergy empty 0 -9 0 15 | 10 -262144 -1 -1 3810 1; 16 | #X floatatom 289 233 5 0 0 0 - - -; 17 | #X floatatom 177 233 5 0 0 0 - - -; 18 | #X floatatom 48 233 5 0 0 0 - - -; 19 | #X msg 48 252 crushingEnergy \$1; 20 | #X msg 177 252 granularity \$1; 21 | #X msg 289 252 fragmentation \$1; 22 | #X text 173 59 granularity; 23 | #X text 284 60 fragmentation; 24 | #X text 45 60 crushing energy; 25 | #X obj 617 173 loadbang; 26 | #X obj 48 295 crumpling~; 27 | #X obj 48 325 *~ -1; 28 | #X obj 228 428 vsl 30 64 100 10000 0 0 empty empty empty 0 -9 0 10 29 | -262144 -1 -1 0 1; 30 | #X obj 12 399 impact~ hammercr objectcr 2; 31 | #X obj 10 588 inertial hammercr; 32 | #X obj 298 588 modal objectcr 3 1; 33 | #X obj 10 561 r hammercr; 34 | #X obj 298 561 r objectcr; 35 | #X obj 12 373 r cr; 36 | #X obj 195 503 *~ 100; 37 | #X msg 556 199 \; hammercr mass 0.01 \; hammercr fragmentSize 1 \; 38 | objectcr freqs 500 1300 1700 \; objectcr decays 0.03 0.02 0.01 \; objectcr 39 | pickup 0 100 100 100 \; objectcr activeModes 3 \; objectcr fragmentSize 40 | 1 \; cr stiffness 1e+07 \; cr dissipation 0.001 \; cr shape 1.5 \; 41 | cr contact0 0 \; cr contact1 0 \; crushingEnergy 3 \; granularity 0.01 42 | \; fragmentation 0.5 \;; 43 | #X text 48 3 crumpling~ - Generates a stochastic sequence of impacts 44 | to form a crushing sound, f 80; 45 | #X obj 654 97 declare -lib SDT; 46 | #X obj 556 155 r pd-dsp-started; 47 | #X connect 5 0 9 0; 48 | #X connect 6 0 8 0; 49 | #X connect 7 0 10 0; 50 | #X connect 8 0 13 0; 51 | #X connect 9 0 12 0; 52 | #X connect 10 0 11 0; 53 | #X connect 11 0 18 0; 54 | #X connect 12 0 18 0; 55 | #X connect 13 0 18 0; 56 | #X connect 17 0 28 0; 57 | #X connect 18 0 19 0; 58 | #X connect 18 1 21 2; 59 | #X connect 18 1 21 5; 60 | #X connect 19 0 21 1; 61 | #X connect 20 0 27 1; 62 | #X connect 21 1 27 0; 63 | #X connect 24 0 22 0; 64 | #X connect 25 0 23 0; 65 | #X connect 26 0 21 0; 66 | #X connect 27 0 0 0; 67 | #X connect 27 0 0 1; 68 | #X connect 31 0 28 0; 69 | -------------------------------------------------------------------------------- /Pd/demix~-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 422 327 829 400 10; 2 | #X declare -lib SDT; 3 | #X msg 596 9 Sound Design Toolkit \; (C) 2001 - 2024 \; \; Project 4 | SOb - soundobject.org \; Project CLOSED - closed.ircam.fr \; Project 5 | NIW - soundobject.org/niw \; Project SkAT-VG - skatvg.eu; 6 | #X obj 11 83 adc~; 7 | #X obj 83 361 dac~; 8 | #X floatatom 56 83 5 0.5 1 0 - overlap -; 9 | #X obj 614 172 loadbang; 10 | #X obj 56 139 demix~ 2048 4; 11 | #X text 150 139 Args: window size \, smoothing radius; 12 | #X text 8 4 demix~ - Transient / tonal / residual component separator 13 | ; 14 | #X obj 131 311 *~; 15 | #X obj 93 311 *~; 16 | #X obj 56 311 *~; 17 | #X obj 71 175 vsl 15 128 0 1 0 0 empty empty empty 0 -9 0 10 -262144 18 | -1 -1 0 1; 19 | #X obj 146 174 vsl 15 128 0 1 0 0 empty empty empty 0 -9 0 10 -262144 20 | -1 -1 0 1; 21 | #X obj 108 174 vsl 15 128 0 1 0 0 empty empty empty 0 -9 0 10 -262144 22 | -1 -1 0 1; 23 | #X msg 596 198 \; overlap 0.75 \; noiseThreshold 0.1 \; tonalThreshold 24 | 0.8 \;; 25 | #X floatatom 372 81 5 0 1 0 - tonalThreshold -; 26 | #X floatatom 219 82 5 0 1 0 - noiseThreshold -; 27 | #X msg 56 104 overlap \$1; 28 | #X text 55 64 Window overlap factor; 29 | #X msg 219 104 noiseThreshold \$1; 30 | #X text 217 64 Amount of residual; 31 | #X msg 372 103 tonalThreshold \$1; 32 | #X text 369 64 Amount of tonal non-residual; 33 | #X obj 712 97 declare -lib SDT; 34 | #X obj 596 148 r pd-dsp-started; 35 | #X connect 1 0 5 0; 36 | #X connect 3 0 17 0; 37 | #X connect 4 0 14 0; 38 | #X connect 5 0 10 0; 39 | #X connect 5 1 9 0; 40 | #X connect 5 2 8 0; 41 | #X connect 8 0 2 0; 42 | #X connect 8 0 2 1; 43 | #X connect 9 0 2 0; 44 | #X connect 9 0 2 1; 45 | #X connect 10 0 2 0; 46 | #X connect 10 0 2 1; 47 | #X connect 11 0 10 1; 48 | #X connect 12 0 8 1; 49 | #X connect 13 0 9 1; 50 | #X connect 15 0 21 0; 51 | #X connect 16 0 19 0; 52 | #X connect 17 0 5 0; 53 | #X connect 19 0 5 0; 54 | #X connect 21 0 5 0; 55 | #X connect 24 0 14 0; 56 | -------------------------------------------------------------------------------- /Pd/explosion~-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 176 160 882 520 10; 2 | #X declare -lib SDT; 3 | #X msg 94 305 blastTime \$1; 4 | #X msg 196 305 scatterTime \$1; 5 | #X msg 311 305 dispersion \$1; 6 | #X msg 407 305 distance \$1; 7 | #X msg 520 305 waveSpeed \$1; 8 | #X msg 637 305 windSpeed \$1; 9 | #X floatatom 94 279 5 0 0 0 - - -; 10 | #X floatatom 196 280 5 0 0 0 - - -; 11 | #X floatatom 311 280 5 0 0 0 - - -; 12 | #X floatatom 407 280 5 0 0 0 - - -; 13 | #X floatatom 520 280 5 0 0 0 - - -; 14 | #X floatatom 637 280 5 0 0 0 - - -; 15 | #X obj 7 143 bng 32 250 50 0 empty empty empty 17 7 0 10 -262144 -1 16 | -1; 17 | #X obj 7 494 dac~; 18 | #X obj 311 144 vsl 15 128 0 1 0 0 empty dispersion empty 0 -9 0 10 19 | -262144 -1 -1 6350 1; 20 | #X obj 520 144 vsl 15 128 0 1000 0 0 empty waveSpeed empty 0 -9 0 10 21 | -262144 -1 -1 4321 1; 22 | #X obj 637 144 vsl 15 128 0 1000 0 0 empty windSpeed empty 0 -9 0 10 23 | -262144 -1 -1 7620 1; 24 | #X obj 407 144 vsl 15 128 0 1000 0 0 empty distance empty 0 -9 0 10 25 | -262144 -1 -1 127 1; 26 | #X obj 196 144 vsl 15 128 0.1 100 0 0 empty scatterTime empty 0 -9 27 | 0 10 -262144 -1 -1 496 1; 28 | #X obj 94 143 vsl 15 128 0.01 1 1 0 empty blastTime empty 0 -9 0 10 29 | -262144 -1 -1 6350 1; 30 | #X text 60 123 Blast time (s); 31 | #X text 159 123 Scatter time (s); 32 | #X text 277 123 Scatter amount; 33 | #X text 383 123 Distance (m); 34 | #X text 6 123 BOOM!; 35 | #X obj 166 432 *~ 0.5; 36 | #X obj 7 432 *~ 0.5; 37 | #X floatatom 40 411 5 0 1 0 - - -; 38 | #X text 12 392 Shock gain; 39 | #X floatatom 199 411 5 0 1 0 - - -; 40 | #X text 177 393 Wind gain; 41 | #X obj 7 462 hip~ 10; 42 | #X msg 656 10 Sound Design Toolkit \; (C) 2001 - 2024 \; \; Project 43 | SOb - soundobject.org \; Project CLOSED - closed.ircam.fr \; Project 44 | NIW - soundobject.org/niw \; Project SkAT-VG - skatvg.eu; 45 | #X text 46 4 explosion~ - Explosion model; 46 | #X msg 755 226 \; blastTime 0.1 \; scatterTime 4 \; dispersion 0.5 47 | \; distance 10 \; waveSpeed 340.27 \; windSpeed 600 \;; 48 | #X text 476 123 Shock speed (m/s); 49 | #X text 602 123 Wind speed (m/s); 50 | #X obj 814 204 loadbang; 51 | #X text 194 356 Args: Reverb buffer length \, delay buffer length; 52 | #X text 193 368 (set them large for long reverbs and distances); 53 | #X obj 7 359 explosion~ 44100 441000; 54 | #X obj 766 98 declare -lib SDT; 55 | #X obj 755 182 r pd-dsp-started; 56 | #X connect 0 0 40 0; 57 | #X connect 1 0 40 0; 58 | #X connect 2 0 40 0; 59 | #X connect 3 0 40 0; 60 | #X connect 4 0 40 0; 61 | #X connect 5 0 40 0; 62 | #X connect 6 0 0 0; 63 | #X connect 7 0 1 0; 64 | #X connect 8 0 2 0; 65 | #X connect 9 0 3 0; 66 | #X connect 10 0 4 0; 67 | #X connect 11 0 5 0; 68 | #X connect 12 0 40 0; 69 | #X connect 14 0 8 0; 70 | #X connect 15 0 10 0; 71 | #X connect 16 0 11 0; 72 | #X connect 17 0 9 0; 73 | #X connect 18 0 7 0; 74 | #X connect 19 0 6 0; 75 | #X connect 25 0 31 0; 76 | #X connect 26 0 31 0; 77 | #X connect 27 0 26 1; 78 | #X connect 29 0 25 1; 79 | #X connect 31 0 13 0; 80 | #X connect 31 0 13 1; 81 | #X connect 37 0 34 0; 82 | #X connect 40 0 26 0; 83 | #X connect 40 1 25 0; 84 | #X connect 42 0 34 0; 85 | -------------------------------------------------------------------------------- /Pd/fluidflow~-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 137 146 1051 455 10; 2 | #X declare -lib SDT; 3 | #X msg 33 320 avgRate \$1; 4 | #X msg 129 319 minRadius \$1; 5 | #X msg 227 319 maxRadius \$1; 6 | #X msg 325 319 expRadius \$1; 7 | #X msg 419 319 minDepth \$1; 8 | #X msg 509 319 maxDepth \$1; 9 | #X msg 601 319 expDepth \$1; 10 | #X msg 692 318 riseFactor \$1; 11 | #X floatatom 33 277 8 0 100000 0 - - -; 12 | #X floatatom 129 275 5 0 0 0 - - -; 13 | #X floatatom 227 277 5 0 0 0 - - -; 14 | #X floatatom 419 276 5 0 0 0 - - -; 15 | #X floatatom 509 276 5 0 0 0 - - -; 16 | #X floatatom 601 277 5 0 0 0 - - -; 17 | #X floatatom 692 276 5 0 0 0 - - -; 18 | #X floatatom 325 277 5 0 0 0 - - -; 19 | #X floatatom 798 277 5 0 0 0 - - -; 20 | #X obj 33 425 dac~; 21 | #X obj 33 378 fluidflow~ 128; 22 | #X msg 798 318 riseCutoff \$1; 23 | #X text 45 5 fluidflow~ - Liquid sounds model; 24 | #X msg 822 11 Sound Design Toolkit \; (C) 2001 - 2024 \; \; Project 25 | SOb - soundobject.org \; Project CLOSED - closed.ircam.fr \; Project 26 | NIW - soundobject.org/niw \; Project SkAT-VG - skatvg.eu; 27 | #X obj 325 136 vsl 15 128 0 10 0 0 empty expRadius empty 0 -9 0 10 28 | -262144 -1 -1 3810 1; 29 | #X obj 227 136 vsl 15 128 0.15 150 0 0 empty maxRadius empty 0 -9 0 30 | 10 -262144 -1 -1 411 1; 31 | #X obj 33 136 vsl 15 128 1 100000 1 0 empty avgRate empty 0 -9 0 10 32 | -262144 -1 -1 7620 1; 33 | #X obj 509 136 vsl 15 128 0 1 0 0 empty maxDepth empty 0 -9 0 10 -262144 34 | -1 -1 12700 1; 35 | #X obj 601 137 vsl 15 128 0 10 0 0 empty expDepth empty 0 -9 0 10 -262144 36 | -1 -1 1270 1; 37 | #X obj 692 136 vsl 15 128 0 4 0 0 empty riseFactor empty 0 -9 0 10 38 | -262144 -1 -1 317 1; 39 | #X obj 798 137 vsl 15 128 0 1 0 0 empty riseCutoff empty 0 -9 0 10 40 | -262144 -1 -1 11430 1; 41 | #X obj 129 134 vsl 15 128 0.15 150 0 0 empty minRadius empty 0 -9 0 42 | 10 -262144 -1 -1 0 1; 43 | #X obj 419 135 vsl 15 128 0 1 0 0 empty minDepth empty 0 -9 0 10 -262144 44 | -1 -1 0 1; 45 | #X text 8 114 Bubbles/sec; 46 | #X text 108 114 Min. and max. radius (mm); 47 | #X text 296 115 Radius gamma; 48 | #X text 414 115 Min. and max. depth; 49 | #X text 573 116 Depth gamma; 50 | #X text 664 116 Bloop amount; 51 | #X text 749 116 Min. blooping depth; 52 | #X obj 227 297 * 0.001; 53 | #X obj 129 296 * 0.001; 54 | #X msg 917 198 \; avgRate 1000 \; minRadius 0.15 \; maxRadius 5 \; 55 | expRadius 3 \; minDepth 0 \; maxDepth 1 \; expDepth 1 \; riseFactor 56 | 0.1 \; riseCutoff 0.9 \;; 57 | #X text 155 378 Arg: n. of voices (set it large for dense events); 58 | #X obj 927 176 loadbang; 59 | #X obj 931 99 declare -lib SDT; 60 | #X obj 917 154 r pd-dsp-started; 61 | #X connect 0 0 18 0; 62 | #X connect 1 0 18 0; 63 | #X connect 2 0 18 0; 64 | #X connect 3 0 18 0; 65 | #X connect 4 0 18 0; 66 | #X connect 5 0 18 0; 67 | #X connect 6 0 18 0; 68 | #X connect 7 0 18 0; 69 | #X connect 8 0 0 0; 70 | #X connect 9 0 39 0; 71 | #X connect 10 0 38 0; 72 | #X connect 11 0 4 0; 73 | #X connect 12 0 5 0; 74 | #X connect 13 0 6 0; 75 | #X connect 14 0 7 0; 76 | #X connect 15 0 3 0; 77 | #X connect 16 0 19 0; 78 | #X connect 18 0 17 0; 79 | #X connect 18 0 17 1; 80 | #X connect 19 0 18 0; 81 | #X connect 22 0 15 0; 82 | #X connect 23 0 10 0; 83 | #X connect 24 0 8 0; 84 | #X connect 25 0 12 0; 85 | #X connect 26 0 13 0; 86 | #X connect 27 0 14 0; 87 | #X connect 28 0 16 0; 88 | #X connect 29 0 9 0; 89 | #X connect 30 0 11 0; 90 | #X connect 38 0 2 0; 91 | #X connect 39 0 1 0; 92 | #X connect 42 0 40 0; 93 | #X connect 44 0 40 0; 94 | -------------------------------------------------------------------------------- /Pd/impact~-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 28 199 1089 512 10; 2 | #X declare -lib SDT; 3 | #X obj 243 472 dac~; 4 | #X msg 860 17 Sound Design Toolkit \; (C) 2001 - 2024 \; \; Project 5 | SOb - soundobject.org \; Project CLOSED - closed.ircam.fr \; Project 6 | NIW - soundobject.org/niw \; Project SkAT-VG - skatvg.eu; 7 | #X obj 939 201 loadbang; 8 | #X msg 48 279 stiffness \$1; 9 | #X msg 183 278 dissipation \$1; 10 | #X obj 323 119 vsl 15 128 1 4 0 0 empty shape empty 0 -9 0 10 -262144 11 | -1 -1 2117 1; 12 | #X obj 183 119 vsl 15 128 0 40 0 0 empty dissipation empty 0 -9 0 10 13 | -262144 -1 -1 317 1; 14 | #X obj 48 121 vsl 15 128 1000 1e+08 1 0 empty stiffness empty 0 -9 15 | 0 10 -262144 -1 -1 10160 1; 16 | #X floatatom 48 259 10 0 0 0 - - -; 17 | #X floatatom 183 257 5 0 0 0 - - -; 18 | #X floatatom 323 257 5 0 0 0 - - -; 19 | #X text 260 328 Args: 1st obj ID \, 2nd obj ID \, n. of outlets; 20 | #X text 573 210 Args: object ID; 21 | #X text 581 275 Args: object ID \, n. of modes \, n. of pickups; 22 | #X obj 48 327 impact~ hammerimp objectimp 2; 23 | #X text 6 98 Impact stiffness; 24 | #X text 136 97 Impact dissipation; 25 | #X msg 323 278 shape \$1; 26 | #X obj 492 183 r hammerimp; 27 | #X obj 429 250 r objectimp; 28 | #X obj 428 210 inertial hammerimp; 29 | #X obj 429 275 modal objectimp 3 1; 30 | #X obj 9 303 r imp; 31 | #X msg 878 227 \; hammerimp mass 0.01 \; hammerimp fragmentSize 1 \; 32 | objectimp freqs 500 1300 1700 \; objectimp decays 1 0.5 0.25 \; objectimp 33 | pickup 0 100 100 100 \; objectimp activeModes 3 \; objectimp fragmentSize 34 | 1 \; imp contact0 0 \; imp contact1 0 \; stiffness 1e+07 \; dissipation 35 | 1 \; shape 1.5 \;; 36 | #X msg 428 157 strike 0 -3; 37 | #X obj 428 118 bng 32 250 50 0 empty empty empty 17 7 0 10 -262144 38 | -1 -1; 39 | #X text 291 97 Contact shape; 40 | #X text 426 98 Strike!; 41 | #X text 48 4 impact~ - Simulates an impact between two solid objects 42 | ; 43 | #X obj 243 441 *~ 1000; 44 | #X obj 282 357 vsl 30 60 100 10000 0 0 empty empty empty 0 -9 0 10 45 | -262144 -1 -1 0 1; 46 | #X obj 970 105 declare -lib SDT; 47 | #X obj 878 180 r pd-dsp-started; 48 | #X connect 2 0 23 0; 49 | #X connect 3 0 14 0; 50 | #X connect 4 0 14 0; 51 | #X connect 5 0 10 0; 52 | #X connect 6 0 9 0; 53 | #X connect 7 0 8 0; 54 | #X connect 8 0 3 0; 55 | #X connect 9 0 4 0; 56 | #X connect 10 0 17 0; 57 | #X connect 14 1 29 0; 58 | #X connect 17 0 14 0; 59 | #X connect 18 0 20 0; 60 | #X connect 19 0 21 0; 61 | #X connect 22 0 14 0; 62 | #X connect 24 0 20 0; 63 | #X connect 25 0 24 0; 64 | #X connect 29 0 0 0; 65 | #X connect 29 0 0 1; 66 | #X connect 30 0 29 1; 67 | #X connect 32 0 23 0; 68 | -------------------------------------------------------------------------------- /Pd/myo~-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 434 339 532 258 10; 2 | #X declare -lib SDT; 3 | #X floatatom 13 175 6 0 0 0 - - -; 4 | #X floatatom 70 174 6 0 0 0 - - -; 5 | #X msg 306 8 Sound Design Toolkit \; (C) 2001 - 2024 \; \; Project 6 | SOb - soundobject.org \; Project CLOSED - closed.ircam.fr \; Project 7 | NIW - soundobject.org/niw \; Project SkAT-VG - skatvg.eu; 8 | #X obj 433 166 loadbang; 9 | #X text 48 4 myo~ - Myoelastic vocal activity detector; 10 | #X obj 13 99 r myo; 11 | #X text 117 137 Args: buffer size; 12 | #X msg 376 187 \; myo lowFrequency 20 \; myo highFrequency 100 \; myo 13 | threshold 0.001 \;; 14 | #X obj 13 137 myo~ 44100; 15 | #X obj 78 99 adc~; 16 | #X text 11 192 Slow myo; 17 | #X text 68 191 Slow myo; 18 | #X floatatom 133 174 6 0 0 0 - - -; 19 | #X floatatom 190 173 6 0 0 0 - - -; 20 | #X text 131 191 Fast myo; 21 | #X text 188 190 Fast myo; 22 | #X text 11 202 Activity; 23 | #X text 68 201 Frequency; 24 | #X text 131 201 Activity; 25 | #X text 188 200 Frequency; 26 | #X obj 415 97 declare -lib SDT; 27 | #X obj 376 146 r pd-dsp-started; 28 | #X connect 3 0 7 0; 29 | #X connect 5 0 8 0; 30 | #X connect 8 0 0 0; 31 | #X connect 8 1 1 0; 32 | #X connect 9 0 8 0; 33 | #X connect 21 0 7 0; 34 | -------------------------------------------------------------------------------- /Pd/pitchshift~-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 434 339 541 222 10; 2 | #X declare -lib SDT; 3 | #X msg 306 8 Sound Design Toolkit \; (C) 2001 - 2024 \; \; Project 4 | SOb - soundobject.org \; Project CLOSED - closed.ircam.fr \; Project 5 | NIW - soundobject.org/niw \; Project SkAT-VG - skatvg.eu; 6 | #X obj 11 83 adc~; 7 | #X obj 11 164 dac~; 8 | #X msg 168 104 ratio \$1; 9 | #X floatatom 168 83 5 0.1 10 0 - ratio -; 10 | #X text 165 64 Pitch shifting ratio; 11 | #X obj 342 149 loadbang; 12 | #X text 8 4 pitchshift~ - Pitch shifter; 13 | #X obj 11 139 pitchshift~ 4096; 14 | #X text 146 139 Args: window size; 15 | #X msg 306 169 \; overlap 0.75 \; ratio 1.5 \;; 16 | #X floatatom 51 82 5 0.75 1 0 - overlap -; 17 | #X text 48 63 Overlap factor; 18 | #X msg 51 103 overlap \$1; 19 | #X obj 416 96 declare -lib SDT; 20 | #X obj 306 128 r pd-dsp-started; 21 | #X connect 1 0 8 0; 22 | #X connect 3 0 8 0; 23 | #X connect 4 0 3 0; 24 | #X connect 6 0 10 0; 25 | #X connect 8 0 2 0; 26 | #X connect 8 0 2 1; 27 | #X connect 11 0 13 0; 28 | #X connect 13 0 8 0; 29 | #X connect 15 0 10 0; 30 | -------------------------------------------------------------------------------- /Pd/pitch~-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 434 339 534 210 10; 2 | #X declare -lib SDT; 3 | #X floatatom 13 125 5 0 0 0 - - -; 4 | #X floatatom 100 124 5 0 0 0 - - -; 5 | #X obj 78 49 adc~; 6 | #X msg 306 8 Sound Design Toolkit \; (C) 2001 - 2024 \; \; Project 7 | SOb - soundobject.org \; Project CLOSED - closed.ircam.fr \; Project 8 | NIW - soundobject.org/niw \; Project SkAT-VG - skatvg.eu; 9 | #X msg 307 161 \; pitch overlap 0.5 \; pitch tolerance 0.1 \;; 10 | #X obj 13 49 r pitch; 11 | #X text 16 6 pitch~ - Fundamental Frequency estimator; 12 | #X text 11 143 Pitch (Hz); 13 | #X text 98 142 Pitch clarity [0 \, 1]; 14 | #X text 117 87 Args: analysis window size; 15 | #X obj 13 87 pitch~ 2048; 16 | #X obj 338 139 loadbang; 17 | #X obj 415 96 declare -lib SDT; 18 | #X obj 307 120 r pd-dsp-started; 19 | #X connect 2 0 10 0; 20 | #X connect 5 0 10 0; 21 | #X connect 10 0 0 0; 22 | #X connect 10 1 1 0; 23 | #X connect 11 0 4 0; 24 | #X connect 13 0 4 0; 25 | -------------------------------------------------------------------------------- /Pd/reverb~-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 118 131 860 415 10; 2 | #X declare -lib SDT; 3 | #X obj 91 290 reverb~; 4 | #X msg 156 240 ySize \$1; 5 | #X msg 91 240 xSize \$1; 6 | #X msg 223 240 zSize \$1; 7 | #X msg 343 240 randomness \$1; 8 | #X msg 468 239 time \$1; 9 | #X msg 547 238 time1k \$1; 10 | #X floatatom 91 216 5 0 0 0 - - -; 11 | #X floatatom 156 215 5 0 0 0 - - -; 12 | #X floatatom 223 215 5 0 0 0 - - -; 13 | #X floatatom 343 216 5 0 0 0 - - -; 14 | #X floatatom 468 218 5 0 0 0 - - -; 15 | #X floatatom 547 218 5 0 0 0 - - -; 16 | #X obj 19 75 adc~; 17 | #X obj 19 386 dac~; 18 | #X obj 343 78 vsl 15 128 0 1 0 0 empty randomness empty 0 -9 0 10 -262144 19 | -1 -1 4191 1; 20 | #X obj 156 77 vsl 15 128 0 40 0 0 empty ySize empty 0 -9 0 10 -262144 21 | -1 -1 2857 1; 22 | #X obj 468 80 vsl 15 128 0 60 0 0 empty time empty 0 -9 0 10 -262144 23 | -1 -1 1270 1; 24 | #X obj 547 80 vsl 15 128 0 60 0 0 empty time1k empty 0 -9 0 10 -262144 25 | -1 -1 1058 1; 26 | #X obj 91 77 vsl 15 128 0 40 0 0 empty xSize empty 0 -9 0 10 -262144 27 | -1 -1 2222 1; 28 | #X obj 223 77 vsl 15 128 0 40 0 0 empty zSize empty 0 -9 0 10 -262144 29 | -1 -1 3492 1; 30 | #X text 70 49 Room width \, height and depth (m); 31 | #X text 305 49 Room irregularity; 32 | #X text 452 50 T60 (s); 33 | #X text 518 51 T60 @ 1kHz (s); 34 | #X obj 91 350 *~ 0.5; 35 | #X obj 19 350 *~ 0.5; 36 | #X floatatom 124 328 5 0 1 0 - - -; 37 | #X floatatom 52 328 5 0 1 0 - - -; 38 | #X text 50 310 Dry; 39 | #X text 123 311 Wet; 40 | #X text 18 6 reverb~ - Signal reverberator; 41 | #X msg 632 10 Sound Design Toolkit \; (C) 2001 - 2024 \; \; Project 42 | SOb - soundobject.org \; Project CLOSED - closed.ircam.fr \; Project 43 | NIW - soundobject.org/niw \; Project SkAT-VG - skatvg.eu; 44 | #X msg 680 206 \; xSize 7 \; ySize 9 \; zSize 11 \; randomness 0.33 45 | \; time 6 \; time1k 5 \;; 46 | #X obj 694 179 loadbang; 47 | #X obj 740 100 declare -lib SDT; 48 | #X obj 680 156 r pd-dsp-started; 49 | #X connect 0 0 25 0; 50 | #X connect 1 0 0 0; 51 | #X connect 2 0 0 0; 52 | #X connect 3 0 0 0; 53 | #X connect 4 0 0 0; 54 | #X connect 5 0 0 0; 55 | #X connect 6 0 0 0; 56 | #X connect 7 0 2 0; 57 | #X connect 8 0 1 0; 58 | #X connect 9 0 3 0; 59 | #X connect 10 0 4 0; 60 | #X connect 11 0 5 0; 61 | #X connect 12 0 6 0; 62 | #X connect 13 0 0 0; 63 | #X connect 13 0 26 0; 64 | #X connect 15 0 10 0; 65 | #X connect 16 0 8 0; 66 | #X connect 17 0 11 0; 67 | #X connect 18 0 12 0; 68 | #X connect 19 0 7 0; 69 | #X connect 20 0 9 0; 70 | #X connect 25 0 14 1; 71 | #X connect 25 0 14 0; 72 | #X connect 26 0 14 0; 73 | #X connect 26 0 14 1; 74 | #X connect 27 0 25 1; 75 | #X connect 28 0 26 1; 76 | #X connect 34 0 33 0; 77 | #X connect 36 0 33 0; 78 | -------------------------------------------------------------------------------- /Pd/rolling~-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 371 172 759 648 10; 2 | #X declare -lib SDT; 3 | #X obj 321 566 dac~; 4 | #X text 185 619 Args: object ID; 5 | #X text 478 618 Args: object ID \, n. of modes \, n. of pickups; 6 | #X text 340 429 Args: 1st obj ID \, 2nd obj ID \, n. of outlets; 7 | #X msg 538 9 Sound Design Toolkit \; (C) 2001 - 2024 \; \; Project 8 | SOb - soundobject.org \; Project CLOSED - closed.ircam.fr \; Project 9 | NIW - soundobject.org/niw \; Project SkAT-VG - skatvg.eu; 10 | #X obj 267 97 vsl 15 128 1e-05 1 1 0 empty grain empty 0 -9 0 10 -262144 11 | -1 -1 5080 1; 12 | #X obj 379 97 vsl 15 128 0 200 0 0 empty depth empty 0 -9 0 10 -262144 13 | -1 -1 6350 1; 14 | #X obj 138 96 vsl 15 128 0 10 0 0 empty velocity empty 0 -9 0 10 -262144 15 | -1 -1 2540 1; 16 | #X floatatom 379 233 5 0 0 0 - - -; 17 | #X floatatom 267 233 6 0 0 0 - - -; 18 | #X floatatom 138 233 5 0 0 0 - - -; 19 | #X obj 617 173 loadbang; 20 | #X obj 366 458 vsl 30 64 1000 100000 0 0 empty gain empty 0 -9 0 10 21 | -262144 -1 -1 3118 1; 22 | #X obj 138 374 rolling~; 23 | #X obj 179 401 r ro; 24 | #X msg 50 253 mass \$1; 25 | #X obj 70 591 r hammerro; 26 | #X obj 338 591 r objectro; 27 | #X obj 50 97 vsl 15 128 0.001 1 0 0 empty mass empty 0 -9 0 10 -262144 28 | -1 -1 114 1; 29 | #X floatatom 50 234 5 0 0 0 - - -; 30 | #X msg 138 252 velocity \$1; 31 | #X text 8 59 Rolling mass (Kg) and velocity (m/s); 32 | #X msg 267 252 grain \$1; 33 | #X text 243 59 Surface grain; 34 | #X msg 379 252 depth \$1; 35 | #X text 354 60 Grain depth; 36 | #X obj 77 286 noise~; 37 | #X obj 77 313 lop~ 20; 38 | #X obj 77 341 *~ 10; 39 | #X msg 72 551 strike 0 0; 40 | #X obj 321 533 *~ 50000; 41 | #X obj 138 429 impact~ hammerro objectro 2; 42 | #X obj 50 618 inertial hammerro; 43 | #X obj 338 618 modal objectro 3 1; 44 | #X msg 556 199 \; hammerro fragmentSize 1 \; objectro freqs 500 1300 45 | 1700 \; objectro decays 0.03 0.02 0.01 \; objectro pickup 0 100 100 46 | 100 \; objectro activeModes 3 \; objectro fragmentSize 1 \; ro stiffness 47 | 1e+08 \; ro dissipation 0.8 \; ro shape 1.5 \; ro contact0 0 \; ro 48 | contact1 0 \; mass 0.01 \; velocity 2 \; grain 0.001 \; depth 100 \; 49 | gain 50000 \;; 50 | #X text 14 6 rolling~ - Generates a stochastic sequence of impacts 51 | to form a rolling sound, f 77; 52 | #X obj 647 99 declare -lib SDT; 53 | #X obj 556 152 r pd-dsp-started; 54 | #X connect 5 0 9 0; 55 | #X connect 6 0 8 0; 56 | #X connect 7 0 10 0; 57 | #X connect 8 0 24 0; 58 | #X connect 9 0 22 0; 59 | #X connect 10 0 20 0; 60 | #X connect 11 0 34 0; 61 | #X connect 12 0 30 1; 62 | #X connect 13 0 31 0; 63 | #X connect 14 0 31 0; 64 | #X connect 15 0 13 0; 65 | #X connect 15 0 32 0; 66 | #X connect 16 0 32 0; 67 | #X connect 17 0 33 0; 68 | #X connect 18 0 19 0; 69 | #X connect 19 0 15 0; 70 | #X connect 20 0 13 0; 71 | #X connect 22 0 13 0; 72 | #X connect 24 0 13 0; 73 | #X connect 26 0 27 0; 74 | #X connect 27 0 28 0; 75 | #X connect 28 0 13 0; 76 | #X connect 29 0 32 0; 77 | #X connect 30 0 0 0; 78 | #X connect 30 0 0 1; 79 | #X connect 31 1 30 0; 80 | #X connect 37 0 34 0; 81 | -------------------------------------------------------------------------------- /Pd/scraping~-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 243 92 729 591 10; 2 | #X declare -lib SDT; 3 | #X obj 98 566 dac~; 4 | #X text 416 559 Args: object ID \, n. of modes \, n. of pickups; 5 | #X text 300 429 Args: 1st obj ID \, 2nd obj ID \, n. of outlets; 6 | #X msg 498 9 Sound Design Toolkit \; (C) 2001 - 2024 \; \; Project 7 | SOb - soundobject.org \; Project CLOSED - closed.ircam.fr \; Project 8 | NIW - soundobject.org/niw \; Project SkAT-VG - skatvg.eu; 9 | #X obj 227 97 vsl 15 128 1e-05 1 1 0 empty grain empty 0 -9 0 10 -262144 10 | -1 -1 5080 1; 11 | #X obj 339 97 vsl 15 128 0 200 0 0 empty force empty 0 -9 0 10 -262144 12 | -1 -1 127 1; 13 | #X obj 98 96 vsl 15 128 0 10 0 0 empty velocity empty 0 -9 0 10 -262144 14 | -1 -1 1270 1; 15 | #X floatatom 339 233 5 0 0 0 - - -; 16 | #X floatatom 227 233 6 0 0 0 - - -; 17 | #X floatatom 98 233 5 0 0 0 - - -; 18 | #X obj 553 173 loadbang; 19 | #X obj 143 458 vsl 30 64 1000 100000 0 0 empty gain empty 0 -9 0 10 20 | -262144 -1 -1 3118 1; 21 | #X msg 98 252 velocity \$1; 22 | #X msg 227 252 grain \$1; 23 | #X text 203 59 Surface grain; 24 | #X obj 37 286 noise~; 25 | #X obj 37 313 lop~ 20; 26 | #X obj 37 341 *~ 10; 27 | #X obj 98 533 *~ 50000; 28 | #X obj 98 429 impact~ objectsc none 1; 29 | #X obj 276 559 modal objectsc 3 1; 30 | #X obj 98 374 scraping~; 31 | #X obj 139 401 r sc; 32 | #X obj 276 532 r objectsc; 33 | #X msg 339 252 force \$1; 34 | #X text 299 60 Perpendicular force (N); 35 | #X text 38 59 Scraping velocity (m/s); 36 | #X msg 492 199 \; objectsc freqs 500 1300 1700 \; objectsc decays 0.03 37 | 0.02 0.01 \; objectsc pickup 0 100 100 100 \; objectsc activeModes 38 | 3 \; objectsc fragmentSize 1 \; sc stiffness 1e+08 \; sc dissipation 39 | 0.8 \; sc shape 1.5 \; sc contact0 0 \; sc contact1 0 \; velocity 1 40 | \; grain 0.001 \; force 2 \; gain 50000 \;; 41 | #X text 8 4 scraping~ - Generates a stochastic sequence of impacts 42 | to form a scraping sound, f 79; 43 | #X obj 607 98 declare -lib SDT; 44 | #X obj 492 152 r pd-dsp-started; 45 | #X connect 4 0 8 0; 46 | #X connect 5 0 7 0; 47 | #X connect 6 0 9 0; 48 | #X connect 7 0 24 0; 49 | #X connect 8 0 13 0; 50 | #X connect 9 0 12 0; 51 | #X connect 10 0 27 0; 52 | #X connect 11 0 18 1; 53 | #X connect 12 0 21 0; 54 | #X connect 13 0 21 0; 55 | #X connect 15 0 16 0; 56 | #X connect 16 0 17 0; 57 | #X connect 17 0 21 0; 58 | #X connect 18 0 0 0; 59 | #X connect 18 0 0 1; 60 | #X connect 19 0 18 0; 61 | #X connect 21 0 19 0; 62 | #X connect 22 0 19 0; 63 | #X connect 23 0 20 0; 64 | #X connect 24 0 21 0; 65 | #X connect 30 0 27 0; 66 | -------------------------------------------------------------------------------- /Pd/sdtOSC-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 0 24 1059 1016 12; 2 | #X declare -lib SDT; 3 | #X obj 10 540 cnv 32 458 466 empty empty initialize\\\ settings 20 4 | 12 0 14 -228856 -66577 0; 5 | #X obj 464 634 cnv 32 454 372 empty empty empty 20 12 0 14 -228856 6 | -66577 0; 7 | #X obj 10 283 cnv 32 908 251 empty empty impact\\\ settings 20 12 0 8 | 14 -261682 -66577 0; 9 | #X obj 473 500 cnv 64 445 128 empty empty empty 20 12 0 14 -261682 10 | -66577 0; 11 | #X obj 689 12 cnv 32 229 267 empty empty receive\\\ osc\\\ messages 12 | 20 12 0 14 -204800 -66577 0; 13 | #X obj 759 202 sdtOSC; 14 | #X obj 696 144 routeOSC /sdt; 15 | #X obj 758 588 dac~; 16 | #X obj 21 622 loadbang; 17 | #X msg 382 404 stiffness \$1; 18 | #X msg 565 404 dissipation \$1; 19 | #X floatatom 382 368 10 0 0 0 - - -; 20 | #X floatatom 565 368 5 0 0 0 - - -; 21 | #X floatatom 779 368 5 0 0 0 - - -; 22 | #X obj 400 495 impact~ hammerimp objectimp 2; 23 | #X msg 779 404 shape \$1; 24 | #X obj 181 364 r hammerimp; 25 | #X obj 15 457 r objectimp; 26 | #X obj 14 417 inertial hammerimp; 27 | #X obj 15 495 modal objectimp 3 1; 28 | #X obj 289 440 r imp; 29 | #X msg 14 364 strike 0 -3; 30 | #X obj 873 455 bng 32 250 50 0 strike empty Strike! 0 -8 0 10 -262144 31 | -260097 -1; 32 | #X obj 874 492 vsl 30 60 0 1000 0 0 empty volume empty 0 -9 0 10 -262144 33 | -1 -1 0 1; 34 | #X obj 382 332 hsl 128 32 1000 1e+08 1 0 empty stiffness stiffness 35 | -2 -8 0 10 -262144 -1 -1 10160 1; 36 | #X obj 565 332 hsl 128 32 0 40 0 0 empty dissipation dissipation -2 37 | -8 0 10 -262144 -1 -1 317 1; 38 | #X obj 779 332 hsl 128 32 1 4 0 0 empty shape contact\\\ shape -2 -8 39 | 0 10 -262144 -1 -1 2117 1; 40 | #X obj 10 12 cnv 32 674 267 empty empty simulate\\\ an\\\ incoming\\\ sequence\\\ of\\\ osc\\\ messages 41 | 20 12 0 14 -204786 -66577 0; 42 | #X obj 696 68 udpreceive 8080; 43 | #X obj 696 106 unpackOSC; 44 | #X obj 837 105 r osc; 45 | #X obj 786 541 *~ 0; 46 | #X obj 14 327 r strike; 47 | #X msg 21 706 \; hammerimp mass 0.01 \; hammerimp fragmentSize 1 \; 48 | objectimp fragmentSize 1 \; imp contact0 0 \; imp contact1 0 \; stiffness 49 | 1e+07 \; dissipation 1 \; shape 1.5 \;; 50 | #X obj 205 660 del 100; 51 | #X obj 21 660 del 100; 52 | #X msg 392 706 \; volume 0 \;; 53 | #X msg 392 808 \; objectimp freqs 500 1300 1700 \; objectimp decays 54 | 1 0.5 0.25 \; objectimp pickup 0 100 100 100 \; objectimp activeModes 55 | 3 \;; 56 | #X msg 18 38 \; osc /sdt/resonator/frequency objectimp 0 550 \; osc 57 | /sdt/resonator/frequency objectimp 1 560 \; osc /sdt/resonator/frequency 58 | objectimp 2 1100 \; osc /sdt/resonator/decay objectimp 0 2 \; osc /sdt/resonator/decay 59 | objectimp 1 1.5 \; osc /sdt/resonator/decay objectimp 2 1.1 \;; 60 | #X obj 932 18 declare -lib SDT; 61 | #X obj 205 623 r pd-dsp-started; 62 | #X connect 6 0 5 0; 63 | #X connect 8 0 35 0; 64 | #X connect 9 0 14 0; 65 | #X connect 10 0 14 0; 66 | #X connect 11 0 9 0; 67 | #X connect 12 0 10 0; 68 | #X connect 13 0 15 0; 69 | #X connect 14 1 31 0; 70 | #X connect 15 0 14 0; 71 | #X connect 16 0 18 0; 72 | #X connect 17 0 19 0; 73 | #X connect 20 0 14 0; 74 | #X connect 21 0 18 0; 75 | #X connect 23 0 31 1; 76 | #X connect 24 0 11 0; 77 | #X connect 25 0 12 0; 78 | #X connect 26 0 13 0; 79 | #X connect 28 0 29 0; 80 | #X connect 29 0 6 0; 81 | #X connect 30 0 6 0; 82 | #X connect 31 0 7 0; 83 | #X connect 31 0 7 1; 84 | #X connect 32 0 21 0; 85 | #X connect 34 0 36 0; 86 | #X connect 34 0 37 0; 87 | #X connect 35 0 33 0; 88 | #X connect 35 0 36 0; 89 | #X connect 35 0 37 0; 90 | #X connect 40 0 34 0; 91 | -------------------------------------------------------------------------------- /Pd/spectralfeats~-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 219 191 702 286 10; 2 | #X declare -lib SDT; 3 | #X obj 11 98 adc~; 4 | #X floatatom 11 195 6 0 0 0 - - -; 5 | #X floatatom 54 195 6 0 0 0 - - -; 6 | #X floatatom 97 195 6 0 0 0 - - -; 7 | #X floatatom 140 195 6 0 0 0 - - -; 8 | #X floatatom 183 195 6 0 0 0 - - -; 9 | #X obj 11 152 route magnitude centroid spread skewness kurtosis flatness 10 | flux onset; 11 | #X floatatom 226 195 6 0 0 0 - - -; 12 | #X floatatom 269 195 6 0 0 0 - - -; 13 | #X floatatom 312 195 6 0 0 0 - - -; 14 | #X msg 335 8 Sound Design Toolkit \; (C) 2001 - 2024 \; \; Project 15 | SOb - soundobject.org \; Project CLOSED - closed.ircam.fr \; Project 16 | NIW - soundobject.org/niw \; Project SkAT-VG - skatvg.eu; 17 | #X msg 56 98 overlap 0.5; 18 | #X text 163 121 Args: analysis window size; 19 | #X obj 11 121 spectralfeats~ 2048; 20 | #X obj 56 74 loadbang; 21 | #X text 50 4 spectralfeats~ - Spectral features extractor; 22 | #X obj 446 97 declare -lib SDT; 23 | #X connect 0 0 13 0; 24 | #X connect 6 0 1 0; 25 | #X connect 6 1 2 0; 26 | #X connect 6 2 3 0; 27 | #X connect 6 3 4 0; 28 | #X connect 6 4 5 0; 29 | #X connect 6 5 7 0; 30 | #X connect 6 6 8 0; 31 | #X connect 6 7 9 0; 32 | #X connect 11 0 13 0; 33 | #X connect 13 0 6 0; 34 | #X connect 14 0 11 0; 35 | -------------------------------------------------------------------------------- /Pd/windcavity~-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 141 324 563 336 10; 2 | #X declare -lib SDT; 3 | #X obj 39 272 windcavity~; 4 | #X msg 225 241 diameter \$1; 5 | #X msg 139 242 length \$1; 6 | #X obj 39 79 vsl 15 128 0 1 0 0 empty speed empty 0 -9 0 10 -262144 7 | -1 -1 5080 1; 8 | #X floatatom 39 218 5 0 0 0 - - -; 9 | #X obj 225 79 vsl 15 128 0 1 0 0 empty diameter empty 0 -9 0 10 -262144 10 | -1 -1 3175 1; 11 | #X floatatom 225 218 5 0 0 0 - - -; 12 | #X obj 139 79 vsl 15 128 0 1 0 0 empty length empty 0 -9 0 10 -262144 13 | -1 -1 8890 1; 14 | #X floatatom 139 218 5 0 0 0 - - -; 15 | #X text 15 55 Wind speed; 16 | #X text 103 55 Cavity length and diameter (m); 17 | #X obj 39 302 dac~; 18 | #X msg 380 235 \; speed 0.4 \; length 0.7 \; diameter 0.25 \;; 19 | #X text 45 4 windcavity~ - Wind through cavities; 20 | #X msg 328 9 Sound Design Toolkit \; (C) 2001 - 2024 \; \; Project 21 | SOb - soundobject.org \; Project CLOSED - closed.ircam.fr \; Project 22 | NIW - soundobject.org/niw \; Project SkAT-VG - skatvg.eu; 23 | #X obj 441 211 loadbang; 24 | #X obj 438 96 declare -lib SDT; 25 | #X obj 380 190 r pd-dsp-started; 26 | #X connect 0 0 11 0; 27 | #X connect 0 0 11 1; 28 | #X connect 1 0 0 0; 29 | #X connect 2 0 0 0; 30 | #X connect 3 0 4 0; 31 | #X connect 4 0 0 0; 32 | #X connect 5 0 6 0; 33 | #X connect 6 0 1 0; 34 | #X connect 7 0 8 0; 35 | #X connect 8 0 2 0; 36 | #X connect 15 0 12 0; 37 | #X connect 17 0 12 0; 38 | -------------------------------------------------------------------------------- /Pd/windflow~-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 189 484 525 287 10; 2 | #X declare -lib SDT; 3 | #X obj 114 67 vsl 15 128 0 1 0 0 empty speed empty 0 -9 0 10 -262144 4 | -1 -1 5080 1; 5 | #X floatatom 114 206 5 0 0 0 - - -; 6 | #X text 90 43 Wind speed; 7 | #X obj 114 260 dac~; 8 | #X msg 294 9 Sound Design Toolkit \; (C) 2001 - 2024 \; \; Project 9 | SOb - soundobject.org \; Project CLOSED - closed.ircam.fr \; Project 10 | NIW - soundobject.org/niw \; Project SkAT-VG - skatvg.eu; 11 | #X text 11 4 windflow~ - Wind against solid surfaces; 12 | #X msg 338 199 \; speed 0.4 \;; 13 | #X obj 114 230 windflow~; 14 | #X obj 356 177 loadbang; 15 | #X obj 403 98 declare -lib SDT; 16 | #X obj 338 155 r pd-dsp-started; 17 | #X connect 0 0 1 0; 18 | #X connect 1 0 7 0; 19 | #X connect 7 0 3 0; 20 | #X connect 7 0 3 1; 21 | #X connect 8 0 6 0; 22 | #X connect 10 0 6 0; 23 | -------------------------------------------------------------------------------- /Pd/windkarman~-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 141 324 553 354 10; 2 | #X declare -lib SDT; 3 | #X msg 155 261 diameter \$1; 4 | #X obj 39 79 vsl 15 128 0 1 0 0 empty speed empty 0 -9 0 10 -262144 5 | -1 -1 5080 1; 6 | #X floatatom 39 218 5 0 0 0 - - -; 7 | #X obj 155 79 vsl 15 128 0 40 0 0 empty diameter empty 0 -9 0 10 -262144 8 | -1 -1 1587 1; 9 | #X floatatom 155 218 5 0 0 0 - - -; 10 | #X text 15 55 Wind speed; 11 | #X obj 39 322 dac~; 12 | #X msg 328 9 Sound Design Toolkit \; (C) 2001 - 2024 \; \; Project 13 | SOb - soundobject.org \; Project CLOSED - closed.ircam.fr \; Project 14 | NIW - soundobject.org/niw \; Project SkAT-VG - skatvg.eu; 15 | #X obj 378 170 loadbang; 16 | #X text 103 55 Object diameter (mm); 17 | #X obj 155 238 * 0.001; 18 | #X msg 320 192 \; speed 0.4 \; diameter 5 \;; 19 | #X text 23 4 windkarman~ - Wind across thin objects; 20 | #X obj 39 292 windkarman~; 21 | #X obj 436 98 declare -lib SDT; 22 | #X obj 320 149 r pd-dsp-started; 23 | #X connect 0 0 13 0; 24 | #X connect 1 0 2 0; 25 | #X connect 2 0 13 0; 26 | #X connect 3 0 4 0; 27 | #X connect 4 0 10 0; 28 | #X connect 8 0 11 0; 29 | #X connect 10 0 0 0; 30 | #X connect 13 0 6 0; 31 | #X connect 13 0 6 1; 32 | #X connect 15 0 11 0; 33 | -------------------------------------------------------------------------------- /Pd/zerox~-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 523 170 539 168 10; 2 | #X declare -lib SDT; 3 | #X floatatom 13 114 5 0 0 0 - - -; 4 | #X obj 13 64 adc~; 5 | #X msg 51 64 overlap 0.5; 6 | #X msg 306 8 Sound Design Toolkit \; (C) 2001 - 2024 \; \; Project 7 | SOb - soundobject.org \; Project CLOSED - closed.ircam.fr \; Project 8 | NIW - soundobject.org/niw \; Project SkAT-VG - skatvg.eu; 9 | #X text 12 6 zerox~ - Zero crossing rate detector; 10 | #X text 11 132 Normalized zero crossing rate [0 \, 1]; 11 | #X obj 13 89 zerox~ 2048; 12 | #X obj 51 40 loadbang; 13 | #X text 118 88 Args: analysis window size; 14 | #X obj 415 96 declare -lib SDT; 15 | #X connect 1 0 6 0; 16 | #X connect 2 0 6 0; 17 | #X connect 6 0 0 0; 18 | #X connect 7 0 2 0; 19 | -------------------------------------------------------------------------------- /src/Max/SDTCommonMax.c: -------------------------------------------------------------------------------- 1 | #include "SDTCommonMax.h" 2 | 3 | #include "SDT/SDTCommon.h" 4 | #include "SDT/SDTCommonMacros.h" 5 | #include "ext.h" 6 | 7 | static char _SDT_logBufferMax[MAXSDTMAXSTRING]; 8 | 9 | static int _SDT_maxPost(void (*post_fn)(C74_CONST char* s, ...), 10 | unsigned char cprint, const char* fmt, va_list args) { 11 | int n = 12 | vsnprintf(_SDT_logBufferMax, sizeof(char) * MAXSDTMAXSTRING, fmt, args); 13 | int s_len = strlen(_SDT_logBufferMax); 14 | if (_SDT_logBufferMax[s_len - 1] == '\n') _SDT_logBufferMax[s_len - 1] = 0; 15 | post_fn("%s\n", _SDT_logBufferMax); 16 | if (cprint) { 17 | printf("%s\n", _SDT_logBufferMax); 18 | } 19 | return n; 20 | } 21 | 22 | int SDT_maxCPost(const char* fmt, ...) { 23 | va_list args; 24 | va_start(args, fmt); 25 | int n = _SDT_maxPost(&cpost, 0, fmt, args); 26 | va_end(args); 27 | return n; 28 | } 29 | 30 | int SDT_maxPost(const char* fmt, ...) { 31 | va_list args; 32 | va_start(args, fmt); 33 | int n = _SDT_maxPost(&post, 1, fmt, args); 34 | va_end(args); 35 | return n; 36 | } 37 | 38 | int SDT_maxError(const char* fmt, ...) { 39 | va_list args; 40 | va_start(args, fmt); 41 | int n = _SDT_maxPost(&error, 1, fmt, args); 42 | va_end(args); 43 | return n; 44 | } 45 | 46 | void SDT_setupMaxLoggers() { 47 | // Only set-up once 48 | int newline = 0; 49 | SDT_getLogger(SDT_LOG_LEVEL_ERROR, &newline); 50 | if (!newline) { 51 | // Everything on Max console (can't see stdout) 52 | SDT_setLogger(SDT_LOG_LEVEL_VERBOSE, &SDT_maxPost, 1); 53 | SDT_setLogger(SDT_LOG_LEVEL_DEBUG, &SDT_maxPost, 1); 54 | SDT_setLogger(SDT_LOG_LEVEL_INFO, &SDT_maxPost, 1); 55 | SDT_setLogger(SDT_LOG_LEVEL_WARN, &SDT_maxError, 1); 56 | SDT_setLogger(SDT_LOG_LEVEL_ERROR, &SDT_maxError, 1); 57 | #ifdef SDT_DEBUG 58 | if (SDT_LOG_LEVEL_DEBUG <= SDT_getLogLevelFromEnv()) { 59 | int (*log)(const char*, ...) = 60 | SDT_getLogger(SDT_LOG_LEVEL_DEBUG, &newline); 61 | log("SDT version %s, (C) 2001 - 2024%s", STRINGIFY(SDT_ver), 62 | (newline) ? "" : "\n"); 63 | #ifdef SDT_MAX_ver 64 | log("SDT for Max version %s, (C) 2001 - 2024%s", STRINGIFY(SDT_MAX_ver), 65 | (newline) ? "" : "\n"); 66 | #endif 67 | } 68 | #endif 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/Max/SDT_fileusage.c: -------------------------------------------------------------------------------- 1 | #include "SDT_fileusage.h" 2 | #include "SDT/SDTCommonMacros.h" 3 | 4 | #ifndef SDT_MAX_PACKNAME 5 | #error SDT Max Package name is undefined. \ 6 | Please, Specify the name as a gcc argument: \ 7 | -DSDT_MAX_PACKNAME= 8 | #endif 9 | 10 | void SDT_fileusage(t_object *x, void *w) { 11 | fileusage_addpackage(w, STRINGIFY(SDT_MAX_PACKNAME), NULL); 12 | } 13 | -------------------------------------------------------------------------------- /src/Max/SDT_fileusage.h: -------------------------------------------------------------------------------- 1 | #include "ext.h" 2 | 3 | #ifndef SDT_FILEUSAGE_H 4 | #define SDT_FILEUSAGE_H 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | extern void SDT_fileusage(t_object *x, void *w); 11 | 12 | #ifdef __cplusplus 13 | }; 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/Max/sdt.OSC.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "SDT/OSC/SDTOSC.h" 4 | #include "SDTCommonMax.h" 5 | #include "SDT_fileusage.h" 6 | #include "ext.h" 7 | #include "ext_obex.h" 8 | #include "z_dsp.h" 9 | 10 | static t_class *sdt_osc_class = NULL; 11 | 12 | typedef struct _sdt_osc { 13 | t_pxobject obj; 14 | } t_sdt_osc; 15 | 16 | SDTOSCArgument *max_arg_to_sdt(t_atom *x) { 17 | if (x->a_type == A_FLOAT) return SDTOSCArgument_newFloat(atom_getfloat(x)); 18 | 19 | if (x->a_type == A_LONG) 20 | return SDTOSCArgument_newFloat((float)atom_getlong(x)); 21 | 22 | if (x->a_type == A_SYM) 23 | return SDTOSCArgument_newString(atom_getsym(x)->s_name); 24 | 25 | return SDTOSCArgument_new(); 26 | } 27 | 28 | SDTOSCMessage *max_args_to_sdt(t_symbol *s, long argc, t_atom *argv) { 29 | SDTOSCArgumentList *a = SDTOSCArgumentList_new(argc); 30 | for (unsigned int i = 0; i < argc; ++i) 31 | SDTOSCArgumentList_setArgument(a, i, max_arg_to_sdt(argv + i)); 32 | return SDTOSCMessage_new(SDTOSCAddress_new(s->s_name), a); 33 | } 34 | 35 | void sdt_osc_root(t_sdt_osc *x, t_symbol *s, long argc, t_atom *argv) { 36 | SDTOSCMessage *m = max_args_to_sdt(s, argc, argv); 37 | SDTOSCRoot(m); 38 | SDTOSCMessage_free(m); 39 | } 40 | 41 | void *sdt_osc_new(void) { 42 | SDT_setupMaxLoggers(); 43 | t_sdt_osc *x = (t_sdt_osc *)object_alloc(sdt_osc_class); 44 | 45 | return (void *)x; 46 | } 47 | 48 | void sdt_osc_free(t_sdt_osc *x) { ; } 49 | 50 | void C74_EXPORT ext_main(void *r) { 51 | t_class *c = class_new("sdt.OSC", (method)sdt_osc_new, (method)sdt_osc_free, 52 | (long)sizeof(t_sdt_osc), 0L, 0); 53 | 54 | class_addmethod(c, (method)sdt_osc_root, "anything", A_GIMME, 0); 55 | class_register(CLASS_BOX, c); 56 | 57 | sdt_osc_class = c; 58 | } 59 | -------------------------------------------------------------------------------- /src/Max/sdt.envelope~.c: -------------------------------------------------------------------------------- 1 | #include "SDT/SDTCommon.h" 2 | #include "SDT/SDTFilters.h" 3 | #include "SDTCommonMax.h" 4 | #include "SDT_fileusage.h" 5 | #include "ext.h" 6 | #include "ext_obex.h" 7 | #include "z_dsp.h" 8 | 9 | typedef struct _envelope { 10 | t_pxobject ob; 11 | SDTEnvelope *envelope; 12 | t_symbol *key; 13 | } t_envelope; 14 | 15 | static t_class *envelope_class = NULL; 16 | 17 | void *envelope_new(t_symbol *s, long argc, t_atom *argv) { 18 | SDT_setupMaxLoggers(); 19 | t_envelope *x; 20 | 21 | x = (t_envelope *)object_alloc(envelope_class); 22 | if (x) { 23 | dsp_setup((t_pxobject *)x, 1); 24 | outlet_new(x, "signal"); 25 | x->envelope = SDTEnvelope_new(); 26 | x->key = 0; 27 | attr_args_process(x, argc, argv); 28 | } 29 | return (x); 30 | } 31 | 32 | void envelope_free(t_envelope *x) { 33 | dsp_free((t_pxobject *)x); 34 | SDT_MAX_FREE(Envelope, envelope) 35 | } 36 | 37 | void envelope_assist(t_envelope *x, void *b, long m, long a, char *s) { 38 | if (m == ASSIST_INLET) { 39 | sprintf(s, 40 | "(signal): Input\n" 41 | "Object attributes and messages (see help patch)"); 42 | } else { 43 | sprintf(s, "(signal): Amplitude envelope"); 44 | } 45 | } 46 | 47 | SDT_MAX_KEY(envelope, Envelope, envelope, "envelope~", "envelope filter") 48 | 49 | // Attack and release to ms for backwards compatibility 50 | SDT_MAX_ACCESSORS(envelope, Envelope, envelope, Attack, float, 1000.0, ) 51 | SDT_MAX_ACCESSORS(envelope, Envelope, envelope, Release, float, 1000.0, ) 52 | 53 | t_int *envelope_perform(t_int *w) { 54 | t_envelope *x = (t_envelope *)(w[1]); 55 | t_float *in = (t_float *)(w[2]); 56 | t_float *out = (t_float *)(w[3]); 57 | int n = (int)w[4]; 58 | 59 | while (n--) { 60 | *out++ = (float)SDTEnvelope_dsp(x->envelope, *in++); 61 | } 62 | return w + 5; 63 | } 64 | 65 | void envelope_dsp(t_envelope *x, t_signal **sp, short *count) { 66 | SDT_setSampleRate(sp[0]->s_sr); 67 | dsp_add(envelope_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); 68 | } 69 | 70 | void envelope_perform64(t_envelope *x, t_object *dsp64, double **ins, 71 | long numins, double **outs, long numouts, 72 | long sampleframes, long flags, void *userparam) { 73 | t_double *in = ins[0]; 74 | t_double *out = outs[0]; 75 | int n = sampleframes; 76 | 77 | while (n--) { 78 | *out++ = SDTEnvelope_dsp(x->envelope, *in++); 79 | } 80 | } 81 | 82 | void envelope_dsp64(t_envelope *x, t_object *dsp64, short *count, 83 | double samplerate, long maxvectorsize, long flags) { 84 | SDT_setSampleRate(samplerate); 85 | object_method(dsp64, gensym("dsp_add64"), x, envelope_perform64, 0, NULL); 86 | } 87 | 88 | void C74_EXPORT ext_main(void *r) { 89 | t_class *c = 90 | class_new("sdt.envelope~", (method)envelope_new, (method)envelope_free, 91 | (long)sizeof(t_envelope), 0L, A_GIMME, 0); 92 | class_addmethod(c, (method)envelope_dsp, "dsp", A_CANT, 0); 93 | class_addmethod(c, (method)envelope_dsp64, "dsp64", A_CANT, 0); 94 | class_addmethod(c, (method)envelope_assist, "assist", A_CANT, 0); 95 | class_addmethod(c, (method)SDT_fileusage, "fileusage", A_CANT, 0L); 96 | 97 | SDT_CLASS_KEY(envelope, "1") 98 | 99 | SDT_MAX_ATTRIBUTE(c, envelope, Attack, attack, float64, 0); 100 | SDT_MAX_ATTRIBUTE(c, envelope, Release, release, float64, 0); 101 | 102 | CLASS_ATTR_FILTER_MIN(c, "attack", 0.0); 103 | CLASS_ATTR_FILTER_MIN(c, "release", 0.0); 104 | 105 | CLASS_ATTR_ORDER(c, "attack", 0, "2"); 106 | CLASS_ATTR_ORDER(c, "release", 0, "3"); 107 | 108 | class_dspinit(c); 109 | class_register(CLASS_BOX, c); 110 | envelope_class = c; 111 | } 112 | -------------------------------------------------------------------------------- /src/Max/sdt.windflow~.c: -------------------------------------------------------------------------------- 1 | #include "SDT/SDTCommon.h" 2 | #include "SDT/SDTGases.h" 3 | #include "SDTCommonMax.h" 4 | #include "SDT_fileusage.h" 5 | #include "ext.h" 6 | #include "ext_obex.h" 7 | #include "z_dsp.h" 8 | 9 | typedef struct _windflow { 10 | t_pxobject ob; 11 | SDTWindFlow *flow; 12 | t_symbol *key; 13 | } t_windflow; 14 | 15 | static t_class *windflow_class = NULL; 16 | 17 | void *windflow_new(t_symbol *s, long argc, t_atom *argv) { 18 | SDT_setupMaxLoggers(); 19 | t_windflow *x = (t_windflow *)object_alloc(windflow_class); 20 | 21 | if (x) { 22 | dsp_setup((t_pxobject *)x, 1); 23 | outlet_new(x, "signal"); 24 | x->flow = SDTWindFlow_new(); 25 | x->key = 0; 26 | attr_args_process(x, argc, argv); 27 | } 28 | return (x); 29 | } 30 | 31 | void windflow_free(t_windflow *x) { 32 | dsp_free((t_pxobject *)x); 33 | SDT_MAX_FREE(WindFlow, flow) 34 | } 35 | 36 | void windflow_assist(t_windflow *x, void *b, long m, long a, char *s) { 37 | if (m == ASSIST_INLET) { 38 | sprintf(s, "(signal): Wind speed [0.0 ~ 1.0]"); 39 | } else { 40 | sprintf(s, "(signal): Output sound"); 41 | } 42 | } 43 | 44 | SDT_MAX_KEY(windflow, WindFlow, flow, "windflow~", "wind flow") 45 | 46 | t_int *windflow_perform(t_int *w) { 47 | t_windflow *x = (t_windflow *)(w[1]); 48 | t_float *inL = (t_float *)(w[2]); 49 | t_float *outL = (t_float *)(w[3]); 50 | int n = (int)w[4]; 51 | 52 | while (n--) { 53 | SDTWindFlow_setWindSpeed(x->flow, *inL++); 54 | *outL++ = (float)SDTWindFlow_dsp(x->flow); 55 | } 56 | 57 | return w + 5; 58 | } 59 | 60 | void windflow_dsp(t_windflow *x, t_signal **sp, short *count) { 61 | SDT_setSampleRate(sp[0]->s_sr); 62 | SDTWindFlow_update(x->flow); 63 | dsp_add(windflow_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); 64 | } 65 | 66 | void windflow_perform64(t_windflow *x, t_object *dsp64, double **ins, 67 | long numins, double **outs, long numouts, 68 | long sampleframes, long flags, void *userparam) { 69 | t_double *inL = ins[0]; 70 | t_double *outL = outs[0]; 71 | int n = sampleframes; 72 | 73 | while (n--) { 74 | SDTWindFlow_setWindSpeed(x->flow, *inL++); 75 | *outL++ = SDTWindFlow_dsp(x->flow); 76 | } 77 | } 78 | 79 | void windflow_dsp64(t_windflow *x, t_object *dsp64, short *count, 80 | double samplerate, long maxvectorsize, long flags) { 81 | SDT_setSampleRate(samplerate); 82 | SDTWindFlow_update(x->flow); 83 | object_method(dsp64, gensym("dsp_add64"), x, windflow_perform64, 0, NULL); 84 | } 85 | 86 | void C74_EXPORT ext_main(void *r) { 87 | t_class *c = 88 | class_new("sdt.windflow~", (method)windflow_new, (method)windflow_free, 89 | (long)sizeof(t_windflow), 0L, A_GIMME, 0); 90 | 91 | class_addmethod(c, (method)windflow_dsp, "dsp", A_CANT, 0); 92 | class_addmethod(c, (method)windflow_dsp64, "dsp64", A_CANT, 0); 93 | class_addmethod(c, (method)windflow_assist, "assist", A_CANT, 0); 94 | class_addmethod(c, (method)SDT_fileusage, "fileusage", A_CANT, 0L); 95 | 96 | SDT_CLASS_KEY(windflow, "1") 97 | 98 | class_dspinit(c); 99 | class_register(CLASS_BOX, c); 100 | windflow_class = c; 101 | } -------------------------------------------------------------------------------- /src/Max/sdt.windkarman~.c: -------------------------------------------------------------------------------- 1 | #include "SDT/SDTCommon.h" 2 | #include "SDT/SDTGases.h" 3 | #include "SDTCommonMax.h" 4 | #include "SDT_fileusage.h" 5 | #include "ext.h" 6 | #include "ext_obex.h" 7 | #include "z_dsp.h" 8 | 9 | typedef struct _windkarman { 10 | t_pxobject ob; 11 | SDTWindKarman *karman; 12 | t_symbol *key; 13 | } t_windkarman; 14 | 15 | static t_class *windkarman_class = NULL; 16 | 17 | void *windkarman_new(t_symbol *s, long argc, t_atom *argv) { 18 | SDT_setupMaxLoggers(); 19 | t_windkarman *x = (t_windkarman *)object_alloc(windkarman_class); 20 | 21 | if (x) { 22 | dsp_setup((t_pxobject *)x, 1); 23 | outlet_new(x, "signal"); 24 | x->karman = SDTWindKarman_new(); 25 | x->key = 0; 26 | attr_args_process(x, argc, argv); 27 | } 28 | return (x); 29 | } 30 | 31 | void windkarman_free(t_windkarman *x) { 32 | dsp_free((t_pxobject *)x); 33 | SDT_MAX_FREE(WindKarman, karman) 34 | } 35 | 36 | void windkarman_assist(t_windkarman *x, void *b, long m, long a, char *s) { 37 | if (m == ASSIST_INLET) { // inlet 38 | sprintf(s, 39 | "(signal): Wind speed [0.0 ~ 1.0]\n" 40 | "Object attributes and messages (see help patch)"); 41 | } else { 42 | sprintf(s, "(signal): Output sound"); 43 | } 44 | } 45 | 46 | SDT_MAX_KEY(windkarman, WindKarman, karman, "windkarman~", "wind Karman") 47 | 48 | SDT_MAX_ACCESSORS(windkarman, WindKarman, karman, Diameter, float, 1000.0, ) 49 | 50 | t_int *windkarman_perform(t_int *w) { 51 | t_windkarman *x = (t_windkarman *)(w[1]); 52 | t_float *inL = (t_float *)(w[2]); 53 | t_float *outL = (t_float *)(w[3]); 54 | int n = (int)w[4]; 55 | 56 | while (n--) { 57 | SDTWindKarman_setWindSpeed(x->karman, *inL++); 58 | *outL++ = (float)SDTWindKarman_dsp(x->karman); 59 | } 60 | 61 | return w + 5; 62 | } 63 | 64 | void windkarman_dsp(t_windkarman *x, t_signal **sp, short *count) { 65 | SDT_setSampleRate(sp[0]->s_sr); 66 | dsp_add(windkarman_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); 67 | } 68 | 69 | void windkarman_perform64(t_windkarman *x, t_object *dsp64, double **ins, 70 | long numins, double **outs, long numouts, 71 | long sampleframes, long flags, void *userparam) { 72 | t_double *inL = ins[0]; 73 | t_double *outL = outs[0]; 74 | int n = sampleframes; 75 | 76 | while (n--) { 77 | SDTWindKarman_setWindSpeed(x->karman, *inL++); 78 | *outL++ = SDTWindKarman_dsp(x->karman); 79 | } 80 | } 81 | 82 | void windkarman_dsp64(t_windkarman *x, t_object *dsp64, short *count, 83 | double samplerate, long maxvectorsize, long flags) { 84 | SDT_setSampleRate(samplerate); 85 | object_method(dsp64, gensym("dsp_add64"), x, windkarman_perform64, 0, NULL); 86 | } 87 | 88 | void C74_EXPORT ext_main(void *r) { 89 | t_class *c = class_new("sdt.windkarman~", (method)windkarman_new, 90 | (method)windkarman_free, (long)sizeof(t_windkarman), 91 | 0L, A_GIMME, 0); 92 | 93 | class_addmethod(c, (method)windkarman_dsp, "dsp", A_CANT, 0); 94 | class_addmethod(c, (method)windkarman_dsp64, "dsp64", A_CANT, 0); 95 | class_addmethod(c, (method)windkarman_assist, "assist", A_CANT, 0); 96 | class_addmethod(c, (method)SDT_fileusage, "fileusage", A_CANT, 0L); 97 | 98 | SDT_CLASS_KEY(windkarman, "1") 99 | 100 | SDT_MAX_ATTRIBUTE(c, windkarman, Diameter, diameter, float64, 0); 101 | 102 | CLASS_ATTR_FILTER_MIN(c, "diameter", 0.001); 103 | 104 | class_dspinit(c); 105 | class_register(CLASS_BOX, c); 106 | windkarman_class = c; 107 | } 108 | -------------------------------------------------------------------------------- /src/Pd/SDTCommonPd.c: -------------------------------------------------------------------------------- 1 | #include "SDTCommonPd.h" 2 | #include 3 | 4 | long sdt_pd_arg_parse(t_symbol *s, long argc, const t_atom *argv, long nargs, 5 | const t_atomtype *targs, long *argi) { 6 | char *selected = calloc(argc, sizeof(char)); 7 | for (long i = 0; i < nargs; ++i) { 8 | argi[i] = -1; 9 | for (long j = 0; j < argc; ++j) 10 | if (!selected[j] && argv[j].a_type == targs[i]) { 11 | argi[i] = j; 12 | selected[j] = 1; 13 | break; 14 | } 15 | } 16 | long i = -1; 17 | for (long j = 0; j < argc; ++j) 18 | if (!selected[j]) { 19 | i = j; 20 | break; 21 | } 22 | free(selected); 23 | return i; 24 | } -------------------------------------------------------------------------------- /src/Pd/bouncing~.c: -------------------------------------------------------------------------------- 1 | #include "SDT/SDTCommon.h" 2 | #include "SDT/SDTControl.h" 3 | #include "SDTCommonPd.h" 4 | #ifdef NT 5 | #pragma warning(disable : 4244) 6 | #pragma warning(disable : 4305) 7 | #endif 8 | 9 | static t_class *bouncing_class; 10 | 11 | typedef struct _bouncing { 12 | t_object obj; 13 | SDTBouncing *bouncing; 14 | t_outlet *out; 15 | const char *key; 16 | } t_bouncing; 17 | 18 | void bouncing_bang(t_bouncing *x) { SDTBouncing_reset(x->bouncing); } 19 | 20 | SDT_PD_SETTER(bouncing, Bouncing, bouncing, Restitution, ) 21 | SDT_PD_SETTER(bouncing, Bouncing, bouncing, Height, ) 22 | SDT_PD_SETTER(bouncing, Bouncing, bouncing, Irregularity, ) 23 | 24 | t_int *bouncing_perform(t_int *w) { 25 | t_bouncing *x = (t_bouncing *)(w[1]); 26 | t_float *out = (t_float *)(w[2]); 27 | int n = (int)w[3]; 28 | 29 | while (n--) { 30 | *out++ = (t_float)SDTBouncing_dsp(x->bouncing); 31 | } 32 | return w + 4; 33 | } 34 | 35 | void bouncing_dsp(t_bouncing *x, t_signal **sp) { 36 | SDT_setSampleRate(sp[0]->s_sr); 37 | dsp_add(bouncing_perform, 3, x, sp[0]->s_vec, sp[0]->s_n); 38 | } 39 | 40 | void *bouncing_new(t_symbol *s, long argc, t_atom *argv) { 41 | SDT_PD_ARG_PARSE(1, A_SYMBOL) 42 | 43 | t_bouncing *x = (t_bouncing *)pd_new(bouncing_class); 44 | x->bouncing = SDTBouncing_new(); 45 | 46 | SDT_PD_REGISTER(Bouncing, bouncing, "bouncing process", 0) 47 | 48 | x->out = outlet_new(&x->obj, gensym("signal")); 49 | return x; 50 | } 51 | 52 | void bouncing_free(t_bouncing *x) { 53 | SDT_PD_FREE(Bouncing, bouncing) 54 | outlet_free(x->out); 55 | } 56 | 57 | void bouncing_tilde_setup(void) { 58 | bouncing_class = class_new(gensym("bouncing~"), (t_newmethod)bouncing_new, 59 | (t_method)bouncing_free, (long)sizeof(t_bouncing), 60 | CLASS_DEFAULT, A_GIMME, 0); 61 | class_addmethod(bouncing_class, (t_method)bouncing_bang, gensym("bang"), 0); 62 | class_addmethod(bouncing_class, (t_method)bouncing_setRestitution, 63 | gensym("restitution"), A_FLOAT, 0); 64 | class_addmethod(bouncing_class, (t_method)bouncing_setHeight, 65 | gensym("height"), A_FLOAT, 0); 66 | class_addmethod(bouncing_class, (t_method)bouncing_setIrregularity, 67 | gensym("irregularity"), A_FLOAT, 0); 68 | class_addmethod(bouncing_class, (t_method)bouncing_dsp, gensym("dsp"), 0); 69 | } 70 | -------------------------------------------------------------------------------- /src/Pd/breaking~.c: -------------------------------------------------------------------------------- 1 | #include "SDT/SDTCommon.h" 2 | #include "SDT/SDTControl.h" 3 | #include "SDTCommonPd.h" 4 | #ifdef NT 5 | #pragma warning(disable : 4244) 6 | #pragma warning(disable : 4305) 7 | #endif 8 | 9 | static t_class *breaking_class; 10 | 11 | typedef struct _breaking { 12 | t_object obj; 13 | SDTBreaking *breaking; 14 | t_outlet *out0, *out1; 15 | const char *key; 16 | } t_breaking; 17 | 18 | void breaking_bang(t_breaking *x) { SDTBreaking_reset(x->breaking); } 19 | 20 | SDT_PD_SETTER(breaking, Breaking, breaking, StoredEnergy, ) 21 | SDT_PD_SETTER(breaking, Breaking, breaking, CrushingEnergy, ) 22 | SDT_PD_SETTER(breaking, Breaking, breaking, Granularity, ) 23 | SDT_PD_SETTER(breaking, Breaking, breaking, Fragmentation, ) 24 | 25 | t_int *breaking_perform(t_int *w) { 26 | t_breaking *x = (t_breaking *)(w[1]); 27 | t_float *out0 = (t_float *)(w[2]); 28 | t_float *out1 = (t_float *)(w[3]); 29 | int n = (int)w[4]; 30 | double tmpOuts[2]; 31 | 32 | while (n--) { 33 | SDTBreaking_dsp(x->breaking, tmpOuts); 34 | *out0++ = (t_float)tmpOuts[0]; 35 | *out1++ = (t_float)tmpOuts[1]; 36 | } 37 | return w + 5; 38 | } 39 | 40 | void breaking_dsp(t_breaking *x, t_signal **sp) { 41 | SDT_setSampleRate(sp[0]->s_sr); 42 | dsp_add(breaking_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); 43 | } 44 | 45 | void *breaking_new(t_symbol *s, long argc, t_atom *argv) { 46 | SDT_PD_ARG_PARSE(1, A_SYMBOL) 47 | 48 | t_breaking *x = (t_breaking *)pd_new(breaking_class); 49 | x->breaking = SDTBreaking_new(); 50 | 51 | SDT_PD_REGISTER(Breaking, breaking, "breaking process", 0) 52 | 53 | x->out0 = outlet_new(&x->obj, gensym("signal")); 54 | x->out1 = outlet_new(&x->obj, gensym("signal")); 55 | return x; 56 | } 57 | 58 | void breaking_free(t_breaking *x) { 59 | SDT_PD_FREE(Breaking, breaking) 60 | outlet_free(x->out0); 61 | outlet_free(x->out1); 62 | } 63 | 64 | void breaking_tilde_setup(void) { 65 | breaking_class = class_new(gensym("breaking~"), (t_newmethod)breaking_new, 66 | (t_method)breaking_free, (long)sizeof(t_breaking), 67 | CLASS_DEFAULT, A_GIMME, 0); 68 | class_addmethod(breaking_class, (t_method)breaking_bang, gensym("bang"), 0); 69 | class_addmethod(breaking_class, (t_method)breaking_setStoredEnergy, 70 | gensym("storedEnergy"), A_FLOAT, 0); 71 | class_addmethod(breaking_class, (t_method)breaking_setCrushingEnergy, 72 | gensym("crushingEnergy"), A_FLOAT, 0); 73 | class_addmethod(breaking_class, (t_method)breaking_setGranularity, 74 | gensym("granularity"), A_FLOAT, 0); 75 | class_addmethod(breaking_class, (t_method)breaking_setFragmentation, 76 | gensym("fragmentation"), A_FLOAT, 0); 77 | class_addmethod(breaking_class, (t_method)breaking_dsp, gensym("dsp"), 0); 78 | } 79 | -------------------------------------------------------------------------------- /src/Pd/bubble~.c: -------------------------------------------------------------------------------- 1 | /** \file bubble~.c 2 | * Puredata external for the generation of single bubbles. 3 | * 4 | * \author Stefano Baldan (stefanobaldan@iuav.it) 5 | * 6 | *****************************************************************************/ 7 | 8 | #include "SDT/SDTCommon.h" 9 | #include "SDT/SDTLiquids.h" 10 | #include "SDTCommonPd.h" 11 | #ifdef NT 12 | #pragma warning(disable : 4244) 13 | #pragma warning(disable : 4305) 14 | #endif 15 | 16 | static t_class *bubble_class; 17 | 18 | typedef struct _bubble { 19 | t_object obj; 20 | SDTBubble *bubble; 21 | t_outlet *out; 22 | const char *key; 23 | } t_bubble; 24 | 25 | void bubble_bang(t_bubble *x) { 26 | SDTBubble_trigger(x->bubble); 27 | // Do not normalize w.r.t. radius and depth 28 | SDTBubble_normAmp(x->bubble); 29 | } 30 | 31 | SDT_PD_SETTER(bubble, Bubble, bubble, Radius, ) 32 | SDT_PD_SETTER(bubble, Bubble, bubble, RiseFactor, ) 33 | // SDT_PD_SETTER(bubble, Bubble, bubble, Depth, ) // Unused 34 | 35 | static t_int *bubble_perform(t_int *w) { 36 | t_bubble *x = (t_bubble *)(w[1]); 37 | t_float *out = (t_float *)(w[2]); 38 | int n = (int)(w[3]); 39 | while (n--) { 40 | *out++ = (float)SDTBubble_dsp(x->bubble); 41 | } 42 | return (w + 4); 43 | } 44 | 45 | static void bubble_dsp(t_bubble *x, t_signal **sp) { 46 | SDT_setSampleRate(sp[0]->s_sr); 47 | dsp_add(bubble_perform, 3, x, sp[0]->s_vec, sp[0]->s_n); 48 | } 49 | 50 | static void *bubble_new(t_symbol *s, int argc, t_atom *argv) { 51 | SDT_PD_ARG_PARSE(1, A_SYMBOL) 52 | 53 | t_bubble *x = (t_bubble *)pd_new(bubble_class); 54 | x->bubble = SDTBubble_new(); 55 | 56 | SDT_PD_REGISTER(Bubble, bubble, "bubble", 0) 57 | 58 | x->out = outlet_new(&x->obj, gensym("signal")); 59 | return (x); 60 | } 61 | 62 | static void bubble_free(t_bubble *x) { 63 | outlet_free(x->out); 64 | SDT_PD_FREE(Bubble, bubble) 65 | } 66 | 67 | void bubble_tilde_setup(void) { 68 | bubble_class = class_new(gensym("bubble~"), (t_newmethod)bubble_new, 69 | (t_method)bubble_free, sizeof(t_bubble), 70 | CLASS_DEFAULT, A_GIMME, 0); 71 | class_addmethod(bubble_class, (t_method)bubble_bang, gensym("bang"), 0); 72 | class_addmethod(bubble_class, (t_method)bubble_setRadius, gensym("radius"), 73 | A_FLOAT, 0); 74 | class_addmethod(bubble_class, (t_method)bubble_setRiseFactor, 75 | gensym("riseFactor"), A_FLOAT, 0); 76 | // class_addmethod(bubble_class, (t_method)bubble_setDepth, gensym("depth"), 77 | // A_FLOAT, 0); // Unused 78 | class_addmethod(bubble_class, (t_method)bubble_dsp, gensym("dsp"), 0); 79 | } 80 | -------------------------------------------------------------------------------- /src/Pd/crumpling~.c: -------------------------------------------------------------------------------- 1 | #include "SDT/SDTCommon.h" 2 | #include "SDT/SDTControl.h" 3 | #include "SDTCommonPd.h" 4 | #ifdef NT 5 | #pragma warning(disable : 4244) 6 | #pragma warning(disable : 4305) 7 | #endif 8 | 9 | static t_class *crumpling_class; 10 | 11 | typedef struct _crumpling { 12 | t_object obj; 13 | SDTCrumpling *crumpling; 14 | t_outlet *out0, *out1; 15 | const char *key; 16 | } t_crumpling; 17 | 18 | SDT_PD_SETTER(crumpling, Crumpling, crumpling, CrushingEnergy, ) 19 | SDT_PD_SETTER(crumpling, Crumpling, crumpling, Granularity, ) 20 | SDT_PD_SETTER(crumpling, Crumpling, crumpling, Fragmentation, ) 21 | 22 | t_int *crumpling_perform(t_int *w) { 23 | t_crumpling *x = (t_crumpling *)(w[1]); 24 | t_float *out0 = (t_float *)(w[2]); 25 | t_float *out1 = (t_float *)(w[3]); 26 | int n = (int)w[4]; 27 | double tmpOuts[2]; 28 | 29 | while (n--) { 30 | SDTCrumpling_dsp(x->crumpling, tmpOuts); 31 | *out0++ = (t_float)tmpOuts[0]; 32 | *out1++ = (t_float)tmpOuts[1]; 33 | } 34 | return w + 5; 35 | } 36 | 37 | void crumpling_dsp(t_crumpling *x, t_signal **sp) { 38 | SDT_setSampleRate(sp[0]->s_sr); 39 | dsp_add(crumpling_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); 40 | } 41 | 42 | void *crumpling_new(t_symbol *s, long argc, t_atom *argv) { 43 | SDT_PD_ARG_PARSE(1, A_SYMBOL) 44 | 45 | t_crumpling *x = (t_crumpling *)pd_new(crumpling_class); 46 | x->crumpling = SDTCrumpling_new(); 47 | 48 | SDT_PD_REGISTER(Crumpling, crumpling, "crumpling process", 0) 49 | 50 | x->out0 = outlet_new(&x->obj, gensym("signal")); 51 | x->out1 = outlet_new(&x->obj, gensym("signal")); 52 | return x; 53 | } 54 | 55 | void crumpling_free(t_crumpling *x) { 56 | SDT_PD_FREE(Crumpling, crumpling) 57 | outlet_free(x->out0); 58 | outlet_free(x->out1); 59 | } 60 | 61 | void crumpling_tilde_setup(void) { 62 | crumpling_class = 63 | class_new(gensym("crumpling~"), (t_newmethod)crumpling_new, 64 | (t_method)crumpling_free, (long)sizeof(t_crumpling), 65 | CLASS_DEFAULT, A_GIMME, 0); 66 | class_addmethod(crumpling_class, (t_method)crumpling_setCrushingEnergy, 67 | gensym("crushingEnergy"), A_FLOAT, 0); 68 | class_addmethod(crumpling_class, (t_method)crumpling_setGranularity, 69 | gensym("granularity"), A_FLOAT, 0); 70 | class_addmethod(crumpling_class, (t_method)crumpling_setFragmentation, 71 | gensym("fragmentation"), A_FLOAT, 0); 72 | class_addmethod(crumpling_class, (t_method)crumpling_dsp, gensym("dsp"), 0); 73 | } 74 | -------------------------------------------------------------------------------- /src/Pd/dcmotor~.c: -------------------------------------------------------------------------------- 1 | #include "SDT/SDTCommon.h" 2 | #include "SDT/SDTDCMotor.h" 3 | #include "SDTCommonPd.h" 4 | #ifdef NT 5 | #pragma warning(disable : 4244) 6 | #pragma warning(disable : 4305) 7 | #endif 8 | 9 | static t_class *dcmotor_class; 10 | 11 | typedef struct _dcmotor { 12 | t_object obj; 13 | SDTDCMotor *motor; 14 | const char *key; 15 | t_float f; 16 | t_inlet *in; 17 | t_outlet *out; 18 | } t_dcmotor; 19 | 20 | SDT_PD_SETTER(dcmotor, DCMotor, motor, Coils, ) 21 | SDT_PD_SETTER(dcmotor, DCMotor, motor, Size, ) 22 | SDT_PD_SETTER(dcmotor, DCMotor, motor, Reson, ) 23 | SDT_PD_SETTER(dcmotor, DCMotor, motor, GearRatio, ) 24 | SDT_PD_SETTER(dcmotor, DCMotor, motor, Harshness, ) 25 | SDT_PD_SETTER(dcmotor, DCMotor, motor, RotorGain, ) 26 | SDT_PD_SETTER(dcmotor, DCMotor, motor, GearGain, ) 27 | SDT_PD_SETTER(dcmotor, DCMotor, motor, BrushGain, ) 28 | SDT_PD_SETTER(dcmotor, DCMotor, motor, AirGain, ) 29 | 30 | static t_int *dcmotor_perform(t_int *w) { 31 | t_dcmotor *x = (t_dcmotor *)(w[1]); 32 | t_float *in0 = (t_float *)(w[2]); 33 | t_float *in1 = (t_float *)(w[3]); 34 | t_float *out = (t_float *)(w[4]); 35 | int n = (int)(w[5]); 36 | while (n--) { 37 | SDTDCMotor_setRpm(x->motor, *in0++); 38 | SDTDCMotor_setLoad(x->motor, *in1++); 39 | *out++ = SDTDCMotor_dsp(x->motor); 40 | } 41 | return (w + 6); 42 | } 43 | 44 | static void dcmotor_dsp(t_dcmotor *x, t_signal **sp) { 45 | SDT_setSampleRate(sp[0]->s_sr); 46 | SDTDCMotor_update(x->motor); 47 | dsp_add(dcmotor_perform, 5, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, 48 | sp[0]->s_n); 49 | } 50 | 51 | static void *dcmotor_new(t_symbol *s, int argc, t_atom *argv) { 52 | SDT_PD_ARG_PARSE(2, A_SYMBOL, A_FLOAT) 53 | 54 | t_dcmotor *x = (t_dcmotor *)pd_new(dcmotor_class); 55 | x->motor = 56 | SDTDCMotor_new(GET_ARG(1, atom_getfloat, SDT_DCMOTOR_MAXSIZE_DEFAULT)); 57 | 58 | SDT_PD_REGISTER(DCMotor, motor, "electric motor", 0) 59 | 60 | x->in = inlet_new(&x->obj, &x->obj.ob_pd, &s_signal, &s_signal); 61 | x->out = outlet_new(&x->obj, gensym("signal")); 62 | return (x); 63 | } 64 | 65 | static void dcmotor_free(t_dcmotor *x) { 66 | inlet_free(x->in); 67 | outlet_free(x->out); 68 | SDT_PD_FREE(DCMotor, motor) 69 | } 70 | 71 | void dcmotor_tilde_setup(void) { 72 | dcmotor_class = class_new(gensym("dcmotor~"), (t_newmethod)dcmotor_new, 73 | (t_method)dcmotor_free, sizeof(t_dcmotor), 74 | CLASS_DEFAULT, A_GIMME, 0); 75 | CLASS_MAINSIGNALIN(dcmotor_class, t_dcmotor, f); 76 | class_addmethod(dcmotor_class, (t_method)dcmotor_setCoils, gensym("coils"), 77 | A_FLOAT, 0); 78 | class_addmethod(dcmotor_class, (t_method)dcmotor_setSize, gensym("size"), 79 | A_FLOAT, 0); 80 | class_addmethod(dcmotor_class, (t_method)dcmotor_setReson, gensym("reson"), 81 | A_FLOAT, 0); 82 | class_addmethod(dcmotor_class, (t_method)dcmotor_setGearRatio, 83 | gensym("gearRatio"), A_FLOAT, 0); 84 | class_addmethod(dcmotor_class, (t_method)dcmotor_setHarshness, 85 | gensym("harshness"), A_FLOAT, 0); 86 | class_addmethod(dcmotor_class, (t_method)dcmotor_setRotorGain, 87 | gensym("rotorGain"), A_FLOAT, 0); 88 | class_addmethod(dcmotor_class, (t_method)dcmotor_setGearGain, 89 | gensym("gearGain"), A_FLOAT, 0); 90 | class_addmethod(dcmotor_class, (t_method)dcmotor_setBrushGain, 91 | gensym("brushGain"), A_FLOAT, 0); 92 | class_addmethod(dcmotor_class, (t_method)dcmotor_setAirGain, 93 | gensym("airGain"), A_FLOAT, 0); 94 | class_addmethod(dcmotor_class, (t_method)dcmotor_dsp, gensym("dsp"), 0); 95 | } 96 | -------------------------------------------------------------------------------- /src/Pd/demix~.c: -------------------------------------------------------------------------------- 1 | #include "SDT/SDTCommon.h" 2 | #include "SDT/SDTDemix.h" 3 | #include "SDTCommonPd.h" 4 | #ifdef NT 5 | #pragma warning(disable : 4244) 6 | #pragma warning(disable : 4305) 7 | #endif 8 | 9 | static t_class *demix_class; 10 | 11 | typedef struct _demix { 12 | t_object obj; 13 | SDTDemix *demix; 14 | t_float f; 15 | t_outlet *out0, *out1, *out2; 16 | const char *key; 17 | } t_demix; 18 | 19 | static t_class *demix_class = NULL; 20 | 21 | SDT_PD_SETTER(demix, Demix, demix, Overlap, ) 22 | SDT_PD_SETTER(demix, Demix, demix, NoiseThreshold, ) 23 | SDT_PD_SETTER(demix, Demix, demix, TonalThreshold, ) 24 | 25 | t_int *demix_perform(t_int *w) { 26 | t_demix *x = (t_demix *)(w[1]); 27 | t_float *in = (t_float *)(w[2]); 28 | t_float *out0 = (t_float *)(w[3]); 29 | t_float *out1 = (t_float *)(w[4]); 30 | t_float *out2 = (t_float *)(w[5]); 31 | int n = (int)w[6]; 32 | double tmpOuts[3]; 33 | 34 | while (n--) { 35 | SDTDemix_dsp(x->demix, tmpOuts, *in++); 36 | *out0++ = (t_float)tmpOuts[0]; 37 | *out1++ = (t_float)tmpOuts[1]; 38 | *out2++ = (t_float)tmpOuts[2]; 39 | } 40 | 41 | return w + 7; 42 | } 43 | 44 | void demix_dsp(t_demix *x, t_signal **sp) { 45 | SDT_setSampleRate(sp[0]->s_sr); 46 | dsp_add(demix_perform, 6, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, 47 | sp[3]->s_vec, sp[0]->s_n); 48 | } 49 | 50 | void *demix_new(t_symbol *s, long argc, t_atom *argv) { 51 | SDT_PD_ARG_PARSE(3, A_SYMBOL, A_FLOAT, A_FLOAT) 52 | 53 | t_demix *x = (t_demix *)pd_new(demix_class); 54 | long kernelRadius; 55 | GET_ARG_WINSIZE(long, windowSize, 1, SDT_DEMIX_SIZE_DEFAULT) 56 | kernelRadius = GET_ARG(2, atom_getfloat, SDT_DEMIX_RADIUS_DEFAULT); 57 | 58 | x->demix = SDTDemix_new(windowSize, kernelRadius); 59 | 60 | SDT_PD_REGISTER(Demix, demix, "demixer", 0) 61 | 62 | x->out0 = outlet_new(&x->obj, gensym("signal")); 63 | x->out1 = outlet_new(&x->obj, gensym("signal")); 64 | x->out2 = outlet_new(&x->obj, gensym("signal")); 65 | return (x); 66 | } 67 | 68 | void demix_free(t_demix *x) { 69 | SDT_PD_FREE(Demix, demix) 70 | outlet_free(x->out0); 71 | outlet_free(x->out1); 72 | outlet_free(x->out2); 73 | } 74 | 75 | void demix_tilde_setup(void) { 76 | demix_class = 77 | class_new(gensym("demix~"), (t_newmethod)demix_new, (t_method)demix_free, 78 | (long)sizeof(t_demix), CLASS_DEFAULT, A_GIMME, 0); 79 | CLASS_MAINSIGNALIN(demix_class, t_demix, f); 80 | class_addmethod(demix_class, (t_method)demix_setOverlap, gensym("overlap"), 81 | A_FLOAT, 0); 82 | class_addmethod(demix_class, (t_method)demix_setNoiseThreshold, 83 | gensym("noiseThreshold"), A_FLOAT, 0); 84 | class_addmethod(demix_class, (t_method)demix_setTonalThreshold, 85 | gensym("tonalThreshold"), A_FLOAT, 0); 86 | class_addmethod(demix_class, (t_method)demix_dsp, gensym("dsp"), 0); 87 | } 88 | -------------------------------------------------------------------------------- /src/Pd/envelope~.c: -------------------------------------------------------------------------------- 1 | #include "SDT/SDTCommon.h" 2 | #include "SDT/SDTFilters.h" 3 | #include "SDTCommonPd.h" 4 | #ifdef NT 5 | #pragma warning(disable : 4244) 6 | #pragma warning(disable : 4305) 7 | #endif 8 | 9 | static t_class *envelope_class; 10 | 11 | typedef struct _envelope { 12 | t_object obj; 13 | SDTEnvelope *envelope; 14 | t_float f; 15 | t_outlet *out0; 16 | const char *key; 17 | } t_envelope; 18 | 19 | SDT_PD_SETTER(envelope, Envelope, envelope, Attack, ) 20 | SDT_PD_SETTER(envelope, Envelope, envelope, Release, ) 21 | 22 | t_int *envelope_perform(t_int *w) { 23 | t_envelope *x = (t_envelope *)(w[1]); 24 | t_float *in = (t_float *)(w[2]); 25 | t_float *out = (t_float *)(w[3]); 26 | int n = (int)w[4]; 27 | 28 | while (n--) { 29 | *out++ = (float)SDTEnvelope_dsp(x->envelope, *in++); 30 | } 31 | return w + 5; 32 | } 33 | 34 | void envelope_dsp(t_envelope *x, t_signal **sp) { 35 | SDT_setSampleRate(sp[0]->s_sr); 36 | dsp_add(envelope_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); 37 | } 38 | 39 | void *envelope_new(t_symbol *s, long argc, t_atom *argv) { 40 | SDT_PD_ARG_PARSE(1, A_SYMBOL) 41 | 42 | t_envelope *x = (t_envelope *)pd_new(envelope_class); 43 | x->envelope = SDTEnvelope_new(); 44 | 45 | SDT_PD_REGISTER(Envelope, envelope, "envelope filter", 0) 46 | 47 | x->out0 = outlet_new(&x->obj, gensym("signal")); 48 | return (x); 49 | } 50 | 51 | void envelope_free(t_envelope *x) { 52 | outlet_free(x->out0); 53 | SDT_PD_FREE(Envelope, envelope) 54 | } 55 | 56 | void envelope_tilde_setup(void) { 57 | envelope_class = class_new(gensym("envelope~"), (t_newmethod)envelope_new, 58 | (t_method)envelope_free, sizeof(t_envelope), 59 | CLASS_DEFAULT, A_GIMME, 0); 60 | CLASS_MAINSIGNALIN(envelope_class, t_envelope, f); 61 | class_addmethod(envelope_class, (t_method)envelope_setAttack, 62 | gensym("attack"), A_FLOAT, 0); 63 | class_addmethod(envelope_class, (t_method)envelope_setRelease, 64 | gensym("release"), A_FLOAT, 0); 65 | class_addmethod(envelope_class, (t_method)envelope_dsp, gensym("dsp"), 0); 66 | } 67 | -------------------------------------------------------------------------------- /src/Pd/explosion~.c: -------------------------------------------------------------------------------- 1 | #include "SDT/SDTCommon.h" 2 | #include "SDT/SDTGases.h" 3 | #include "SDTCommonPd.h" 4 | #ifdef NT 5 | #pragma warning(disable : 4244) 6 | #pragma warning(disable : 4305) 7 | #endif 8 | 9 | static t_class *explosion_class; 10 | 11 | typedef struct _explosion { 12 | t_object obj; 13 | SDTExplosion *explosion; 14 | t_outlet *out0, *out1; 15 | const char *key; 16 | } t_explosion; 17 | 18 | SDT_PD_SETTER(explosion, Explosion, explosion, BlastTime, ) 19 | SDT_PD_SETTER(explosion, Explosion, explosion, ScatterTime, ) 20 | SDT_PD_SETTER(explosion, Explosion, explosion, Dispersion, ) 21 | SDT_PD_SETTER(explosion, Explosion, explosion, Distance, ) 22 | SDT_PD_SETTER(explosion, Explosion, explosion, WaveSpeed, ) 23 | SDT_PD_SETTER(explosion, Explosion, explosion, WindSpeed, ) 24 | 25 | void explosion_trigger(t_explosion *x) { SDTExplosion_trigger(x->explosion); } 26 | 27 | static t_int *explosion_perform(t_int *w) { 28 | t_explosion *x = (t_explosion *)(w[1]); 29 | t_float *out0 = (t_float *)(w[2]); 30 | t_float *out1 = (t_float *)(w[3]); 31 | int n = (int)(w[4]); 32 | double tmpOuts[2]; 33 | while (n--) { 34 | SDTExplosion_dsp(x->explosion, tmpOuts); 35 | *out0++ = tmpOuts[0]; 36 | *out1++ = tmpOuts[1]; 37 | } 38 | return (w + 5); 39 | } 40 | 41 | static void explosion_dsp(t_explosion *x, t_signal **sp) { 42 | SDT_setSampleRate(sp[0]->s_sr); 43 | dsp_add(explosion_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); 44 | } 45 | 46 | static void *explosion_new(t_symbol *s, int argc, t_atom *argv) { 47 | SDT_PD_ARG_PARSE(3, A_SYMBOL, A_FLOAT, A_FLOAT) 48 | 49 | t_explosion *x = (t_explosion *)pd_new(explosion_class); 50 | t_float maxScatter, maxDelay; 51 | maxScatter = GET_ARG(1, atom_getfloat, SDT_EXPLOSION_MAX_SCATTER_DEFAULT); 52 | maxDelay = GET_ARG(2, atom_getfloat, SDT_EXPLOSION_MAX_DELAY_DEFAULT); 53 | x->explosion = SDTExplosion_new(maxScatter, maxDelay); 54 | 55 | SDT_PD_REGISTER(Explosion, explosion, "explosion", 0) 56 | 57 | x->out0 = outlet_new(&x->obj, gensym("signal")); 58 | x->out1 = outlet_new(&x->obj, gensym("signal")); 59 | return (x); 60 | } 61 | 62 | static void explosion_free(t_explosion *x) { 63 | outlet_free(x->out0); 64 | outlet_free(x->out1); 65 | SDT_PD_FREE(Explosion, explosion) 66 | } 67 | 68 | void explosion_tilde_setup(void) { 69 | explosion_class = class_new(gensym("explosion~"), (t_newmethod)explosion_new, 70 | (t_method)explosion_free, sizeof(t_explosion), 71 | CLASS_DEFAULT, A_GIMME, 0); 72 | class_addmethod(explosion_class, (t_method)explosion_trigger, gensym("bang"), 73 | 0); 74 | class_addmethod(explosion_class, (t_method)explosion_setBlastTime, 75 | gensym("blastTime"), A_FLOAT, 0); 76 | class_addmethod(explosion_class, (t_method)explosion_setScatterTime, 77 | gensym("scatterTime"), A_FLOAT, 0); 78 | class_addmethod(explosion_class, (t_method)explosion_setDispersion, 79 | gensym("dispersion"), A_FLOAT, 0); 80 | class_addmethod(explosion_class, (t_method)explosion_setDistance, 81 | gensym("distance"), A_FLOAT, 0); 82 | class_addmethod(explosion_class, (t_method)explosion_setWaveSpeed, 83 | gensym("waveSpeed"), A_FLOAT, 0); 84 | class_addmethod(explosion_class, (t_method)explosion_setWindSpeed, 85 | gensym("windSpeed"), A_FLOAT, 0); 86 | class_addmethod(explosion_class, (t_method)explosion_dsp, gensym("dsp"), 0); 87 | } 88 | -------------------------------------------------------------------------------- /src/Pd/fluidflow~.c: -------------------------------------------------------------------------------- 1 | /** \file fluidflow~.c 2 | * Puredata external for the generation of liquid sounds. 3 | * 4 | * \author Stefano Baldan (stefanobaldan@iuav.it) 5 | * 6 | *****************************************************************************/ 7 | 8 | #include "SDT/SDTCommon.h" 9 | #include "SDT/SDTLiquids.h" 10 | #include "SDTCommonPd.h" 11 | #ifdef NT 12 | #pragma warning(disable : 4244) 13 | #pragma warning(disable : 4305) 14 | #endif 15 | 16 | static t_class *fluidflow_class; 17 | 18 | typedef struct _fluidflow { 19 | t_object obj; 20 | SDTFluidFlow *flow; 21 | t_outlet *out; 22 | const char *key; 23 | } t_fluidflow; 24 | 25 | SDT_PD_SETTER(fluidflow, FluidFlow, flow, AvgRate, ) 26 | SDT_PD_SETTER(fluidflow, FluidFlow, flow, MinRadius, ) 27 | SDT_PD_SETTER(fluidflow, FluidFlow, flow, MaxRadius, ) 28 | SDT_PD_SETTER(fluidflow, FluidFlow, flow, ExpRadius, ) 29 | SDT_PD_SETTER(fluidflow, FluidFlow, flow, MinDepth, ) 30 | SDT_PD_SETTER(fluidflow, FluidFlow, flow, MaxDepth, ) 31 | SDT_PD_SETTER(fluidflow, FluidFlow, flow, ExpDepth, ) 32 | SDT_PD_SETTER(fluidflow, FluidFlow, flow, RiseFactor, ) 33 | SDT_PD_SETTER(fluidflow, FluidFlow, flow, RiseCutoff, ) 34 | 35 | static t_int *fluidflow_perform(t_int *w) { 36 | t_fluidflow *x = (t_fluidflow *)(w[1]); 37 | t_float *out = (t_float *)(w[2]); 38 | int n = (int)(w[3]); 39 | while (n--) { 40 | *out++ = (float)SDTFluidFlow_dsp(x->flow); 41 | } 42 | return (w + 4); 43 | } 44 | 45 | static void fluidflow_dsp(t_fluidflow *x, t_signal **sp) { 46 | SDT_setSampleRate(sp[0]->s_sr); 47 | dsp_add(fluidflow_perform, 3, x, sp[0]->s_vec, sp[0]->s_n); 48 | } 49 | 50 | static void *fluidflow_new(t_symbol *s, int argc, t_atom *argv) { 51 | SDT_PD_ARG_PARSE(2, A_SYMBOL, A_FLOAT) 52 | 53 | t_fluidflow *x = (t_fluidflow *)pd_new(fluidflow_class); 54 | x->flow = SDTFluidFlow_new( 55 | GET_ARG(1, atom_getfloat, SDT_FLUIDFLOW_NBUBBLES_DEFAULT)); 56 | 57 | SDT_PD_REGISTER(FluidFlow, flow, "fluid flow", 0) 58 | 59 | x->out = outlet_new(&x->obj, gensym("signal")); 60 | return (x); 61 | } 62 | 63 | static void fluidflow_free(t_fluidflow *x) { 64 | outlet_free(x->out); 65 | SDT_PD_FREE(FluidFlow, flow) 66 | } 67 | 68 | void fluidflow_tilde_setup(void) { 69 | fluidflow_class = class_new(gensym("fluidflow~"), (t_newmethod)fluidflow_new, 70 | (t_method)fluidflow_free, sizeof(t_fluidflow), 71 | CLASS_DEFAULT, A_GIMME, 0); 72 | class_addmethod(fluidflow_class, (t_method)fluidflow_setAvgRate, 73 | gensym("avgRate"), A_FLOAT, 0); 74 | class_addmethod(fluidflow_class, (t_method)fluidflow_setMinRadius, 75 | gensym("minRadius"), A_FLOAT, 0); 76 | class_addmethod(fluidflow_class, (t_method)fluidflow_setMaxRadius, 77 | gensym("maxRadius"), A_FLOAT, 0); 78 | class_addmethod(fluidflow_class, (t_method)fluidflow_setExpRadius, 79 | gensym("expRadius"), A_FLOAT, 0); 80 | class_addmethod(fluidflow_class, (t_method)fluidflow_setMinDepth, 81 | gensym("minDepth"), A_FLOAT, 0); 82 | class_addmethod(fluidflow_class, (t_method)fluidflow_setMaxDepth, 83 | gensym("maxDepth"), A_FLOAT, 0); 84 | class_addmethod(fluidflow_class, (t_method)fluidflow_setExpDepth, 85 | gensym("expDepth"), A_FLOAT, 0); 86 | class_addmethod(fluidflow_class, (t_method)fluidflow_setRiseFactor, 87 | gensym("riseFactor"), A_FLOAT, 0); 88 | class_addmethod(fluidflow_class, (t_method)fluidflow_setRiseCutoff, 89 | gensym("riseCutoff"), A_FLOAT, 0); 90 | class_addmethod(fluidflow_class, (t_method)fluidflow_dsp, gensym("dsp"), 0); 91 | } 92 | -------------------------------------------------------------------------------- /src/Pd/inertial.c: -------------------------------------------------------------------------------- 1 | #include "SDT/SDTCommon.h" 2 | #include "SDT/SDTInteractors.h" 3 | #include "SDTCommonPd.h" 4 | #include "m_pd.h" 5 | 6 | #ifdef NT 7 | #pragma warning(disable : 4244) 8 | #pragma warning(disable : 4305) 9 | #endif 10 | 11 | static t_class *inertial_class; 12 | 13 | typedef struct _inertial { 14 | t_object obj; 15 | SDTResonator *inertial; 16 | const char *key; 17 | t_sample f; 18 | } t_inertial; 19 | 20 | void inertial_mass(t_inertial *x, t_float f) { 21 | SDTResonator_setWeight(x->inertial, 0, f); 22 | } 23 | 24 | SDT_PD_SETTER(inertial, Resonator, inertial, FragmentSize, ) 25 | 26 | void inertial_strike(t_inertial *x, t_float p, t_float v) { 27 | SDTResonator_setPosition(x->inertial, 0, p); 28 | SDTResonator_setVelocity(x->inertial, 0, v); 29 | } 30 | 31 | void inertial_dsp(t_inertial *x, t_signal **sp) { 32 | SDT_setSampleRate(sp[0]->s_sr); 33 | SDTResonator_update(x->inertial); 34 | } 35 | 36 | void *inertial_new(t_symbol *s, long argc, t_atom *argv) { 37 | t_inertial *x; 38 | 39 | if (argc < 1 || argv[0].a_type != A_SYMBOL) { 40 | pd_error(s, "sdt.inertial: Please provide a unique id as first argument."); 41 | return NULL; 42 | } 43 | x = (t_inertial *)pd_new(inertial_class); 44 | x->inertial = SDTResonator_new(1, 1); 45 | x->key = (char *)(atom_getsymbol(argv)->s_name); 46 | if (SDT_registerResonator(x->inertial, x->key)) { 47 | pd_error( 48 | x, 49 | "sdt.inertial: Error registering the resonator. Probably a duplicate " 50 | "id?"); 51 | SDTResonator_free(x->inertial); 52 | return NULL; 53 | } 54 | SDTResonator_setFrequency(x->inertial, 0, 0.0); 55 | SDTResonator_setDecay(x->inertial, 0, 0.0); 56 | SDTResonator_setWeight(x->inertial, 0, 1.0); 57 | SDTResonator_setGain(x->inertial, 0, 0, 1.0); 58 | SDTResonator_setFragmentSize(x->inertial, 1.0); 59 | SDTResonator_setActiveModes(x->inertial, 1); 60 | return x; 61 | } 62 | 63 | void inertial_free(t_inertial *x) { 64 | SDT_unregisterResonator(x->key); 65 | SDTResonator_free(x->inertial); 66 | } 67 | 68 | void inertial_setup(void) { 69 | inertial_class = class_new(gensym("inertial"), (t_newmethod)inertial_new, 70 | (t_method)inertial_free, sizeof(t_inertial), 71 | CLASS_DEFAULT, A_GIMME, 0); 72 | CLASS_MAINSIGNALIN(inertial_class, t_inertial, f); 73 | class_addmethod(inertial_class, (t_method)inertial_dsp, gensym("dsp"), 0); 74 | class_addmethod(inertial_class, (t_method)inertial_mass, gensym("mass"), 75 | A_FLOAT, 0); 76 | class_addmethod(inertial_class, (t_method)inertial_setFragmentSize, 77 | gensym("fragmentSize"), A_FLOAT, 0); 78 | class_addmethod(inertial_class, (t_method)inertial_strike, gensym("strike"), 79 | A_FLOAT, A_FLOAT, 0); 80 | } 81 | -------------------------------------------------------------------------------- /src/Pd/modal.c: -------------------------------------------------------------------------------- 1 | #include "SDT/SDTCommon.h" 2 | #include "SDT/SDTInteractors.h" 3 | #include "SDTCommonPd.h" 4 | #include "m_pd.h" 5 | #ifdef NT 6 | #pragma warning(disable : 4244) 7 | #pragma warning(disable : 4305) 8 | #endif 9 | 10 | static t_class *modal_class; 11 | 12 | typedef struct _modal { 13 | t_object obj; 14 | SDTResonator *modal; 15 | const char *key; 16 | t_sample f; 17 | } t_modal; 18 | 19 | SDT_PD_SETTER(modal, Resonator, modal, FragmentSize, ) 20 | SDT_PD_SETTER(modal, Resonator, modal, ActiveModes, ) 21 | 22 | SDT_PD_ARRAY_SETTER(modal, Resonator, modal, Frequency, ) 23 | SDT_PD_ARRAY_SETTER(modal, Resonator, modal, Decay, ) 24 | SDT_PD_ARRAY_SETTER(modal, Resonator, modal, Weight, ) 25 | 26 | void modal_pickup(t_modal *x, void *attr, long ac, t_atom *av) { 27 | int pickup = atom_getint(av); 28 | for (int mode = 1; mode < ac; mode++) { 29 | SDTResonator_setGain(x->modal, pickup, mode - 1, atom_getfloat(av + mode)); 30 | } 31 | } 32 | 33 | void modal_dsp(t_modal *x, t_signal **sp) { 34 | SDT_setSampleRate(sp[0]->s_sr); 35 | SDTResonator_update(x->modal); 36 | } 37 | 38 | void *modal_new(t_symbol *s, long argc, t_atom *argv) { 39 | t_modal *x; 40 | 41 | if (argc < 3 || argv[0].a_type != A_SYMBOL || argv[1].a_type != A_FLOAT || 42 | argv[2].a_type != A_FLOAT) { 43 | pd_error(NULL, 44 | "modal: Please provide a unique id as first argument, " 45 | "the number of modes as second argument and " 46 | "the number of pickups as third argument."); 47 | return NULL; 48 | } 49 | x = (t_modal *)pd_new(modal_class); 50 | int nModes = atom_getint(argv + 1); 51 | int nPickups = atom_getint(argv + 2); 52 | x->modal = SDTResonator_new(nModes, nPickups); 53 | x->key = (char *)(atom_getsymbol(argv)->s_name); 54 | if (SDT_registerResonator(x->modal, x->key)) { 55 | pd_error( 56 | x, 57 | "sdt.modal: Error registering the resonator. Probably a duplicate id?"); 58 | SDTResonator_free(x->modal); 59 | return NULL; 60 | } 61 | SDTResonator_setFragmentSize(x->modal, 1.0); 62 | for (long mode = 0; mode < nModes; ++mode) { 63 | SDTResonator_setWeight(x->modal, mode, 1.0); 64 | } 65 | return x; 66 | } 67 | 68 | void modal_free(t_modal *x) { 69 | SDT_unregisterResonator(x->key); 70 | SDTResonator_free(x->modal); 71 | } 72 | 73 | void modal_setup(void) { 74 | modal_class = 75 | class_new(gensym("modal"), (t_newmethod)modal_new, (t_method)modal_free, 76 | sizeof(t_modal), CLASS_DEFAULT, A_GIMME, 0); 77 | CLASS_MAINSIGNALIN(modal_class, t_modal, f); 78 | class_addmethod(modal_class, (t_method)modal_dsp, gensym("dsp"), 0); 79 | class_addmethod(modal_class, (t_method)modal_setFrequency, gensym("freqs"), 80 | A_GIMME, 0); 81 | class_addmethod(modal_class, (t_method)modal_setDecay, gensym("decays"), 82 | A_GIMME, 0); 83 | class_addmethod(modal_class, (t_method)modal_setWeight, gensym("masses"), 84 | A_GIMME, 0); 85 | class_addmethod(modal_class, (t_method)modal_pickup, gensym("pickup"), 86 | A_GIMME, 0); 87 | class_addmethod(modal_class, (t_method)modal_setFragmentSize, 88 | gensym("fragmentSize"), A_FLOAT, 0); 89 | class_addmethod(modal_class, (t_method)modal_setActiveModes, 90 | gensym("activeModes"), A_FLOAT, 0); 91 | } 92 | -------------------------------------------------------------------------------- /src/Pd/myo~.c: -------------------------------------------------------------------------------- 1 | #include "SDT/SDTAnalysis.h" 2 | #include "SDT/SDTCommon.h" 3 | #include "SDTCommonPd.h" 4 | #ifdef NT 5 | #pragma warning(disable : 4244) 6 | #pragma warning(disable : 4305) 7 | #endif 8 | 9 | static t_class *myo_class; 10 | 11 | typedef struct _myo { 12 | t_object obj; 13 | SDTMyoelastic *myo; 14 | t_float f; 15 | t_outlet *out0, *out1, *out2, *out3; 16 | double time; 17 | const char *key; 18 | } t_myo; 19 | 20 | SDT_PD_SETTER(myo, Myoelastic, myo, DcFrequency, update) 21 | SDT_PD_SETTER(myo, Myoelastic, myo, LowFrequency, update) 22 | SDT_PD_SETTER(myo, Myoelastic, myo, HighFrequency, update) 23 | SDT_PD_SETTER(myo, Myoelastic, myo, Threshold, ) 24 | 25 | t_int *myo_perform(t_int *w) { 26 | t_myo *x = (t_myo *)(w[1]); 27 | t_float *in = (t_float *)(w[2]); 28 | int n = (int)w[3]; 29 | double tmpOuts[4]; 30 | 31 | while (n--) { 32 | SDTMyoelastic_dsp(x->myo, tmpOuts, *in++); 33 | if (x->time != sys_getrealtime()) { 34 | outlet_float(x->out0, (t_float)tmpOuts[0]); 35 | outlet_float(x->out1, (t_float)tmpOuts[1]); 36 | outlet_float(x->out2, (t_float)tmpOuts[2]); 37 | outlet_float(x->out3, (t_float)tmpOuts[3]); 38 | x->time = sys_getrealtime(); 39 | } 40 | } 41 | return w + 4; 42 | } 43 | 44 | void myo_dsp(t_myo *x, t_signal **sp, short *count) { 45 | SDT_setSampleRate(sp[0]->s_sr); 46 | SDTMyoelastic_update(x->myo); 47 | dsp_add(myo_perform, 3, x, sp[0]->s_vec, sp[0]->s_n); 48 | } 49 | 50 | void *myo_new(t_symbol *s, long argc, t_atom *argv) { 51 | SDT_PD_ARG_PARSE(1, A_SYMBOL) 52 | 53 | t_myo *x = (t_myo *)pd_new(myo_class); 54 | x->myo = SDTMyoelastic_new(); 55 | x->time = 0.0; 56 | 57 | SDT_PD_REGISTER(Myoelastic, myo, "myoelastic feature extractor", 0) 58 | 59 | x->out0 = outlet_new(&x->obj, gensym("float")); 60 | x->out1 = outlet_new(&x->obj, gensym("float")); 61 | x->out2 = outlet_new(&x->obj, gensym("float")); 62 | x->out3 = outlet_new(&x->obj, gensym("float")); 63 | return (x); 64 | } 65 | 66 | void myo_free(t_myo *x) { 67 | outlet_free(x->out0); 68 | outlet_free(x->out1); 69 | outlet_free(x->out2); 70 | outlet_free(x->out3); 71 | SDT_PD_FREE(Myoelastic, myo) 72 | } 73 | 74 | void myo_tilde_setup(void) { 75 | myo_class = 76 | class_new(gensym("myo~"), (t_newmethod)myo_new, (t_method)myo_free, 77 | sizeof(t_myo), CLASS_DEFAULT, A_GIMME, 0); 78 | CLASS_MAINSIGNALIN(myo_class, t_myo, f); 79 | class_addmethod(myo_class, (t_method)myo_setDcFrequency, 80 | gensym("dcFrequency"), A_FLOAT, 0); 81 | class_addmethod(myo_class, (t_method)myo_setLowFrequency, 82 | gensym("lowFrequency"), A_FLOAT, 0); 83 | class_addmethod(myo_class, (t_method)myo_setHighFrequency, 84 | gensym("highFrequency"), A_FLOAT, 0); 85 | class_addmethod(myo_class, (t_method)myo_setThreshold, gensym("threshold"), 86 | A_FLOAT, 0); 87 | class_addmethod(myo_class, (t_method)myo_dsp, gensym("dsp"), 0); 88 | } 89 | -------------------------------------------------------------------------------- /src/Pd/pitchshift~.c: -------------------------------------------------------------------------------- 1 | #include "SDT/SDTCommon.h" 2 | #include "SDT/SDTEffects.h" 3 | #include "SDTCommonPd.h" 4 | #ifdef NT 5 | #pragma warning(disable : 4244) 6 | #pragma warning(disable : 4305) 7 | #endif 8 | 9 | static t_class *pitchshift_class; 10 | 11 | typedef struct _pitchshift { 12 | t_object obj; 13 | t_float f; 14 | SDTPitchShift *shift; 15 | t_outlet *out; 16 | const char *key; 17 | } t_pitchshift; 18 | 19 | SDT_PD_SETTER(pitchshift, PitchShift, shift, Overlap, ) 20 | SDT_PD_SETTER(pitchshift, PitchShift, shift, Ratio, ) 21 | 22 | static t_int *pitchshift_perform(t_int *w) { 23 | t_pitchshift *x = (t_pitchshift *)(w[1]); 24 | t_float *in = (t_float *)(w[2]); 25 | t_float *out = (t_float *)(w[3]); 26 | int n = (int)w[4]; 27 | 28 | while (n--) { 29 | *out++ = (t_float)SDTPitchShift_dsp(x->shift, *in++); 30 | } 31 | 32 | return w + 5; 33 | } 34 | 35 | void pitchshift_dsp(t_pitchshift *x, t_signal **sp) { 36 | SDT_setSampleRate(sp[0]->s_sr); 37 | dsp_add(pitchshift_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); 38 | } 39 | 40 | static void *pitchshift_new(t_symbol *s, long argc, t_atom *argv) { 41 | SDT_PD_ARG_PARSE(3, A_SYMBOL, A_FLOAT, A_FLOAT) 42 | 43 | t_pitchshift *x = (t_pitchshift *)pd_new(pitchshift_class); 44 | float size, oversample; 45 | size = GET_ARG(1, atom_getfloat, SDT_PITCHSHIFT_SIZE_DEFAULT); 46 | oversample = GET_ARG(2, atom_getfloat, SDT_PITCHSHIFT_OVERSAMPLE_DEFAULT); 47 | x->shift = SDTPitchShift_new(size, oversample); 48 | 49 | SDT_PD_REGISTER(PitchShift, shift, "pitch shifter", 0) 50 | 51 | x->out = outlet_new(&x->obj, gensym("signal")); 52 | return (x); 53 | } 54 | 55 | static void pitchshift_free(t_pitchshift *x) { 56 | outlet_free(x->out); 57 | SDT_PD_FREE(PitchShift, shift) 58 | } 59 | 60 | void pitchshift_tilde_setup(void) { 61 | pitchshift_class = 62 | class_new(gensym("pitchshift~"), (t_newmethod)pitchshift_new, 63 | (t_method)pitchshift_free, sizeof(t_pitchshift), CLASS_DEFAULT, 64 | A_GIMME, 0); 65 | CLASS_MAINSIGNALIN(pitchshift_class, t_pitchshift, f); 66 | class_addmethod(pitchshift_class, (t_method)pitchshift_setRatio, 67 | gensym("ratio"), A_FLOAT, 0); 68 | class_addmethod(pitchshift_class, (t_method)pitchshift_setOverlap, 69 | gensym("overlap"), A_FLOAT, 0); 70 | class_addmethod(pitchshift_class, (t_method)pitchshift_dsp, gensym("dsp"), 0); 71 | } 72 | -------------------------------------------------------------------------------- /src/Pd/pitch~.c: -------------------------------------------------------------------------------- 1 | #include "SDT/SDTAnalysis.h" 2 | #include "SDT/SDTCommon.h" 3 | #include "SDTCommonPd.h" 4 | #ifdef NT 5 | #pragma warning(disable : 4244) 6 | #pragma warning(disable : 4305) 7 | #endif 8 | 9 | static t_class *pitch_class; 10 | 11 | typedef struct _pitch { 12 | t_object obj; 13 | SDTPitch *pitch; 14 | t_float f; 15 | t_outlet *out0, *out1; 16 | const char *key; 17 | } t_pitch; 18 | 19 | SDT_PD_SETTER(pitch, Pitch, pitch, Overlap, ) 20 | SDT_PD_SETTER(pitch, Pitch, pitch, Tolerance, ) 21 | 22 | t_int *pitch_perform(t_int *w) { 23 | t_pitch *x = (t_pitch *)(w[1]); 24 | t_float *in = (t_float *)(w[2]); 25 | int n = (int)w[3]; 26 | double tmpOuts[2]; 27 | int hasOutput = 0; 28 | 29 | while (n--) { 30 | hasOutput += SDTPitch_dsp(x->pitch, tmpOuts, *in++); 31 | } 32 | if (hasOutput) { 33 | outlet_float(x->out0, tmpOuts[0]); 34 | outlet_float(x->out1, tmpOuts[1]); 35 | } 36 | return w + 4; 37 | } 38 | 39 | void pitch_dsp(t_pitch *x, t_signal **sp) { 40 | SDT_setSampleRate(sp[0]->s_sr); 41 | dsp_add(pitch_perform, 3, x, sp[0]->s_vec, sp[0]->s_n); 42 | } 43 | 44 | void *pitch_new(t_symbol *s, long argc, t_atom *argv) { 45 | SDT_PD_ARG_PARSE(3, A_SYMBOL, A_FLOAT) 46 | 47 | t_pitch *x = (t_pitch *)pd_new(pitch_class); 48 | GET_ARG_WINSIZE(int, windowSize, 1, SDT_PITCH_SIZE_DEFAULT) 49 | x->pitch = SDTPitch_new(windowSize); 50 | 51 | SDT_PD_REGISTER(Pitch, pitch, "fundamental frequency estimator", 0) 52 | 53 | x->out0 = outlet_new(&x->obj, gensym("float")); 54 | x->out1 = outlet_new(&x->obj, gensym("float")); 55 | return (x); 56 | } 57 | 58 | void pitch_free(t_pitch *x) { 59 | outlet_free(x->out0); 60 | outlet_free(x->out1); 61 | SDT_PD_FREE(Pitch, pitch) 62 | } 63 | 64 | void pitch_tilde_setup(void) { 65 | pitch_class = 66 | class_new(gensym("pitch~"), (t_newmethod)pitch_new, (t_method)pitch_free, 67 | sizeof(t_pitch), CLASS_DEFAULT, A_GIMME, 0); 68 | CLASS_MAINSIGNALIN(pitch_class, t_pitch, f); 69 | class_addmethod(pitch_class, (t_method)pitch_setOverlap, gensym("overlap"), 70 | A_FLOAT, 0); 71 | class_addmethod(pitch_class, (t_method)pitch_setTolerance, 72 | gensym("tolerance"), A_FLOAT, 0); 73 | class_addmethod(pitch_class, (t_method)pitch_dsp, gensym("dsp"), 0); 74 | } -------------------------------------------------------------------------------- /src/Pd/reverb~.c: -------------------------------------------------------------------------------- 1 | #include "SDT/SDTCommon.h" 2 | #include "SDT/SDTEffects.h" 3 | #include "SDTCommonPd.h" 4 | #ifdef NT 5 | #pragma warning(disable : 4244) 6 | #pragma warning(disable : 4305) 7 | #endif 8 | 9 | static t_class *reverb_class; 10 | 11 | typedef struct _reverb { 12 | t_object obj; 13 | t_float f; 14 | SDTReverb *reverb; 15 | t_outlet *out0; 16 | const char *key; 17 | } t_reverb; 18 | 19 | SDT_PD_SETTER(reverb, Reverb, reverb, XSize, update) 20 | SDT_PD_SETTER(reverb, Reverb, reverb, YSize, update) 21 | SDT_PD_SETTER(reverb, Reverb, reverb, ZSize, update) 22 | SDT_PD_SETTER(reverb, Reverb, reverb, Randomness, update) 23 | SDT_PD_SETTER(reverb, Reverb, reverb, Time, update) 24 | SDT_PD_SETTER(reverb, Reverb, reverb, Time1k, update) 25 | 26 | static t_int *reverb_perform(t_int *w) { 27 | t_reverb *x = (t_reverb *)(w[1]); 28 | t_float *in = (t_float *)(w[2]); 29 | t_float *out = (t_float *)(w[3]); 30 | int n = (int)w[4]; 31 | 32 | while (n--) { 33 | *out++ = (float)SDTReverb_dsp(x->reverb, *in++); 34 | } 35 | 36 | return w + 5; 37 | } 38 | 39 | void reverb_dsp(t_reverb *x, t_signal **sp) { 40 | SDT_setSampleRate(sp[0]->s_sr); 41 | SDTReverb_update(x->reverb); 42 | dsp_add(reverb_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); 43 | } 44 | 45 | static void *reverb_new(t_symbol *s, long argc, t_atom *argv) { 46 | SDT_PD_ARG_PARSE(2, A_SYMBOL, A_FLOAT) 47 | 48 | t_reverb *x = (t_reverb *)pd_new(reverb_class); 49 | t_float maxDelay = GET_ARG(1, atom_getfloat, 44100.0); 50 | x->reverb = SDTReverb_new(maxDelay); 51 | 52 | SDT_PD_REGISTER(Reverb, reverb, "reverb", 0) 53 | 54 | x->out0 = outlet_new(&x->obj, gensym("signal")); 55 | return (x); 56 | } 57 | 58 | static void reverb_free(t_reverb *x) { 59 | outlet_free(x->out0); 60 | SDT_PD_FREE(Reverb, reverb) 61 | } 62 | 63 | void reverb_tilde_setup(void) { 64 | reverb_class = class_new(gensym("reverb~"), (t_newmethod)reverb_new, 65 | (t_method)reverb_free, sizeof(t_reverb), 66 | CLASS_DEFAULT, A_GIMME, 0); 67 | CLASS_MAINSIGNALIN(reverb_class, t_reverb, f); 68 | class_addmethod(reverb_class, (t_method)reverb_setXSize, gensym("xSize"), 69 | A_FLOAT, 0); 70 | class_addmethod(reverb_class, (t_method)reverb_setYSize, gensym("ySize"), 71 | A_FLOAT, 0); 72 | class_addmethod(reverb_class, (t_method)reverb_setZSize, gensym("zSize"), 73 | A_FLOAT, 0); 74 | class_addmethod(reverb_class, (t_method)reverb_setRandomness, 75 | gensym("randomness"), A_FLOAT, 0); 76 | class_addmethod(reverb_class, (t_method)reverb_setTime, gensym("time"), 77 | A_FLOAT, 0); 78 | class_addmethod(reverb_class, (t_method)reverb_setTime1k, gensym("time1k"), 79 | A_FLOAT, 0); 80 | class_addmethod(reverb_class, (t_method)reverb_dsp, gensym("dsp"), 0); 81 | } 82 | -------------------------------------------------------------------------------- /src/Pd/rolling~.c: -------------------------------------------------------------------------------- 1 | #include "SDT/SDTCommon.h" 2 | #include "SDT/SDTControl.h" 3 | #include "SDTCommonPd.h" 4 | #ifdef NT 5 | #pragma warning(disable : 4244) 6 | #pragma warning(disable : 4305) 7 | #endif 8 | 9 | static t_class *rolling_class; 10 | 11 | typedef struct _rolling { 12 | t_object obj; 13 | SDTRolling *rolling; 14 | t_float f; 15 | t_outlet *out; 16 | const char *key; 17 | } t_rolling; 18 | 19 | SDT_PD_SETTER(rolling, Rolling, rolling, Grain, ) 20 | SDT_PD_SETTER(rolling, Rolling, rolling, Depth, ) 21 | SDT_PD_SETTER(rolling, Rolling, rolling, Mass, ) 22 | SDT_PD_SETTER(rolling, Rolling, rolling, Velocity, ) 23 | 24 | t_int *rolling_perform(t_int *w) { 25 | t_rolling *x = (t_rolling *)(w[1]); 26 | t_float *in = (t_float *)(w[2]); 27 | t_float *out = (t_float *)(w[3]); 28 | int n = (int)w[4]; 29 | 30 | while (n--) { 31 | *out++ = (t_float)SDTRolling_dsp(x->rolling, *in++); 32 | } 33 | return w + 5; 34 | } 35 | 36 | void rolling_dsp(t_rolling *x, t_signal **sp) { 37 | SDT_setSampleRate(sp[0]->s_sr); 38 | dsp_add(rolling_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); 39 | } 40 | 41 | void *rolling_new(t_symbol *s, long argc, t_atom *argv) { 42 | SDT_PD_ARG_PARSE(1, A_SYMBOL) 43 | 44 | t_rolling *x = (t_rolling *)pd_new(rolling_class); 45 | x->rolling = SDTRolling_new(); 46 | 47 | SDT_PD_REGISTER(Rolling, rolling, "rolling process", 0) 48 | 49 | x->out = outlet_new(&x->obj, gensym("signal")); 50 | return x; 51 | } 52 | 53 | void rolling_free(t_rolling *x) { 54 | SDT_PD_FREE(Rolling, rolling) 55 | outlet_free(x->out); 56 | } 57 | 58 | void rolling_tilde_setup(void) { 59 | rolling_class = class_new(gensym("rolling~"), (t_newmethod)rolling_new, 60 | (t_method)rolling_free, (long)sizeof(t_rolling), 61 | CLASS_DEFAULT, A_GIMME, 0); 62 | CLASS_MAINSIGNALIN(rolling_class, t_rolling, f); 63 | class_addmethod(rolling_class, (t_method)rolling_setGrain, gensym("grain"), 64 | A_FLOAT, 0); 65 | class_addmethod(rolling_class, (t_method)rolling_setDepth, gensym("depth"), 66 | A_FLOAT, 0); 67 | class_addmethod(rolling_class, (t_method)rolling_setMass, gensym("mass"), 68 | A_FLOAT, 0); 69 | class_addmethod(rolling_class, (t_method)rolling_setVelocity, 70 | gensym("velocity"), A_FLOAT, 0); 71 | class_addmethod(rolling_class, (t_method)rolling_dsp, gensym("dsp"), 0); 72 | } 73 | -------------------------------------------------------------------------------- /src/Pd/scraping~.c: -------------------------------------------------------------------------------- 1 | #include "SDT/SDTCommon.h" 2 | #include "SDT/SDTControl.h" 3 | #include "SDTCommonPd.h" 4 | #ifdef NT 5 | #pragma warning(disable : 4244) 6 | #pragma warning(disable : 4305) 7 | #endif 8 | 9 | static t_class *scraping_class; 10 | 11 | typedef struct _scraping { 12 | t_object obj; 13 | SDTScraping *scraping; 14 | t_float f; 15 | t_outlet *out; 16 | const char *key; 17 | } t_scraping; 18 | 19 | SDT_PD_SETTER(scraping, Scraping, scraping, Grain, ) 20 | SDT_PD_SETTER(scraping, Scraping, scraping, Force, ) 21 | SDT_PD_SETTER(scraping, Scraping, scraping, Velocity, ) 22 | 23 | t_int *scraping_perform(t_int *w) { 24 | t_scraping *x = (t_scraping *)(w[1]); 25 | t_float *in = (t_float *)(w[2]); 26 | t_float *out = (t_float *)(w[3]); 27 | int n = (int)w[4]; 28 | 29 | while (n--) { 30 | *out++ = (t_float)SDTScraping_dsp(x->scraping, *in++); 31 | } 32 | return w + 5; 33 | } 34 | 35 | void scraping_dsp(t_scraping *x, t_signal **sp) { 36 | SDT_setSampleRate(sp[0]->s_sr); 37 | dsp_add(scraping_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); 38 | } 39 | 40 | void *scraping_new(t_symbol *s, long argc, t_atom *argv) { 41 | SDT_PD_ARG_PARSE(1, A_SYMBOL) 42 | 43 | t_scraping *x = (t_scraping *)pd_new(scraping_class); 44 | x->scraping = SDTScraping_new(); 45 | 46 | SDT_PD_REGISTER(Scraping, scraping, "scraping process", 0) 47 | 48 | x->out = outlet_new(&x->obj, gensym("signal")); 49 | return x; 50 | } 51 | 52 | void scraping_free(t_scraping *x) { 53 | SDT_PD_FREE(Scraping, scraping) 54 | outlet_free(x->out); 55 | } 56 | 57 | void scraping_tilde_setup(void) { 58 | scraping_class = class_new(gensym("scraping~"), (t_newmethod)scraping_new, 59 | (t_method)scraping_free, (long)sizeof(t_scraping), 60 | CLASS_DEFAULT, A_GIMME, 0); 61 | CLASS_MAINSIGNALIN(scraping_class, t_scraping, f); 62 | class_addmethod(scraping_class, (t_method)scraping_setGrain, gensym("grain"), 63 | A_FLOAT, 0); 64 | class_addmethod(scraping_class, (t_method)scraping_setForce, gensym("force"), 65 | A_FLOAT, 0); 66 | class_addmethod(scraping_class, (t_method)scraping_setVelocity, 67 | gensym("velocity"), A_FLOAT, 0); 68 | class_addmethod(scraping_class, (t_method)scraping_dsp, gensym("dsp"), 0); 69 | } -------------------------------------------------------------------------------- /src/Pd/sdtOSC.c: -------------------------------------------------------------------------------- 1 | #include "SDT/OSC/SDTOSC.h" 2 | 3 | #include 4 | 5 | #include "m_pd.h" 6 | 7 | static t_class *sdt_osc_class; 8 | 9 | typedef struct _sdt_osc { 10 | t_object obj; 11 | } t_sdt_osc; 12 | 13 | SDTOSCArgument *pd_arg_to_sdt(t_atom *x) { 14 | if (x->a_type == A_FLOAT) return SDTOSCArgument_newFloat(x->a_w.w_float); 15 | 16 | if (x->a_type == A_SYMBOL) 17 | return SDTOSCArgument_newString(x->a_w.w_symbol->s_name); 18 | 19 | return SDTOSCArgument_new(); 20 | } 21 | 22 | SDTOSCMessage *pd_args_to_sdt(t_symbol *s, int argc, t_atom *argv) { 23 | SDTOSCArgumentList *a = SDTOSCArgumentList_new(argc); 24 | for (unsigned int i = 0; i < argc; ++i) 25 | SDTOSCArgumentList_setArgument(a, i, pd_arg_to_sdt(argv + i)); 26 | return SDTOSCMessage_new(SDTOSCAddress_new(s->s_name), a); 27 | } 28 | 29 | void sdt_osc_root(t_sdt_osc *x, t_symbol *s, int argc, t_atom *argv) { 30 | SDTOSCMessage *m = pd_args_to_sdt(s, argc, argv); 31 | SDTOSCRoot(m); 32 | SDTOSCMessage_free(m); 33 | } 34 | 35 | void *sdt_osc_new(void) { 36 | t_sdt_osc *x = (t_sdt_osc *)pd_new(sdt_osc_class); 37 | 38 | return (void *)x; 39 | } 40 | 41 | void sdt_osc_free(t_sdt_osc *x) { ; } 42 | 43 | void sdt_osc_setup(void) { 44 | sdt_osc_class = 45 | class_new(gensym("sdtOSC"), (t_newmethod)sdt_osc_new, 46 | (t_method)sdt_osc_free, sizeof(t_sdt_osc), CLASS_DEFAULT, 0); 47 | 48 | class_addanything(sdt_osc_class, sdt_osc_root); 49 | } 50 | -------------------------------------------------------------------------------- /src/Pd/spectralfeats~.c: -------------------------------------------------------------------------------- 1 | #include "SDT/SDTAnalysis.h" 2 | #include "SDT/SDTCommon.h" 3 | #include "SDTCommonPd.h" 4 | #ifdef NT 5 | #pragma warning(disable : 4244) 6 | #pragma warning(disable : 4305) 7 | #endif 8 | 9 | static t_class *spectralfeats_class; 10 | 11 | typedef struct _spectralfeats { 12 | t_object obj; 13 | SDTSpectralFeats *feats; 14 | t_float f; 15 | t_outlet *out0; 16 | const char *key; 17 | } t_spectralfeats; 18 | 19 | SDT_PD_SETTER(spectralfeats, SpectralFeats, feats, Overlap, ) 20 | SDT_PD_SETTER(spectralfeats, SpectralFeats, feats, MinFreq, ) 21 | SDT_PD_SETTER(spectralfeats, SpectralFeats, feats, MaxFreq, ) 22 | 23 | t_int *spectralfeats_perform(t_int *w) { 24 | t_spectralfeats *x = (t_spectralfeats *)(w[1]); 25 | t_float *in = (t_float *)(w[2]); 26 | int n = (int)w[3]; 27 | double tmpOuts[8]; 28 | t_atom argv; 29 | int hasOutput = 0; 30 | 31 | while (n--) { 32 | hasOutput += SDTSpectralFeats_dsp(x->feats, tmpOuts, *in++); 33 | } 34 | if (hasOutput) { 35 | SETFLOAT(&argv, tmpOuts[0]); 36 | outlet_anything(x->out0, gensym("magnitude"), 1, &argv); 37 | SETFLOAT(&argv, tmpOuts[1]); 38 | outlet_anything(x->out0, gensym("centroid"), 1, &argv); 39 | SETFLOAT(&argv, tmpOuts[2]); 40 | outlet_anything(x->out0, gensym("spread"), 1, &argv); 41 | SETFLOAT(&argv, tmpOuts[3]); 42 | outlet_anything(x->out0, gensym("skewness"), 1, &argv); 43 | SETFLOAT(&argv, tmpOuts[4]); 44 | outlet_anything(x->out0, gensym("kurtosis"), 1, &argv); 45 | SETFLOAT(&argv, tmpOuts[5]); 46 | outlet_anything(x->out0, gensym("flatness"), 1, &argv); 47 | SETFLOAT(&argv, tmpOuts[6]); 48 | outlet_anything(x->out0, gensym("flux"), 1, &argv); 49 | SETFLOAT(&argv, tmpOuts[7]); 50 | outlet_anything(x->out0, gensym("onset"), 1, &argv); 51 | } 52 | return w + 4; 53 | } 54 | 55 | void spectralfeats_dsp(t_spectralfeats *x, t_signal **sp, short *count) { 56 | SDT_setSampleRate(sp[0]->s_sr); 57 | dsp_add(spectralfeats_perform, 3, x, sp[0]->s_vec, sp[0]->s_n); 58 | } 59 | 60 | void *spectralfeats_new(t_symbol *s, long argc, t_atom *argv) { 61 | SDT_PD_ARG_PARSE(2, A_SYMBOL, A_FLOAT) 62 | 63 | t_spectralfeats *x = (t_spectralfeats *)pd_new(spectralfeats_class); 64 | GET_ARG_WINSIZE(long, windowSize, 1, SDT_SPECTRALFEATS_SIZE_DEFAULT) 65 | x->feats = SDTSpectralFeats_new(windowSize); 66 | 67 | SDT_PD_REGISTER(SpectralFeats, feats, "spectral features extractor", 0) 68 | 69 | x->out0 = outlet_new(&x->obj, NULL); 70 | return (x); 71 | } 72 | 73 | void spectralfeats_free(t_spectralfeats *x) { 74 | outlet_free(x->out0); 75 | SDT_PD_FREE(SpectralFeats, feats) 76 | } 77 | 78 | void spectralfeats_tilde_setup(void) { 79 | spectralfeats_class = 80 | class_new(gensym("spectralfeats~"), (t_newmethod)spectralfeats_new, 81 | (t_method)spectralfeats_free, sizeof(t_spectralfeats), 82 | CLASS_DEFAULT, A_GIMME, 0); 83 | CLASS_MAINSIGNALIN(spectralfeats_class, t_spectralfeats, f); 84 | class_addmethod(spectralfeats_class, (t_method)spectralfeats_setOverlap, 85 | gensym("overlap"), A_FLOAT, 0); 86 | class_addmethod(spectralfeats_class, (t_method)spectralfeats_setMinFreq, 87 | gensym("minFreq"), A_FLOAT, 0); 88 | class_addmethod(spectralfeats_class, (t_method)spectralfeats_setMaxFreq, 89 | gensym("maxFreq"), A_FLOAT, 0); 90 | class_addmethod(spectralfeats_class, (t_method)spectralfeats_dsp, 91 | gensym("dsp"), 0); 92 | } 93 | -------------------------------------------------------------------------------- /src/Pd/windcavity~.c: -------------------------------------------------------------------------------- 1 | /** \file windcavity~.c 2 | * Puredata external for the simulation of gas flowing through resonating 3 | *cavities. 4 | * 5 | * \author Stefano Baldan (stefanobaldan@iuav.it) 6 | * 7 | *****************************************************************************/ 8 | 9 | #include "SDT/SDTCommon.h" 10 | #include "SDT/SDTGases.h" 11 | #include "SDTCommonPd.h" 12 | #ifdef NT 13 | #pragma warning(disable : 4244) 14 | #pragma warning(disable : 4305) 15 | #endif 16 | 17 | static t_class *windcavity_class; 18 | 19 | typedef struct _windcavity { 20 | t_object obj; 21 | SDTWindCavity *cavity; 22 | t_float f; 23 | t_outlet *out; 24 | const char *key; 25 | } t_windcavity; 26 | 27 | SDT_PD_SETTER(windcavity, WindCavity, cavity, Length, ) 28 | SDT_PD_SETTER(windcavity, WindCavity, cavity, Diameter, ) 29 | 30 | static t_int *windcavity_perform(t_int *w) { 31 | t_windcavity *x = (t_windcavity *)(w[1]); 32 | t_float *in = (t_float *)(w[2]); 33 | t_float *out = (t_float *)(w[3]); 34 | int n = (int)(w[4]); 35 | while (n--) { 36 | SDTWindCavity_setWindSpeed(x->cavity, *in++); 37 | *out++ = (float)SDTWindCavity_dsp(x->cavity); 38 | } 39 | return (w + 5); 40 | } 41 | 42 | static void windcavity_dsp(t_windcavity *x, t_signal **sp) { 43 | SDT_setSampleRate(sp[0]->s_sr); 44 | dsp_add(windcavity_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); 45 | } 46 | 47 | static void *windcavity_new(t_symbol *s, int argc, t_atom *argv) { 48 | SDT_PD_ARG_PARSE(2, A_SYMBOL, A_FLOAT) 49 | 50 | t_windcavity *x = (t_windcavity *)pd_new(windcavity_class); 51 | x->cavity = SDTWindCavity_new( 52 | GET_ARG(1, atom_getfloat, SDT_WINDCAVITY_MAXDELAY_DEFAULT)); 53 | 54 | SDT_PD_REGISTER(WindCavity, cavity, "wind cavity", 0) 55 | 56 | x->out = outlet_new(&x->obj, gensym("signal")); 57 | return (x); 58 | } 59 | 60 | static void windcavity_free(t_windcavity *x) { 61 | outlet_free(x->out); 62 | SDT_PD_FREE(WindCavity, cavity) 63 | } 64 | 65 | void windcavity_tilde_setup(void) { 66 | windcavity_class = 67 | class_new(gensym("windcavity~"), (t_newmethod)windcavity_new, 68 | (t_method)windcavity_free, sizeof(t_windcavity), CLASS_DEFAULT, 69 | A_GIMME, 0); 70 | CLASS_MAINSIGNALIN(windcavity_class, t_windcavity, f); 71 | class_addmethod(windcavity_class, (t_method)windcavity_setLength, 72 | gensym("length"), A_FLOAT, 0); 73 | class_addmethod(windcavity_class, (t_method)windcavity_setDiameter, 74 | gensym("diameter"), A_FLOAT, 0); 75 | class_addmethod(windcavity_class, (t_method)windcavity_dsp, gensym("dsp"), 0); 76 | } 77 | -------------------------------------------------------------------------------- /src/Pd/windflow~.c: -------------------------------------------------------------------------------- 1 | /** \file windflow~.c 2 | * Puredata external for the simulation of flowing gases. 3 | * 4 | * \author Stefano Baldan (stefanobaldan@iuav.it) 5 | * 6 | *****************************************************************************/ 7 | 8 | #include "SDT/SDTCommon.h" 9 | #include "SDT/SDTGases.h" 10 | #include "SDTCommonPd.h" 11 | #ifdef NT 12 | #pragma warning(disable : 4244) 13 | #pragma warning(disable : 4305) 14 | #endif 15 | 16 | static t_class *windflow_class; 17 | 18 | typedef struct _windflow { 19 | t_object obj; 20 | SDTWindFlow *flow; 21 | t_float f; 22 | t_outlet *out; 23 | const char *key; 24 | } t_windflow; 25 | 26 | static t_int *windflow_perform(t_int *w) { 27 | t_windflow *x = (t_windflow *)(w[1]); 28 | t_float *in = (t_float *)(w[2]); 29 | t_float *out = (t_float *)(w[3]); 30 | int n = (int)(w[4]); 31 | while (n--) { 32 | SDTWindFlow_setWindSpeed(x->flow, *in++); 33 | *out++ = (float)SDTWindFlow_dsp(x->flow); 34 | } 35 | return (w + 5); 36 | } 37 | 38 | static void windflow_dsp(t_windflow *x, t_signal **sp) { 39 | SDT_setSampleRate(sp[0]->s_sr); 40 | SDTWindFlow_update(x->flow); 41 | dsp_add(windflow_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); 42 | } 43 | 44 | static void *windflow_new(t_symbol *s, int argc, t_atom *argv) { 45 | SDT_PD_ARG_PARSE(1, A_SYMBOL) 46 | 47 | t_windflow *x = (t_windflow *)pd_new(windflow_class); 48 | x->flow = SDTWindFlow_new(); 49 | 50 | SDT_PD_REGISTER(WindFlow, flow, "wind flow", 0) 51 | 52 | x->out = outlet_new(&x->obj, gensym("signal")); 53 | return (x); 54 | } 55 | 56 | static void windflow_free(t_windflow *x) { 57 | outlet_free(x->out); 58 | SDT_PD_FREE(WindFlow, flow) 59 | } 60 | 61 | void windflow_tilde_setup(void) { 62 | windflow_class = class_new(gensym("windflow~"), (t_newmethod)windflow_new, 63 | (t_method)windflow_free, sizeof(t_windflow), 64 | CLASS_DEFAULT, A_GIMME, 0); 65 | CLASS_MAINSIGNALIN(windflow_class, t_windflow, f); 66 | class_addmethod(windflow_class, (t_method)windflow_dsp, gensym("dsp"), 0); 67 | } 68 | -------------------------------------------------------------------------------- /src/Pd/windkarman~.c: -------------------------------------------------------------------------------- 1 | /** \file windkarman~.c 2 | * Puredata external for the simulation of karman vortex sounds. 3 | * 4 | * \author Stefano Baldan (stefanobaldan@iuav.it) 5 | * 6 | *****************************************************************************/ 7 | 8 | #include "SDT/SDTCommon.h" 9 | #include "SDT/SDTGases.h" 10 | #include "SDTCommonPd.h" 11 | #ifdef NT 12 | #pragma warning(disable : 4244) 13 | #pragma warning(disable : 4305) 14 | #endif 15 | 16 | static t_class *windkarman_class; 17 | 18 | typedef struct _windkarman { 19 | t_object obj; 20 | SDTWindKarman *karman; 21 | t_float f; 22 | t_outlet *out; 23 | const char *key; 24 | } t_windkarman; 25 | 26 | SDT_PD_SETTER(windkarman, WindKarman, karman, Diameter, ) 27 | 28 | static t_int *windkarman_perform(t_int *w) { 29 | t_windkarman *x = (t_windkarman *)(w[1]); 30 | t_float *in = (t_float *)(w[2]); 31 | t_float *out = (t_float *)(w[3]); 32 | int n = (int)(w[4]); 33 | while (n--) { 34 | SDTWindKarman_setWindSpeed(x->karman, *in++); 35 | *out++ = (float)SDTWindKarman_dsp(x->karman); 36 | } 37 | return (w + 5); 38 | } 39 | 40 | static void windkarman_dsp(t_windkarman *x, t_signal **sp) { 41 | SDT_setSampleRate(sp[0]->s_sr); 42 | dsp_add(windkarman_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); 43 | } 44 | 45 | static void *windkarman_new(t_symbol *s, int argc, t_atom *argv) { 46 | SDT_PD_ARG_PARSE(1, A_SYMBOL) 47 | 48 | t_windkarman *x = (t_windkarman *)pd_new(windkarman_class); 49 | x->karman = SDTWindKarman_new(); 50 | 51 | SDT_PD_REGISTER(WindKarman, karman, "wind Karman", 0) 52 | 53 | x->out = outlet_new(&x->obj, gensym("signal")); 54 | return (x); 55 | } 56 | 57 | static void windkarman_free(t_windkarman *x) { 58 | outlet_free(x->out); 59 | SDT_PD_FREE(WindKarman, karman) 60 | } 61 | 62 | void windkarman_tilde_setup(void) { 63 | windkarman_class = 64 | class_new(gensym("windkarman~"), (t_newmethod)windkarman_new, 65 | (t_method)windkarman_free, sizeof(t_windkarman), CLASS_DEFAULT, 66 | A_GIMME, 0); 67 | CLASS_MAINSIGNALIN(windkarman_class, t_windkarman, f); 68 | class_addmethod(windkarman_class, (t_method)windkarman_setDiameter, 69 | gensym("diameter"), A_FLOAT, 0); 70 | class_addmethod(windkarman_class, (t_method)windkarman_dsp, gensym("dsp"), 0); 71 | } 72 | -------------------------------------------------------------------------------- /src/Pd/zerox~.c: -------------------------------------------------------------------------------- 1 | #include "SDT/SDTAnalysis.h" 2 | #include "SDT/SDTCommon.h" 3 | #include "SDTCommonPd.h" 4 | #ifdef NT 5 | #pragma warning(disable : 4244) 6 | #pragma warning(disable : 4305) 7 | #endif 8 | 9 | static t_class *zerox_class; 10 | 11 | typedef struct _zerox { 12 | t_object obj; 13 | SDTZeroCrossing *zerox; 14 | t_float f; 15 | t_outlet *out0; 16 | const char *key; 17 | } t_zerox; 18 | 19 | SDT_PD_SETTER(zerox, ZeroCrossing, zerox, Overlap, ) 20 | 21 | t_int *zerox_perform(t_int *w) { 22 | t_zerox *x = (t_zerox *)(w[1]); 23 | t_float *in = (t_float *)(w[2]); 24 | int n = (int)w[3]; 25 | double tmpOut; 26 | int hasOutput = 0; 27 | 28 | while (n--) { 29 | hasOutput += SDTZeroCrossing_dsp(x->zerox, &tmpOut, *in++); 30 | } 31 | if (hasOutput) { 32 | outlet_float(x->out0, tmpOut); 33 | } 34 | 35 | return w + 4; 36 | } 37 | 38 | void zerox_dsp(t_zerox *x, t_signal **sp, short *count) { 39 | SDT_setSampleRate(sp[0]->s_sr); 40 | dsp_add(zerox_perform, 3, x, sp[0]->s_vec, sp[0]->s_n); 41 | } 42 | 43 | void *zerox_new(t_symbol *s, long argc, t_atom *argv) { 44 | SDT_PD_ARG_PARSE(2, A_SYMBOL, A_FLOAT) 45 | 46 | t_zerox *x = (t_zerox *)pd_new(zerox_class); 47 | int windowSize = GET_ARG(1, atom_getfloat, SDT_ZEROCROSSING_SIZE_DEFAULT); 48 | x->zerox = SDTZeroCrossing_new(windowSize); 49 | 50 | SDT_PD_REGISTER(ZeroCrossing, zerox, "zero crossing rate detector", 0) 51 | 52 | x->out0 = outlet_new(&x->obj, gensym("float")); 53 | return (x); 54 | } 55 | 56 | void zerox_free(t_zerox *x) { 57 | outlet_free(x->out0); 58 | SDT_PD_FREE(ZeroCrossing, zerox) 59 | } 60 | 61 | void zerox_tilde_setup(void) { 62 | zerox_class = 63 | class_new(gensym("zerox~"), (t_newmethod)zerox_new, (t_method)zerox_free, 64 | sizeof(t_zerox), CLASS_DEFAULT, A_GIMME, 0); 65 | CLASS_MAINSIGNALIN(zerox_class, t_zerox, f); 66 | class_addmethod(zerox_class, (t_method)zerox_setOverlap, gensym("overlap"), 67 | A_FLOAT, 0); 68 | class_addmethod(zerox_class, (t_method)zerox_dsp, gensym("dsp"), 0); 69 | } 70 | -------------------------------------------------------------------------------- /src/SDT/OSC/SDTOSC.c: -------------------------------------------------------------------------------- 1 | #include "SDTOSC.h" 2 | 3 | #include 4 | 5 | #include "../SDTProjects.h" 6 | #include "SDTOSCAnalysis.h" 7 | #include "SDTOSCControl.h" 8 | #include "SDTOSCDCMotor.h" 9 | #include "SDTOSCDemix.h" 10 | #include "SDTOSCEffects.h" 11 | #include "SDTOSCFilters.h" 12 | #include "SDTOSCGases.h" 13 | #include "SDTOSCInteractors.h" 14 | #include "SDTOSCLiquids.h" 15 | #include "SDTOSCMotor.h" 16 | #include "SDTOSCProjects.h" 17 | #include "SDTOSCResonators.h" 18 | 19 | /** @brief Forward message to appropriate type 20 | @param[in] TYPENAME SDT type 21 | @param[in] TYPEKEY SDT JSON type key 22 | @param[in] U Ignored */ 23 | #define _SDT_FORWARD_CASE(TYPENAME, TYPEKEY, U) \ 24 | if (!strcmp(#TYPEKEY, k)) { \ 25 | return SDTOSC##TYPENAME(x); \ 26 | } 27 | 28 | int SDTOSCRoot(const SDTOSCMessage* x) { 29 | if (!SDTOSCMessage_valid(x)) { 30 | SDT_LOG(ERROR, "Invalid OSC message\n"); 31 | return -1; 32 | } 33 | SDTOSC_MESSAGE_LOGA(DEBUG, "\n %s\n", x, ""); 34 | const SDTOSCAddress* a = SDTOSCMessage_getAddress(x); 35 | if (!(a && SDTOSCAddress_getDepth(a))) return 1; 36 | const char* k = SDTOSCAddress_getNode(a, 0); 37 | // Special types 38 | if (!strcmp("project", k)) return SDTOSCProject(x); 39 | if (!strcmp("friction", k)) return SDTOSCFriction(x); 40 | if (!strcmp("impact", k)) return SDTOSCImpact(x); 41 | // Most types 42 | _SDT_CALL_FOR_ALL_TYPES(_SDT_FORWARD_CASE); 43 | // Synonyms 44 | if (!strcmp("myoelastic", k)) return SDTOSCMyoelastic(x); 45 | if (!strcmp("modal", k) || !strcmp("inertial", k)) return SDTOSCResonator(x); 46 | if (!strcmp("karman", k)) return SDTOSCWindKarman(x); 47 | if (!strcmp("zerocrossing", k)) return SDTOSCZeroCrossing(x); 48 | #ifdef SDT_VERBOSE 49 | // In verbose builds, where memory tracking is active, 50 | // an OSC message to /_arenaWarnNonEmpty will print 51 | // all non-deallocated SDT dynamic memory allocations 52 | // on the warning-level logger. 53 | // Please, consider that it will print warnings also for 54 | // the memory occupied by the OSC message itself. 55 | if (!strcmp("_arenaWarnNonEmpty", k)) { 56 | SDT_LOG(WARN, "--- Start of memory warnings ----------\n"); 57 | _SDT_arenaWarnNonEmpty(); 58 | SDT_LOG(WARN, "--- End of memory warnings ------------\n"); 59 | return 0; 60 | } 61 | #endif 62 | SDTOSC_MESSAGE_LOGA(ERROR, 63 | "\n %s\n [NOT IMPLEMENTED] The specified container is " 64 | "not implemented: % s\n %s\n ", 65 | x, k, SDTOSC_rtfm_string()); 66 | return 2; 67 | } 68 | -------------------------------------------------------------------------------- /src/SDT/OSC/SDTOSC.h: -------------------------------------------------------------------------------- 1 | #include "SDTOSCCommon.h" 2 | 3 | /** @defgroup oscmethods OSC Methods 4 | Implementation of OSC methods for SDT 5 | 6 | \section ordinary_classes Ordinary classes 7 | Most SDT classes can be controlled via OSC in the same way. 8 | Their address space is defined by the following pattern: 9 | \code{osc} // \endcode 10 | 11 | \subsection setter_methods Setter methods 12 | Each class has a setter method for each of their attributes. 13 | The method name for setter methods is the attribute name. 14 | The arguments for the setter methods are: 15 | \code{osc} // \endcode 16 | Please note that, for a SDT object to be controllable via OSC, it has to be 17 | registered with a key. See the `SDT_register()` method 18 | of the class of interest for further details. 19 | 20 | \subsection json_methods JSON methods 21 | Each class also has methods for JSON serialization and deserialization. 22 | - `log` logs the JSON description of an object to the configured 23 | info-level stream 24 | - `save` saves the JSON description of an object to a file 25 | - `load` loads the JSON description of an object from a file 26 | - `loads` loads the JSON description of an object from a string 27 | 28 | The first argument is always the key of the object of interest. 29 | The methods `save` and `load` also require a filepath as a 30 | second argument. The method `loads` interprets any following 31 | arguments as a JSON payload. \code{osc} 32 | //log 33 | //save 34 | //load 35 | //loads ... 36 | \endcode 37 | \section special_classes Special classes 38 | Some classes have a special behaviour, namely: 39 | - resonators (@ref oscresonators) have array-valued attributes 40 | - interactors (@ref OSCInteractors) are identified by two keys 41 | - projects (@ref oscprojects) allow to handle multiple objects at once with JSON 42 | @ingroup osc 43 | @{ */ 44 | 45 | /** @} */ 46 | 47 | /** @defgroup osc Open Sound Control 48 | Open Sound Control implementation for SDT 49 | @{ */ 50 | 51 | /** @} */ 52 | 53 | /** @file SDTOSC.h 54 | @defgroup osc_h SDTOSC.h: Open Sound Control 55 | Open Sound Control root for SDT 56 | @{ */ 57 | 58 | #ifndef SDT_OSC_H 59 | #define SDT_OSC_H 60 | 61 | #ifdef __cplusplus 62 | extern "C" { 63 | #endif 64 | 65 | /** @defgroup oscroot SDTOSC 66 | OSC root for SDT 67 | @ingroup oscmethods 68 | @{ */ 69 | 70 | /** @brief `/` 71 | 72 | OSC root for SDT methods 73 | @param [in] x OSC message 74 | @return Zero on success, non-zero otherwise */ 75 | extern int SDTOSCRoot(const SDTOSCMessage* x); 76 | 77 | /** @} */ 78 | 79 | #ifdef __cplusplus 80 | }; 81 | #endif 82 | 83 | #endif 84 | 85 | /** @} */ 86 | -------------------------------------------------------------------------------- /src/SDT/OSC/SDTOSCDCMotor.c: -------------------------------------------------------------------------------- 1 | #include "SDTOSCDCMotor.h" 2 | 3 | #include 4 | 5 | #include "../SDTDCMotor.h" 6 | 7 | int SDTOSCDCMotor(const SDTOSCMessage *x) { 8 | SDTOSC_MESSAGE_LOGA(VERBOSE, "\n %s\n", x, ""); 9 | const SDTOSCAddress *a = SDTOSCMessage_getAddress(x); 10 | if (SDTOSCAddress_getDepth(a) < 2) { 11 | SDTOSC_MESSAGE_LOGA(ERROR, 12 | "\n %s\n [MISSING METHOD] Please, specify an OSC " 13 | "method from the container\n %s\n", 14 | x, SDTOSC_rtfm_string()); 15 | return 1; 16 | } 17 | const char *k = SDTOSCAddress_getNode(a, 1); 18 | if (!strcmp("log", k)) return SDTOSCDCMotor_log(x); 19 | if (!strcmp("save", k)) return SDTOSCDCMotor_save(x); 20 | if (!strcmp("load", k)) return SDTOSCDCMotor_load(x); 21 | if (!strcmp("loads", k)) return SDTOSCDCMotor_loads(x); 22 | if (!strcmp("coils", k)) return SDTOSCDCMotor_setCoils(x); 23 | if (!strcmp("size", k)) return SDTOSCDCMotor_setSize(x); 24 | if (!strcmp("rpm", k)) return SDTOSCDCMotor_setRpm(x); 25 | if (!strcmp("stress", k)) return SDTOSCDCMotor_setLoad(x); 26 | if (!strcmp("reson", k)) return SDTOSCDCMotor_setReson(x); 27 | if (!strcmp("gearRatio", k) || !strcmp("ratio", k)) 28 | return SDTOSCDCMotor_setGearRatio(x); 29 | if (!strcmp("harshness", k) || !strcmp("harsh", k)) 30 | return SDTOSCDCMotor_setHarshness(x); 31 | if (!strcmp("rotorGain", k) || !strcmp("rotor", k)) 32 | return SDTOSCDCMotor_setRotorGain(x); 33 | if (!strcmp("gearGain", k) || !strcmp("gear", k)) 34 | return SDTOSCDCMotor_setGearGain(x); 35 | if (!strcmp("brushGain", k) || !strcmp("brush", k)) 36 | return SDTOSCDCMotor_setBrushGain(x); 37 | if (!strcmp("airGain", k) || !strcmp("air", k) || !strcmp("fan", k)) 38 | return SDTOSCDCMotor_setAirGain(x); 39 | 40 | SDTOSC_MESSAGE_LOGA(ERROR, 41 | "\n %s\n [NOT IMPLEMENTED] The specified method is not" 42 | " implemented: % s\n %s\n ", 43 | x, k, SDTOSC_rtfm_string()); 44 | return 2; 45 | } 46 | 47 | _SDTOSC_LOG_FUNCTION(DCMotor) 48 | _SDTOSC_SAVE_FUNCTION(DCMotor) 49 | _SDTOSC_LOAD_FUNCTION(DCMotor, ) 50 | _SDTOSC_LOADS_FUNCTION(DCMotor, ) 51 | 52 | _SDTOSC_SETTER_FUNCTION(DCMotor, coils, Coils, long, Float, float, ) 53 | _SDTOSC_FLOAT_SETTER_FUNCTION(DCMotor, rpm, Rpm, double, ) 54 | _SDTOSC_FLOAT_SETTER_FUNCTION(DCMotor, load, Load, double, ) 55 | _SDTOSC_FLOAT_SETTER_FUNCTION(DCMotor, size, Size, double, ) 56 | _SDTOSC_FLOAT_SETTER_FUNCTION(DCMotor, reson, Reson, double, ) 57 | _SDTOSC_FLOAT_SETTER_FUNCTION(DCMotor, gearRatio, GearRatio, double, ) 58 | _SDTOSC_FLOAT_SETTER_FUNCTION(DCMotor, harshness, Harshness, double, ) 59 | _SDTOSC_FLOAT_SETTER_FUNCTION(DCMotor, rotorGain, RotorGain, double, ) 60 | _SDTOSC_FLOAT_SETTER_FUNCTION(DCMotor, gearGain, GearGain, double, ) 61 | _SDTOSC_FLOAT_SETTER_FUNCTION(DCMotor, brushGain, BrushGain, double, ) 62 | _SDTOSC_FLOAT_SETTER_FUNCTION(DCMotor, airGain, AirGain, double, ) 63 | -------------------------------------------------------------------------------- /src/SDT/OSC/SDTOSCDemix.c: -------------------------------------------------------------------------------- 1 | #include "SDTOSCDemix.h" 2 | 3 | #include 4 | 5 | #include "../SDTDemix.h" 6 | 7 | 8 | int SDTOSCDemix(const SDTOSCMessage *x) { 9 | SDTOSC_MESSAGE_LOGA(VERBOSE, "\n %s\n", x, ""); 10 | const SDTOSCAddress *a = SDTOSCMessage_getAddress(x); 11 | if (SDTOSCAddress_getDepth(a) < 2) { 12 | SDTOSC_MESSAGE_LOGA(ERROR, 13 | "\n %s\n [MISSING METHOD] Please, specify an OSC " 14 | "method from the container\n %s\n", 15 | x, SDTOSC_rtfm_string()); 16 | return 1; 17 | } 18 | const char *k = SDTOSCAddress_getNode(a, 1); 19 | if (!strcmp("log", k)) return SDTOSCDemix_log(x); 20 | if (!strcmp("save", k)) return SDTOSCDemix_save(x); 21 | if (!strcmp("load", k)) return SDTOSCDemix_load(x); 22 | if (!strcmp("loads", k)) return SDTOSCDemix_loads(x); 23 | if (!strcmp("overlap", k)) return SDTOSCDemix_setOverlap(x); 24 | if (!strcmp("noiseThreshold", k)) return SDTOSCDemix_setNoiseThreshold(x); 25 | if (!strcmp("tonalThreshold", k)) return SDTOSCDemix_setTonalThreshold(x); 26 | SDTOSC_MESSAGE_LOGA(ERROR, 27 | "\n %s\n [NOT IMPLEMENTED] The specified method is not" 28 | " implemented: % s\n %s\n ", 29 | x, k, SDTOSC_rtfm_string()); 30 | return 2; 31 | } 32 | 33 | _SDTOSC_LOG_FUNCTION(Demix) 34 | _SDTOSC_SAVE_FUNCTION(Demix) 35 | _SDTOSC_LOAD_FUNCTION(Demix, ) 36 | _SDTOSC_LOADS_FUNCTION(Demix, ) 37 | 38 | _SDTOSC_FLOAT_SETTER_FUNCTION(Demix, overlap, Overlap, double, ) 39 | _SDTOSC_FLOAT_SETTER_FUNCTION(Demix, noiseThreshold, NoiseThreshold, double, ) 40 | _SDTOSC_FLOAT_SETTER_FUNCTION(Demix, tonalThreshold, TonalThreshold, double, ) 41 | -------------------------------------------------------------------------------- /src/SDT/OSC/SDTOSCDemix.h: -------------------------------------------------------------------------------- 1 | #include "SDTOSCCommon.h" 2 | 3 | /** @file SDTOSCDemix.h 4 | @defgroup OSCDemix SDTOSCDemix.h: OSC Demix 5 | OSC for #SDTDemix objects. 6 | @{ 7 | */ 8 | 9 | #ifndef SDT_OSC_DEMIX_H 10 | #define SDT_OSC_DEMIX_H 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /** @defgroup oscdemix SDTOSCDemix 17 | OSC for #SDTDemix objects. 18 | @ingroup oscmethods 19 | @{ 20 | */ 21 | 22 | /** @brief `/demix/log ` 23 | 24 | Function that implements OSC JSON log for #SDTDemix objects 25 | @param x OSC message 26 | @return Zero on success, non-zero otherwise */ 27 | extern int SDTOSCDemix_log(const SDTOSCMessage *x); 28 | 29 | /** @brief `/demix/save ` 30 | 31 | Function that implements OSC JSON save for #SDTDemix objects 32 | @param x OSC message 33 | @return Zero on success, non-zero otherwise */ 34 | extern int SDTOSCDemix_save(const SDTOSCMessage *x); 35 | 36 | /** @brief `/demix/load ` 37 | 38 | Function that implements OSC JSON file loading for #SDTDemix objects 39 | @param x OSC message 40 | @return Zero on success, non-zero otherwise */ 41 | extern int SDTOSCDemix_load(const SDTOSCMessage *x); 42 | 43 | /** @brief `/demix/loads ` 44 | 45 | Function that implements OSC JSON loading from string for #SDTDemix 46 | objects 47 | @param x OSC message 48 | @return Zero on success, non-zero otherwise */ 49 | extern int SDTOSCDemix_loads(const SDTOSCMessage *x); 50 | 51 | /** @brief `/demix/...` 52 | 53 | Function that routes OSC commands for #SDTDemix objects 54 | @param x OSC message pointer 55 | @return Zero on success, non-zero otherwise */ 56 | extern int SDTOSCDemix(const SDTOSCMessage *x); 57 | 58 | /** @brief `/demix/overlap ` 59 | 60 | Function that implements OSC parameter setting for #SDTBouncing objects 61 | @param x OSC message 62 | @return Zero on success, non-zero otherwise */ 63 | extern int SDTOSCDemix_setOverlap(const SDTOSCMessage *x); 64 | 65 | /** @brief `/demix/noiseThreshold ` 66 | 67 | Function that implements OSC parameter setting for #SDTBouncing objects 68 | @param x OSC message 69 | @return Zero on success, non-zero otherwise */ 70 | extern int SDTOSCDemix_setNoiseThreshold(const SDTOSCMessage *x); 71 | 72 | /** @brief `/demix/tonalThreshold ` 73 | 74 | Function that implements OSC parameter setting for #SDTBouncing objects 75 | @param x OSC message 76 | @return Zero on success, non-zero otherwise */ 77 | extern int SDTOSCDemix_setTonalThreshold(const SDTOSCMessage *x); 78 | 79 | /** @} */ 80 | 81 | #ifdef __cplusplus 82 | }; 83 | #endif 84 | 85 | #endif 86 | 87 | /** @} */ 88 | -------------------------------------------------------------------------------- /src/SDT/OSC/SDTOSCFilters.c: -------------------------------------------------------------------------------- 1 | #include "SDTOSCFilters.h" 2 | 3 | #include 4 | 5 | #include "../SDTFilters.h" 6 | 7 | /* --- Envelope -------------------------------------------------------- */ 8 | int SDTOSCEnvelope(const SDTOSCMessage* x) { 9 | SDTOSC_MESSAGE_LOGA(VERBOSE, "\n %s\n", x, ""); 10 | const SDTOSCAddress* a = SDTOSCMessage_getAddress(x); 11 | if (SDTOSCAddress_getDepth(a) < 2) { 12 | SDTOSC_MESSAGE_LOGA(ERROR, 13 | "\n %s\n [MISSING METHOD] Please, specify an OSC " 14 | "method from the container\n %s\n", 15 | x, SDTOSC_rtfm_string()); 16 | return 1; 17 | } 18 | const char* k = SDTOSCAddress_getNode(a, 1); 19 | if (!strcmp("log", k)) return SDTOSCEnvelope_log(x); 20 | if (!strcmp("save", k)) return SDTOSCEnvelope_save(x); 21 | if (!strcmp("load", k)) return SDTOSCEnvelope_load(x); 22 | if (!strcmp("loads", k)) return SDTOSCEnvelope_loads(x); 23 | if (!strcmp("attack", k)) return SDTOSCEnvelope_setAttack(x); 24 | if (!strcmp("release", k)) return SDTOSCEnvelope_setRelease(x); 25 | SDTOSC_MESSAGE_LOGA(ERROR, 26 | "\n %s\n [NOT IMPLEMENTED] The specified method is not " 27 | "implemented: %s\n %s\n", 28 | x, k, SDTOSC_rtfm_string()); 29 | return 2; 30 | } 31 | 32 | _SDTOSC_LOG_FUNCTION(Envelope) 33 | _SDTOSC_SAVE_FUNCTION(Envelope) 34 | _SDTOSC_LOAD_FUNCTION(Envelope, ) 35 | _SDTOSC_LOADS_FUNCTION(Envelope, ) 36 | 37 | _SDTOSC_FLOAT_SETTER_FUNCTION(Envelope, attack, Attack, double, ) 38 | _SDTOSC_FLOAT_SETTER_FUNCTION(Envelope, release, Release, double, ) 39 | /* ------------------------------------------------------------------------- */ 40 | -------------------------------------------------------------------------------- /src/SDT/OSC/SDTOSCFilters.h: -------------------------------------------------------------------------------- 1 | #include "SDTOSCCommon.h" 2 | 3 | /** @file SDTOSCFilters.h 4 | @defgroup oscfilters SDTOSCFilters.h: OSC for audio filters 5 | @{ */ 6 | 7 | #ifndef SDT_OSC_FILTERS_H 8 | #define SDT_OSC_FILTERS_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | /** @defgroup oscenvelope SDTOSCEnvelope 15 | OSC for #SDTEnvelope objects 16 | @ingroup oscmethods 17 | @{ */ 18 | 19 | /** @brief `/envelope/log ` 20 | 21 | Function that implements OSC JSON log for #SDTEnvelope objects 22 | @param x OSC message 23 | @return Zero on success, non-zero otherwise */ 24 | extern int SDTOSCEnvelope_log(const SDTOSCMessage *x); 25 | 26 | /** @brief `/envelope/save ` 27 | 28 | Function that implements OSC JSON save for #SDTEnvelope objects 29 | @param x OSC message 30 | @return Zero on success, non-zero otherwise */ 31 | extern int SDTOSCEnvelope_save(const SDTOSCMessage *x); 32 | 33 | /** @brief `/envelope/load ` 34 | 35 | Function that implements OSC JSON file loading for #SDTEnvelope objects 36 | @param x OSC message 37 | @return Zero on success, non-zero otherwise */ 38 | extern int SDTOSCEnvelope_load(const SDTOSCMessage *x); 39 | 40 | /** @brief `/envelope/loads ` 41 | 42 | Function that implements OSC JSON loading from string for #SDTEnvelope 43 | objects 44 | @param x OSC message 45 | @return Zero on success, non-zero otherwise */ 46 | extern int SDTOSCEnvelope_loads(const SDTOSCMessage *x); 47 | 48 | /** @brief `/envelope/attack ` 49 | 50 | Function that implements OSC parameter setting for #SDTEnvelope objects 51 | @param x OSC message 52 | @return Zero on success, non-zero otherwise */ 53 | extern int SDTOSCEnvelope_setAttack(const SDTOSCMessage *x); 54 | 55 | /** @brief `/envelope/release ` 56 | 57 | Function that implements OSC parameter setting for #SDTEnvelope objects 58 | @param x OSC message 59 | @return Zero on success, non-zero otherwise */ 60 | extern int SDTOSCEnvelope_setRelease(const SDTOSCMessage *x); 61 | 62 | /** @brief `/envelope/...` 63 | 64 | Function that routes OSC commands for #SDTEnvelope objects 65 | @param x OSC message pointer 66 | @return Zero on success, non-zero otherwise */ 67 | extern int SDTOSCEnvelope(const SDTOSCMessage *x); 68 | 69 | /** @} */ 70 | 71 | #ifdef __cplusplus 72 | }; 73 | #endif 74 | 75 | #endif 76 | 77 | /** @} */ 78 | -------------------------------------------------------------------------------- /src/SDT/OSC/SDTOSCProjects.c: -------------------------------------------------------------------------------- 1 | #include "SDTOSCProjects.h" 2 | 3 | #include 4 | 5 | #include "../SDTProjects.h" 6 | 7 | int SDTOSCProject(const SDTOSCMessage *x) { 8 | SDTOSC_MESSAGE_LOGA(VERBOSE, "n %sn", x, ""); 9 | const SDTOSCAddress *a = SDTOSCMessage_getAddress(x); 10 | if (SDTOSCAddress_getDepth(a) < 2) { 11 | SDTOSC_MESSAGE_LOGA(ERROR, 12 | "n %sn [MISSING METHOD] Please, specify an OSC " 13 | "method from the containern %sn", 14 | x, SDTOSC_rtfm_string()); 15 | return 1; 16 | } 17 | const char *k = SDTOSCAddress_getNode(a, 1); 18 | if (!strcmp("log", k)) return SDTOSCProject_log(x); 19 | if (!strcmp("save", k)) return SDTOSCProject_save(x); 20 | if (!strcmp("load", k)) return SDTOSCProject_load(x); 21 | if (!strcmp("loads", k)) return SDTOSCProject_loads(x); 22 | SDTOSC_MESSAGE_LOGA(ERROR, 23 | "n %sn [NOT IMPLEMENTED] The specified method is not" 24 | " implemented: % sn %sn ", 25 | x, k, SDTOSC_rtfm_string()); 26 | return 2; 27 | } 28 | 29 | /** @brief Convert an OSC argument list to a C-string array 30 | @param[in] x OSC Message 31 | @param[in] start Index of the first argument to save 32 | @param[out] s Output string array. Array should be freed. 33 | Individual strings should not 34 | @return Number of strings */ 35 | static int _SDTOSC_getStringsFromArgs(const SDTOSCMessage *x, int start, 36 | const char ***s) { 37 | int argc = 0; 38 | const SDTOSCArgumentList *args = SDTOSCMessage_getArguments(x); 39 | int n = SDTOSCArgumentList_getNArgs(args); 40 | for (int i = start; i < n; ++i) 41 | if (SDTOSCArgumentList_isString(args, i)) argc++; 42 | *s = malloc(sizeof(const char *) * argc); 43 | for (int i = start, j = 0; i < n; ++i) 44 | if (SDTOSCArgumentList_isString(args, i)) { 45 | (*s)[j] = SDTOSCArgumentList_getString(args, i); 46 | j++; 47 | } 48 | return argc; 49 | } 50 | 51 | int SDTOSCProject_log(const SDTOSCMessage *x) { 52 | SDTOSC_MESSAGE_LOGA(VERBOSE, "n %sn", x, "") 53 | const char **argv = NULL; 54 | int argc = _SDTOSC_getStringsFromArgs(x, 0, &argv); 55 | json_value *jobj = SDTProject_toJSON(argc, argv); 56 | free(argv); 57 | int r = SDTOSCJSON_log("SDT project", jobj); 58 | json_builder_free(jobj); 59 | return r; 60 | } 61 | 62 | int SDTOSCProject_save(const SDTOSCMessage *x) { 63 | SDTOSC_MESSAGE_LOGA(VERBOSE, "n %sn", x, "") 64 | const SDTOSCArgumentList *args = SDTOSCMessage_getArguments(x); 65 | _SDTOSC_GETFPATH(fpath, x, 0); 66 | const char **argv = NULL; 67 | int argc = _SDTOSC_getStringsFromArgs(x, 1, &argv); 68 | json_value *jobj = SDTProject_toJSON(argc, argv); 69 | free(argv); 70 | int r = SDTOSCJSON_save("SDT project", jobj, fpath); 71 | json_builder_free(jobj); 72 | return r; 73 | } 74 | 75 | int SDTOSCProject_load(const SDTOSCMessage *x) { 76 | SDTOSC_MESSAGE_LOGA(VERBOSE, "n %sn", x, "") 77 | const SDTOSCArgumentList *args = SDTOSCMessage_getArguments(x); 78 | _SDTOSC_GETFPATH(fpath, x, 0); 79 | json_value *jobj; 80 | int r = SDTOSCJSON_load("SDT project", &jobj, fpath); 81 | if (r) return r; 82 | r = SDTProject_fromJSON(jobj, 0); 83 | json_builder_free(jobj); 84 | return r; 85 | } 86 | 87 | int SDTOSCProject_loads(const SDTOSCMessage *x) { 88 | SDTOSC_MESSAGE_LOGA(VERBOSE, "n %sn", x, "") 89 | json_value *jobj = _SDTOSC_trailingArgsToJSON(x, 0); 90 | if (!jobj) { 91 | SDTOSC_MESSAGE_LOGA( 92 | ERROR, "\n %s\n [PARSER ERROR] Error while parsing JSON string\n%s", 93 | x, ""); 94 | return 7; 95 | } 96 | int r = SDTProject_fromJSON(jobj, 0); 97 | json_builder_free(jobj); 98 | return r; 99 | } 100 | -------------------------------------------------------------------------------- /src/SDT/OSC/SDTOSCProjects.h: -------------------------------------------------------------------------------- 1 | #include "SDTOSCCommon.h" 2 | 3 | /** @file SDTOSCProjects.h 4 | @defgroup osc_projects SDTOSCProjects.h: OSC Projects 5 | OSC containers and methods for SDT Projects 6 | @{ 7 | */ 8 | 9 | #ifndef SDT_OSC_PROJECTS_H 10 | #define SDT_OSC_PROJECTS_H 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /** @defgroup oscprojects SDTOSCProjects 17 | OSC for SDT projects 18 | 19 | \section project_methods Project methods 20 | Project methods can affect multiple objects at once. This is useful to debug, 21 | save and set the parameters when multiple SDT objects are involved. 22 | 23 | \subsection json_methods JSON methods 24 | Projects only have methods for JSON serialization and 25 | deserialization. The methods `save` and `load` require a filepath as a first 26 | argument. The methods `log` and `save` require the keys of the objects of 27 | interest. \code{osc} 28 | //log ... 29 | //save ... 30 | //load 31 | //loads ... 32 | \endcode 33 | Note that, if two or more resonators are involved in the project, so will any 34 | interactor registered between any pair of such resonators. 35 | @ingroup oscmethods 36 | @{ 37 | */ 38 | 39 | /** @brief `/project/log ...` 40 | 41 | Function that implements OSC JSON log for SDT projects 42 | @param x OSC message 43 | @return Zero on success, non-zero otherwise */ 44 | extern int SDTOSCProject_log(const SDTOSCMessage *x); 45 | 46 | /** @brief `/project/save ...` 47 | 48 | Function that implements OSC JSON save for SDT projects 49 | @param x OSC message 50 | @return Zero on success, non-zero otherwise */ 51 | extern int SDTOSCProject_save(const SDTOSCMessage *x); 52 | 53 | /** @brief `/project/load ` 54 | 55 | Function that implements OSC JSON file loading for SDT projects 56 | @param x OSC message 57 | @return Zero on success, non-zero otherwise */ 58 | extern int SDTOSCProject_load(const SDTOSCMessage *x); 59 | 60 | /** @brief `/project/loads ` 61 | 62 | Function that implements OSC JSON loading from string for SDT projects 63 | @param x OSC message 64 | @return Zero on success, non-zero otherwise */ 65 | extern int SDTOSCProject_loads(const SDTOSCMessage *x); 66 | 67 | /** @brief `/project/...` 68 | 69 | Function that routes OSC commands for SDT projects 70 | @param x OSC message pointer 71 | @return Zero on success, non-zero otherwise */ 72 | extern int SDTOSCProject(const SDTOSCMessage *x); 73 | 74 | /** @} */ 75 | 76 | #ifdef __cplusplus 77 | }; 78 | #endif 79 | 80 | #endif 81 | 82 | /** @} */ 83 | -------------------------------------------------------------------------------- /src/SDT/OSC/SDTOSCResonators.c: -------------------------------------------------------------------------------- 1 | #include "SDTOSCResonators.h" 2 | 3 | #include 4 | 5 | #include "../SDTResonators.h" 6 | 7 | int SDTOSCResonator(const SDTOSCMessage *x) { 8 | SDTOSC_MESSAGE_LOGA(VERBOSE, "\n %s\n", x, ""); 9 | const SDTOSCAddress *a = SDTOSCMessage_getAddress(x); 10 | if (SDTOSCAddress_getDepth(a) < 2) { 11 | SDTOSC_MESSAGE_LOGA(ERROR, 12 | "\n %s\n [MISSING METHOD] Please, specify an OSC " 13 | "method from the container\n %s\n", 14 | x, SDTOSC_rtfm_string()); 15 | return 1; 16 | } 17 | const char *k = SDTOSCAddress_getNode(a, 1); 18 | if (!strcmp("log", k)) return SDTOSCResonator_log(x); 19 | if (!strcmp("save", k)) return SDTOSCResonator_save(x); 20 | if (!strcmp("load", k)) return SDTOSCResonator_load(x); 21 | if (!strcmp("loads", k)) return SDTOSCResonator_loads(x); 22 | if (!strcmp("frequency", k) || !strcmp("freq", k)) 23 | return SDTOSCResonator_setFrequency(x); 24 | if (!strcmp("decay", k)) return SDTOSCResonator_setDecay(x); 25 | if (!strcmp("weight", k)) return SDTOSCResonator_setWeight(x); 26 | if (!strcmp("gain", k) || !strcmp("pickup", k)) 27 | return SDTOSCResonator_setGain(x); 28 | if (!strcmp("fragmentSize", k) || !strcmp("fragment", k)) 29 | return SDTOSCResonator_setFragmentSize(x); 30 | if (!strcmp("activeModes", k) || !strcmp("modes", k) || !strcmp("active", k)) 31 | return SDTOSCResonator_setActiveModes(x); 32 | SDTOSC_MESSAGE_LOGA(ERROR, 33 | "\n %s\n [NOT IMPLEMENTED] The specified method is not " 34 | "implemented: %s\n %s\n", 35 | x, k, SDTOSC_rtfm_string()); 36 | return 2; 37 | } 38 | 39 | _SDTOSC_LOG_FUNCTION(Resonator) 40 | _SDTOSC_SAVE_FUNCTION(Resonator) 41 | _SDTOSC_LOAD_FUNCTION(Resonator, ) 42 | _SDTOSC_LOADS_FUNCTION(Resonator, ) 43 | 44 | #define _SDT_OSC_RESONATOR_SET_ARRAY_ELEM(ATTRNAME) \ 45 | int SDTOSCResonator_set##ATTRNAME(const SDTOSCMessage *x) { \ 46 | SDTOSC_MESSAGE_LOGA(VERBOSE, "\n %s\n", x, ""); \ 47 | _SDTOSC_FIND_IN_HASHMAP(Resonator, obj, name, x); \ 48 | _SDTOSC_GETARG(f, 2, float, Float, float, x); \ 49 | _SDTOSC_GETARG(mode, 1, int, Float, float, x); \ 50 | SDTResonator_set##ATTRNAME(obj, mode, f); \ 51 | return 0; \ 52 | } 53 | 54 | _SDT_OSC_RESONATOR_SET_ARRAY_ELEM(Frequency) 55 | _SDT_OSC_RESONATOR_SET_ARRAY_ELEM(Decay) 56 | _SDT_OSC_RESONATOR_SET_ARRAY_ELEM(Weight) 57 | 58 | int SDTOSCResonator_setGain(const SDTOSCMessage *x) { 59 | SDTOSC_MESSAGE_LOGA(VERBOSE, "\n %s\n", x, ""); 60 | _SDTOSC_FIND_IN_HASHMAP(Resonator, obj, name, x); 61 | _SDTOSC_GETARG(f, 3, float, Float, float, x); 62 | _SDTOSC_GETARG(mode, 2, int, Float, float, x); 63 | _SDTOSC_GETARG(pickup, 1, int, Float, float, x); 64 | SDTResonator_setGain(obj, pickup, mode, f); 65 | return 0; 66 | } 67 | 68 | _SDTOSC_FLOAT_SETTER_FUNCTION(Resonator, fragmentSize, FragmentSize, double, ) 69 | _SDTOSC_FLOAT_SETTER_FUNCTION(Resonator, activeModes, ActiveModes, 70 | unsigned int, ) 71 | -------------------------------------------------------------------------------- /src/SDT/SDTComplex.c: -------------------------------------------------------------------------------- 1 | #include "SDTComplex.h" 2 | #include 3 | #include 4 | #include "SDTCommon.h" 5 | 6 | SDTComplex SDTComplex_car(double real, double imag) { 7 | SDTComplex x; 8 | 9 | x.r = real; 10 | x.i = imag; 11 | return x; 12 | } 13 | 14 | SDTComplex SDTComplex_exp(double phase) { 15 | SDTComplex x; 16 | 17 | x.r = cos(phase); 18 | x.i = sin(phase); 19 | return x; 20 | } 21 | 22 | double SDTComplex_abs(SDTComplex a) { 23 | double x; 24 | 25 | x = sqrt(a.r * a.r + a.i * a.i); 26 | return x; 27 | } 28 | 29 | double SDTComplex_angle(SDTComplex a) { 30 | double x; 31 | 32 | x = atan2(a.i, a.r); 33 | return x; 34 | } 35 | 36 | SDTComplex SDTComplex_conj(SDTComplex a) { 37 | SDTComplex x; 38 | 39 | x.r = a.r; 40 | x.i = -a.i; 41 | return x; 42 | } 43 | 44 | SDTComplex SDTComplex_add(SDTComplex a, SDTComplex b) { 45 | SDTComplex x; 46 | 47 | x.r = a.r + b.r; 48 | x.i = a.i + b.i; 49 | return x; 50 | } 51 | 52 | SDTComplex SDTComplex_sub(SDTComplex a, SDTComplex b) { 53 | SDTComplex x; 54 | 55 | x.r = a.r - b.r; 56 | x.i = a.i - b.i; 57 | return x; 58 | } 59 | 60 | SDTComplex SDTComplex_mult(SDTComplex a, SDTComplex b) { 61 | SDTComplex x; 62 | 63 | x.r = a.r * b.r - a.i * b.i; 64 | x.i = a.i * b.r + a.r * b.i; 65 | return x; 66 | } 67 | 68 | SDTComplex SDTComplex_div(SDTComplex a, SDTComplex b) { 69 | SDTComplex x; 70 | double d; 71 | 72 | d = b.r * b.r + b.i * b.i; 73 | x.r = (a.r * b.r + a.i * b.i) / d; 74 | x.i = (a.i * b.r - a.r * b.i) / d; 75 | return x; 76 | } 77 | 78 | SDTComplex SDTComplex_addReal(SDTComplex a, double b) { 79 | SDTComplex x; 80 | 81 | x.r = a.r + b; 82 | x.i = a.i; 83 | return x; 84 | } 85 | 86 | SDTComplex SDTComplex_subReal(SDTComplex a, double b) { 87 | SDTComplex x; 88 | 89 | x.r = a.r - b; 90 | x.i = a.i; 91 | return x; 92 | } 93 | 94 | SDTComplex SDTComplex_realSub(double a, SDTComplex b) { 95 | SDTComplex x; 96 | 97 | x.r = a - b.r; 98 | x.i = -b.i; 99 | return x; 100 | } 101 | 102 | SDTComplex SDTComplex_multReal(SDTComplex a, double b) { 103 | SDTComplex x; 104 | 105 | x.r = a.r * b; 106 | x.i = a.i * b; 107 | return x; 108 | } 109 | 110 | SDTComplex SDTComplex_divReal(SDTComplex a, double b) { 111 | SDTComplex x; 112 | double d; 113 | 114 | d = b * b; 115 | x.r = (a.r * b) / d; 116 | x.i = (a.i * b) / d; 117 | return x; 118 | } 119 | 120 | SDTComplex SDTComplex_realDiv(double a, SDTComplex b) { 121 | SDTComplex x; 122 | double d; 123 | 124 | d = b.r * b.r + b.i * b.i; 125 | x.r = (a * b.r) / d; 126 | x.i = (-a * b.i) / d; 127 | return x; 128 | } 129 | -------------------------------------------------------------------------------- /src/SDT/SDTFFT.h: -------------------------------------------------------------------------------- 1 | #include "SDTComplex.h" 2 | 3 | /** @file SDTFFT.h 4 | @defgroup fft SDTFFT.h: Fast Fourier Transform 5 | Data structures and functions to perform frequency analysis on signals 6 | by means of the Discrete Fourier Transform and its inverse. 7 | This implementation is based on the iterative version of the Cooley-Tukey 8 | algorithm, works with double precision floating point arithmetic and provides an 9 | optimization for the transformation of real-valued signals. 10 | 11 | @{ */ 12 | 13 | #ifndef SDT_FFT_H 14 | #define SDT_FFT_H 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /** @brief Opaque data structure, representing a FFT object. */ 21 | typedef struct SDTFFT SDTFFT; 22 | 23 | /** @brief Object constructor. 24 | @param[in] n FFT window length, must be a power of 2 25 | @return Pointer to the newly created instance, or NULL if n is not a power of 2 26 | */ 27 | extern SDTFFT *SDTFFT_new(unsigned int n); 28 | 29 | /** @brief Object destructor. 30 | @param[in] Pointer to the instance to destroy */ 31 | extern void SDTFFT_free(SDTFFT *x); 32 | 33 | /** @brief Performs a direct or inverse FFT of a complex-valued signal. 34 | @param[in] inverse Perform a direct FFT if 0, or an inverse FFT otherwise 35 | @param[in] in Input signal to transform, must be at least of length n 36 | @param[out] out Transformed output, must be at least of length n. When 37 | performing 38 | an inverse transform, divide every sample by n to obtain the original signal */ 39 | extern void SDTFFT_fft(SDTFFT *x, int inverse, SDTComplex *in, SDTComplex *out); 40 | 41 | /** @brief Performs a direct FFT of a real-valued signal. 42 | @param[in] in Input signal to transform, must be at least of length 2n 43 | @param[out] out Transformed output */ 44 | extern void SDTFFT_fftr(SDTFFT *x, double *in, SDTComplex *out); 45 | 46 | /** @brief Performs an inverse FFT of a signal known to be real-valued. 47 | @param[in] in Input FFT to invert 48 | @param[out] out Reconstructed signal. Divide every sample by n 49 | to obtain the original signal */ 50 | extern void SDTFFT_ifftr(SDTFFT *x, SDTComplex *in, double *out); 51 | 52 | #ifdef __cplusplus 53 | }; 54 | #endif 55 | 56 | #endif 57 | 58 | /** @} */ -------------------------------------------------------------------------------- /src/SDT/SDTMemoryTrack.h: -------------------------------------------------------------------------------- 1 | // Include in debug mode only 2 | #ifdef SDT_DEBUG 3 | 4 | #include 5 | #include 6 | 7 | #include "SDTCommon.h" 8 | 9 | /** @file SDTMemoryTrack.h 10 | @defgroup MemoryTrack SDTMemoryTrack.h: Memory tracking utilities 11 | Functions and structures to track memory leaks 12 | @{ 13 | */ 14 | 15 | #ifndef SDT_MEMORYTRACK_H 16 | #define SDT_MEMORYTRACK_H 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /** @brief Warn if SDT's memory is not empty 23 | @return Zero if empty, non-zero otherwise */ 24 | extern int _SDT_arenaWarnNonEmpty(); 25 | 26 | /** @brief Reset SDT's memory trace */ 27 | extern void _SDT_resetArena(); 28 | 29 | /** @brief Get SDT's current memory trace size */ 30 | extern size_t _SDT_currentArena(); 31 | 32 | /** @brief Get SDT's current number of objects in the memory trace */ 33 | extern size_t _SDT_currentArenaLength(); 34 | 35 | /** @brief SDT's tracking malloc 36 | @param[in] size Memory size to allocate 37 | @param[in] file File where call to malloc happens 38 | @param[in] line Line where call to malloc happens 39 | @param[in] func Function where call to malloc happens 40 | @return Pointer to the allocated memory */ 41 | extern void* _SDT_mallocTrack(size_t size, const char* file, unsigned int line, 42 | const char* func); 43 | 44 | /** @brief SDT's tracking calloc 45 | @param[in] count Number of elements to allocate 46 | @param[in] size Size of each element 47 | @param[in] file File where call to malloc happens 48 | @param[in] line Line where call to malloc happens 49 | @param[in] func Function where call to malloc happens 50 | @return Pointer to the allocated memory */ 51 | extern void* _SDT_callocTrack(size_t count, size_t size, const char* file, 52 | unsigned int line, const char* func); 53 | 54 | /** @brief SDT's tracking free 55 | @param[in] p Pointer to the allocated memory to free 56 | @param[in] file File where call to free happens 57 | @param[in] line Line where call to free happens 58 | @param[in] func Function where call to free happens */ 59 | extern void _SDT_freeTrack(void* p, const char* file, unsigned int line, 60 | const char* func); 61 | 62 | #define malloc(X) _SDT_mallocTrack(X, __FILE__, __LINE__, __func__) 63 | #define calloc(C, S) _SDT_callocTrack(C, S, __FILE__, __LINE__, __func__) 64 | #define free(X) _SDT_freeTrack(X, __FILE__, __LINE__, __func__) 65 | 66 | #ifdef __cplusplus 67 | }; 68 | #endif 69 | 70 | #endif 71 | 72 | /** @} */ 73 | #endif 74 | -------------------------------------------------------------------------------- /src/SDT/SDTOscillators.c: -------------------------------------------------------------------------------- 1 | #include "SDTOscillators.h" 2 | #include 3 | #include 4 | #include "SDTCommon.h" 5 | 6 | #define LCG_MULT 1664525 7 | #define LCG_ADD 1013904223 8 | 9 | unsigned int seed = 42; 10 | 11 | //-------------------------------------------------------------------------------------// 12 | 13 | struct SDTPinkNoise { 14 | double *octaves; 15 | int *steps, *offsets, n, count; 16 | }; 17 | 18 | SDTPinkNoise *SDTPinkNoise_new(int nOctaves) { 19 | SDTPinkNoise *x; 20 | int i; 21 | 22 | x = (SDTPinkNoise *)malloc(sizeof(SDTPinkNoise)); 23 | x->octaves = (double *)calloc(nOctaves, sizeof(double)); 24 | x->steps = (int *)calloc(nOctaves, sizeof(int)); 25 | x->offsets = (int *)calloc(nOctaves, sizeof(int)); 26 | x->n = nOctaves; 27 | x->count = 0; 28 | for (i = 0; i < x->n; i++) { 29 | x->steps[i] = exp2(i); 30 | x->offsets[i] = x->steps[i] >> 1; 31 | } 32 | return x; 33 | } 34 | 35 | void SDTPinkNoise_free(SDTPinkNoise *x) { 36 | free(x->offsets); 37 | free(x->steps); 38 | free(x->octaves); 39 | free(x); 40 | } 41 | 42 | double SDTPinkNoise_dsp(SDTPinkNoise *x) { 43 | double result; 44 | int i; 45 | 46 | result = 0; 47 | for (i = 0; i < x->n; i++) { 48 | if ((x->count + x->offsets[i]) % x->steps[i] == 0) { 49 | x->octaves[i] = SDT_whiteNoise(); 50 | } 51 | result += x->octaves[i]; 52 | } 53 | result /= (double)x->n; 54 | x->count = (x->count + 1) % x->steps[x->n - 1]; 55 | return result; 56 | } 57 | 58 | //-------------------------------------------------------------------------------------// 59 | 60 | double SDT_whiteNoise() { 61 | seed = seed * LCG_MULT + LCG_ADD; 62 | return (double)seed / (double)0x7FFFFFFF - 1.0; 63 | } 64 | -------------------------------------------------------------------------------- /src/SDT/SDTOscillators.h: -------------------------------------------------------------------------------- 1 | /** @file SDTOscillators.h 2 | @defgroup oscillators SDTOscillators.h: Oscillators 3 | Simple, commonly used sound generators. 4 | @{ */ 5 | 6 | #ifndef SDT_OSCILLATORS_H 7 | #define SDT_OSCILLATORS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /** @brief Opaque data structure for a pink noise generator */ 14 | typedef struct SDTPinkNoise SDTPinkNoise; 15 | 16 | /** @brief Object constructor. 17 | @param[in] nOctaves N. of octave bands for the pink noise generator. 18 | @return Pointer to the new instance */ 19 | extern SDTPinkNoise *SDTPinkNoise_new(int nOctaves); 20 | 21 | /** @brief Object destructor. 22 | @param[in] x Pointer to the instance to destroy */ 23 | extern void SDTPinkNoise_free(SDTPinkNoise *x); 24 | 25 | /** @brief Signal processing routine. 26 | Call this function at sample rate to generate pink noise */ 27 | extern double SDTPinkNoise_dsp(SDTPinkNoise *x); 28 | 29 | /** @brief Signal processing routine. 30 | Call this function at sample rate to generate white noise */ 31 | extern double SDT_whiteNoise(); 32 | 33 | /** @} */ 34 | 35 | #ifdef __cplusplus 36 | }; 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/SDT/SDTProjects.h: -------------------------------------------------------------------------------- 1 | #include "SDTJSON.h" 2 | 3 | /** @file SDTProjects.h 4 | @defgroup sdt_projects SDTProjects.h: SDT Projects 5 | Functions for SDT Projects 6 | @{ 7 | */ 8 | 9 | #ifndef SDT_PROJECTS_H 10 | #define SDT_PROJECTS_H 11 | 12 | /** @brief Convert to a JSON object the information about a SDT project 13 | @param[in] argc Number of arguments 14 | @param[in] argv Array of keys of the objects in the project 15 | @return The project JSON object. Must be freed with json_builder_free */ 16 | extern json_value *SDTProject_toJSON(int argc, const char **argv); 17 | 18 | /** @brief Load information about a SDT project from a JSON object 19 | @param[in] prj The project JSON object 20 | @param[in] unsafe If false, do not perform any memory-related changes 21 | @return Zero on success, non-zero otherwise */ 22 | extern int SDTProject_fromJSON(const json_value *prj, unsigned char unsafe); 23 | 24 | /** @brief Call macro for all types, except interactors 25 | @param[in] FOO Macro */ 26 | #define _SDT_CALL_FOR_ALL_TYPES(FOO) \ 27 | FOO(Bouncing, bouncing, ); \ 28 | FOO(Breaking, breaking, ); \ 29 | FOO(Bubble, bubble, ); \ 30 | FOO(Crumpling, crumpling, ); \ 31 | FOO(DCMotor, dcmotor, update); \ 32 | FOO(Demix, demix, ); \ 33 | FOO(Envelope, envelope, update); \ 34 | FOO(Explosion, explosion, ); \ 35 | FOO(Motor, motor, update); \ 36 | FOO(Myoelastic, myo, update); \ 37 | FOO(Pitch, pitch, ); \ 38 | FOO(PitchShift, pitchshift, ); \ 39 | FOO(Resonator, resonator, update); \ 40 | FOO(Reverb, reverb, update); \ 41 | FOO(Rolling, rolling, ); \ 42 | FOO(Scraping, scraping, ); \ 43 | FOO(SpectralFeats, spectralfeats, ); \ 44 | FOO(WindCavity, windcavity, ); \ 45 | FOO(WindFlow, windflow, update); \ 46 | FOO(WindKarman, windkarman, ); \ 47 | FOO(ZeroCrossing, zerox, ); 48 | 49 | #endif 50 | 51 | /** @} */ 52 | -------------------------------------------------------------------------------- /src/SDT/SDTStructs.c: -------------------------------------------------------------------------------- 1 | #include "SDTStructs.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "SDTCommon.h" 8 | 9 | typedef struct SDTHashItem { 10 | char *key; 11 | void *value; 12 | struct SDTHashItem *next; 13 | } SDTHashItem; 14 | 15 | struct SDTHashmap { 16 | SDTHashItem **bins, *item, *prev; 17 | int size; 18 | }; 19 | 20 | int SDTHashmap_hash(SDTHashmap *x, const char *key) { 21 | int h = 0; 22 | for (const char *c = key; *c; c++) h = (h * 31 + *c) % x->size; 23 | return h; 24 | } 25 | 26 | int SDTHashmap_lookup(SDTHashmap *x, const char *key) { 27 | int hash; 28 | 29 | hash = SDTHashmap_hash(x, key); 30 | x->prev = NULL; 31 | x->item = x->bins[hash]; 32 | while (x->item) { 33 | if (!strcmp(x->item->key, key)) break; 34 | x->prev = x->item; 35 | x->item = x->item->next; 36 | } 37 | return hash; 38 | } 39 | 40 | SDTHashmap *SDTHashmap_new(int size) { 41 | SDTHashmap *x; 42 | int i; 43 | 44 | x = (SDTHashmap *)malloc(sizeof(SDTHashmap)); 45 | x->bins = (SDTHashItem **)malloc(size * sizeof(SDTHashItem *)); 46 | for (i = 0; i < size; i++) { 47 | x->bins[i] = NULL; 48 | } 49 | x->size = size; 50 | return x; 51 | } 52 | 53 | void SDTHashmap_free(SDTHashmap *x) { 54 | SDTHashmap_clear(x); 55 | free(x->bins); 56 | free(x); 57 | } 58 | 59 | void *SDTHashmap_get(SDTHashmap *x, const char *key) { 60 | SDTHashmap_lookup(x, key); 61 | return x->item ? x->item->value : NULL; 62 | } 63 | 64 | int SDTHashmap_put(SDTHashmap *x, const char *key, void *value) { 65 | int hash; 66 | 67 | hash = SDTHashmap_lookup(x, key); 68 | if (x->item) return 1; 69 | x->item = (SDTHashItem *)malloc(sizeof(SDTHashItem)); 70 | x->item->key = (char *)malloc(strlen(key) + 1); 71 | strcpy(x->item->key, key); 72 | x->item->value = value; 73 | x->item->next = x->bins[hash]; 74 | x->bins[hash] = x->item; 75 | return 0; 76 | } 77 | 78 | int SDTHashmap_del(SDTHashmap *x, const char *key) { 79 | int hash; 80 | 81 | hash = SDTHashmap_lookup(x, key); 82 | if (!x->item) return 1; 83 | if (x->prev) 84 | x->prev->next = x->item->next; 85 | else 86 | x->bins[hash] = x->item->next; 87 | free(x->item->key); 88 | free(x->item); 89 | return 0; 90 | } 91 | 92 | void SDTHashmap_clear(SDTHashmap *x) { 93 | SDTHashItem *item, *next; 94 | 95 | for (int i = 0; i < x->size; i++) { 96 | item = x->bins[i]; 97 | while (item) { 98 | next = item->next; 99 | free(item->key); 100 | free(item); 101 | item = next; 102 | } 103 | x->bins[i] = NULL; 104 | } 105 | } 106 | 107 | int SDTHashmap_empty(const SDTHashmap *x) { 108 | for (int i = 0; i < x->size; i++) 109 | if (x->bins[i]) return 0; 110 | return 1; 111 | } 112 | -------------------------------------------------------------------------------- /templates/Info.def: -------------------------------------------------------------------------------- 1 | LIBRARY ${PRODUCT_NAME} 2 | 3 | EXPORTS 4 | ext_main 5 | -------------------------------------------------------------------------------- /templates/Max7External.mxo/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${PRODUCT_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.cycling74.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | ${PRODUCT_VERSION} 15 | CFBundlePackageType 16 | iLaX 17 | CFBundleSignature 18 | max2 19 | CFBundleVersion 20 | 1.0 21 | 22 | CFBundleVersion 23 | ${PRODUCT_VERSION} 24 | CFBundleShortVersionString 25 | ${PRODUCT_VERSION} 26 | CFBundleLongVersionString 27 | ${PRODUCT_NAME}, Sound Design Toolkit (SDT) 28 | 29 | CSResourcesFileMapped 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /templates/Max7External.mxo/Contents/PkgInfo: -------------------------------------------------------------------------------- 1 | iLaXmax2 2 | -------------------------------------------------------------------------------- /templates/SDT.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /templates/SDT.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /templates/SDT.framework/SDT: -------------------------------------------------------------------------------- 1 | Versions/Current/SDT -------------------------------------------------------------------------------- /templates/SDT.framework/Versions/A/Resources/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkAT-VG/SDT/0509de418e7bebc8b37866b3b4458e0acc8cf1f4/templates/SDT.framework/Versions/A/Resources/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /templates/SDT.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | SDT 9 | CFBundleIdentifier 10 | it.iuav.SDT 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | FMWK 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 0.1 19 | CSResourcesFileMapped 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /templates/SDT.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /templates/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | $projectname: $title 10 | $title 11 | 12 | 13 | 14 | $treeview 15 | $search 16 | $mathjax 17 | 18 | $extrastylesheet 19 | 20 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | $projectname 38 | $projectnumber 39 | 40 | $projectbrief 41 | 42 | 43 | 44 | 45 | 46 | $projectbrief 47 | 48 | 49 | 50 | 51 | 52 | $searchbox 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | --------------------------------------------------------------------------------