├── .github └── workflows │ └── main.yml ├── .gitignore ├── .gitmodules ├── CNAME ├── COPYING.txt ├── Documentation ├── Implementation.tex ├── ToDoList.tex └── images │ ├── ClassDiagram.pdf │ ├── JSON.png │ ├── ScenarioConnect.pdf │ ├── ScenarioDrop.pdf │ ├── ScenarioEdit.pdf │ ├── ScenarioInit.pdf │ ├── Scenarios.docx │ ├── ScenariosConnect.docx │ ├── ScenariosDrop.docx │ └── ScenariosEdit.docx ├── README.md ├── css ├── AccelerometerEdit.css ├── Accueil.css ├── FaustInterface.css ├── Finish.css ├── Library.css ├── Main.css ├── Menu.css ├── Modules.css ├── Pedagogie.css ├── Playground.css ├── Reset.css ├── Scenes.css └── perfect-scrollbar.min.css ├── favicon.ico ├── fonts ├── proxima_nova_reg-webfont.eot ├── proxima_nova_reg-webfont.svg ├── proxima_nova_reg-webfont.ttf └── proxima_nova_reg-webfont.woff ├── index.html ├── logo ├── fpgapp.png └── fpgdoc.png ├── package-lock.json ├── package.json ├── public ├── faust-modules │ ├── Licence.md │ ├── Modes-de-jeu-SMARTFAUST.md │ ├── combined │ │ ├── AtonalSoftHarp.dsp │ │ ├── Birds.dsp │ │ ├── BlowhistleBottle.dsp │ │ ├── BouncyHarp.dsp │ │ ├── Brass.dsp │ │ ├── CMajDryHarp.dsp │ │ ├── CMajFlute.dsp │ │ ├── CMajSoftHarp.dsp │ │ ├── ChromaticSoftHarp.dsp │ │ ├── Clarinet.dsp │ │ ├── FlappyFlute.dsp │ │ ├── Flute.dsp │ │ ├── Meow.dsp │ │ ├── Modulations.dsp │ │ ├── PentatonicDryHarp.dsp │ │ ├── PentatonicFlute.dsp │ │ ├── PentatonicSoftHarp.dsp │ │ ├── Pulsaxophone.dsp │ │ ├── RandomFlute.dsp │ │ ├── Seaside.dsp │ │ ├── StalactiteHarp.dsp │ │ ├── TibetanBowl.dsp │ │ ├── TibetanBowlMulti.dsp │ │ ├── TunedBars.dsp │ │ ├── Whistles.dsp │ │ └── WoodenKeyboard.dsp │ ├── effects │ │ ├── ASREnvelope.dsp │ │ ├── BandPassFilter.dsp │ │ ├── CombFilter.dsp │ │ ├── Echo.dsp │ │ ├── Flanger.dsp │ │ ├── Freeverb.dsp │ │ ├── Granulator.dsp │ │ ├── HighPassFilter.dsp │ │ ├── InstrReverb.dsp │ │ ├── Loop.dsp │ │ ├── LowPassFilter.dsp │ │ ├── Modulations.dsp │ │ ├── Notch.dsp │ │ ├── OnOff.dsp │ │ ├── PeakEqualizer.dsp │ │ ├── Phaser.dsp │ │ ├── RandomRingModulation.dsp │ │ ├── RandomVibrato.dsp │ │ ├── RingModulation.dsp │ │ ├── SLimiter.dsp │ │ ├── VibratoEnvelope.dsp │ │ ├── Volume.dsp │ │ ├── WahWah.dsp │ │ └── ZitaReverb.dsp │ ├── generators │ │ ├── Kisana.dsp │ │ ├── SAtonalSoftHarp.dsp │ │ ├── SBird.dsp │ │ ├── SBlowhistleBottle.dsp │ │ ├── SBouncyHarp.dsp │ │ ├── SBrass.dsp │ │ ├── SBrassMulti.dsp │ │ ├── SCMajBlowBottle.dsp │ │ ├── SCMajDryHarp.dsp │ │ ├── SCMajFlute.dsp │ │ ├── SCMajSoftHarp.dsp │ │ ├── SCMajTunedBars.dsp │ │ ├── SCameleonKeyboard.dsp │ │ ├── SChromaticSoftHarp.dsp │ │ ├── SChromaticTunedBars.dsp │ │ ├── SClarinet.dsp │ │ ├── SFlute.dsp │ │ ├── SModulation1.dsp │ │ ├── SModulation2.dsp │ │ ├── SModulation3.dsp │ │ ├── SModulation4.dsp │ │ ├── SNoise.dsp │ │ ├── SNoiseS.dsp │ │ ├── SNoiseburst.dsp │ │ ├── SOscillator.dsp │ │ ├── SPentatonicBlowBottle.dsp │ │ ├── SPentatonicDryHarp.dsp │ │ ├── SPentatonicFlute.dsp │ │ ├── SPentatonicSoftHarp.dsp │ │ ├── SPulsaxophone.dsp │ │ ├── SRandomAndHold.dsp │ │ ├── SRandomFlute.dsp │ │ ├── SRandomFrequencyGenerator.dsp │ │ ├── STibetanBowl.dsp │ │ ├── STinkle.dsp │ │ ├── STunedBar.dsp │ │ ├── STunedBar3.dsp │ │ ├── STunedBar6.dsp │ │ ├── SWhistles2.dsp │ │ └── SWhistles3.dsp │ ├── index.json │ ├── make-json │ └── update-acc ├── img │ ├── BACK.png │ ├── Oldlogo.png │ ├── analyser-bg.png │ ├── big.png │ ├── blueFilter.png │ ├── body-bkg.gif │ ├── body-bkg.png │ ├── cancel_white.png │ ├── checkBox.png │ ├── close.png │ ├── cross_close.png │ ├── cross_close_menu.png │ ├── curve1.png │ ├── curve2.png │ ├── curve3.png │ ├── curve4.png │ ├── edit.png │ ├── enter.png │ ├── export.png │ ├── fullscreen.png │ ├── grame.png │ ├── ico-analyser.gif │ ├── ico-arrow.png │ ├── ico-close.gif │ ├── ico-micro-mute.png │ ├── ico-micro.png │ ├── ico-play.gif │ ├── ico-plus.png │ ├── ico-speaker-mute.png │ ├── ico-speaker.png │ ├── ico-stop.gif │ ├── loader.gif │ ├── logo.png │ ├── logoAnim.gif │ ├── minus.png │ ├── open.png │ ├── output-bkg.gif │ ├── pseudoRandomFilter2.png │ ├── pseudoRandomFilter3.png │ ├── slider-bkg.gif │ ├── slider-handle.png │ ├── slider.png │ ├── slider_chrome.png │ ├── sliderleft.png │ ├── sliderleft_chrome.png │ ├── slidermiddle.png │ ├── slidermiddle_chrome.png │ ├── sliderright.png │ ├── sliderright_chrome.png │ ├── trash.png │ ├── triangleClose.png │ ├── triangleOpen.png │ └── validate_white.png └── json │ ├── Big_Exemple.json │ ├── Big_Exemple_Precompile.json │ ├── Small_Exemple.json │ ├── Small_Exemple_Precompile.json │ ├── patch_big.json │ ├── patch_big_precompile.json │ ├── patch_light.json │ └── patch_light_precompile.json ├── resources ├── resources_en-EN.json └── resources_fr-FR.json ├── src ├── Accelerometer.ts ├── App.ts ├── CodeFaustParser.ts ├── Connect.ts ├── Dragging.ts ├── DriveAPI.ts ├── EquivalentFaust.ts ├── Error.ts ├── ExportLib.ts ├── Lib │ ├── AudioContextMonkeyPatch.js │ └── perfectScrollBar │ │ └── js │ │ ├── perfect-scrollbar.min.d.ts │ │ └── perfect-scrollbar.min.js ├── Main.ts ├── Menu │ ├── AccelerometerEdit.ts │ ├── AccelerometerEditView.ts │ ├── Export.ts │ ├── ExportView.ts │ ├── Library.ts │ ├── LibraryView.ts │ ├── Load.ts │ ├── LoadView.ts │ ├── Menu.ts │ ├── MenuView.ts │ ├── Save.ts │ └── SaveView.ts ├── Messages.ts ├── Modules │ ├── FaustInterface.ts │ ├── ModuleClass.ts │ ├── ModuleFaust.ts │ └── ModuleView.ts ├── Resources.ts ├── Scenes │ ├── SceneClass.ts │ └── SceneView.ts ├── Utilitary.ts └── global.d.ts └── vite.config.js /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | # Simple workflow for deploying static content to GitHub Pages 2 | name: Deploy static content to Pages 3 | 4 | on: 5 | # Runs on pushes targeting the default branch 6 | push: 7 | branches: ['master'] 8 | 9 | # Allows you to run this workflow manually from the Actions tab 10 | workflow_dispatch: 11 | 12 | # Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages 13 | permissions: 14 | contents: read 15 | pages: write 16 | id-token: write 17 | 18 | # Allow one concurrent deployment 19 | concurrency: 20 | group: 'pages' 21 | cancel-in-progress: true 22 | 23 | jobs: 24 | # Single deploy job since we're just deploying 25 | deploy: 26 | environment: 27 | name: github-pages 28 | url: ${{ steps.deployment.outputs.page_url }} 29 | runs-on: ubuntu-latest 30 | steps: 31 | - name: Checkout 32 | uses: actions/checkout@v3 33 | - name: Set up Node 34 | uses: actions/setup-node@v3 35 | with: 36 | node-version: 18 37 | cache: 'npm' 38 | - name: Install dependencies 39 | run: npm install 40 | - name: Build 41 | run: npm run build 42 | - name: Setup Pages 43 | uses: actions/configure-pages@v3 44 | - name: Upload artifact 45 | uses: actions/upload-pages-artifact@v3 46 | with: 47 | # Upload dist repository 48 | path: './dist' 49 | - name: Deploy to GitHub Pages 50 | id: deployment 51 | uses: actions/deploy-pages@v4 52 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/.gitmodules -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | faustplayground.grame.fr -------------------------------------------------------------------------------- /Documentation/ToDoList.tex: -------------------------------------------------------------------------------- 1 | 2 | \documentclass[a4paper]{article} 3 | \usepackage{pslatex} 4 | \usepackage[T1]{fontenc} 5 | \usepackage[utf8x]{inputenc} 6 | \setlength\parskip{\medskipamount} 7 | \setlength\parindent{0pt} 8 | \usepackage{graphicx} 9 | \usepackage{amssymb} 10 | \usepackage{lscape} 11 | %\usepackage{hyperref} 12 | 13 | \usepackage{multicol} 14 | 15 | \makeatletter 16 | 17 | \providecommand{\boldsymbol}[1]{\mbox{\boldmath $#1$}} 18 | \newcommand{\ASL} {ASL} 19 | \newcommand{\OSC}[1] {\texttt{#1}} 20 | \newcommand{\lra} {$\leftrightarrow$} 21 | \newcommand{\seg}[1] {Seg(#1)} 22 | 23 | \setlength{\parskip}{1mm} 24 | 25 | \makeatother 26 | 27 | \begin{document} 28 | 29 | \title{TO DO ON FAUSTPLAYGROUND \\ v.1.0} 30 | 31 | \author{Grame, Centre National de Création Musicale\\ 32 | {\small } \\ 33 | \vspace{2mm} 34 | [ANR-12-CORD- 0009] and [ANR-13-BS02-0008] 35 | } 36 | 37 | \maketitle 38 | 39 | \topskip0pt 40 | 41 | \newpage 42 | \section{La Forme} 43 | 44 | \begin{itemize} 45 | \item Le resize doit toujours bien se passer (notamment pour le connexions) 46 | \item La bibliothèque ne se ferme pas toujours très bien selon comment on en sort 47 | \end{itemize} 48 | 49 | \section{Les Fonctionnalités} 50 | \subsection{En Interne} 51 | \begin{itemize} 52 | \item Save/Recall des scènes (trouver le bon moyen d'enregistrer la session en ligne). 53 | Les pistes : 54 | \begin{itemize} 55 | \item Google Docs 56 | \item Compte Facebook 57 | \item Téléchargement d'un fichier 58 | \item DropBox 59 | \item Email 60 | \item Compte sur le serveur 61 | \end{itemize} 62 | \item Pouvoir faire resize sur les modules et avoir une scrollbar 63 | \item Pouvoir réduire la taille des modules (style itunes passage en mode mini-player) 64 | \item Ajouter un bouton de bypass sur les modules 65 | \item mieux gérer les erreurs (compilation et faustweb) 66 | \item Assurer la compatibilité des plateformes (notamment Safari et l'export) 67 | \item Peut-être modifier la manière de déconnecter des modules (ce n'est pas évident pour tout le monde) 68 | \item Assurer que ça se passe bien quand il y a plusieurs instances du même effet et qu'on calcule le faust equivalent 69 | \end{itemize} 70 | 71 | \subsection{Demande du groupe TICE des profs de musique} 72 | \begin{itemize} 73 | \item interface des instruments plus "standardisés" qu'on comprenne mieux comment en jouer 74 | \item mettre le nom des notes plutôt que des int sur les instruments type harpe 75 | \item pouvoir enregistrer les scènes 76 | \item pouvoir partager les scènes enregistrées 77 | \item choix du logo de l'application téléchargée sur le téléphone 78 | \item pouvoir connaitre les modules qui ont été utilisés à partir d'une application finie ou forcer une capture d'écran avec l'export... 79 | \item pouvoir choisir l'axe sur lequel on va jouer d'un paramètre une fois l'appli compilée 80 | \item penser au déploiement sur tablette 81 | \end{itemize} 82 | 83 | \subsection{Demande de Philippe Jeanjacquot de l'institut national de l'éducation} 84 | \begin{itemize} 85 | \item mise à disposition d'application "instruments" pour Android (harpe, sitar, organ, etc) 86 | \item mettre le nom des notes plutôt que des int sur les instruments type harpe 87 | \end{itemize} 88 | 89 | \section{Le Déploiement} 90 | 91 | \begin{itemize} 92 | \item Ajouter un lien vers les playgrounds depuis le site de Faust 93 | \item Mettre une bibliothèque jolie des effets publiés dans www/library sur le site de Faust 94 | \end{itemize} 95 | 96 | \section{Les choses sombres et dures} 97 | 98 | En dur dans le serveur, on trouve le chemin d'accès aux ressources de la bibliothèque ==> http://faust.grame.fr/www/libfaust.js par exemple. Ce serait peut-être bien de choisir une structure de serveur définitive pour mettre les chemins en relatifs. Par exemple avoir un dossier js avec à la fois les fichies liés à fausptlayground et ceux liés à libfaust. \\ 99 | 100 | Les endroits avec des chemins d'accès à modifier sont : 101 | \begin{itemize} 102 | \item index.html 103 | \item pedagogie/index.html 104 | \item src/Pedagogie/Library.js 105 | \item src/Scenes/Finish.js 106 | \end{itemize} 107 | \end{document} 108 | -------------------------------------------------------------------------------- /Documentation/images/ClassDiagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/Documentation/images/ClassDiagram.pdf -------------------------------------------------------------------------------- /Documentation/images/JSON.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/Documentation/images/JSON.png -------------------------------------------------------------------------------- /Documentation/images/ScenarioConnect.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/Documentation/images/ScenarioConnect.pdf -------------------------------------------------------------------------------- /Documentation/images/ScenarioDrop.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/Documentation/images/ScenarioDrop.pdf -------------------------------------------------------------------------------- /Documentation/images/ScenarioEdit.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/Documentation/images/ScenarioEdit.pdf -------------------------------------------------------------------------------- /Documentation/images/ScenarioInit.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/Documentation/images/ScenarioInit.pdf -------------------------------------------------------------------------------- /Documentation/images/Scenarios.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/Documentation/images/Scenarios.docx -------------------------------------------------------------------------------- /Documentation/images/ScenariosConnect.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/Documentation/images/ScenariosConnect.docx -------------------------------------------------------------------------------- /Documentation/images/ScenariosDrop.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/Documentation/images/ScenariosDrop.docx -------------------------------------------------------------------------------- /Documentation/images/ScenariosEdit.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/Documentation/images/ScenariosEdit.docx -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Faust Playground 2 | 3 | Faust playground is a Web platform designed to enable children to learn basic audio programming in a simple and graphic way. In particular, it allows them to develop musical instruments for Android smartphones. 4 | 5 | ## Useful links 6 | 7 | - [https://faustplayground.grame.fr](https://faustplayground.grame.fr): official FaustPlayground website 8 | - [https://github.com/grame-cncm/faustplayground](https://github.com/grame-cncm/faustplayground): GitHub repository 9 | 10 | ## Development 11 | 12 | ### Notes 13 | This project uses [Vite](https://vitejs.dev/) for development mode and builds and [FaustWasm](https://github.com/grame-cncm/faustwasm) for compiling Faust in the browser. 14 | 15 | ### Setup 16 | Clone and enter the repository, then run: 17 | ```bash 18 | npm install 19 | ``` 20 | 21 | ### Run in development mode (automatic reloading) 22 | ```bash 23 | npm run dev 24 | ``` 25 | Then press o to open in a browser. 26 | 27 | ### Build 28 | ``` shell 29 | npm run build 30 | ``` 31 | Generates output in `dist/`. To view locally, run 32 | ``` shell 33 | cd dist 34 | python -m http.server 35 | ``` 36 | 37 | ### To create examples (in `public/json/`) 38 | - create a patch in the platform 39 | - possibly rename it using the the "Edit" button 40 | - save it (regular or precompiled version) using the "Save" button 41 | - rename it with a `.json` file extension 42 | 43 | ### To add new Faust modules 44 | In `public/faust-modules/`, add your .dsp files to `effects/` or `generators/`. Then update `index.json` to include the paths to your new modules. 45 | -------------------------------------------------------------------------------- /css/Accueil.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/css/Accueil.css -------------------------------------------------------------------------------- /css/Finish.css: -------------------------------------------------------------------------------- 1 | #bubble{ 2 | 3 | background: url('../img/output-bkg.gif') 0 0 repeat; 4 | color:white; 5 | position:absolute; 6 | margin-left:auto; 7 | margin-right:auto; 8 | text-align:center; 9 | font-family: 'Droid Serif', Georgia, serif; 10 | top:20%; 11 | left:40%; 12 | border-radius: 30%; 13 | border: 3px solid black; 14 | } 15 | 16 | #exportName{ 17 | color:black; 18 | } 19 | 20 | #sceneSubtitle{ 21 | color:black; 22 | } 23 | 24 | #androidImg{ 25 | position:relative; 26 | left:49%; 27 | } 28 | 29 | #backImg{ 30 | position:absolute; 31 | top:2%; 32 | left:2%; 33 | } 34 | 35 | #androidButton{ 36 | position:absolute; 37 | left:43%; 38 | top:25%; 39 | } -------------------------------------------------------------------------------- /css/Library.css: -------------------------------------------------------------------------------- 1 | 2 | #library { 3 | background:orange; 4 | height: 100%; 5 | position: fixed; 6 | left: 0%; 7 | top: 0%; 8 | bottom: 15%; 9 | /*z-index: 1;*/ 10 | font-size : 14px; 11 | color:white; 12 | text-align:center; 13 | padding:0.5em 0.5em 0.5em 0.5em; 14 | overflow-y: auto; 15 | overflow-x: hidden; 16 | } 17 | 18 | #library .space{ 19 | height: 70px; 20 | } 21 | 22 | #library.link a { 23 | color: white; 24 | font: inherit; 25 | text-decoration: underline; 26 | } 27 | 28 | #library li.sections{ 29 | color: black; 30 | display : list-item; 31 | text-align:left; 32 | font-size:18px; 33 | } 34 | 35 | #library .title{ 36 | 37 | text-align:left; 38 | color:black; 39 | -webkit-transform:rotate(270deg); 40 | -moz-transform:rotate(270deg); 41 | -o-transform: rotate(270deg); 42 | display:block; 43 | position: relative; 44 | top:40%; 45 | right:250%; 46 | width:300px; 47 | font-size:20px; 48 | /*z-index:2;*/ 49 | margin: 0px 0px 0px 0px; 50 | padding: 0px 0px 0px 0px; 51 | } -------------------------------------------------------------------------------- /css/Modules.css: -------------------------------------------------------------------------------- 1 | 2 | .inputconnector { 3 | position: absolute; 4 | left:-12px; top:75px; 5 | width:10px; height:10px; 6 | border:5px solid red; 7 | border-radius: 10px; 8 | background: gray; 9 | } 10 | 11 | .inputconnector.connected, .outputconnector.connected { background: lightgreen } 12 | .inputconnector.canConnect, .outputconnector.canConnect { background: pink } 13 | 14 | .outputconnector { 15 | position: absolute; 16 | right:-12px; top:75px; 17 | width:10px; height:10px; 18 | border:5px solid green; 19 | border-radius: 10px; 20 | background: gray; 21 | } 22 | 23 | .dialcontrol { 24 | position: absolute; 25 | } 26 | 27 | /* #code { font: 10pt Courier New, fixed; } */ 28 | 29 | /* --------------------------------------------------------------------------- 30 | * :: Input 31 | * -------------------------------------------------------------------------*/ 32 | #input { 33 | 34 | bottom: 0; 35 | display: block; 36 | position: fixed; 37 | padding:10px; 38 | left: 0; 39 | width: 8%; 40 | /*z-index: 1;*/ 41 | } 42 | 43 | #input .node { 44 | right: -18px; 45 | margin-top: -11px; 46 | position: absolute; 47 | top: 50%; 48 | } 49 | 50 | .text{ 51 | 52 | position:relative; 53 | margin-left:auto; 54 | margin-right:auto; 55 | text-align:center; 56 | font-size:19px; 57 | background-color:transparent; 58 | top: 60%; 59 | left:10%; 60 | } 61 | 62 | 63 | /* --------------------------------------------------------------------------- 64 | * :: Output 65 | * -------------------------------------------------------------------------*/ 66 | #sceneOutput { 67 | /*! background: 68 | url('../img/output-bkg.gif') 0 0 repeat; */ 69 | /*! box-shadow: 0 0 3px rgba(0,0,0, .4); */ 70 | display: block; 71 | position: fixed; 72 | padding-right:20px; 73 | padding-left:20px; 74 | right: 0; 75 | top: 0; 76 | width: 150px; 77 | /*z-index: 4;*/ 78 | border-radius: 0px 0px 0px 0px; 79 | padding:10px; 80 | background: rgba(6, 39, 156, 0.21); 81 | } 82 | 83 | 84 | #sceneOutput .node { 85 | left: -18px; 86 | margin-top: -11px; 87 | position: absolute; 88 | top: 50%; 89 | } 90 | 91 | #sceneOutput .export-title { 92 | color: black; 93 | font-size: 20px; 94 | text-align:center; 95 | font-size: 14px; 96 | margin: 0 0 1em; 97 | text-align: center; 98 | text-transform: uppercase; 99 | } 100 | 101 | #sceneOutput .architectures, #sceneOutput .platforms{ 102 | width: 100%; 103 | margin-top: 7px; 104 | /*! border-radius: 32px; */ 105 | } 106 | #svgRefreshButton{ 107 | width: 100%; 108 | } 109 | 110 | #sceneOutput .qrcodeDiv{ 111 | position: fixed; 112 | bottom: 2px; 113 | } 114 | 115 | #sceneOutput .exportButton{ 116 | position: fixed; 117 | right: 60px; 118 | } 119 | 120 | .textArea { 121 | margin-top: -2em; 122 | margin-left: 1em; 123 | margin-right: 1em; 124 | } 125 | -------------------------------------------------------------------------------- /css/Pedagogie.css: -------------------------------------------------------------------------------- 1 | #svgCanvas{ 2 | position:absolute; 3 | width:100%; 4 | height:100%; 5 | top:0; 6 | left:0; 7 | /*z-index:-1;*/ 8 | } 9 | 10 | #exportButton>a { 11 | box-shadow: 0 0 10px grey; 12 | border-radius: 50px; 13 | margin-bottom: 20px; 14 | display: block; 15 | cursor: pointer; 16 | } 17 | #exportButton>a:hover{ 18 | box-shadow: 0 0 10px black; 19 | } 20 | 21 | #subtitleButton{ 22 | font-size:11px; 23 | } -------------------------------------------------------------------------------- /css/Playground.css: -------------------------------------------------------------------------------- 1 | #svgCanvas{ 2 | position:absolute; 3 | width:100%; 4 | height:100%; 5 | top:0; 6 | left:0; 7 | /*z-index:-1;*/ 8 | } 9 | 10 | 11 | #optionExportContainer{ 12 | position:relative; 13 | width:100% 14 | } 15 | 16 | 17 | 18 | 19 | #ChrisLine{ 20 | position:fixed; 21 | left:100px; 22 | color: rgba(24, 24, 162, 0.65); 23 | /*z-index:2;*/ 24 | } 25 | 26 | .text{ 27 | position:absolute; 28 | top:60%; 29 | } 30 | 31 | #logoDiv{ 32 | bottom:4px; 33 | position:absolute; 34 | margin-left:auto; 35 | margin-right : auto; 36 | } 37 | 38 | .dropElementGraph { 39 | width: 100%; 40 | height: 100%; 41 | position: absolute; 42 | top: 0; 43 | z-index: -1; 44 | } 45 | .dropElementText { 46 | position: absolute; 47 | bottom: 0px; 48 | font-size: 500%; 49 | text-shadow: 0 0 10px rgba(0, 0, 0, 0.28); 50 | color: rgba(0, 0, 0, 0.1); 51 | text-align: center; 52 | width: 100%; 53 | } 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /css/Reset.css: -------------------------------------------------------------------------------- 1 | /* reset.css */ 2 | 3 | article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; } 4 | audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; } 5 | audio:not([controls]) { display: none; } 6 | [hidden] { display: none; } 7 | 8 | html { font-size: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } 9 | html, button, input, select, textarea { font-family: sans-serif; color: #222; } 10 | body { margin: 0; font-size: 1em; line-height: 1.4; } 11 | 12 | ::-moz-selection { background: #00e; color: #fff; text-shadow: none; } 13 | ::selection { background: #00e; color: #fff; text-shadow: none; } 14 | 15 | a { color: #00e; } 16 | a:visited { color: #551a8b; } 17 | a:hover { color: #06e; } 18 | a:focus { outline: thin dotted; } 19 | a:hover, a:active { outline: 0; } 20 | abbr[title] { border-bottom: 1px dotted; } 21 | b, strong { font-weight: bold; } 22 | blockquote { margin: 1em 40px; } 23 | dfn { font-style: italic; } 24 | hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; } 25 | ins { background: #ff9; color: #000; text-decoration: none; } 26 | mark { background: #ff0; color: #000; font-style: italic; font-weight: bold; } 27 | pre, code, kbd, samp { font-family: monospace, serif; _font-family: 'courier new', monospace; font-size: 1em; } 28 | pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; } 29 | 30 | q { quotes: none; } 31 | q:before, q:after { content: ""; content: none; } 32 | small { font-size: 85%; } 33 | sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } 34 | sup { top: -0.5em; } 35 | sub { bottom: -0.25em; } 36 | 37 | ul, ol { margin: 1em 0; padding: 0 0 0 40px; } 38 | dd { margin: 0 0 0 40px; } 39 | nav ul, nav ol { list-style: none; list-style-image: none; margin: 0; padding: 0; } 40 | 41 | img { border: 0; -ms-interpolation-mode: bicubic; vertical-align: middle; } 42 | svg:not(:root) { overflow: hidden; } 43 | figure { margin: 0; } 44 | 45 | form { margin: 0; } 46 | fieldset { border: 0; margin: 0; padding: 0; } 47 | 48 | label { cursor: pointer; } 49 | legend { border: 0; *margin-left: -7px; padding: 0; white-space: normal; } 50 | button, input, select, textarea { font-size: 100%; margin: 0; vertical-align: baseline; *vertical-align: middle; } 51 | button, input { line-height: normal; } 52 | button, input[type="button"], input[type="reset"], input[type="submit"] { cursor: pointer; -webkit-appearance: button; *overflow: visible; } 53 | button[disabled], input[disabled] { cursor: default; } 54 | input[type="checkbox"], input[type="radio"] { box-sizing: border-box; padding: 0; *width: 13px; *height: 13px; } 55 | input[type="search"] { -webkit-appearance: textfield; -moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box; } 56 | input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; } 57 | button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } 58 | textarea { overflow: auto; vertical-align: top; resize: vertical; } 59 | input:valid, textarea:valid { } 60 | input:invalid, textarea:invalid { background-color: #f0dddd; } 61 | 62 | table { border-collapse: collapse; border-spacing: 0; } 63 | td { vertical-align: top; } 64 | -------------------------------------------------------------------------------- /css/Scenes.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | .sceneTitle:focus { 4 | outline: 0px solid transparent; 5 | } 6 | 7 | .sceneSubtitle{ 8 | color:white; 9 | position:relative; 10 | margin-left:auto; 11 | margin-right:auto; 12 | margin-top:auto; 13 | margin-bottom:auto; 14 | text-align:center; 15 | font-size:18px; 16 | background-color:transparent; 17 | /*z-index:1;*/ 18 | } 19 | 20 | /* 21 | .grayButton { 22 | position:fixed; 23 | color: white; 24 | bottom: 2px; 25 | right: 200px; 26 | text-align: center; 27 | background-color: #FCD21C; 28 | border-radius: 5px; 29 | color: #4c4c4c; 30 | font-size: 1em; 31 | padding-top: 5px; 32 | padding-right: 10px; 33 | padding-bottom: 5px; 34 | padding-left: 10px; 35 | text-transform: uppercase; 36 | font-size:20px; 37 | } 38 | */ 39 | 40 | .orangeButton { 41 | 42 | position:relative; 43 | text-align: center; 44 | background-color: orange; 45 | border-radius: 5px; 46 | color: #4c4c4c; 47 | padding-top: 5px; 48 | padding-right: 20px; 49 | padding-bottom: 5px; 50 | padding-left: 15px; 51 | text-transform: uppercase; 52 | font-size:20px; 53 | width: 100px; 54 | margin-left:auto; 55 | margin-right:auto; 56 | top:200px; 57 | box-shadow: 2px 2px 2px 2px black; 58 | } 59 | div#sceneSensor { 60 | width: 100%; 61 | height: 100%; 62 | } -------------------------------------------------------------------------------- /css/perfect-scrollbar.min.css: -------------------------------------------------------------------------------- 1 | /* perfect-scrollbar v0.6.10 */ 2 | .ps-container{-ms-touch-action:none;touch-action:none;overflow:hidden !important;-ms-overflow-style:none}@supports (-ms-overflow-style: none){.ps-container{overflow:auto !important}}@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none){.ps-container{overflow:auto !important}}.ps-container.ps-active-x>.ps-scrollbar-x-rail,.ps-container.ps-active-y>.ps-scrollbar-y-rail{display:block;background-color:transparent}.ps-container.ps-in-scrolling{pointer-events:none}.ps-container.ps-in-scrolling.ps-x>.ps-scrollbar-x-rail{background-color:#eee;opacity:0.9}.ps-container.ps-in-scrolling.ps-x>.ps-scrollbar-x-rail>.ps-scrollbar-x{background-color:#999}.ps-container.ps-in-scrolling.ps-y>.ps-scrollbar-y-rail{background-color:#eee;opacity:0.9}.ps-container.ps-in-scrolling.ps-y>.ps-scrollbar-y-rail>.ps-scrollbar-y{background-color:#999}.ps-container>.ps-scrollbar-x-rail{display:none;position:absolute;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;opacity:0;-webkit-transition:background-color .2s linear, opacity .2s linear;-moz-transition:background-color .2s linear, opacity .2s linear;-o-transition:background-color .2s linear, opacity .2s linear;transition:background-color .2s linear, opacity .2s linear;bottom:3px;height:8px}.ps-container>.ps-scrollbar-x-rail>.ps-scrollbar-x{position:absolute;background-color:#aaa;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-transition:background-color .2s linear;-moz-transition:background-color .2s linear;-o-transition:background-color .2s linear;transition:background-color .2s linear;bottom:0;height:8px}.ps-container>.ps-scrollbar-y-rail{display:none;position:absolute;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;opacity:0;-webkit-transition:background-color .2s linear, opacity .2s linear;-moz-transition:background-color .2s linear, opacity .2s linear;-o-transition:background-color .2s linear, opacity .2s linear;transition:background-color .2s linear, opacity .2s linear;right:3px;width:8px}.ps-container>.ps-scrollbar-y-rail>.ps-scrollbar-y{position:absolute;background-color:#aaa;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-transition:background-color .2s linear;-moz-transition:background-color .2s linear;-o-transition:background-color .2s linear;transition:background-color .2s linear;right:0;width:8px}.ps-container:hover.ps-in-scrolling{pointer-events:none}.ps-container:hover.ps-in-scrolling.ps-x>.ps-scrollbar-x-rail{background-color:#eee;opacity:0.9}.ps-container:hover.ps-in-scrolling.ps-x>.ps-scrollbar-x-rail>.ps-scrollbar-x{background-color:#999}.ps-container:hover.ps-in-scrolling.ps-y>.ps-scrollbar-y-rail{background-color:#eee;opacity:0.9}.ps-container:hover.ps-in-scrolling.ps-y>.ps-scrollbar-y-rail>.ps-scrollbar-y{background-color:#999}.ps-container:hover>.ps-scrollbar-x-rail,.ps-container:hover>.ps-scrollbar-y-rail{opacity:0.6}.ps-container:hover>.ps-scrollbar-x-rail:hover{background-color:#eee;opacity:0.9}.ps-container:hover>.ps-scrollbar-x-rail:hover>.ps-scrollbar-x{background-color:#999}.ps-container:hover>.ps-scrollbar-y-rail:hover{background-color:#eee;opacity:0.9}.ps-container:hover>.ps-scrollbar-y-rail:hover>.ps-scrollbar-y{background-color:#999} 3 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/favicon.ico -------------------------------------------------------------------------------- /fonts/proxima_nova_reg-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/fonts/proxima_nova_reg-webfont.eot -------------------------------------------------------------------------------- /fonts/proxima_nova_reg-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/fonts/proxima_nova_reg-webfont.ttf -------------------------------------------------------------------------------- /fonts/proxima_nova_reg-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/fonts/proxima_nova_reg-webfont.woff -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | FaustPlayGround 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 |
29 |
Loading
30 |
31 | 32 | 33 | 34 | 35 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /logo/fpgapp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/logo/fpgapp.png -------------------------------------------------------------------------------- /logo/fpgdoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/logo/fpgdoc.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "faustplayground", 3 | "private": true, 4 | "version": "1.4.1", 5 | "description": "Online platform to combine and run Faust DSP modules", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "preview": "vite preview" 10 | }, 11 | "devDependencies": { 12 | "@types/file-saver": "^2.0.5", 13 | "vite": ">=4.5.2" 14 | }, 15 | "dependencies": { 16 | "@grame/faustwasm": "^0.9.4", 17 | "file-saver": "^2.0.5", 18 | "qrcode": "^1.5.3" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /public/faust-modules/Licence.md: -------------------------------------------------------------------------------- 1 | ## Licence 2 | 3 | GRAME LICENSE 4 | Copyright (C) 2003-2023 by GRAME, 5 | Centre National de Creation Musicale. 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU Lesser General Public License as 9 | published by the Free Software Foundation; either version 2.1 of the 10 | License, or (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with the GNU C Library; if not, write to the Free 19 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 20 | 02111-1307 USA. 21 | 22 | EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a 23 | larger FAUST program which directly or indirectly imports this library 24 | file and still distribute the compiled code generated by the FAUST 25 | compiler, or a modified version of this compiled code, under your own 26 | copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly 27 | grants you the right to freely choose the license for the resulting 28 | compiled code. In particular the resulting compiled code has no obligation 29 | to be LGPL or GPL. For example you are free to choose a commercial or 30 | closed source license or any other license if you decide so. 31 | -------------------------------------------------------------------------------- /public/faust-modules/combined/AtonalSoftHarp.dsp: -------------------------------------------------------------------------------- 1 | declare name "Atonal Soft Harp"; 2 | declare author "ER"; //Adapted from NLFeks by Julius Smith and Romain Michon; 3 | 4 | import("stdfaust.lib"); 5 | instrument = library("instruments.lib"); 6 | 7 | /* =============== DESCRIPTION ======================== : 8 | 9 | - Soft Atonal Harp 10 | - Head = High frequencies + Reverberation 11 | - Bottom = Low frequencies / Silence 12 | - Swing + Right = Plucking all the strings one by one 13 | - Left = Slow rhythm / Silence 14 | - Right = Fast rhythm 15 | - Front = Short and dry notes 16 | - Back = Long and bright notes 17 | - Back + horizontal shaking = vibrato 18 | 19 | */ 20 | 21 | //==================== INSTRUMENT ======================= 22 | 23 | process = par(i, N, NFLeks(i)):>_<: instrReverbHarp; 24 | 25 | NFLeks(n) = filtered_excitation(n+1,P(freq(n)),freq(n)) : stringloop(freq(n)); 26 | 27 | //==================== GUI SPECIFICATION ================ 28 | N = 20; 29 | hand = hslider("h:[1]/Instrument Hand[acc:1 1 -10 0 10]", 10, 0, N, 1) : ba.automat(bps, 15, 0.0)// => gate 30 | with{ 31 | bps = hslider("h:[1]/Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; 32 | }; 33 | gain = 1; 34 | 35 | pickangle = 0.9; 36 | 37 | beta = 0.5; 38 | 39 | // String decay time in seconds: 40 | t60 = hslider("h:[2]Reverberation/ Resonance[unit:s][acc:2 0 -10 0 10]", 5, 0.5, 10, 0.01):min(10):max(0.5); // -60db decay time (sec) 41 | 42 | B = 0; 43 | L = -10 : ba.db2linear; 44 | 45 | //---------------------------------- FREQUENCY TABLE --------------------------- 46 | 47 | freq(0) = 200; 48 | freq(1) = 215; 49 | freq(2) = 230; 50 | freq(3) = 245; 51 | freq(4) = 260; 52 | freq(5) = 275; 53 | 54 | freq(d) = freq(d-6)*(2); 55 | 56 | //==================== SIGNAL PROCESSING ================ 57 | 58 | //----------------------- noiseburst ------------------------- 59 | // White no.noise burst (adapted from Faust's karplus.dsp example) 60 | // Requires music.lib (for no.noise) 61 | noiseburst(d,e) = no.noise : *(trigger(d,e)) 62 | with { 63 | upfront(x) = (x-x') > 0; 64 | decay(n,x) = x - (x>0)/n; 65 | release(n) = + ~ decay(n); 66 | position(d) = abs(hand - d) < 0.5; 67 | trigger(d,n) = position(d) : upfront : release(n) : > (0.0); 68 | }; 69 | 70 | 71 | P(f) = ma.SR/f ; // fundamental period in samples 72 | Pmax = 4096; // maximum P (for de.delay-line allocation) 73 | 74 | ppdel(f) = beta*P(f); // pick position de.delay 75 | pickposfilter(f) = fi.ffcombfilter(Pmax,ppdel(f),-1); // defined in filter.lib 76 | 77 | excitation(d,e) = noiseburst(d,e) : *(gain); // defined in signal.lib 78 | 79 | rho(f) = pow(0.001,1.0/(f*t60)); // multiplies loop-gain 80 | 81 | // Original EKS damping filter: 82 | b1 = 0.5*B; b0 = 1.0-b1; // S and 1-S 83 | dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); 84 | 85 | // Linear phase FIR3 damping filter: 86 | h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; 87 | dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); 88 | 89 | loopfilter(f) = dampingfilter2(f); // or dampingfilter1 90 | 91 | filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) 92 | : pickposfilter(f) : fi.levelfilter(L,f); // see filter.lib 93 | 94 | stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f)); 95 | 96 | //================================ REVERB ============================== 97 | 98 | instrReverbHarp = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : 99 | re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ 100 | with { 101 | reverbGain = hslider("h:[2]Reverberation/Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -30 0 12]", 0.1,0.05,1,0.01) : si.smooth(0.999):min(1):max(0.05); 102 | roomSize = hslider("h:[2]Reverberation/ Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -30 0 12]", 0.2,0.05,1.7,0.01) : min(1.7):max(0.05); 103 | rdel = 20; 104 | f1 = 200; 105 | f2 = 6000; 106 | t60dc = roomSize*3; 107 | t60m = roomSize*2; 108 | fsmax = 48000; 109 | }; 110 | -------------------------------------------------------------------------------- /public/faust-modules/combined/Brass.dsp: -------------------------------------------------------------------------------- 1 | declare name "Brass"; 2 | declare description "WaveGuide Brass instrument from STK"; 3 | declare author "Romain Michon (rmichon@ccrma.stanford.edu)"; 4 | declare copyright "Romain Michon"; 5 | declare version "1.0"; 6 | declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license); 7 | declare description "A simple brass instrument waveguide model, a la Cook (TBone, HosePlayer)."; 8 | declare reference "https://ccrma.stanford.edu/~jos/pasp/Brasses.html"; 9 | 10 | //Modification GRAME July 2015 11 | 12 | import("stdfaust.lib"); 13 | instrument = library("instruments.lib"); 14 | 15 | /* =============== DESCRIPTION ================= : 16 | 17 | - Brass instrument 18 | - Head = Reverb/Silence 19 | - Upward = Higher frequency 20 | - Downward = Lower frequency 21 | 22 | */ 23 | 24 | //==================== INSTRUMENT ======================= 25 | 26 | process = vgroup("Brass Instrument", Brass <: InstrReverBrass :>_); 27 | 28 | Brass = (borePressure <: deltaPressure,_ : 29 | (lipFilter <: *(mouthPressure),(1-_)),_ : _, * :> + : 30 | fi.dcblocker) ~ (boreDelay) : 31 | *(gain)*(2); 32 | 33 | //==================== GUI SPECIFICATION ================ 34 | 35 | freq = hslider("h:[1]Instrument/Frequency[1][unit:Hz] [tooltip:Tone frequency][acc:1 1 -10 0 10]", 300,170,700,1):si.smooth(0.999); 36 | gain = 0.8; 37 | gate = checkbox("h:[1]Instrument/ ON/OFF (ASR Envelope)"); 38 | 39 | lipTension = 0.780; 40 | pressure = 1; 41 | slideLength = 0.041; 42 | 43 | vibratoFreq = hslider("v:[3]Parameters/h:/Vibrato Frequency (Vibrato Envelope)[unit:Hz][style:knob][unit:Hz][acc:0 1 -10 0 10]", 5,1,10,0.01); 44 | vibratoGain = 0.05; 45 | vibratoBegin = 0.05; 46 | vibratoAttack = 0.5; 47 | vibratoRelease = 0.1; 48 | 49 | envelopeDecay = 0.001; 50 | envelopeAttack = 0.005; 51 | envelopeRelease = 0.07; 52 | //==================== SIGNAL PROCESSING ================ 53 | 54 | //----------------------- Synthesis parameters computing and functions declaration ---------------------------- 55 | 56 | //lips are simulated by a biquad filter whose output is squared and hard-clipped, instrument.bandPassH and instrument.saturationPos are declared in instrument.lib 57 | lipFilterFrequency = freq*pow(4,(2*lipTension)-1); 58 | lipFilter = *(0.03) : instrument.bandPassH(lipFilterFrequency,0.997) <: * : instrument.saturationPos; 59 | 60 | //de.delay times in number of samples 61 | slideTarget = ((ma.SR/freq)*2 + 3)*(0.5 + slideLength); 62 | boreDelay = de.fdelay(4096,slideTarget); 63 | 64 | //----------------------- Algorithm implementation ---------------------------- 65 | 66 | //vibrato 67 | vibrato = vibratoGain*os.osc(vibratoFreq)*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate); 68 | 69 | //envelope (Attack / Decay / Sustain / Release), breath pressure and vibrato 70 | breathPressure = pressure*en.adsr(envelopeAttack,envelopeDecay,1,envelopeRelease,gate) + vibrato; 71 | mouthPressure = 0.3*breathPressure; 72 | 73 | //scale the de.delay feedback 74 | borePressure = *(0.85); 75 | 76 | //differencial presure 77 | deltaPressure = mouthPressure - _; 78 | 79 | //-------------------------------- InstrReverb --------------------------------- 80 | 81 | InstrReverBrass = re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ 82 | with { 83 | roomSize = hslider("v:[4]Reverb/Reverberation Room Size (InstrReverb)[acc:1 1 -15 0 12]", 0.2,0.05,1.7,0.01) : min(1.7) : max(0.05); 84 | rdel = 20; 85 | f1 = 200; 86 | f2 = 6000; 87 | t60dc = roomSize*3; 88 | t60m = roomSize*2; 89 | fsmax = 48000; 90 | }; 91 | 92 | -------------------------------------------------------------------------------- /public/faust-modules/combined/CMajSoftHarp.dsp: -------------------------------------------------------------------------------- 1 | declare name "C Major Soft Harp"; 2 | declare author "ER";//Adapted from Nonlinear EKS by Julius Smith and Romain Michon; 3 | declare reference "http://ccrma.stanford.edu/~jos/pasp/vegf.html"; 4 | 5 | import("stdfaust.lib"); 6 | instrument = library("instruments.lib"); 7 | 8 | /* =============== DESCRIPTION ================= : 9 | 10 | - Reverberated C Major soft harp 11 | - Left = Lower frequencies/Silence when still 12 | - Front = Resonance 13 | - Back = No resonance 14 | - Right = Higher frequencies/Fast rhythm 15 | - Head = Reverberation 16 | - Rocking = plucking all strings one by one 17 | 18 | */ 19 | 20 | //==================== INSTRUMENT ======================= 21 | 22 | process = vgroup("Soft Harp - C Major",par(i, N, NFLeks(i)):>_<: instrReverbHarp); 23 | 24 | NFLeks(n) = filtered_excitation(n,P(freq(n)),freq(n)) : stringloop(freq(n)); 25 | 26 | //==================== GUI SPECIFICATION ================ 27 | 28 | N = 24; 29 | hand = hslider("h:[1]/Instrument Hand[acc:0 1 -10 0 10]", 12, 0, N, 1) : ba.automat(bps, 15, 0.0)// => gate 30 | with{ 31 | bps = hslider("h:[1]/Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; 32 | }; 33 | 34 | gain = 1; 35 | pickangle = 0.81; 36 | beta = 0.5; 37 | 38 | t60 = hslider("h:[2]Reverb/ Resonance (InstrReverb)[unit:s][acc:0 0 -10 0 10]", 5, 0.5, 10, 0.01):min(10):max(0.5); // -60db decay time (sec) 39 | 40 | B = 0; 41 | L = -10 : ba.db2linear; 42 | 43 | //---------------------------------- FREQUENCY TABLE --------------------------- 44 | 45 | freq(0) = 130.81; 46 | freq(1) = 146.83; 47 | freq(2) = 164.81; 48 | freq(3) = 174.61; 49 | freq(4) = 195.99; 50 | freq(5) = 220.00; 51 | freq(6) = 246.94; 52 | 53 | freq(d) = freq(d-7)*(2); 54 | 55 | //==================== SIGNAL PROCESSING ================ 56 | 57 | //----------------------- noiseburst ------------------------- 58 | // White no.noise burst (adapted from Faust's karplus.dsp example) 59 | // Requires music.lib (for no.noise) 60 | noiseburst(d,e) = no.noise : *(trigger(d,e)) 61 | with { 62 | upfront(x) = (x-x') > 0; 63 | decay(n,x) = x - (x>0)/n; 64 | release(n) = + ~ decay(n); 65 | position(d) = abs(hand - d) < 0.5; 66 | trigger(d,n) = position(d) : upfront : release(n) : > (0.0); 67 | }; 68 | 69 | P(f) = ma.SR/f ; // fundamental period in samples 70 | Pmax = 4096; // maximum P (for de.delay-line allocation) 71 | 72 | ppdel(f) = beta*P(f); // pick position de.delay 73 | pickposfilter(f) = fi.ffcombfilter(Pmax,ppdel(f),-1); // defined in filter.lib 74 | 75 | excitation(d,e) = noiseburst(d,e) : *(gain); // defined in signal.lib 76 | 77 | rho(f) = pow(0.001,1.0/(f*t60)); // multiplies loop-gain 78 | 79 | // Original EKS damping filter: 80 | b1 = 0.5*B; b0 = 1.0-b1; // S and 1-S 81 | dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); 82 | 83 | // Linear phase FIR3 damping filter: 84 | h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; 85 | dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); 86 | 87 | loopfilter(f) = dampingfilter2(f); // or dampingfilter1 88 | 89 | filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) 90 | : pickposfilter(f) : fi.levelfilter(L,f); // see filter.lib 91 | 92 | stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f)); 93 | 94 | //================================= REVERB ============================== 95 | 96 | instrReverbHarp = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : 97 | re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ 98 | with { 99 | reverbGain = hslider("h:[2]Reverb/ Reverberation Volume (InstrReverb)[style:knob][acc:1 1 -30 0 17]", 0.2,0.05,1,0.01):si.smooth(0.999):min(1):max(0.05); 100 | roomSize = hslider("h:[2]Reverb/Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -30 0 16]", 0.72,0.05,2,0.01):min(2):max(0.05); 101 | rdel = 20; 102 | f1 = 200; 103 | f2 = 6000; 104 | t60dc = roomSize*3; 105 | t60m = roomSize*2; 106 | fsmax = 48000; 107 | }; 108 | 109 | -------------------------------------------------------------------------------- /public/faust-modules/combined/Meow.dsp: -------------------------------------------------------------------------------- 1 | declare name "Meow"; 2 | declare description "WaveGuide Brass instrument from STK"; 3 | declare author "ER"; //From Brass by Romain Michon (rmichon@ccrma.stanford.edu); 4 | 5 | import("stdfaust.lib"); 6 | instrument = library("instruments.lib"); 7 | 8 | /* =============== DESCRIPTION ================= : 9 | 10 | - Triple brass mimicking mewing cats 11 | - Left = silence. 12 | - Rocking from top Left to Front/Right : one cat mewing 13 | - Rotation = two cats in turn 14 | - Back/Front = Tutti 15 | 16 | */ 17 | 18 | //==================== INSTRUMENT ======================= 19 | 20 | process = vgroup("MEOW", par(i, 3, brass(i)) :> crybb); 21 | 22 | brass(n) = (borePressure <: deltaPressure(pressure(n)),_ : 23 | (lipFilter(freq(n)) <: *(mouthPressure(pressure(n))),(1-_)),_ : _, * :> + : 24 | fi.dcblocker) ~ (boreDelay(freq(n))) 25 | *(gain(n)): fi.lowpass((n+1),((n+1)*1500)); 26 | 27 | //==================== GUI SPECIFICATION ================ 28 | 29 | //gate = checkbox(" Play[1]"); 30 | gate = hslider(" ON/OFF", 0, 0, 1, 1):int; 31 | 32 | freq(0) = hslider("h:Instrument/v:Frequencies/Frequency 1 [unit:Hz][acc:1 0 -10 0 10][tooltip:Tone frequency]",370,280,380, 0.01):si.smooth(0.999); 33 | freq(1) = hslider("h:Instrument/v:Frequencies/Frequency 2 [unit:Hz][acc:0 0 -10 0 10][tooltip:Tone frequency]",440,380,550,0.01):si.smooth(0.999); 34 | freq(2) = hslider("h:Instrument/v:Frequencies/Frequency 3 [unit:Hz][acc:2 1 -10 0 12][tooltip:Tone frequency]",587.32,550,700,0.01):si.smooth(0.999); 35 | 36 | gain(0) = hslider("h:Instrument/v:Gain/Volume 1 [style:knob][acc:1 1 -12 0 12][tooltip:Gain (value between 0 and 1)]",0.5,0,1,0.01); 37 | gain(1) = hslider("h:Instrument/v:Gain/Volume 2 [style:knob][acc:0 1 -12 0 12][tooltip:Gain (value between 0 and 1)]",0.5,0,1,0.01); 38 | gain(2) = hslider("h:Instrument/v:Gain/Volume 3 [style:knob][acc:2 0 -12 0 10][tooltip:Gain (value between 0 and 1)]",0.5,0,0.5,0.01); 39 | 40 | pressure(0) = 0.37; 41 | pressure(1) = 0.68; 42 | pressure(2) = 1.0; 43 | 44 | lipTension = 0.780; 45 | 46 | slideLength = 0.041; 47 | 48 | vibratoFreq = 6; 49 | vibratoGain = 0.05; 50 | vibratoBegin = 0.05; 51 | vibratoAttack = 0.5; 52 | vibratoRelease = 0.1; 53 | 54 | envelopeAttack = 0.01; 55 | envelopeDecay = 0.001; 56 | envelopeRelease = 2; 57 | //==================== SIGNAL PROCESSING ================ 58 | 59 | crybb = ve.crybaby(wah) with { 60 | wah = hslider("Wah Wah[acc:0 0 -15 10 0]", 0.5,0,1,0.01) : ba.automat(360, 15, 0.0); 61 | }; 62 | 63 | //--------- Synthesis parameters computing and functions declaration ----------- 64 | 65 | //lips are simulated by a biquad filter whose output is squared and hard-clipped, instrument.bandPassH and instrument.saturationPos are declared in instrument.lib 66 | lipFilterFrequency(f) = f*pow(4,(2*lipTension)-1); 67 | lipFilter(f) = *(0.03) : instrument.bandPassH(lipFilterFrequency(f),0.997) <: * : instrument.saturationPos; 68 | 69 | //de.delay times in number of samples 70 | slideTarget(f) = ((ma.SR/f)*2 + 3)*(0.5 + slideLength); 71 | boreDelay(f) = de.fdelay(4096,slideTarget(f)); 72 | 73 | //----------------------- Algorithm implementation ---------------------------- 74 | 75 | //vibrato 76 | vibrato = vibratoGain*os.osc(vibratoFreq)*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate); 77 | 78 | //envelope (Attack / Decay / Sustain / Release), breath pressure and vibrato 79 | breathPressure(p) = p*en.adsr(envelopeAttack,envelopeDecay,1,envelopeRelease,gate) + vibrato; 80 | mouthPressure(p) = 0.3*breathPressure(p); 81 | 82 | //scale the de.delay feedback 83 | borePressure = *(0.85); 84 | 85 | //differencial presure 86 | deltaPressure(p) = mouthPressure(p) - _; 87 | -------------------------------------------------------------------------------- /public/faust-modules/combined/Modulations.dsp: -------------------------------------------------------------------------------- 1 | declare name "Modulations"; 2 | declare author "ER"; 3 | 4 | import("stdfaust.lib"); 5 | instrument = library("instruments.lib"); 6 | 7 | /* =========== DESCRIPTION ============== 8 | 9 | - Non Linear Filter Modulators applied to a sinewave 10 | - Head = Silence/Revereration/Higher Frequencies 11 | - Bottom = Modulation n°3 = FM/ Lower Frequencies 12 | - Rocking = Modulating Frequency (low to high) 13 | - Front = Modulation n°2 14 | - Left = Modulation n°0 & n°1 15 | - Upward = swing from head/bottom/head (a bit like tennis racket) = interesting 16 | 17 | */ 18 | 19 | //======================== INSTRUMENT ============================= 20 | 21 | process = vgroup("Modulations",oscil <: seq(i, 3, NLFM(i)), NLFM3 :> fi.lowpass(1,2000) *(0.6) *(vol) <: instrReverbMod:*(vool),*(vool)); 22 | 23 | NLFM(n) = _ : instrument.nonLinearModulator((nonlinearity:si.smooth(0.999)),env(n),freq,typeMod(n),freqMod,nlfOrder) : _; 24 | NLFM3 = _ : instrument.nonLinearModulator((nonlinearity:si.smooth(0.999)),env(3),freq,typeMod(3),freqMod,nlfOrder) : _; 25 | oscil = os.osci(freq); 26 | 27 | //======================== GUI SPECIFICATIONS ===================== 28 | 29 | freq = hslider("h:Instrument/ Frequency [unit:Hz][acc:1 1 -10 0 15]", 330, 100, 1200, 0.1):si.smooth(0.999); 30 | freqMod = hslider("h:Instrument/Modulating Frequency[style:knob][unit:Hz][acc:0 0 -10 0 10]", 1200, 900, 1700, 0.1):si.smooth(0.999); 31 | 32 | vol = (hslider("h:Instrument/ Oscillator Volume[style:knob][acc:1 0 -10 0 10]", 0.5, 0, 1, 0.01)^2):si.smooth(0.999); 33 | vool = hslider("h:Instrument/ General Volume[style:knob][acc:1 1 -10 0 10]", 1, 0.75, 4, 0.01):si.smooth(0.999):min(4):max(0.75); 34 | 35 | gate(0) = hslider("v:Modulations/Play Modulation 0 (ASR Envelope)[tooltip:noteOn = 1, noteOff = 0][acc:0 0 -30 0 10]", 0,0,1,1); 36 | gate(1) = hslider("v:Modulations/Play Modulation 1 (ASR Envelope)[tooltip:noteOn = 1, noteOff = 0][acc:0 0 -30 0 5]", 0,0,1,1); 37 | gate(2) = hslider("v:Modulations/Play Modulation 2 (ASR Envelope)[tooltip:noteOn = 1, noteOff = 0][acc:2 1 -30 0 10]", 0,0,1,1); 38 | gate(3) = hslider("v:Modulations/Play Modulation 3 (ASR Envelope)[tooltip:noteOn = 1, noteOff = 0][acc:1 0 -10 0 10]", 0,0,1,1); 39 | 40 | //------------------------ NLFM PARAMETERS ------------------------ 41 | nlfOrder = 6; 42 | nonlinearity = 0.8; 43 | typeMod(n) = n; 44 | 45 | env(n) = ASR(n); 46 | ASR(n) = en.asr(a,s,r,t(n)); 47 | a = 3; 48 | s = 1; 49 | r = 2; 50 | t(n) = gate(n); 51 | 52 | //----------------------- INSTRREVERB ------------------------------- 53 | 54 | instrReverbMod = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : 55 | re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ 56 | with { 57 | reverbGain = hslider("v:Reverb/Reverberation Volume(InstrReverb)[acc:1 1 -10 0 10]",0.25,0.05,1,0.01) : si.smooth(0.999):min(1):max(0.05); 58 | roomSize = hslider("v:Reverb/Reverberation Room Size(InstrReverb)[acc:1 1 -10 0 10]", 0.5,0.05,2,0.01):min(2):max(0.05); 59 | rdel = 20; 60 | f1 = 200; 61 | f2 = 6000; 62 | t60dc = roomSize*3; 63 | t60m = roomSize*2; 64 | fsmax = 48000; 65 | }; 66 | -------------------------------------------------------------------------------- /public/faust-modules/combined/PentatonicSoftHarp.dsp: -------------------------------------------------------------------------------- 1 | declare name "Pentatonic Soft Harp"; 2 | declare author "ER";//Adapted from "Nonlinear EKS" by Julius Smith and Romain Michon; 3 | 4 | 5 | import("stdfaust.lib"); 6 | instrument = library("instruments.lib"); 7 | 8 | /* =============== DESCRIPTION ================= 9 | 10 | - Reverberated pentatonic soft harp 11 | - Left = Lower frequencies/Silence when still 12 | - Front = Resonance 13 | - Back = No resonance 14 | - Right = Higher frequencies/Fast rhythm 15 | - Head = Reverberation 16 | - Rocking = plucking all strings one by one 17 | 18 | */ 19 | //==================== INSTRUMENT ======================= 20 | 21 | process = par(i, N, NFLeks(i)):>_<: instrReverbHarp; 22 | 23 | NFLeks(n) = filtered_excitation(n,P(freq(n)),freq(n)) : stringloop(freq(n)); 24 | 25 | //==================== GUI SPECIFICATION ================ 26 | // standard MIDI voice parameters: 27 | // NOTE: The labels MUST be "freq", "gain", and "gate" for faust2pd 28 | 29 | N = 20; 30 | hand = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 10, 0, N, 1) : ba.automat(bps, 15, 0.0)// => gate 31 | with{ 32 | bps = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; 33 | }; 34 | gain = 1; 35 | pickangle = 0.81; 36 | 37 | beta = 0.5; 38 | t60 = hslider("h:[3]Reverb/[1]Resonance[unit:s][acc:2 1 -10 0 10]", 5, 0.5, 10, 0.01); // -60db decay time (sec) 39 | 40 | B = 0; 41 | L = -10 : ba.db2linear; 42 | 43 | //---------------------------------- FREQUENCY TABLE --------------------------- 44 | 45 | freq(0) = 184.99; 46 | freq(1) = 207.65; 47 | freq(2) = 233.08; 48 | freq(3) = 277.18; 49 | freq(4) = 311.12; 50 | 51 | freq(d) = freq(d-5)*2; 52 | 53 | //==================== SIGNAL PROCESSING ================ 54 | 55 | //----------------------- noiseburst ------------------------- 56 | // White no.noise burst (adapted from Faust's karplus.dsp example) 57 | // Requires music.lib (for no.noise) 58 | noiseburst(d,e) = no.noise : *(trigger(d,e)) 59 | with{ 60 | upfront(x) = (x-x') > 0; 61 | decay(n,x) = x - (x>0)/n; 62 | release(n) = + ~ decay(n); 63 | position(d) = abs(hand - d) < 0.5; 64 | trigger(d,n) = position(d) : upfront : release(n) : > (0.0); 65 | }; 66 | 67 | //nlfOrder = 6; 68 | P(f) = ma.SR/f ; // fundamental period in samples 69 | Pmax = 4096; // maximum P (for de.delay-line allocation) 70 | 71 | ppdel(f) = beta*P(f); // pick position de.delay 72 | pickposfilter(f) = fi.ffcombfilter(Pmax,ppdel(f),-1); // defined in filter.lib 73 | 74 | excitation(d,e) = noiseburst(d,e) : *(gain); // defined in signal.lib 75 | 76 | rho(f) = pow(0.001,1.0/(f*t60)); // multiplies loop-gain 77 | 78 | // Original EKS damping filter: 79 | b1 = 0.5*B; b0 = 1.0-b1; // S and 1-S 80 | dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); 81 | 82 | // Linear phase FIR3 damping filter: 83 | h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; 84 | dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); 85 | 86 | loopfilter(f) = dampingfilter2(f); // or dampingfilter1 87 | 88 | filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) 89 | : pickposfilter(f) : fi.levelfilter(L,f); // see filter.lib 90 | 91 | stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f)); 92 | 93 | //================================= REVERB ============================== 94 | 95 | instrReverbHarp = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : 96 | re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ 97 | with { 98 | reverbGain = hslider("h:[3]Reverb/[1]Reverberation Volume(InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.2,0.05,1,0.01):si.smooth(0.999):min(1):max(0.05); 99 | roomSize = hslider("h:[3]Reverb/[2]Reverberation Room Size (InstrReverb)[style:knob][acc:1 1 -10 0 10]", 0.2,0.05,1.7,0.01):min(1.3):max(0.05); 100 | rdel = 20; 101 | f1 = 200; 102 | f2 = 6000; 103 | t60dc = roomSize*3; 104 | t60m = roomSize*2; 105 | fsmax = 48000; 106 | }; 107 | 108 | -------------------------------------------------------------------------------- /public/faust-modules/combined/Seaside.dsp: -------------------------------------------------------------------------------- 1 | declare name "Seaside"; 2 | declare autho "ER"; 3 | 4 | 5 | /* =========== DESCRIPTION ============ 6 | 7 | - Pink no.noise filtering which emulates the sound of waves, of the sea 8 | - Rocking = waves coming back and forth 9 | - Head = Slight reverberation 10 | 11 | */ 12 | 13 | import("stdfaust.lib"); 14 | instrument = library("instruments.lib"); 15 | 16 | process = Pink : fi.bandpass(1, Lowf, Highf) <: instrReverbSea :> _ 17 | 18 | // ----------------------- Band Pass Filter -------------------------- 19 | 20 | with { 21 | freq = 200; 22 | Lowf = freq - Q; 23 | Highf = freq + Q; 24 | Q = hslider("[1]Q - Filter Bandwidth (Bandpass)[style:knob][unit:Hz][acc:0 1 -10 0 10]", 30,10,150,0.0001):si.smooth(0.999); 25 | }; 26 | 27 | // ----------------------- Pink Noise -------------------------------- 28 | 29 | Pink = (w : p) * (3); 30 | 31 | // pink no.noise filter (-3dB per octave), see musicdsp.org 32 | 33 | p = f : (+ ~ g) with { 34 | f(x) = 0.04957526213389*x - 0.06305581334498*x' + 35 | 0.01483220320740*x''; 36 | g(x) = 1.80116083982126*x - 0.80257737639225*x'; 37 | }; 38 | 39 | // white no.noise generator 40 | 41 | rand = +(12345)~*(1103515245); 42 | w = rand/2147483647.0; 43 | 44 | // ----------------------- InstrReverb -------------------------------- 45 | 46 | instrReverbSea = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : 47 | re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ 48 | with { 49 | reverbGain = hslider("[2]Reverberation Volume (InstrReverb)[acc:1 1 -10 0 10]",0.1,0.05,1,0.01) : si.smooth(0.999) : min(1) : max(0.05); 50 | roomSize = hslider("[3]Reverberation Room Size (InstrReverb)[acc:1 1 -10 0 10]", 0.1,0.05,2,0.01) : min(2) : max(0.05); 51 | rdel = 20; 52 | f1 = 200; 53 | f2 = 6000; 54 | t60dc = roomSize*3; 55 | t60m = roomSize*2; 56 | fsmax = 48000; 57 | }; 58 | -------------------------------------------------------------------------------- /public/faust-modules/combined/WoodenKeyboard.dsp: -------------------------------------------------------------------------------- 1 | declare name "Wooden Keyboard"; 2 | declare author "ER"; 3 | 4 | import("stdfaust.lib"); 5 | instrument = library("instruments.lib"); 6 | 7 | //d'apres les enveloppes de John Chowning utilisees dans Turenas 8 | 9 | /* =============== DESCRIPTION ================= : 10 | 11 | - Wooden keyboard 12 | - Head = Echo/Silence 13 | - Rocking = striking across the keyboard from low frequencies (Left) to high frequencies (Right) 14 | - Back + Rotation = long notes 15 | - Front + Rotation = short notes 16 | 17 | */ 18 | 19 | //--------------------------------- INSTRUMENT --------------------------------- 20 | 21 | marimkey(n) = os.osc(octave(n)) * (0.1) 22 | *(trigger(n+1) : enveloppe : fi.lowpass(1,500)); 23 | 24 | process = hand <: par(i, 10, marimkey(i)) :> echo *(3); 25 | 26 | //---------------------------------- UI ---------------------------------------- 27 | 28 | hand = hslider("[1]Instrument Hand[acc:1 0 -10 0 10]", 5, 0, 10, 1); 29 | hight = hslider("[2]Hight[acc:0 1 -10 0 30]", 5, 1, 10, 0.3) : si.smooth(0.99):min(12):max(1); 30 | envsize = hslider("[3]Note Duration (BPF Envelope) [unit:s][acc:2 0 -10 0 10]", 0.2, 0.1, 0.5, 0.01) * (ma.SR) : si.smooth(0.999): min(44100) : max(4410) : int; 31 | feedback = hslider("[4]Echo Intensity[acc:1 1 -10 0 15]", 0.1, 0.01, 0.9, 0.01):si.smooth(0.999):min(0.9):max(0.01); 32 | 33 | //---------------------------------- FREQUENCY TABLE --------------------------- 34 | freq(0) = 164.81; 35 | freq(1) = 174.61; 36 | freq(d) = freq(d-2); 37 | 38 | octave(d) = freq(d)* hight; 39 | 40 | //------------------------------------ TRIGGER --------------------------------- 41 | 42 | upfront(x) = x>x'; 43 | counter(g)= (+(1):*(1-g))~_; 44 | position(a,x) = abs(x - a) < 0.5; 45 | 46 | trigger(p) = position(p) : upfront : counter; 47 | 48 | //------------------------------------ ECHO ------------------------------------ 49 | 50 | echo = +~(@(echoDelay)*(feedback)); 51 | echoDelay = 8096; 52 | 53 | //----------------------------------- ENVELOPPES ------------------------------ 54 | 55 | /* envelope */ 56 | 57 | enveloppe = tabchowning.f9; 58 | 59 | /* Tables Chowning */ 60 | 61 | tabchowning = environment 62 | { 63 | corres(x) = int(x*envsize/1024); 64 | // f9 0 1024 7 1 248 0.25 259 0.1 259 0.05 258 0 65 | 66 | f9 = ba.bpf.start(0, 0): 67 | ba.bpf.point(corres(2), 0.25): 68 | ba.bpf.point(corres(4), 0.5): 69 | ba.bpf.point(corres(10), 0.9): 70 | ba.bpf.point(corres(248), 0.25): 71 | ba.bpf.point(corres(507), 0.1): 72 | ba.bpf.point(corres(766), 0.05): 73 | ba.bpf.end(corres(1024), 0); 74 | }; 75 | -------------------------------------------------------------------------------- /public/faust-modules/effects/ASREnvelope.dsp: -------------------------------------------------------------------------------- 1 | declare name "ASR Envelope"; 2 | 3 | import("stdfaust.lib"); 4 | instrument = library("instruments.lib"); 5 | 6 | /* =========== DESCRITPTION ============ 7 | 8 | - An Attack, Sustain, Release envelope is used to "shape" a sound : 9 | ==> The ATTACK defines how long it takes to start : it is also called a "fade in" 10 | ==> The RELEASE defines how long it takes to end : it is also called a "fade out" 11 | ==> The ON/OFF slider is also called GATE or TRIGGER : it is used to trigger the envelope 12 | ==> The 'S' in ASR stands for SUSTAIN : it is the sound level in % reached at the end of the attack. 13 | - When the slider is ON, the trigger = 1 and the attack starts. 14 | - When the slider is OFF, the trigger = 0 and the release starts. 15 | 16 | - Head = Silence 17 | - Left = Short attack and release (0.01s) 18 | - Front/Back = medium attack and release (1s) 19 | - Right = Long attack (2s) and release (5s) 20 | 21 | */ 22 | 23 | process = *(en.asr(a,s,r,t)):_ 24 | 25 | with { 26 | a = hslider("[2]Envelope Attack[unit:s][acc:0 1 -10 0 10][style:knob]", 0.1, 0.01, 2, 0.01) : si.smooth(0.999); 27 | s = 1; 28 | r = hslider("[3]Envelope Release[unit:s][style:knob][acc:0 1 -10 0 10]", 1, 0.01, 5, 0.01) : si.smooth(0.999); 29 | //g = checkbox("[1]ON/OFF"); 30 | t = hslider("[1]ON/OFF[acc:1 0 -12 0 5]", 0, 0, 1, 1); 31 | //t = (g>0)|(sl>0); 32 | }; 33 | -------------------------------------------------------------------------------- /public/faust-modules/effects/BandPassFilter.dsp: -------------------------------------------------------------------------------- 1 | declare name "Band Pass Filter"; 2 | 3 | /* ============ DESCRITPION ============ 4 | 5 | - A band pass filter blocks all the frequencies but the designated frequency band 6 | - The slider CENTER FREQUENCY corresponds to the center frequency of the band 7 | - The slider Q - FILTER BANDWIDTH indicates the width of the band in Hz around the center frequency. 8 | - Head = High center frequency 9 | - Bottom = Low center frequency 10 | - Left = narrow band 11 | - Right = wide band 12 | 13 | */ 14 | 15 | import("stdfaust.lib"); 16 | 17 | 18 | 19 | process = _:fi.bandpass(1, Lowf, Highf):_ 20 | 21 | with { 22 | freq = hslider("[1]Center Frequency[unit:Hz][style:log][acc:1 1 -10 0 10]", 200, 50, 10000, 0.01):si.smooth(0.999); 23 | Lowf = freq - Q; 24 | Highf = freq + Q; 25 | Q = hslider("Q - Filter Bandwidth[style:knob][unit:Hz][acc:0 1 -10 0 10]", 20,2,200,0.0001)*(0.5):si.smooth(0.999); 26 | }; 27 | 28 | -------------------------------------------------------------------------------- /public/faust-modules/effects/CombFilter.dsp: -------------------------------------------------------------------------------- 1 | declare name "Comb Filter"; 2 | 3 | /* =========== DESCRIPTION ============== 4 | 5 | - A comb filter creates interferences in a sound 6 | - Rocking = to change the filtering frequency 7 | - Head = no filter 8 | - Bottom = maximum filtering 9 | 10 | */ 11 | 12 | import("stdfaust.lib"); 13 | 14 | process = fi.fb_fcomb(maxdel,del,b0,aN) 15 | with { 16 | maxdel = 1<<16; 17 | freq = 1/(hslider("Frequency[acc:0 1 -10 0 10]", 2500,100,20000,0.001)):si.smooth(0.99); 18 | del = freq *(ma.SR) : si.smooth(0.99); 19 | b0 = 1; 20 | aN = hslider("Intensity[acc:1 0 -10 0 10]", 80,0,100,0.01)*(0.01):si.smooth(0.99):min(0.999):max(0); 21 | }; 22 | 23 | -------------------------------------------------------------------------------- /public/faust-modules/effects/Echo.dsp: -------------------------------------------------------------------------------- 1 | declare name "Echo"; 2 | 3 | import("stdfaust.lib"); 4 | 5 | /* ============ DESCRIPTION ============= 6 | 7 | - Variable de.delay echo 8 | - Echo Delay = Pick manually which amount of time in seconds must be repeated by the echo 9 | - Rocking = To vary the intensity of the echo 10 | 11 | */ 12 | 13 | process = echo; 14 | 15 | echo = +~ @(echoDelay)*(feedback); 16 | 17 | echoDelay = hslider("Echo Delay[unit:s]", 0.5, 0.01, 1, 0.001):min(1):max(0.01)*(44100):int; 18 | feedback = hslider("Echo Intensity (Feedback)[style:knob][acc:0 1 -10 0 10]", 0.001, 0.001, 0.65, 0.001):si.smooth(0.999); 19 | -------------------------------------------------------------------------------- /public/faust-modules/effects/Flanger.dsp: -------------------------------------------------------------------------------- 1 | declare name "Flanger"; 2 | 3 | import("stdfaust.lib"); 4 | 5 | /* =========== DESCRIPTION ========== 6 | 7 | - Flanger effect 8 | - Head = No effect 9 | - Bottom = Maximum Intensity and Amplitude 10 | - Left = Slow Flanging 11 | - Right = Maximum Speed 12 | 13 | */ 14 | 15 | process = _<:_,(_<:FlangerDemo:>*(0.1)):drywet; 16 | 17 | FlangerDemo = flanger_stereo_demo with { 18 | flanger_group(x) = 19 | vgroup("FLANGER [tooltip: Reference: https://ccrma.stanford.edu/~jos/pasp/Flanging.html]", x); 20 | ctl_group(x) = flanger_group(hgroup("[1]", x)); 21 | 22 | invert = 0;// meter_group(checkbox("[1] Invert Flange Sum")); 23 | 24 | flanger_stereo_demo(x,y) = x,y : pf.flanger_stereo(dmax,curdel1,curdel2,depth,fb,invert); 25 | 26 | lfol = os.oscrs; // sine for left channel 27 | lfor = os.oscrc; // cosine for right channel 28 | dmax = 2048; 29 | dflange = 0.001 * ma.SR * 10; 30 | odflange = 0.001 * ma.SR * 1; 31 | freq = ctl_group(hslider("[1] Speed [acc:0 1 -10 0 10][unit:Hz] [style:knob]", 3, 0, 10, 0.01)); 32 | depth = 1; 33 | fb = 0.99; 34 | curdel1 = odflange+dflange*(1 + lfol(freq))/2; 35 | curdel2 = odflange+dflange*(1 + lfor(freq))/2; 36 | }; 37 | 38 | drywet(x,y) = (1-c)*x + c*y 39 | with { 40 | c = hslider("[3] Flanger Intensity [unit:%][acc:1 0 -10 0 10]", 10,0,100,0.01)*(0.01):si.smooth(0.999); 41 | }; 42 | -------------------------------------------------------------------------------- /public/faust-modules/effects/Freeverb.dsp: -------------------------------------------------------------------------------- 1 | declare name "freeverb"; 2 | declare version "1.0"; 3 | declare author "Grame"; 4 | declare license "BSD"; 5 | declare copyright "(c) GRAME 2006"; 6 | declare reference "https://ccrma.stanford.edu/~jos/pasp/Freeverb.html"; 7 | 8 | import("stdfaust.lib"); 9 | 10 | /* Description : 11 | 12 | - Reverberation processor. 13 | - Head = maximum reverberation. 14 | 15 | */ 16 | 17 | freeverb = vgroup("Freeverb", fxctrl(fixedgain, wetSlider, stereoReverb(combfeed, allpassfeed, dampSlider, stereospread))); 18 | 19 | process = _<: freeverb :>_; 20 | 21 | //====================================================== 22 | // 23 | // Freeverb 24 | // Faster version using fixed delays (20% gain) 25 | // 26 | //====================================================== 27 | 28 | // Constant Parameters 29 | //-------------------- 30 | 31 | fixedgain = 0.015; //value of the gain of fxctrl 32 | scalewet = 3.0; 33 | scaledry = 2.0; 34 | scaledamp = 0.4; 35 | scaleroom = 0.28; 36 | offsetroom = 0.7; 37 | initialroom = 0.5; 38 | initialdamp = 0.5; 39 | initialwet = 1.0/scalewet; 40 | initialdry = 0; 41 | initialwidth= 1.0; 42 | initialmode = 0.0; 43 | freezemode = 0.5; 44 | stereospread= 23; 45 | allpassfeed = 0.5; //feedback of the delays used in allpass filters 46 | 47 | // Filter Parameters 48 | //------------------ 49 | 50 | combtuningL1 = 1116; 51 | combtuningL2 = 1188; 52 | combtuningL3 = 1277; 53 | combtuningL4 = 1356; 54 | combtuningL5 = 1422; 55 | combtuningL6 = 1491; 56 | combtuningL7 = 1557; 57 | combtuningL8 = 1617; 58 | 59 | allpasstuningL1 = 556; 60 | allpasstuningL2 = 441; 61 | allpasstuningL3 = 341; 62 | allpasstuningL4 = 225; 63 | 64 | // Control Sliders 65 | //-------------------- 66 | // Damp : filters the high frequencies of the echoes (especially active for great values of RoomSize) 67 | // RoomSize : size of the reverberation room 68 | // Dry : original signal 69 | // Wet : reverberated signal 70 | 71 | //dampSlider = hslider("Damp",0.5, 0, 1, 0.025)*scaledamp; 72 | 73 | dampSlider = 0.7*scaledamp; 74 | roomsizeSlider = hslider("Reverberation Room Size[acc:1 1 -10 0 10]", 0.5, 0.1, 0.9, 0.025) : si.smooth(0.999) : min(0.9) :max(0.1) *scaleroom + offsetroom; 75 | wetSlider = hslider("Reverberation Intensity[acc:1 1 -10 0 10]", 0.3333, 0.1, 0.9, 0.025) : si.smooth(0.999) : min(0.9) :max(0.1); 76 | combfeed = roomsizeSlider; 77 | 78 | // Comb and Allpass filters 79 | //------------------------- 80 | 81 | allpass(dt,fb) = (_,_ <: (*(fb),_:+:@(dt)), -) ~ _ : (!,_); 82 | 83 | comb(dt, fb, damp) = (+:@(dt)) ~ (*(1-damp) : (+ ~ *(damp)) : *(fb)); 84 | 85 | // Reverb components 86 | //------------------ 87 | 88 | monoReverb(fb1, fb2, damp, spread) 89 | = _ <: comb(combtuningL1+spread, fb1, damp), 90 | comb(combtuningL2+spread, fb1, damp), 91 | comb(combtuningL3+spread, fb1, damp), 92 | comb(combtuningL4+spread, fb1, damp), 93 | comb(combtuningL5+spread, fb1, damp), 94 | comb(combtuningL6+spread, fb1, damp), 95 | comb(combtuningL7+spread, fb1, damp), 96 | comb(combtuningL8+spread, fb1, damp) 97 | +> 98 | allpass (allpasstuningL1+spread, fb2) 99 | : allpass (allpasstuningL2+spread, fb2) 100 | : allpass (allpasstuningL3+spread, fb2) 101 | : allpass (allpasstuningL4+spread, fb2) 102 | ; 103 | 104 | stereoReverb(fb1, fb2, damp, spread) 105 | = + <: monoReverb(fb1, fb2, damp, 0), monoReverb(fb1, fb2, damp, spread); 106 | 107 | // fxctrl : add an input gain and a wet-dry control to a stereo FX 108 | //---------------------------------------------------------------- 109 | 110 | fxctrl(g,w,Fx) = _,_ <: (*(g),*(g) : Fx : *(w),*(w)), *(1-w), *(1-w) +> _,_; 111 | -------------------------------------------------------------------------------- /public/faust-modules/effects/Granulator.dsp: -------------------------------------------------------------------------------- 1 | declare name "Granulator"; 2 | declare author "Adapted from sfIter by Christophe Lebreton"; 3 | 4 | /* =========== DESCRITPTION ============= 5 | 6 | - The granulator takes very small parts of a sound, called GRAINS, and plays them at a varying speed 7 | - Front = Medium size grains 8 | - Back = short grains 9 | - Left Slow rhythm 10 | - Right = Fast rhythm 11 | - Bottom = Regular occurrences 12 | - Head = Irregular occurrences 13 | */ 14 | 15 | import("stdfaust.lib"); 16 | 17 | process = hgroup("Granulator", *(excitation : ampf)); 18 | 19 | excitation = noiseburst(gate,P) * (gain); 20 | ampf = an.amp_follower_ud(duree_env,duree_env); 21 | 22 | //----------------------- NOISEBURST ------------------------- 23 | 24 | noiseburst(gate,P) = no.noise : *(gate : trigger(P)) 25 | with { 26 | upfront(x) = (x-x') > 0; 27 | decay(n,x) = x - (x>0)/n; 28 | release(n) = + ~ decay(n); 29 | trigger(n) = upfront : release(n) : > (0.0); 30 | }; 31 | 32 | P = freq; // fundamental period in samples 33 | Pmax = 4096; // maximum P (for de.delay-line allocation) 34 | 35 | gate = phasor_bin(1) :-(0.001):pulsar; 36 | gain = 1; 37 | freq = hslider("[1]Grain Size[style:knob][acc:2 0 -10 0 10]", 200,5,2205,1); 38 | // la frequence donne la largeur de bande extraite du bruit blanc 39 | 40 | // PHASOR_BIN ////////////////////////////// 41 | phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); 42 | 43 | // PULSAR ////////////////////////////// 44 | //Le pulsar permet de creer une 'pulsation' plus ou moins aleatoire (proba). 45 | 46 | pulsar = _<:((_<(ratio_env)):@(100))*(proba>(_,abs(no.noise):ba.latch)); 47 | speed = hslider ("[2]Speed[unit:Hz][style:knob][acc:0 1 -10 0 10]", 10,1,20,0.0001):fi.lowpass(1,1); 48 | ratio_env = 0.5; 49 | fade = (0.5); // min > 0 pour eviter division par 0 50 | proba = hslider ("[3]Probability[unit:%][style:knob][acc:1 0 -10 0 10]", 70,50,100,1) * (0.01):fi.lowpass(1,1); 51 | duree_env = 1/(speed: / (ratio_env*(0.25)*fade)); 52 | -------------------------------------------------------------------------------- /public/faust-modules/effects/HighPassFilter.dsp: -------------------------------------------------------------------------------- 1 | declare name "High Pass Filter"; 2 | import("stdfaust.lib"); 3 | 4 | /* ========= DESCRITPION =========== 5 | 6 | - A high pass filter blocks all the frequencies inferior to the designated CUT-OFF FREQUENCY 7 | - Front = no filter 8 | - Back = maximum filtering 9 | - Rocking = Increase/Decrease of the filtering 10 | */ 11 | 12 | process = _:fi.highpass(2,fc):_ 13 | 14 | with { 15 | fc = hslider("Cut-off Frequency[acc:2 0 -10 0 10][scale:log]", 1300, 10, 20000, 0.01):si.smooth(0.999):min(20000):max(10); 16 | }; 17 | -------------------------------------------------------------------------------- /public/faust-modules/effects/InstrReverb.dsp: -------------------------------------------------------------------------------- 1 | declare name "InstrReverb"; //instrument.lib 2 | import("stdfaust.lib"); 3 | 4 | /* =========== DESCRIPTION ============= 5 | 6 | - Reverberation 7 | - Head = Maximum Reverberation 8 | - Bottom = No reverberation 9 | 10 | */ 11 | 12 | process = _<: instrReverb:>_; 13 | 14 | instrReverb = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : 15 | re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ 16 | with { 17 | reverbGain = hslider("v:Reverb/Reverberation Volume[acc:1 1 -10 0 10]",0.1,0.05,1,0.01) : si.smooth(0.999) : min(1) : max(0.05); 18 | roomSize = hslider("v:Reverb/Reverberation Room Size[acc:1 1 -10 0 10]", 0.1,0.05,2,0.01) : min(2) : max(0.05); 19 | rdel = 20; 20 | f1 = 200; 21 | f2 = 6000; 22 | t60dc = roomSize*3; 23 | t60m = roomSize*2; 24 | fsmax = 48000; 25 | }; 26 | -------------------------------------------------------------------------------- /public/faust-modules/effects/Loop.dsp: -------------------------------------------------------------------------------- 1 | declare name "Loop"; 2 | declare version "1.0"; 3 | declare author "Grame"; 4 | declare license "BSD"; 5 | declare copyright "(c)GRAME 2006"; 6 | 7 | /* =========== DESCRITPION =========== 8 | 9 | - Record and Loop up to 20s of sound 10 | - Activate the Loop Mode : 1 = ON, 0 = OFF 11 | - When Loop Mode is active : 12 | ==> Head = Not recording/ Looping the recorded sound 13 | ==> Bottom = Recording sound 14 | ==> Swift movements around Head = scratched record effect 15 | 16 | */ 17 | 18 | import("stdfaust.lib"); 19 | 20 | B = hslider("Start/Stop Recording (Max 20s)[acc:1 0 -10 0 12]", 1,0,1,1); // Capture sound while pressed 21 | I = int(B); // convert button signal from float to integer 22 | R = (I-I') <= 0; // Reset capture when button is pressed 23 | D = (+(I):*(R))~_; // Compute capture duration while button is pressed: 0..NNNN0..MMM 24 | 25 | 26 | capture = *(B) : (+ : de.delay(1048576, D-1)) ~ *(1.0-B) ; 27 | 28 | level = hslider("Volume [unit:dB]", 0, -96, 4, 0.1) : ba.db2linear : si.smooth(0.999); 29 | captONOFF = hslider("Loop Mode ON/OFF",0,0,1,1); 30 | 31 | process = vgroup( "LOOP", _<:_,(_<:capture,_ : select2(B)): select2(captONOFF) *(level) ) ; 32 | 33 | -------------------------------------------------------------------------------- /public/faust-modules/effects/LowPassFilter.dsp: -------------------------------------------------------------------------------- 1 | declare name "Low Pass Filter"; 2 | import("stdfaust.lib"); 3 | 4 | /* ========= DESCRITPION =========== 5 | 6 | - A low pass filter blocks all the frequencies superior to the designated CUT-OFF FREQUENCY 7 | - Front = no filter 8 | - Back = maximum filtering 9 | - Rocking = Increase/Decrease of the filtering 10 | */ 11 | 12 | process = _:fi.lowpass(2,fc):_ 13 | with{ 14 | fc = hslider("Cut-off Frequency[acc:2 1 -10 0 10][scale:log]", 800, 10, 20000, 0.01):si.smooth(0.999):min(20000):max(10); 15 | }; 16 | -------------------------------------------------------------------------------- /public/faust-modules/effects/Modulations.dsp: -------------------------------------------------------------------------------- 1 | declare name "Modulations"; 2 | 3 | /* =========== DESCRITPION =========== 4 | 5 | - Non Linear modulation processor 6 | - There are 5 different types of modulations available : 7 | ==> 0, 1, 2 use the incoming signal to perform the modulation 8 | ==> 3 uses the modulating frequency to modulate the sound 9 | ==> 4 uses the default 220Hz frequency to modulate the sound 10 | 11 | - Pick a modulation type 12 | - Left/Right/Back = modulated sound 13 | - Front = No modulation 14 | - Head = minimum modulation intensity/ High modulating frequency 15 | - Bottom = maximum modulation intensity/ Low modulating frequency 16 | - Swing = change modulation intensity and modulating frequency 17 | 18 | */ 19 | 20 | import("stdfaust.lib"); 21 | instrument=library("instruments.lib"); 22 | 23 | NLFM = _ : instrument.nonLinearModulator(nonlinearity,env,freq,typeMod,freqMod,order) : _; 24 | process = NLFM; 25 | 26 | gate = hslider("[1]ON/OFF (ASR Envelope)[acc:2 0 -10 0 10]", 1,0,1,1); 27 | 28 | ASR =(en.asr(a,s,r,t)) 29 | with { 30 | a = 1; 31 | s = 1; 32 | r = 1; 33 | t = gate; 34 | }; 35 | 36 | nonlinearity = hslider("[4]Modulation Intensity[acc:1 0 -10 0 10][style:knob]", 0.1, 0, 1, 0.001); 37 | env = ASR; 38 | freq = 220; 39 | typeMod = hslider("[2]Modulation Type[style:radio{'0':0;'1':1;'2':2;'3':3;'4':4}]", 0, 0, 4, 1); 40 | freqMod = hslider("[3]Modulating Frequency[acc:1 1 -10 0 10][style:knob][unit:Hz]", 204.8, 50, 1700, 0.1):si.smooth(0.999); 41 | order = nlfOrder; 42 | nlfOrder = 6; 43 | -------------------------------------------------------------------------------- /public/faust-modules/effects/Notch.dsp: -------------------------------------------------------------------------------- 1 | import("stdfaust.lib"); 2 | 3 | /* =========== Description ===========: 4 | 5 | - A Notch creates a "hole" in the sound at the indicated frequency 6 | - The slider Q - FILTER BANDWIDTH indicates the width of the band in Hz around the center frequency. 7 | 8 | - Rocking : to chose the frequency to be cut-off. 9 | - Back : Maximum Q. 10 | - Front : Minimum Q. 11 | - Note : The smaller Q is, the larger the notch. 12 | 13 | */ 14 | 15 | G = -3; 16 | F = hslider("Frequency[scale:log][acc:0 1 -10 0 15]", 440, 80, 10000, 1):min(10000):max(80); 17 | Q = hslider("Q - Filter Bandwidth[scale:log][acc:2 0 -10 0 10]", 20, 0.01, 50, 0.01):min(50):max(0.01); 18 | 19 | process(x) = library("maxmsp.lib").notch(x,F,G,Q); 20 | 21 | -------------------------------------------------------------------------------- /public/faust-modules/effects/OnOff.dsp: -------------------------------------------------------------------------------- 1 | import("stdfaust.lib"); 2 | process = * (button("On Off"):ba.toggle:si.smooth(0.998)); -------------------------------------------------------------------------------- /public/faust-modules/effects/PeakEqualizer.dsp: -------------------------------------------------------------------------------- 1 | declare name "Peak Equalizer"; 2 | 3 | import("stdfaust.lib"); 4 | 5 | /* =========== DESCRITPION ============== 6 | 7 | - An Equalizer - or EQ - is used to cut or boost a designated peak frequency from a sound 8 | - The Q - FILTER BANDWIDTH indicates in Hz the width of the frequency band around the peak frequency impacted by the cut or boost 9 | 10 | - Front = Boosting effect/ Narrow band 11 | - Back = Cutting effect/ Wide band 12 | - Left = Low peak frequency 13 | - Right = High peak frequency 14 | 15 | */ 16 | 17 | process = vgroup("Peak EQ",fi.peak_eq(level,freq,Q)) 18 | 19 | with { 20 | level = hslider("[2]Level[unit:dB][style:knob][acc:2 1 -10 0 10][tooltip: boost Level>0 or cut Level<0)", 0, -40, 32, 0.01):min(32):max(-40); 21 | freq = hslider("[1]Peak Frequency[unit:Hz][acc:0 1 -10 0 10][scale:log]", 440, 50, 11000, 0.01):si.smooth(0.999); 22 | Q = hslider("Q - Filter Bandwidth [unit:Hz][acc:2 0 -10 0 10]", 50, 20, 200, 1):si.smooth(0.999):min(200):max(20); 23 | }; 24 | -------------------------------------------------------------------------------- /public/faust-modules/effects/Phaser.dsp: -------------------------------------------------------------------------------- 1 | declare name "Phaser"; 2 | 3 | import("stdfaust.lib"); 4 | 5 | /* =========== DESCRIPTION ========== 6 | 7 | - Flanger effect 8 | - Head = No effect 9 | - Bottom = Maximum Intensity and Amplitude 10 | - Left = Slow Flanging 11 | - Right = Maximum Speed 12 | 13 | */ 14 | process = _<:_,(_<:phaser2Demo:>*(0.2)):drywet; 15 | 16 | phaser2Demo = phaser2_stereo_demo with { 17 | phaser2_group(x) = 18 | vgroup("PHASER2 [tooltip: Reference: https://ccrma.stanford.edu/~jos/pasp/Flanging.html]", x); 19 | meter_group(x) = phaser2_group(hgroup("[0]", x)); 20 | ctl_group(x) = phaser2_group(hgroup("[1]", x)); 21 | nch_group(x) = phaser2_group(hgroup("[2]", x)); 22 | lvl_group(x) = phaser2_group(hgroup("[3]", x)); 23 | 24 | invert = 0; 25 | 26 | // FIXME: This should be an amplitude-response display: 27 | //flangeview = phaser2_amp_resp : meter_group(hspectrumview("[2] Phaser Amplitude Response", 0,1)); 28 | //phaser2_stereo_demo(x,y) = attach(x,flangeview),y : ... 29 | 30 | phaser2_stereo_demo = 31 | pf.phaser2_stereo(Notches,width,frqmin,fratio,frqmax,speed,depth,fb,invert); 32 | 33 | Notches = 4; // Compile-time parameter: 2 is typical for analog phaser stomp-boxes 34 | 35 | // FIXME: Add tooltips 36 | speed = ctl_group(hslider("[1]Speed[acc:0 1 -10 0 10] [unit:Hz] [style:knob]", 3, 0, 10, 0.001)); 37 | depth = 1; 38 | fb = 0.8; 39 | 40 | width = 150; 41 | frqmin = 100; 42 | frqmax = 800; 43 | fratio = 1.5; 44 | }; 45 | 46 | drywet(x,y) = (1-c)*x + c*y 47 | with { 48 | c = hslider("[2]Phaser Intensity[style:knob][unit:%][acc:1 0 -10 0 10]", 10,0,100,0.01)*(0.01):si.smooth(0.999); 49 | }; 50 | -------------------------------------------------------------------------------- /public/faust-modules/effects/RandomRingModulation.dsp: -------------------------------------------------------------------------------- 1 | declare name "Random Ring Modulator"; 2 | 3 | 4 | /* ========== DESCRITPION =========== 5 | 6 | - Ring Modulator which randomly changes the modulation frequency 7 | - Left = Irregular and rare changes 8 | - Right = Regular and frequent changes 9 | - Front = Low ranging modulating frequencies 10 | - Back = High ranging modulating frequencies 11 | 12 | */ 13 | 14 | import("stdfaust.lib"); 15 | 16 | process = *(ringmod); 17 | 18 | ringmod = os.oscs(rfreq); 19 | 20 | ringSpeed = hslider("[1]Ring Modulation Speed Range[scale:log][acc:2 0 -10 0 10]", 20, 10, 10000, 1) : si.smooth(0.99) : min(10000) : max(1); 21 | 22 | //--------------------------- Random Frequency --------------------------- 23 | 24 | rfreq = pulsaring.gate : randfreq : si.smooth(0.99) : fi.lowpass (1, 3000); 25 | randfreq(g) = no.noise : sampleAndhold(sahgate(g))*(ringSpeed) 26 | with{ 27 | sampleAndhold(t) = select2(t) ~_; 28 | sahgate(g) = g : upfront : counter -(3) <=(0); 29 | upfront(x) = abs(x-x')>0.5; 30 | counter(g) = (+(1):*(1-g))~_; 31 | }; 32 | 33 | //----------------------- Pulsar -------------------------------------- 34 | 35 | pulsaring = environment { 36 | 37 | gate = phasor_bin(1) :-(0.001):pulsar; 38 | ratio_env = (0.5); 39 | fade = (0.5); // min > 0 pour eviter division par 0 40 | speed = hslider ("[2]Occurrence Speed (Granulator)[unit:Hz][style:knob][acc:0 1 -10 0 10]", 4,0.001,10,0.0001):fi.lowpass(1,1); 41 | proba = hslider ("[3]Probability(Granulator)[unit:%][style:knob][acc:0 1 -10 0 10]", 88,75,100,1) *(0.01):fi.lowpass(1,1); 42 | 43 | phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); 44 | pulsar = _<:(((_)<(ratio_env)):@(100))*((proba)>((_),(no.noise:abs):ba.latch)); 45 | 46 | }; 47 | -------------------------------------------------------------------------------- /public/faust-modules/effects/RandomVibrato.dsp: -------------------------------------------------------------------------------- 1 | declare name "Random Vibrato"; 2 | 3 | /* ========== DESCRITPION =========== 4 | 5 | - Vibrato processor which randomly changes the vibrato frequency 6 | - Left = Irregular and rare changes 7 | - Right = Regular and frequent changes 8 | - Front = Low ranging vibrato frequencies 9 | - Back = High ranging vibrato frequencies 10 | 11 | */ 12 | 13 | import("stdfaust.lib"); 14 | 15 | //Random Vibrato: 16 | 17 | process = *(vibrato); 18 | 19 | //----------------- VIBRATO --------------------// 20 | 21 | vibrato = vibratoGain * os.osc(vibratoFreq) + (1-vibratoGain); 22 | vibratoGain = hslider("[2]Vibrato Intensity[style:knob][acc:1 0 -10 0 10]", 0.1, 0.05, 0.4, 0.01) : si.smooth(0.999); 23 | vibratoFreq = vfreq; 24 | vibratoSpeed = hslider("[1]Vibrato Speed Range[scale:log][acc:2 0 -10 0 10]", 10, 5, 40, 1) : si.smooth(0.99) : min(40) : max(1); 25 | 26 | //--------------------------- Random Frequency --------------------------- 27 | 28 | vfreq = pulsawhistle.gate : randfreq : si.smooth(0.99) : fi.lowpass (1, 3000); 29 | randfreq(g) = no.noise : sampleAndhold(sahgate(g))*(vibratoSpeed) 30 | with{ 31 | sampleAndhold(t) = select2(t) ~_; 32 | sahgate(g) = g : upfront : counter -(3) <=(0); 33 | upfront(x) = abs(x-x')>0.5; 34 | counter(g) = (+(1):*(1-g))~_; 35 | }; 36 | 37 | //----------------------- Pulsar -------------------------------------- 38 | 39 | pulsawhistle = environment { 40 | 41 | gate = phasor_bin(1) :-(0.001):pulsar; 42 | ratio_env = (0.5); 43 | fade = (0.5); // min > 0 pour eviter division par 0 44 | speed = hslider ("[3]Occurrence Speed (Granulator)[unit:Hz][style:knob][acc:0 1 -10 0 10]", 4,0.001,10,0.0001):fi.lowpass(1,1); 45 | proba = hslider ("[4]Probability (Granulator)[unit:%][style:knob][acc:0 1 -10 0 10]", 88,75,100,1) *(0.01):fi.lowpass(1,1); 46 | 47 | phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); 48 | pulsar = _<:(((_)<(ratio_env)):@(100))*((proba)>((_),(no.noise:abs):ba.latch)); 49 | 50 | }; 51 | -------------------------------------------------------------------------------- /public/faust-modules/effects/RingModulation.dsp: -------------------------------------------------------------------------------- 1 | declare name "Ring Modulation"; 2 | 3 | /* ======== DESCRIPTION ========== 4 | 5 | - Ring modulation consists in modulating a sound by multiplying it with a sine wave 6 | - Head = no modulation 7 | - Downward = modulation, varying the modulating frequency 8 | 9 | */ 10 | 11 | import("stdfaust.lib"); 12 | 13 | 14 | process = ringmod; 15 | 16 | ringmod = _<:_,*(os.oscs(freq)):drywet 17 | with { 18 | freq = hslider ( "[1]Modulation Frequency[acc:1 0 -10 0 10][scale:log]", 2,0.001,100,0.001):si.smooth(0.999); 19 | drywet(x,y) = (1-c)*x + c*y; 20 | c = hslider("[2]Modulation intensity[style:knob][unit:%][acc:1 0 -10 0 10]", 60,0,100,0.01)*(0.01):si.smooth(0.999); 21 | }; 22 | -------------------------------------------------------------------------------- /public/faust-modules/effects/SLimiter.dsp: -------------------------------------------------------------------------------- 1 | declare name "Limiter"; 2 | declare author "Yann Orlarey"; 3 | 4 | /* ========= DESCRITPION ========== 5 | 6 | - A limiter is a security that prevents a sound from saturating 7 | 8 | */ 9 | 10 | process =slimiter; 11 | 12 | slimiter(x,y) =x*coeff,y*coeff 13 | 14 | with { 15 | epsilon =1/(44100*1.0); 16 | peak = max(abs(x),abs(y)):max~-(epsilon); 17 | coeff = 1.0/max(1.0,peak); 18 | }; 19 | 20 | -------------------------------------------------------------------------------- /public/faust-modules/effects/VibratoEnvelope.dsp: -------------------------------------------------------------------------------- 1 | declare name "Vibrato Envelope"; //instrument.lib 2 | import("stdfaust.lib"); 3 | instrument = library("instruments.lib"); 4 | 5 | /* =========== DESCRIPTION ============ 6 | 7 | - Vibrato generator 8 | - Head = no vibrato 9 | - Bottom = Maximum virato intensity 10 | - Rocking = From slow to fast vibrato 11 | 12 | */ 13 | 14 | process = vgroup("Vibrato",vibrato); 15 | 16 | vibrato = _*((vibratoGain*os.osc(vibratoFreq)+(1-vibratoGain))*vibratoEnv); 17 | 18 | vibratoGain = hslider("Vibrato Intensity[style:knob][acc:1 0 -10 0 10]", 0.1, 0.05, 0.4, 0.01) : si.smooth(0.999):min(0.5):max(0.05); 19 | vibratoFreq = hslider("Vibrato Frequency[unit:Hz][acc:0 1 -10 0 10]", 5, 0, 10, 0.001) : si.smooth(0.999); 20 | 21 | vibratoEnv = _ : *(instrument.envVibrato(b,a,s,r,t)) : _ 22 | with { 23 | b = 0.25; 24 | a = 1; 25 | s = 100; 26 | r = 2; 27 | t = hslider("h:/ON/OFF Slider[acc:1 0 -10 0 10]", 0, 0, 1, 1); 28 | }; 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /public/faust-modules/effects/Volume.dsp: -------------------------------------------------------------------------------- 1 | declare name "Volume"; 2 | declare author "GRAME"; 3 | 4 | /* ========== DESCRITPION =========== 5 | 6 | - Simple volume slider 7 | - Head = Silence 8 | - Bottom = Max volume 9 | 10 | */ 11 | 12 | import("stdfaust.lib"); 13 | 14 | process = par(i,2,*(hslider("Volume[acc:1 0 -10 0 10]", 0.75, 0, 1, 0.01):si.smooth(0.999))); 15 | -------------------------------------------------------------------------------- /public/faust-modules/effects/WahWah.dsp: -------------------------------------------------------------------------------- 1 | declare name "WahWah"; 2 | 3 | /* ========== DESCRIPTION =========== 4 | 5 | - Wahwah effect 6 | - Head = no effect 7 | - Bottom = Maximum wahwah intensity 8 | - Rocking = varying the Wahwah effect 9 | 10 | */ 11 | 12 | import("stdfaust.lib"); 13 | 14 | process = _<:_,ve.crybaby(wah):drywet 15 | with { 16 | wah = hslider("[1]Wah Wah[acc:0 1 -10 0 10]", 0.6,0,1,0.01) : ba.automat(bps, 15, 0.0); 17 | bps = hslider("[2]Speed[acc:0 1 -10 0 10]", 540, 360, 780, 0.1):si.smooth(0.999):min(780):max(360):int; 18 | drywet(x,y) = (1-c)*x + c*y; 19 | c = hslider("[3]Wah wah intensity[style:knob][unit:%][acc:1 0 -10 0 10]", 60,0,100,0.01)*(0.01):si.smooth(0.999):min(1):max(0); 20 | }; 21 | -------------------------------------------------------------------------------- /public/faust-modules/generators/Kisana.dsp: -------------------------------------------------------------------------------- 1 | declare name "Kisana"; 2 | declare author "Yann Orlarey"; 3 | 4 | //Modifications GRAME July 2015 5 | 6 | /* ========= DESCRITPION ============= 7 | 8 | - Kisana : 3-loops string instrument (based on Karplus-Strong) 9 | - Head = Silence 10 | - Tilt = High frequencies 11 | - Front = High + Medium frequencies 12 | - Bottom = High + Medium + Low frequencies 13 | - Left = Minimum brightness 14 | - Right = Maximum birghtness 15 | - Front = Long notes 16 | - Back = Short notes 17 | 18 | */ 19 | 20 | import("stdfaust.lib"); 21 | 22 | KEY = 60; // basic midi key 23 | NCY = 15; // note cycle length 24 | CCY = 15; // control cycle length 25 | BPS = 360; // general tempo (ba.beat per sec) 26 | 27 | process = kisana; 28 | 29 | //-------------------------------kisana---------------------------------- 30 | // USAGE: kisana : _,_; 31 | // 3-loops string instrument 32 | //----------------------------------------------------------------------- 33 | 34 | kisana = vgroup("Kisana", harpe(C,11,48), harpe(C,11,60), (harpe(C,11,72) : *(1.5), *(1.5)) 35 | :>*(l)) 36 | with { 37 | l = -20 : ba.db2linear;//hslider("[1]Volume",-20, -60, 0, 0.01) : ba.db2linear; 38 | C = hslider("[2]Brightness[acc:0 1 -10 0 10]", 0.2, 0, 1, 0.01) : ba.automat(BPS, CCY, 0.0); 39 | }; 40 | 41 | //----------------------------------Harpe-------------------------------- 42 | // USAGE: harpe(C,10,60) : _,_; 43 | // C is the filter coefficient 0..1 44 | // Build a N (10) strings harpe using a pentatonic scale 45 | // based on midi key b (60) 46 | // Each string is triggered by a specific 47 | // position of the "hand" 48 | //----------------------------------------------------------------------- 49 | harpe(C,N,b) = hand(b) <: par(i, N, position(i+1) 50 | : string(C,Penta(b).degree2Hz(i), att, lvl) 51 | : pan((i+0.5)/N) ) 52 | :> _,_ 53 | with { 54 | att = hslider("[3]Resonance[acc:2 1 -10 0 12]", 4, 0.1, 10, 0.01); 55 | hand(48) = vslider("h:[1]Instrument Hands/1 (Note %b)[unit:pk][acc:1 0 -10 0 14]", 0, 0, N, 1) : int : ba.automat(120, CCY, 0.0); 56 | hand(60) = vslider("h:[1]Instrument Hands/2 (Note %b)[unit:pk][acc:1 0 -10 0 14]", 2, 0, N, 1) : int : ba.automat(240, CCY, 0.0); 57 | hand(72) = vslider("h:[1]Instrument Hands/3 (Note %b)[unit:pk][acc:1 0 -10 0 10]", 4, 0, N, 1) : int : ba.automat(480, CCY, 0.0); 58 | //lvl = vslider("h:loop/level", 0, 0, 6, 1) : int : ba.automat(BPS, CCY, 0.0) : -(6) : ba.db2linear; 59 | lvl = 1; 60 | pan(p) = _ <: *(sqrt(1-p)), *(sqrt(p)); 61 | position(a,x) = abs(x - a) < 0.5; 62 | }; 63 | 64 | //----------------------------------Penta------------------------------- 65 | // Pentatonic scale with degree to midi and degree to Hz conversion 66 | // USAGE: Penta(60).degree2midi(3) ==> 67 midikey 67 | // Penta(60).degree2Hz(4) ==> 440 Hz 68 | //----------------------------------------------------------------------- 69 | 70 | Penta(key) = environment { 71 | 72 | A4Hz = 440; 73 | 74 | degree2midi(0) = key+0; 75 | degree2midi(1) = key+2; 76 | degree2midi(2) = key+4; 77 | degree2midi(3) = key+7; 78 | degree2midi(4) = key+9; 79 | degree2midi(d) = degree2midi(d-5)+12; 80 | 81 | degree2Hz(d) = A4Hz*semiton(degree2midi(d)-69) with { semiton(n) = 2.0^(n/12.0); }; 82 | 83 | }; 84 | 85 | //----------------------------------String------------------------------- 86 | // A karplus-strong string. 87 | // 88 | // USAGE: string(440Hz, 4s, 1.0, button("play")) 89 | // or button("play") : string(440Hz, 4s, 1.0) 90 | //----------------------------------------------------------------------- 91 | 92 | string(coef, freq, t60, level, trig) = no.noise*level 93 | : *(trig : trigger(freq2samples(freq))) 94 | : resonator(freq2samples(freq), att) 95 | with { 96 | resonator(d,a) = (+ : @(d-1)) ~ (average : *(a)); 97 | average(x) = (x*(1+coef)+x'*(1-coef))/2; 98 | trigger(n) = upfront : + ~ decay(n) : >(0.0); 99 | upfront(x) = (x-x') > 0.0; 100 | decay(n,x) = x - (x>0.0)/n; 101 | freq2samples(f) = 44100.0/f; 102 | att = pow(0.001,1.0/(freq*t60)); // attenuation coefficient 103 | random = +(12345)~*(1103515245); 104 | noise = random/2147483647.0; 105 | }; 106 | 107 | 108 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SAtonalSoftHarp.dsp: -------------------------------------------------------------------------------- 1 | declare name "Atonal Soft Harp"; 2 | declare author "ER"; //Adapted from NLFeks by Julius Smith and Romain Michon; 3 | 4 | /* =============== DESCRIPTION ======================== : 5 | 6 | - Soft Atonal Harp 7 | - Swing = Plucking all the strings one by one 8 | - Left = Slow rhythm /Low frequencies/ Silence 9 | - Right = Fast rhythm/ High frequencies 10 | - Back = Short and dry notes 11 | - Front = Long and bright notes 12 | 13 | */ 14 | 15 | import("stdfaust.lib"); 16 | 17 | //==================== INSTRUMENT ======================= 18 | 19 | process = par(i, N, NFLeks(i)):>_; 20 | 21 | NFLeks(n) = filtered_excitation(n,P(freq(n)),freq(n)) : stringloop(freq(n)); 22 | 23 | //==================== GUI SPECIFICATION ================ 24 | N = 20; 25 | hand = hslider("h:[1]/Instrument Hand[acc:0 1 -10 0 10]", 10, 0, N, 1) : ba.automat(bps, 15, 0.0)// => gate 26 | with{ 27 | bps = hslider("h:[1]/Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; 28 | }; 29 | gain = 1; 30 | 31 | pickangle = 0.9; 32 | 33 | beta = 0.5; 34 | 35 | // String decay time in seconds: 36 | t60 = hslider("h:[2]Reverberation/ Resonance[unit:s][acc:2 1 -10 0 10]", 5, 0.5, 10, 0.01):min(10):max(0.5); // -60db decay time (sec) 37 | 38 | B = 0; 39 | L = -10 : ba.db2linear; 40 | 41 | //---------------------------------- FREQUENCY TABLE --------------------------- 42 | 43 | freq(0) = 200; 44 | freq(1) = 215; 45 | freq(2) = 230; 46 | freq(3) = 245; 47 | freq(4) = 260; 48 | freq(5) = 275; 49 | 50 | freq(d) = freq(d-6)*(2); 51 | 52 | //==================== SIGNAL PROCESSING ================ 53 | 54 | //----------------------- noiseburst ------------------------- 55 | // White noise burst (adapted from Faust's karplus.dsp example) 56 | // Requires music.lib (for no.noise) 57 | noiseburst(d,e) = no.noise : *(trigger(d,e)) 58 | with{ 59 | upfront(x) = (x-x') > 0; 60 | decay(n,x) = x - (x>0)/n; 61 | release(n) = + ~ decay(n); 62 | position(d) = abs(hand - d) < 0.5; 63 | trigger(d,n) = position(d) : upfront : release(n) : > (0.0); 64 | }; 65 | 66 | P(f) = ma.SR/f ; // fundamental period in samples 67 | Pmax = 4096; // maximum P (for delay-line allocation) 68 | 69 | ppdel(f) = beta*P(f); // pick position delay 70 | pickposfilter(f) = fi.ffcombfilter(Pmax,ppdel(f),-1); // defined in filter.lib 71 | 72 | excitation(d,e) = noiseburst(d,e) : *(gain); // defined in signal.lib 73 | 74 | rho(f) = pow(0.001,1.0/(f*t60)); // multiplies loop-gain 75 | 76 | // Original EKS damping filter: 77 | b1 = 0.5*B; b0 = 1.0-b1; // S and 1-S 78 | dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); 79 | 80 | // Linear phase FIR3 damping filter: 81 | h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; 82 | dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); 83 | 84 | loopfilter(f) = dampingfilter2(f); // or dampingfilter1 85 | 86 | filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) 87 | : pickposfilter(f) : fi.levelfilter(L,f); // see filter.lib 88 | 89 | stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f)); 90 | 91 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SBlowhistleBottle.dsp: -------------------------------------------------------------------------------- 1 | declare name "Blowhistle Bottle"; 2 | declare author "ER"; //From "Blow bottle" by Romain Michon; 3 | declare version "1.0"; 4 | declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license); 5 | declare description "This object implements a helmholtz resonator (biquad filter) with a polynomial jet excitation (a la Cook)."; 6 | 7 | /* =============== DESCRIPTION ================= : 8 | 9 | - Blow bottles with whistling echo. 10 | - Left : silence/dying echo. 11 | - Front : single blow bottle. 12 | - Back : maximum whistling echo 13 | - Bottom : bottle + whistling echo 14 | - Rocking : changes tone of blow bottle. 15 | 16 | */ 17 | 18 | import("stdfaust.lib"); 19 | instrument = library("instruments.lib"); 20 | 21 | //==================== INSTRUMENT ======================= 22 | 23 | process = vgroup("Blowhistle Bottles", par(i, N, blow(i)) :>_); 24 | 25 | blow(n)= par(i, 2, 26 | //differential pressure 27 | (-(breathPressure(trigger(n))) <: 28 | ((+(1))*randPressure((trigger(n))) : +(breathPressure(trigger(n)))) - *(instrument.jetTable),_ : baPaF(i,n),_)~_: !,_: 29 | //signal scaling 30 | fi.dcblocker*envelopeG(trigger(n))*(0.5)<:+(voice(i,n))*resonGain(i)):>_ 31 | with{ 32 | baPaF(0,n) = bandPassFilter(freq(n)); 33 | baPaF(1,n) = bandPassFilter(freq(n)*8); 34 | voice(0,n) = 0*n; 35 | voice(1,n) = 1*(fi.resonbp(freq(n)*8,Q,gain):echo); 36 | resonGain(0) = 1; 37 | resonGain(1) =(hslider("v:[1]Instrument/Whistle Volume[acc:2 0 -10 0 10]", 0.07, 0, 0.2, 0.001))^2:si.smooth(0.999); 38 | 39 | echo = _:+~(@(delayEcho):*(feedback)); 40 | delayEcho = 44100; 41 | feedback = hslider("h:[2]Echo/Echo Intensity [style:knob][acc:2 0 -10 0 10]", 0.48, 0.2, 0.98, 0.01):si.smooth(0.999):min(0.98):max(0.2); 42 | }; 43 | 44 | //==================== GUI SPECIFICATION ================ 45 | N = 10; 46 | Q = 30; 47 | position(n) = abs(hand - n) < 0.5; 48 | hand = hslider("v:[1]Instrument/Instrument Hand[acc:0 1 -10 0 10]", 5, 0, N, 1):int:ba.automat(360, 15, 0.0); 49 | envelopeAttack = 0.01; 50 | vibratoFreq = 5; 51 | vibratoGain = 0.1; 52 | 53 | //--------------------- Non-variable Parameters ------------- 54 | 55 | gain = 0.5; 56 | noiseGain = 0.5; 57 | pressure = 1.2; 58 | vibratoBegin = 0.05; 59 | vibratoAttack = 0.5; 60 | vibratoRelease = 0.01; 61 | envelopeDecay = 0.01; 62 | envelopeRelease = 0.5; 63 | 64 | //----------------------- Frequency Table -------------------- 65 | 66 | freq(0) = 130.81; 67 | freq(1) = 146.83; 68 | freq(2) = 164.81; 69 | freq(3) = 195.99; 70 | freq(4) = 220.00; 71 | 72 | freq(d) = freq(d-5)*2; 73 | 74 | //==================== SIGNAL PROCESSING ================ 75 | 76 | //----------------------- Synthesis parameters computing and functions declaration ---------------------------- 77 | 78 | //botlle radius 79 | bottleRadius = 0.999; 80 | 81 | bandPassFilter(f) = instrument.bandPass(f,bottleRadius); 82 | 83 | //----------------------- Algorithm implementation ---------------------------- 84 | 85 | //global envelope is of type attack - decay - sustain - release 86 | envelopeG(t) = gain*en.adsr(gain*envelopeAttack,envelopeDecay,0.8,envelopeRelease,t); 87 | 88 | //pressure envelope is also ADSR 89 | envelope(t) = pressure*en.adsr(gain*0.02,0.01,0.8,gain*0.2,t); 90 | 91 | //vibrato 92 | vibrato(t) = os.osc(vibratoFreq)*vibratoGain*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*os.osc(vibratoFreq); 93 | 94 | //breat pressure 95 | breathPressure(t) = envelope(t) + vibrato(t); 96 | 97 | //breath no.noise 98 | randPressure(t) = noiseGain*no.noise*breathPressure(t) ; 99 | 100 | //------------------------- Enveloppe Trigger -------------------------------------------- 101 | 102 | trigger(n) = position(n): trig 103 | with { 104 | upfront(x) = (x-x') > 0; 105 | decay(n,x) = x - (x>0.0)/n; 106 | release(n) = + ~ decay(n); 107 | trig = upfront : release(8820) : >(0.0); 108 | }; 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SBouncyHarp.dsp: -------------------------------------------------------------------------------- 1 | declare name "Bouncy Harp"; 2 | declare author "ER"; //From Nonlinear EKS by Julius Smith and Romain Michon; 3 | 4 | /* =============== DESCRIPTION ================= : 5 | 6 | Do not hesitate to make swift and abrupt gestures. 7 | - Head : Silence 8 | - Swing : To pluck the strings of the harp. 9 | - Fishing rod with abrupt stop in Head position : bouncing string effect. 10 | - Frying Pan and Tennis Racket : to pluck a single bouncing string. 11 | 12 | */ 13 | 14 | import("stdfaust.lib"); 15 | 16 | //==================== INSTRUMENT ======================= 17 | 18 | process = par(i, N, NLFeks(i)):>_; 19 | 20 | NLFeks(n) = filtered_excitation(n,P(octave(n)),octave(n)) : stringloop(octave(n)); 21 | 22 | //==================== GUI SPECIFICATION ================ 23 | 24 | N = 15; 25 | hand = hslider("[1]Instrument Hand [acc:1 0 -8 0 11]", 0, 0, N, 1);// => gate 26 | gain = 1; 27 | reverse = select2(_, 1, 0); 28 | pickangle = 0.9 * hslider("[3]Dry/Soft Strings[acc:2 1 -10 0 10]", 0.45,0,0.9,0.1); 29 | 30 | beta = hslider("[4]Picking Position [acc:2 1 -10 0 10]", 0.13, 0.02, 0.5, 0.01); 31 | t60 = hslider("[5]Resonance (InstrReverb)[acc:1 1 -10 0 10]", 5, 0.5, 10, 0.01); // -60db decay time (sec) 32 | 33 | B = 0.5; 34 | L = -10 : ba.db2linear; 35 | 36 | //---------------------------------- FREQUENCY TABLE --------------------------- 37 | 38 | freq(0) = 115; 39 | freq(1) = 130; 40 | freq(2) = 145; 41 | freq(3) = 160; 42 | freq(4) = 175; 43 | 44 | freq(d) = freq(d-5)*(2); 45 | octave(d) = freq(d) * hslider("Hight[acc:2 1 -10 0 10]", 3, 1, 6, 0.1) : si.smooth(0.999); 46 | 47 | //==================== SIGNAL PROCESSING ================ 48 | 49 | //----------------------- noiseburst ------------------------- 50 | // White no.noise burst (adapted from Faust's karplus.dsp example) 51 | // Requires music.lib (for no.noise) 52 | noiseburst(d,e) = no.noise : *(trigger(d,e)) 53 | with { 54 | upfront(x) = (x-x') > 0; 55 | decay(n,x) = x - (x>0)/n; 56 | release(n) = + ~ decay(n); 57 | position(d) = abs(hand - d) < 0.5; 58 | trigger(d,n) = position(d) : upfront : release(n) : > (0.0); 59 | }; 60 | 61 | 62 | P(f) = ma.SR/f ; // fundamental period in samples 63 | Pmax = 4096; // maximum P (for delay-line allocation) 64 | 65 | ppdel(f) = beta*P(f); // pick position delay 66 | pickposfilter(f) = fi.ffcombfilter(Pmax,ppdel(f),-1); // defined in filter.lib 67 | 68 | excitation(d,e) = noiseburst(d,e) : *(gain); // defined in signal.lib 69 | 70 | rho(f) = pow(0.001,1.0/(f*t60)); // multiplies loop-gain 71 | 72 | // Original EKS damping filter: 73 | b1 = 0.5*B; b0 = 1.0-b1; // S and 1-S 74 | dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); 75 | 76 | // Linear phase FIR3 damping filter: 77 | h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; 78 | dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); 79 | 80 | loopfilter(f) = dampingfilter2(f); // or dampingfilter1 81 | 82 | filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) 83 | : pickposfilter(f) : fi.levelfilter(L,f); // see filter.lib 84 | 85 | stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f));// : NLFM(f)); 86 | 87 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SBrass.dsp: -------------------------------------------------------------------------------- 1 | declare name "Brass"; 2 | declare description "WaveGuide Brass instrument from STK"; 3 | declare author "Romain Michon (rmichon@ccrma.stanford.edu)"; 4 | declare copyright "Romain Michon"; 5 | declare version "1.0"; 6 | declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license); 7 | //declare description "A simple brass instrument waveguide model, a la Cook (TBone, HosePlayer)."; 8 | declare reference "https://ccrma.stanford.edu/~jos/pasp/Brasses.html"; 9 | 10 | //Modification GRAME July 2015 11 | 12 | /* =============== DESCRIPTION ================= : 13 | 14 | - Brass instrument 15 | - Turn ON brass (0=OFF, 1=ON) 16 | - Head = Silence 17 | - Upward = Higher frequency 18 | - Downward = Lower frequency 19 | 20 | */ 21 | 22 | import("stdfaust.lib"); 23 | instrument=library("instruments.lib"); 24 | 25 | //==================== INSTRUMENT ======================= 26 | 27 | process = (borePressure <: deltaPressure,_ : 28 | (lipFilter <: *(mouthPressure),(1-_)),_ : _, * :> + : 29 | fi.dcblocker) ~ (boreDelay) : 30 | *(gain)*(2); 31 | 32 | //==================== GUI SPECIFICATION ================ 33 | 34 | freq = hslider("h:[1]Instrument/Frequency[1][unit:Hz] [tooltip:Tone frequency][acc:1 1 -10 0 10]", 300,170,700,1):si.smooth(0.999); 35 | gain = 0.8; 36 | gate = hslider("h:[1]Instrument/ ON/OFF",0,0,1,1); 37 | 38 | lipTension = 0.780; 39 | pressure = 1; 40 | slideLength = 0.041; 41 | 42 | vibratoFreq = hslider("v:[3]Parameters/h:/Vibrato Frequency (Vibrato Envelope)[unit:Hz][style:knob][unit:Hz][acc:0 1 -10 0 10]", 5,1,10,0.01); 43 | vibratoGain = 0.05; 44 | vibratoBegin = 0.05; 45 | vibratoAttack = 0.5; 46 | vibratoRelease = 0.1; 47 | 48 | envelopeDecay = 0.001; 49 | envelopeAttack = 0.005; 50 | envelopeRelease = 0.07; 51 | //==================== SIGNAL PROCESSING ================ 52 | 53 | 54 | //----------------------- Synthesis parameters computing and functions declaration ---------------------------- 55 | 56 | //lips are simulated by a biquad filter whose output is squared and hard-clipped, bandPassH and saturationPos are declared in instrument.lib 57 | lipFilterFrequency = freq*pow(4,(2*lipTension)-1); 58 | lipFilter = *(0.03) : instrument.bandPassH(lipFilterFrequency,0.997) <: * : instrument.saturationPos; 59 | 60 | //delay times in number of samples 61 | slideTarget = ((ma.SR/freq)*2 + 3)*(0.5 + slideLength); 62 | boreDelay = de.fdelay(4096,slideTarget); 63 | 64 | //----------------------- Algorithm implementation ---------------------------- 65 | 66 | //vibrato 67 | vibrato = vibratoGain*os.osc(vibratoFreq)*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate); 68 | 69 | //envelope (Attack / Decay / Sustain / Release), breath pressure and vibrato 70 | breathPressure = pressure*en.adsr(envelopeAttack,envelopeDecay,1,envelopeRelease,gate) + vibrato; 71 | mouthPressure = 0.3*breathPressure; 72 | 73 | //scale the delay feedback 74 | borePressure = *(0.85); 75 | 76 | //differencial presure 77 | deltaPressure = mouthPressure - _; 78 | 79 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SBrassMulti.dsp: -------------------------------------------------------------------------------- 1 | declare name "Multiple Brass"; 2 | declare description "WaveGuide Brass instrument from STK"; 3 | declare author "ER"; //Adapted from Brass by Romain Michon (rmichon@ccrma.stanford.edu); 4 | 5 | import("stdfaust.lib"); 6 | instrument=library("instruments.lib"); 7 | 8 | /* ========= DESCRITPION =========== 9 | 10 | - Triple Brass 11 | - Left = Silence 12 | - Other positions = interpolating brass voices 13 | */ 14 | 15 | //==================== INSTRUMENT ======================= 16 | 17 | process = vgroup("Brass Instrument", par(i, 3, brass(i)) :>_); 18 | 19 | brass(n) = (borePressure <: deltaPressure(pressure(n)),_ : 20 | (lipFilter(freq(n)) <: *(mouthPressure(pressure(n))),(1-_)),_ : _, * :> + : 21 | fi.dcblocker) ~ (boreDelay(freq(n))) 22 | *(gain(n)): fi.lowpass((n+1),((n+1)*1500)); 23 | 24 | //==================== GUI SPECIFICATION ================ 25 | 26 | //gate = checkbox(" Play"); 27 | gate = hslider(" ON/OFF", 0, 0, 1, 1); 28 | 29 | freq(0) = hslider("h:Instrument/v:Frequencies/Frequency 1 [unit:Hz][acc:1 1 -10 0 10]",370,280,380, 0.01):si.smooth(0.999); 30 | freq(1) = hslider("h:Instrument/v:Frequencies/Frequency 2 [unit:Hz][acc:0 1 -10 0 10]",440,380,550,0.01):si.smooth(0.999); 31 | freq(2) = hslider("h:Instrument/v:Frequencies/Frequency 3 [unit:Hz][acc:2 0 -10 0 12]",587.32,550,700,0.01):si.smooth(0.999); 32 | 33 | gain(0) = hslider("h:Instrument/v:Gain/Volume 1 [style:knob][acc:1 0 -10 0 12][tooltip:Gain (value between 0 and 1)]",0.5,0,1,0.01); 34 | gain(1) = hslider("h:Instrument/v:Gain/Volume 2 [style:knob][acc:0 0 -10 0 12][tooltip:Gain (value between 0 and 1)]",0.5,0,1,0.01); 35 | gain(2) = hslider("h:Instrument/v:Gain/Volume 3 [style:knob][acc:2 1 -10 0 10][tooltip:Gain (value between 0 and 1)]",0.5,0,0.5,0.01); 36 | 37 | 38 | pressure(0) = 0.37; 39 | pressure(1) = 0.68; 40 | pressure(2) = 1.0; 41 | 42 | lipTension = 0.780; 43 | 44 | slideLength = 0.041; 45 | 46 | vibratoFreq = 6; 47 | vibratoGain = 0.05; 48 | vibratoBegin = 0.05; 49 | vibratoAttack = 0.5; 50 | vibratoRelease = 0.1; 51 | 52 | envelopeAttack = 0.01; 53 | envelopeDecay = 0.001; 54 | envelopeRelease = 2; 55 | //==================== SIGNAL PROCESSING ================ 56 | 57 | //---------- Synthesis parameters computing and functions declaration ---------- 58 | 59 | //lips are simulated by a biquad filter whose output is squared and hard-clipped, bandPassH and saturationPos are declared in instrument.lib 60 | lipFilterFrequency(f) = f*pow(4,(2*lipTension)-1); 61 | lipFilter(f) = *(0.03) : instrument.bandPassH(lipFilterFrequency(f),0.997) <: * : instrument.saturationPos; 62 | 63 | //delay times in number of samples 64 | slideTarget(f) = ((ma.SR/f)*2 + 3)*(0.5 + slideLength); 65 | boreDelay(f) = de.fdelay(4096,slideTarget(f)); 66 | 67 | //----------------------- Algorithm implementation ---------------------------- 68 | 69 | //vibrato 70 | vibrato = vibratoGain*os.osc(vibratoFreq)*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate); 71 | 72 | //envelope (Attack / Decay / Sustain / Release), breath pressure and vibrato 73 | breathPressure(p) = p*en.adsr(envelopeAttack,envelopeDecay,1,envelopeRelease,gate) + vibrato; 74 | mouthPressure(p) = 0.3*breathPressure(p); 75 | 76 | //scale the delay feedback 77 | borePressure = *(0.85); 78 | 79 | //differencial presure 80 | deltaPressure(p) = mouthPressure(p) - _; 81 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SCMajBlowBottle.dsp: -------------------------------------------------------------------------------- 1 | declare name "C Maj BlowBottle"; 2 | declare author "ER";//Adapted from Blow Bottle by Romain Michon (rmichon@ccrma.stanford.edu); 3 | 4 | /* =========== DESCRITPION ============= 5 | 6 | - C Major Blow Bottles 7 | - Left = Low frequencies/ Silence/ Slow rhythm 8 | - Right = High frequencies/ Fast rhythm 9 | - Front = Long notes 10 | - Back = Short notes 11 | 12 | */ 13 | 14 | import("stdfaust.lib"); 15 | instrument = library("instruments.lib"); 16 | 17 | //==================== INSTRUMENT ======================= 18 | 19 | process = vgroup("Blowhistle Bottles", par(i, N, blow(i)) :>*(2)); 20 | blow(n)= 21 | //differential pressure 22 | (-(breathPressure(trigger(n))) <: 23 | ((+(1))*randPressure((trigger(n))) : +(breathPressure(trigger(n)))) - *(instrument.jetTable),_ : baPaF(n),_)~_: !,_: 24 | //signal scaling 25 | fi.dcblocker*envelopeG(trigger(n))*(0.5) 26 | with{ 27 | baPaF(n) = bandPassFilter(freq(n)); 28 | }; 29 | 30 | //==================== GUI SPECIFICATION ================ 31 | N = 16; 32 | 33 | position(n) = abs(hand - n) < 0.5; 34 | hand = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 12, 0, N, 1) : si.smooth(0.999) : min(24) : max(0) :int: ba.automat(bps, 15, 0.0) 35 | with{ 36 | bps = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; 37 | }; 38 | envelopeAttack = 0.01; 39 | vibratoFreq = 5; 40 | vibratoGain = 0.1; 41 | 42 | //--------------------- Non-variable Parameters ------------- 43 | 44 | gain = 0.5; 45 | noiseGain = 0.5; 46 | pressure = 1.2; 47 | vibratoBegin = 0.05; 48 | vibratoAttack = 0.5; 49 | vibratoRelease = 0.01; 50 | envelopeDecay = 0.01; 51 | envelopeRelease = 0.05; 52 | 53 | //----------------------- Frequency Table -------------------- 54 | 55 | freq(0) = 130.81; 56 | freq(1) = 146.83; 57 | freq(2) = 164.81; 58 | freq(3) = 174.61; 59 | freq(4) = 195.99; 60 | freq(5) = 220.00; 61 | freq(6) = 246.94; 62 | freq(d) = freq(d-7)*2; 63 | 64 | //==================== SIGNAL PROCESSING ================ 65 | 66 | //----------------------- Synthesis parameters computing and functions declaration ---------------------------- 67 | 68 | //botlle radius 69 | bottleRadius = 0.999; 70 | 71 | bandPassFilter(f) = instrument.bandPass(f,bottleRadius); 72 | 73 | //----------------------- Algorithm implementation ---------------------------- 74 | 75 | //global envelope is of type attack - decay - sustain - release 76 | envelopeG(t) = gain*en.adsr(gain*envelopeAttack,envelopeDecay,0.8,envelopeRelease,t); 77 | 78 | //pressure envelope is also ADSR 79 | envelope(t) = pressure*en.adsr(gain*0.02,0.01,0.8,gain*0.2,t); 80 | 81 | //vibrato 82 | vibrato(t) = os.osc(vibratoFreq)*vibratoGain*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*os.osc(vibratoFreq); 83 | 84 | //breat pressure 85 | breathPressure(t) = envelope(t) + vibrato(t); 86 | 87 | //breath no.noise 88 | randPressure(t) = noiseGain*no.noise*breathPressure(t) ; 89 | 90 | //------------------------- Enveloppe Trigger -------------------------------------------- 91 | 92 | trigger(n) = position(n): trig 93 | with { 94 | upfront(x) = (x-x') > 0; 95 | decay(n,x) = x - (x>0.0)/n; 96 | release(n) = + ~ decay(n); 97 | noteDuration = hslider("[3]Note Duration[unit:s][style:knob][acc:2 1 -10 0 10]", 0.166, 0.1, 0.2, 0.01)*44100 : min(8820) : max(4410):int; 98 | trig = upfront : release(noteDuration) : >(0.0); 99 | }; 100 | 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SCMajFlute.dsp: -------------------------------------------------------------------------------- 1 | declare name "C Major Flute"; 2 | declare author "ER";// Adapted from "Nonlinear WaveGuide Flute" by Romain Michon (rmichon@ccrma.stanford.edu)"; 3 | 4 | import("stdfaust.lib"); 5 | instrument=library("instruments.lib"); 6 | 7 | /* =============== DESCRIPTION ================= : 8 | 9 | - C Major flute 10 | - Rocking = playing all notes from low to high frequencies 11 | - Left = Silence/Slow rhythm 12 | - Right = Fast rhythm 13 | - Front = long notes 14 | - Back = short notes 15 | 16 | */ 17 | //==================== INSTRUMENT ======================= 18 | 19 | flute(n) = (_ <: (flow(trigger(n)) + *(feedBack1) : embouchureDelay(freq(n)): poly) + *(feedBack2) : reflexionFilter)~(boreDelay(freq(n))) : *(env2(trigger(n)))*gain:_; 20 | 21 | process = vgroup("C Maj Flute", par(i, N, flute(i)):>_); 22 | 23 | //==================== GUI SPECIFICATION ================ 24 | vibratoFreq = 2.5; 25 | env1Attack = 0.06; 26 | env1Release = 1; 27 | 28 | //-------------------- Non-Variable Parameters ----------- 29 | N = 17; 30 | 31 | gain = 1; 32 | pressure = 0.9; 33 | breathAmp = 0.01; 34 | vibratoGain = 0.1; 35 | vibratoBegin = 0.1; 36 | vibratoAttack = 0.1; 37 | vibratoRelease = 0.2; 38 | pressureEnvelope = 0; 39 | env1Decay = 0.2; 40 | env2Attack = 0.1; 41 | env2Release = 0.1; 42 | 43 | //----------------------- Frequency Table -------------------- 44 | 45 | freq(0) = 261.62; 46 | freq(1) = 293.66; 47 | freq(2) = 329.62; 48 | freq(3) = 349.22; 49 | freq(4) = 391.99; 50 | freq(5) = 440.00; 51 | freq(6) = 493.88; 52 | 53 | freq(d) = freq(d-7)*2; 54 | 55 | //==================== SIGNAL PROCESSING ================ 56 | 57 | //----------------------- Synthesis parameters computing and functions declaration ---------------------------- 58 | 59 | //Loops feedbacks gains 60 | feedBack1 = 0.4; 61 | feedBack2 = 0.4; 62 | 63 | //Delay Lines 64 | embouchureDelayLength(f) = (ma.SR/f)/2-2; 65 | boreDelayLength(f) = ma.SR/f-2; 66 | embouchureDelay(f) = de.fdelay(4096,embouchureDelayLength(f)); 67 | boreDelay(f) = de.fdelay(4096,boreDelayLength(f)); 68 | 69 | //Polinomial 70 | poly = _ <: _ - _*_*_; 71 | 72 | //jet filter is a lowwpass filter (declared in filter.lib) 73 | reflexionFilter = fi.lowpass(1,2000); 74 | 75 | //----------------------- Algorithm implementation ---------------------------- 76 | 77 | //Pressure envelope 78 | env1(t) = en.adsr(env1Attack,env1Decay,0.9,env1Release,(t | pressureEnvelope))*pressure*1.1; 79 | 80 | //Global envelope 81 | env2(t) = en.asr(env2Attack,1,env2Release,t)*0.5; 82 | 83 | //Vibrato Envelope 84 | vibratoEnvelope(t) = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*vibratoGain; 85 | 86 | vibrato(t) = os.osc(vibratoFreq)*vibratoEnvelope(t); 87 | 88 | breath(t) = no.noise*env1(t); 89 | 90 | flow(t) = env1(t) + breath(t)*breathAmp + vibrato(t); 91 | 92 | //------------------------- Enveloppe Trigger -------------------------------------------- 93 | 94 | trigger(n) = position(n): trig 95 | with{ 96 | upfront(x) = (x-x') > 0; 97 | decay(n,x) = x - (x>0.0)/n; 98 | release(n) = + ~ decay(n); 99 | noteDuration = hslider("h:[1]/[3]Note Duration[unit:s][style:knob][acc:2 1 -10 0 10]", 0.166, 0.1, 0.25, 0.01)*44100 : min(11025) : max(4410):int; 100 | trig = upfront : release(noteDuration) : >(0.0); 101 | }; 102 | 103 | position(n) = abs(hand - n) < 0.5; 104 | hand = hslider("h:[1]/[1]Instrument Hand[acc:0 1 -12 0 10]", 9, 0, N, 1): ba.automat(bps, 15, 0.0)// => gate 105 | with{ 106 | bps = hslider("h:[1]/[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; 107 | }; 108 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SCMajSoftHarp.dsp: -------------------------------------------------------------------------------- 1 | declare name "C Major Soft Harp"; 2 | declare author "ER";//Adapted from Nonlinear EKS by Julius Smith and Romain Michon; 3 | declare reference "http://ccrma.stanford.edu/~jos/pasp/vegf.html"; 4 | 5 | import("stdfaust.lib"); 6 | 7 | /* =============== DESCRIPTION ================= : 8 | 9 | - C Major soft harp 10 | - Left = Lower frequencies/Silence when still 11 | - Front = Resonance 12 | - Back = No resonance 13 | - Right = Higher frequencies/Fast rhythm 14 | - Rocking = plucking all strings one by one 15 | 16 | */ 17 | //==================== INSTRUMENT ======================= 18 | 19 | process = vgroup("Soft Harp - C Major",par(i, N, NFLeks(i)):>_); 20 | 21 | NFLeks(n) = filtered_excitation(n,P(freq(n)),freq(n)) : stringloop(freq(n)); 22 | 23 | //==================== GUI SPECIFICATION ================ 24 | 25 | N = 24; 26 | hand = hslider("h:[1]/Instrument Hand[acc:0 1 -10 0 10]", 12, 0, N, 1) : ba.automat(bps, 15, 0.0)// => gate 27 | with{ 28 | bps = hslider("h:[1]/Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; 29 | }; 30 | 31 | gain = 1; 32 | pickangle = 0.81; 33 | beta = 0.5; 34 | 35 | t60 = hslider("[2]Resonance (InstrReverb)[unit:s][acc:0 0 -10 0 10]", 5, 0.5, 10, 0.01):min(10):max(0.5); // -60db decay time (sec) 36 | 37 | B = 0; 38 | L = -10 : ba.db2linear; 39 | //---------------------------------- FREQUENCY TABLE --------------------------- 40 | 41 | freq(0) = 130.81; 42 | freq(1) = 146.83; 43 | freq(2) = 164.81; 44 | freq(3) = 174.61; 45 | freq(4) = 195.99; 46 | freq(5) = 220.00; 47 | freq(6) = 246.94; 48 | 49 | freq(d) = freq(d-7)*(2); 50 | 51 | //==================== SIGNAL PROCESSING ================ 52 | 53 | //----------------------- noiseburst ------------------------- 54 | // White no.noise burst (adapted from Faust's karplus.dsp example) 55 | // Requires music.lib (for no.noise) 56 | noiseburst(d,e) = no.noise : *(trigger(d,e)) 57 | with{ 58 | upfront(x) = (x-x') > 0; 59 | decay(n,x) = x - (x>0)/n; 60 | release(n) = + ~ decay(n); 61 | position(d) = abs(hand - d) < 0.5; 62 | trigger(d,n) = position(d) : upfront : release(n) : > (0.0); 63 | }; 64 | 65 | P(f) = ma.SR/f ; // fundamental period in samples 66 | Pmax = 4096; // maximum P (for delay-line allocation) 67 | 68 | ppdel(f) = beta*P(f); // pick position delay 69 | pickposfilter(f) = fi.ffcombfilter(Pmax,ppdel(f),-1); // defined in filter.lib 70 | 71 | excitation(d,e) = noiseburst(d,e) : *(gain); // defined in signal.lib 72 | 73 | rho(f) = pow(0.001,1.0/(f*t60)); // multiplies loop-gain 74 | 75 | // Original EKS damping filter: 76 | b1 = 0.5*B; b0 = 1.0-b1; // S and 1-S 77 | dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); 78 | 79 | // Linear phase FIR3 damping filter: 80 | h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; 81 | dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); 82 | 83 | loopfilter(f) = dampingfilter2(f); // or dampingfilter1 84 | 85 | filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) 86 | : pickposfilter(f) : fi.levelfilter(L,f); // see filter.lib 87 | 88 | stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f));// : NLFM(f)); 89 | 90 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SCMajTunedBars.dsp: -------------------------------------------------------------------------------- 1 | declare name "C Major Tuned Bars"; 2 | declare author "ER";//From "Tuned Bar" by Romain Michon (rmichon@ccrma.stanford.edu); 3 | 4 | import("stdfaust.lib"); 5 | instrument = library("instruments.lib"); 6 | 7 | /* =============== DESCRIPTION ================= : 8 | 9 | - C Major tuned bars 10 | - Left = Low frequencies + slow rhythm/Silence 11 | - Right = High frequencies + fast rhythm 12 | 13 | */ 14 | //==================== INSTRUMENT ======================= 15 | 16 | process = par(i, N, tunedBar(i)):>_; 17 | 18 | tunedBar(n) = 19 | ((select-1)*-1) <: 20 | //nModes resonances with nModes feedbacks for bow table look-up 21 | par(i,nModes,(resonance(i,freq(n),gate(n))~_)) :> + : 22 | //Signal Scaling and stereo 23 | *(4); 24 | 25 | 26 | //==================== GUI SPECIFICATION ================ 27 | N = 24; 28 | 29 | gain = 0.8; 30 | gate(n) = position(n) : upfront; 31 | hand = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 12, 0, N, 1):si.smooth(0.999):min(N):max(0):int:ba.automat(B, 15, 0.0); 32 | B = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 60): si.smooth(0.99) : min(720) : max(180) : int; 33 | position(n) = abs(hand - n) < 0.5; 34 | upfront(x) = x>x'; 35 | 36 | select = 1; 37 | 38 | nMode(2) = 4; 39 | 40 | //-------------------- Frequency Table ------------------ 41 | 42 | freq(0) = 130.81; 43 | freq(1) = 146.83; 44 | freq(2) = 164.81; 45 | freq(3) = 174.61; 46 | freq(4) = 195.99; 47 | freq(5) = 220.00; 48 | freq(6) = 246.94; 49 | 50 | freq(d) = freq(d-7)*2; 51 | 52 | //==================== MODAL PARAMETERS ================ 53 | 54 | preset = 2; 55 | 56 | modes(2,0) = 1; 57 | basegains(2,0) = pow(0.999,1); 58 | excitation(2,0,g) = 1*gain*g/nMode(2); 59 | 60 | modes(2,1) = 4.0198391420; 61 | basegains(2,1) = pow(0.999,2); 62 | excitation(2,1,g) = 1*gain*g/nMode(2); 63 | 64 | modes(2,2) = 10.7184986595; 65 | basegains(2,2) = pow(0.999,3); 66 | excitation(2,2,g) = 1*gain*g/nMode(2); 67 | 68 | modes(2,3) = 18.0697050938; 69 | basegains(2,3) = pow(0.999,4); 70 | excitation(2,3,g) = 1*gain*g/nMode(2); 71 | 72 | //==================== SIGNAL PROCESSING ================ 73 | 74 | //----------------------- Synthesis parameters computing and functions declaration ---------------------------- 75 | 76 | //the number of modes depends on the preset being used 77 | nModes = nMode(preset); 78 | 79 | delayLengthBase(f) = ma.SR/f; 80 | 81 | //delay lengths in number of samples 82 | delayLength(x,f) = delayLengthBase(f)/modes(preset,x); 83 | 84 | //delay lines 85 | delayLine(x,f) = de.delay(4096,delayLength(x,f)); 86 | 87 | //Filter bank: fi.bandpass filters (declared in instrument.lib) 88 | radius = 1 - ma.PI*32/ma.SR; 89 | bandPassFilter(x,f) = instrument.bandPass(f*modes(preset,x),radius); 90 | 91 | //----------------------- Algorithm implementation ---------------------------- 92 | 93 | //One resonance 94 | resonance(x,f,g) = + : + (excitation(preset,x,g)*select) : delayLine(x,f) : *(basegains(preset,x)) : bandPassFilter(x,f); 95 | 96 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SChromaticSoftHarp.dsp: -------------------------------------------------------------------------------- 1 | declare name "Chromatic Soft Harp"; 2 | declare author "ER";//Adapted from Nonlinear EKS by Julius Smith and Romain Michon; 3 | declare reference "http://ccrma.stanford.edu/~jos/pasp/vegf.html"; 4 | 5 | import("stdfaust.lib"); 6 | 7 | /* =============== DESCRIPTION ================= 8 | 9 | - Soft chromatic harp 10 | - Left = Lower frequencies/Silence when still 11 | - Front = Resonance 12 | - Back = No resonance 13 | - Right = Higher frequencies/Fast rhythm 14 | - Rocking = plucking all strings one by one 15 | 16 | */ 17 | //==================== INSTRUMENT ======================= 18 | 19 | process = par(i, N, NFLeks(i)):>_; 20 | 21 | NFLeks(n) = filtered_excitation(n,P(freq(n)),freq(n)) : stringloop(freq(n)); 22 | 23 | //==================== GUI SPECIFICATION ================ 24 | 25 | N = 24; 26 | hand = hslider("h:[1]/Instrument Hand[acc:0 1 -10 0 10]", 12, 0, N, 1) : ba.automat(bps, 15, 0.0)// => gate 27 | with{ 28 | bps = hslider("h:[1]/Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; 29 | }; 30 | gain = 1; 31 | vol = 2; 32 | pickangle = 0.9; 33 | beta = 0.5; 34 | 35 | // String decay time in seconds: 36 | t60 = hslider("[2]Resonance [unit:s][acc:2 1 -10 0 10]", 5, 0.5, 10, 0.01):min(10):max(0.5); // -60db decay time (sec) 37 | B = 0; 38 | L = -10 : ba.db2linear; 39 | 40 | //---------------------------------- FREQUENCY TABLE --------------------------- 41 | 42 | freq(0) = 130.81; 43 | freq(1) = 138.59; 44 | freq(2) = 146.83; 45 | freq(3) = 155.56; 46 | freq(4) = 164.81; 47 | freq(5) = 174.61; 48 | freq(6) = 184.99; 49 | freq(7) = 195.99; 50 | freq(8) = 207.65; 51 | freq(9) = 220.00; 52 | freq(10) = 233.08; 53 | freq(11) = 246.94; 54 | 55 | freq(d) = freq(d-12)*(2); 56 | 57 | //==================== SIGNAL PROCESSING ================ 58 | 59 | //----------------------- noiseburst ------------------------- 60 | // White no.noise burst (adapted from Faust's karplus.dsp example) 61 | // Requires music.lib (for no.noise) 62 | noiseburst(d,e) = no.noise : *(trigger(d,e)) 63 | with { 64 | upfront(x) = (x-x') > 0; 65 | decay(n,x) = x - (x>0)/n; 66 | release(n) = + ~ decay(n); 67 | position(d) = abs(hand - d) < 0.5; 68 | trigger(d,n) = position(d) : upfront : release(n) : > (0.0); 69 | }; 70 | 71 | //nlfOrder = 6; 72 | P(f) = ma.SR/f ; // fundamental period in samples 73 | Pmax = 4096; // maximum P (for delay-line allocation) 74 | 75 | ppdel(f) = beta*P(f); // pick position delay 76 | pickposfilter(f) = fi.ffcombfilter(Pmax,ppdel(f),-1); // defined in filter.lib 77 | 78 | excitation(d,e) = noiseburst(d,e) : *(gain); // defined in signal.lib 79 | 80 | rho(f) = pow(0.001,1.0/(f*t60)); // multiplies loop-gain 81 | 82 | // Original EKS damping filter: 83 | b1 = 0.5*B; b0 = 1.0-b1; // S and 1-S 84 | dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); 85 | 86 | // Linear phase FIR3 damping filter: 87 | h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; 88 | dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); 89 | 90 | loopfilter(f) = dampingfilter2(f); // or dampingfilter1 91 | 92 | filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) 93 | : pickposfilter(f) : fi.levelfilter(L,f); // see filter.lib 94 | 95 | stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f)); 96 | 97 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SChromaticTunedBars.dsp: -------------------------------------------------------------------------------- 1 | declare name "Chromatic Tuned Bars"; 2 | declare author "ER";//From "Tuned Bar" by Romain Michon (rmichon@ccrma.stanford.edu); 3 | 4 | import("stdfaust.lib"); 5 | instrument = library("instruments.lib"); 6 | 7 | /* =============== DESCRIPTION ================= : 8 | 9 | - Chromatic tuned bars 10 | - Left = Low frequencies + slow rhythm/Silence 11 | - Right = High frequencies + fast rhythm 12 | 13 | */ 14 | 15 | //==================== INSTRUMENT ======================= 16 | 17 | process = par(i, N, tunedBar(i)):> fi.lowpass(1,5000); 18 | 19 | tunedBar(n) = 20 | ((select-1)*-1) <: 21 | //nModes resonances with nModes feedbacks for bow table look-up 22 | par(i,nModes,(resonance(i,freq(n),gate(n))~_)):> + : 23 | //Signal Scaling and stereo 24 | *(4); 25 | 26 | 27 | //==================== GUI SPECIFICATION ================ 28 | N = 24; 29 | 30 | gain = 0.8; 31 | 32 | gate(n) = position(n) : upfront; 33 | hand = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 12, 0, N, 1):si.smooth(0.999):min(N):max(0):int:ba.automat(B, 15, 0.0); 34 | B = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 60): si.smooth(0.99) : min(720) : max(180) : int; 35 | position(n) = abs(hand - n) < 0.5; 36 | upfront(x) = x>x'; 37 | 38 | select = 1; 39 | 40 | //-------------------- Frequency Table ------------------ 41 | 42 | freq(0) = 130.81; 43 | freq(1) = 138.59; 44 | freq(2) = 146.83; 45 | freq(3) = 155.56; 46 | freq(4) = 164.81; 47 | freq(5) = 174.61; 48 | freq(6) = 184.99; 49 | freq(7) = 195.99; 50 | freq(8) = 207.65; 51 | freq(9) = 220.00; 52 | freq(10) = 233.08; 53 | freq(11) = 246.94; 54 | //freq(12) = 261.62; 55 | 56 | freq(d) = freq(d-12)*2; 57 | 58 | //==================== MODAL PARAMETERS ================ 59 | 60 | preset = 2; 61 | 62 | nMode(2) = 4; 63 | 64 | modes(2,0) = 1; 65 | basegains(2,0) = pow(0.999,1); 66 | excitation(2,0,g) = 1*gain*g/nMode(2); 67 | 68 | modes(2,1) = 4.0198391420; 69 | basegains(2,1) = pow(0.999,2); 70 | excitation(2,1,g) = 1*gain*g/nMode(2); 71 | 72 | modes(2,2) = 10.7184986595; 73 | basegains(2,2) = pow(0.999,3); 74 | excitation(2,2,g) = 1*gain*g/nMode(2); 75 | 76 | modes(2,3) = 18.0697050938; 77 | basegains(2,3) = pow(0.999,4); 78 | excitation(2,3,g) = 1*gain*g/nMode(2); 79 | 80 | //==================== SIGNAL PROCESSING ================ 81 | 82 | //----------------------- Synthesis parameters computing and functions declaration ---------------------------- 83 | 84 | //the number of modes depends on the preset being used 85 | nModes = nMode(preset); 86 | 87 | delayLengthBase(f) = ma.SR/f; 88 | 89 | //delay lengths in number of samples 90 | delayLength(x,f) = delayLengthBase(f)/modes(preset,x); 91 | 92 | //delay lines 93 | delayLine(x,f) = de.delay(4096,delayLength(x,f)); 94 | 95 | //Filter bank: fi.bandpass filters (declared in instrument.lib) 96 | radius = 1 - ma.PI*32/ma.SR; 97 | bandPassFilter(x,f) = instrument.bandPass(f*modes(preset,x),radius); 98 | 99 | //----------------------- Algorithm implementation ---------------------------- 100 | 101 | //One resonance 102 | resonance(x,f,g) = + : + (excitation(preset,x,g)*select) : delayLine(x,f) : *(basegains(preset,x)) : bandPassFilter(x,f); 103 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SClarinet.dsp: -------------------------------------------------------------------------------- 1 | declare name "Clarinet"; 2 | declare description "Nonlinear WaveGuide Clarinet"; 3 | declare author "Romain Michon"; 4 | declare copyright "Romain Michon (rmichon@ccrma.stanford.edu)"; 5 | declare version "1.0"; 6 | declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license); 7 | declare description "A simple clarinet physical model, as discussed by Smith (1986), McIntyre, Schumacher, Woodhouse (1983), and others."; 8 | declare reference "https://ccrma.stanford.edu/~jos/pasp/Woodwinds.html"; 9 | 10 | //Modification Grame July 2015 11 | 12 | import("stdfaust.lib"); 13 | instrument = library("instruments.lib"); 14 | 15 | /* =============== DESCRIPTION ================= : 16 | 17 | - Clarinet responding to vigorous gestures 18 | - Turn ON clarinet (0=OFF, 1=ON) 19 | - Head = High frequencies/Silence when hold still 20 | - Tilt = very soft sound 21 | - Bottom = Low frequencies 22 | - Right = Breathy clarinet 23 | - Fishing rod (vigorous mouvements) : 24 | ==> Downward = to reach lower frequencies 25 | ==> Upward = To 'through' the sound in the air = vanishes, comes back when Tilt 26 | - Rocking = from full sound to breathy sound 27 | - Shaking in right position = no.noise impulses 28 | 29 | */ 30 | 31 | //==================== INSTRUMENT ======================= 32 | 33 | process = vgroup("CLARINET", 34 | //Commuted Loss Filtering 35 | (_,(breathPressure <: _,_) : (filter*-0.95 - _ <: 36 | 37 | //Non-Linear Scattering 38 | *(reedTable)) + _) ~ 39 | 40 | //Delay with Feedback 41 | (delayLine):// : NLFM) : 42 | 43 | //scaling and stereo 44 | *(gain)*1.5); 45 | 46 | //==================== GUI SPECIFICATION ================ 47 | 48 | 49 | freq = hslider("h:[2]Instrument/Frequency[unit:Hz][tooltip:Tone frequency][acc:1 1 -14 0 10]", 440,110,1300,0.01):si.smooth(0.999); 50 | gain = 1; 51 | gate = hslider("[1]ON/OFF",0,0,1,1); 52 | 53 | reedStiffness = hslider("h:[3]Parameters/Instrument Stiffness[style:knob][acc:0 1 -12 0 12]", 0.25,0.01,1,0.01); 54 | noiseGain = hslider("h:[3]Parameters/Breath Noise[style:knob][acc:0 1 -10 0 12]", 0.02,0,0.12,0.01); 55 | pressure = hslider("h:[3]Parameters/ Pressure[style:knob][acc:1 0 -10 0 10]", 0.8,0.25,1,0.01); 56 | 57 | vibratoFreq = 5; 58 | vibratoGain = 0.1; 59 | vibratoAttack = 0.5; 60 | vibratoRelease = 0.01; 61 | 62 | envelopeAttack = 0.1; 63 | envelopeDecay = 0.05; 64 | envelopeRelease = 0.1; 65 | 66 | //==================== SIGNAL PROCESSING ====================== 67 | 68 | //----------------------- Synthesis PARAMETERS computing and functions declaration ---------------------------- 69 | 70 | //reed table PARAMETERS 71 | reedTableOffset = 0.7; 72 | reedTableSlope = -0.44 + (0.26*reedStiffness); 73 | 74 | //the reed function is declared in INSTRUMENT.lib 75 | reedTable = instrument.reed(reedTableOffset,reedTableSlope); 76 | 77 | //delay line with a length adapted in function of the order of nonlinear filter 78 | delayLength = ma.SR/freq*0.5 - 1.5;// - (nlfOrder*nonLinearity)*(typeModulation < 2); 79 | delayLine = de.fdelay(4096,delayLength); 80 | 81 | //one zero filter used as a allpass: pole is set to -1 82 | filter = instrument.oneZero0(0.5,0.5); 83 | 84 | //stereoizer is declared in INSTRUMENT.lib and implement a stereo spacialisation in function of 85 | //the frequency period in number of samples 86 | //stereo = stereoizerCla(ma.SR/freq); 87 | 88 | //----------------------- Algorithm implementation ---------------------------- 89 | 90 | //Breath pressure + vibrato + breath no.noise + envelope (Attack / Decay / Sustain / Release) 91 | envelope = en.adsr(envelopeAttack,envelopeDecay,1,envelopeRelease,gate)*pressure*0.9; 92 | 93 | vibrato = os.osc(vibratoFreq)*vibratoGain* 94 | instrument.envVibrato(0.1*2*vibratoAttack,0.9*2*vibratoAttack,100,vibratoRelease,gate); 95 | breath = envelope + envelope*no.noise*noiseGain; 96 | breathPressure = breath + breath*vibrato; 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SFlute.dsp: -------------------------------------------------------------------------------- 1 | declare name "Flute"; 2 | declare description "Nonlinear WaveGuide Flute"; 3 | declare author "Romain Michon (rmichon@ccrma.stanford.edu)"; 4 | declare copyright "Romain Michon"; 5 | declare version "1.0"; 6 | declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license); 7 | declare description "A simple flute based on Smith algorythm: https://ccrma.stanford.edu/~jos/pasp/Flutes_Recorders_Pipe_Organs.html"; 8 | 9 | //Modifications GRAME July 2015 10 | 11 | /* =========== DESCRITPION =========== 12 | 13 | - Flute 14 | - Turn ON flute (0=OFF, 1=ON) 15 | - Head = High frequencies/ Silence 16 | - Bottom = Low frequencies 17 | - Left = No vibrato 18 | - Right = Fast vibrato 19 | - Front = Full sound 20 | - Back = Breathy sound 21 | 22 | */ 23 | 24 | import("stdfaust.lib"); 25 | instrument = library("instruments.lib"); 26 | 27 | //==================== INSTRUMENT ======================= 28 | 29 | flute = (_ <: (flow + *(feedBack1) : embouchureDelay: poly) + *(feedBack2) : reflexionFilter)~(boreDelay) : NLFM : *(env2)*gain:_; 30 | 31 | process = flute; 32 | 33 | //==================== GUI SPECIFICATION ================ 34 | 35 | freq = hslider("[1]Frequency[acc:1 1 -10 0 10]", 440,247,1200,1):si.smooth(0.999); 36 | pressure = hslider("[2]Pressure[style:knob][acc:1 0 -10 0 10]", 0.96, 0.2, 0.99, 0.01):si.smooth(0.999):min(0.99):max(0.2); 37 | breathAmp = hslider("[3]Breath Noise[style:knob][acc:2 0 -10 0 10]", 0.02, 0.01, 0.2, 0.01):si.smooth(0.999):min(0.2):max(0.01); 38 | 39 | gate = hslider("[0]ON/OFF (ASR Envelope)",0,0,1,1); 40 | vibratoFreq = hslider("[4]Vibrato Freq (Vibrato Envelope)[style:knob][unit:Hz][acc:0 1 -10 0 10]", 4,0.5,8,0.1); 41 | env1Attack = 0.1;//hslider("h:Parameters/Press_Env_Attack[unit:s][style:knob][acc:1 0 -10 0 10][tooltip:Pressure envelope attack duration]",0.05,0.05,0.2,0.01); 42 | 43 | //-------------------- Non-Variable Parameters ----------- 44 | 45 | gain = 1; 46 | typeModulation = 0; 47 | nonLinearity = 0; 48 | frequencyMod = 220; 49 | nonLinAttack = 0.1; 50 | vibratoGain = 0.05; 51 | vibratoBegin = 0.1; 52 | vibratoAttack = 0.5; 53 | vibratoRelease = 0.2; 54 | pressureEnvelope = 0; 55 | env1Decay = 0.2; 56 | env2Attack = 0.1; 57 | env2Release = 0.1; 58 | env1Release = 0.5; 59 | 60 | //==================== SIGNAL PROCESSING ================ 61 | 62 | //----------------------- Nonlinear filter ---------------------------- 63 | //nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib 64 | 65 | //nonlinear filter order 66 | nlfOrder = 6; 67 | 68 | //attack - sustain - release envelope for nonlinearity (declared in instrument.lib) 69 | envelopeMod = en.asr(nonLinAttack,1,0.1,gate); 70 | 71 | //nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib 72 | //for using it with waveguide instruments 73 | NLFM = instrument.nonLinearModulator((nonLinearity : si.smooth(0.999)),envelopeMod,freq, 74 | typeModulation,(frequencyMod : si.smooth(0.999)),nlfOrder); 75 | 76 | //----------------------- Synthesis parameters computing and functions declaration ---------------------------- 77 | 78 | //Loops feedbacks gains 79 | feedBack1 = 0.4; 80 | feedBack2 = 0.4; 81 | 82 | //Delay Lines 83 | embouchureDelayLength = (ma.SR/freq)/2-2; 84 | boreDelayLength = ma.SR/freq-2; 85 | embouchureDelay = de.fdelay(4096,embouchureDelayLength); 86 | boreDelay = de.fdelay(4096,boreDelayLength); 87 | 88 | //Polinomial 89 | poly = _ <: _ - _*_*_; 90 | 91 | //jet filter is a lowwpass filter (declared in filter.lib) 92 | reflexionFilter = fi.lowpass(1,2000); 93 | 94 | //----------------------- Algorithm implementation ---------------------------- 95 | 96 | //Pressure envelope 97 | env1 = en.adsr(env1Attack,env1Decay,0.9,env1Release,(gate | pressureEnvelope))*pressure*1.1; 98 | 99 | //Global envelope 100 | env2 = en.asr(env2Attack,1,env2Release,gate)*0.5; 101 | 102 | //Vibrato Envelope 103 | vibratoEnvelope = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate)*vibratoGain; 104 | 105 | vibrato = os.osc(vibratoFreq)*vibratoEnvelope; 106 | 107 | breath = no.noise*env1; 108 | 109 | flow = env1 + breath*breathAmp + vibrato; 110 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SModulation1.dsp: -------------------------------------------------------------------------------- 1 | declare name "Modulation 1"; 2 | declare author "ER"; 3 | 4 | import("stdfaust.lib"); 5 | instrument = library("instruments.lib"); 6 | 7 | /* =========== DESCRIPTION ============== 8 | 9 | - Non Linear Filter Modulators applied to a sinewave 10 | - Head = Silence/Higher Frequencies 11 | - Bottom = Lower Frequencies 12 | - Right = No modulation 13 | - Left = Modulation n°1 14 | 15 | */ 16 | 17 | //======================== INSTRUMENT ============================= 18 | 19 | process = vgroup("NLFM",oscil : NLFM1 : fi.lowpass(1,2000) *(0.6)*(vol)); 20 | 21 | NLFM1 = _ : instrument.nonLinearModulator((nonlinearity:si.smooth(0.999)),env,freq,typeMod,freqMod,nlfOrder) : _; 22 | oscil = os.osc(freq); 23 | 24 | //======================== GUI SPECIFICATIONS ===================== 25 | 26 | freq = hslider("[2]Frequency [unit:Hz][acc:1 1 -10 0 15]", 330, 100, 1200, 0.1):si.smooth(0.999); 27 | vol = (hslider("[3]Volume[style:knob][acc:1 0 -10 0 10]", 0.5, 0, 1, 0.01)^2):si.smooth(0.999); 28 | 29 | 30 | //------------------------ NLFM PARAMETERS ------------------------ 31 | nlfOrder = 6; 32 | nonlinearity = 0.8; 33 | typeMod = 1; 34 | freqMod = hslider("[4]Modulating Frequency[style:knob][unit:Hz][acc:0 0 -10 0 10]", 1200, 900, 1700, 0.1):si.smooth(0.999); 35 | 36 | env = ASR; 37 | ASR = en.asr(a,s,r,t); 38 | a = 3; 39 | s = 1; 40 | r = 2; 41 | t = gate; 42 | 43 | gate = hslider("[1]Modulation Type 1[tooltip:noteOn = 1, noteOff = 0][acc:0 0 -30 0 5]", 0,0,1,1); 44 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SModulation2.dsp: -------------------------------------------------------------------------------- 1 | declare name "Modulation 2"; 2 | declare author "ER"; 3 | 4 | import("stdfaust.lib"); 5 | instrument = library("instruments.lib"); 6 | 7 | /* =========== DESCRIPTION ============== 8 | 9 | - Non Linear Filter Modulators applied to a sinewave 10 | - Head = Silence/Higher Frequencies 11 | - Bottom = Lower Frequencies 12 | - Back = No modulation 13 | - Front = Modulation n°2 14 | 15 | */ 16 | 17 | //======================== INSTRUMENT ============================= 18 | 19 | process = vgroup("NLFMs",oscil : NLFM2 : fi.lowpass(1,2000) *(0.6)*(vol)); 20 | 21 | NLFM2 = _ : instrument.nonLinearModulator((nonlinearity:si.smooth(0.999)),env,freq,typeMod,freqMod,nlfOrder) : _; 22 | oscil = os.osci(freq); 23 | 24 | //======================== GUI SPECIFICATIONS ===================== 25 | 26 | freq = hslider("[2]Frequency [unit:Hz][acc:1 1 -10 0 15]", 330, 100, 1200, 0.1):si.smooth(0.999); 27 | freqMod = hslider("[4]Modulating Frequency[style:knob][unit:Hz][acc:0 0 -10 0 10]", 1200, 900, 1700, 0.1):si.smooth(0.999); 28 | vol = (hslider("[3]Volume[style:knob][acc:1 0 -10 0 10]", 0.5, 0, 1, 0.01)^2):si.smooth(0.999); 29 | 30 | 31 | //------------------------ NLFM PARAMETERS ------------------------ 32 | nlfOrder = 6; 33 | nonlinearity = 0.8; 34 | typeMod = 2; 35 | 36 | env = ASR; 37 | ASR = en.asr(a,s,r,t); 38 | a = 3; 39 | s = 1; 40 | r = 2; 41 | t = gate; 42 | 43 | gate = hslider("[1]Modulation Type 2[acc:2 1 -30 0 10]", 0,0,1,1); 44 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SModulation3.dsp: -------------------------------------------------------------------------------- 1 | declare name "Modulation 3"; 2 | declare author "ER"; 3 | 4 | import("stdfaust.lib"); 5 | instrument = library("instruments.lib"); 6 | 7 | /* =========== DESCRIPTION ============== 8 | 9 | - Non Linear Filter Modulators applied to a sinewave 10 | - Head = Silence/Higher Frequencies/No modulation 11 | - Bottom = Lower Frequencies/ Modulation n°3 12 | - Rocking = Modulating Frequency (low to high) 13 | 14 | */ 15 | 16 | //======================== INSTRUMENT ============================= 17 | 18 | process = vgroup("NLFMs",oscil : NLFM3 : fi.lowpass(1,2000) *(0.6)*(vol)); 19 | 20 | NLFM3 = _ : instrument.nonLinearModulator((nonlinearity:si.smooth(0.999)),env,freq,typeMod,freqMod,nlfOrder) : _; 21 | oscil = os.osci(freq); 22 | 23 | //======================== GUI SPECIFICATIONS ===================== 24 | 25 | freq = hslider("[2]Frequency [unit:Hz][acc:1 1 -10 0 15]", 330, 100, 1200, 0.1):si.smooth(0.999); 26 | freqMod = hslider("[4]Modulating Frequency[style:knob][unit:Hz][acc:0 0 -10 0 10]", 1200, 900, 1700, 0.1):si.smooth(0.999); 27 | vol = (hslider("[3]Volume[style:knob][acc:1 0 -10 0 10]", 0.5, 0, 1, 0.01)^2):si.smooth(0.999); 28 | 29 | //------------------------ NLFM PARAMETERS ------------------------ 30 | nlfOrder = 6; 31 | nonlinearity = 0.8; 32 | typeMod = 3; 33 | 34 | env = ASR; 35 | ASR = en.asr(a,s,r,t); 36 | a = 3; 37 | s = 1; 38 | r = 2; 39 | t = gate; 40 | 41 | gate = hslider("[1]Modulation Type 3[acc:1 0 -10 0 10]", 0,0,1,1); 42 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SModulation4.dsp: -------------------------------------------------------------------------------- 1 | declare name "Modulation 2"; 2 | declare author "ER"; 3 | 4 | import("stdfaust.lib"); 5 | instrument = library("instruments.lib"); 6 | 7 | /* =========== DESCRIPTION ============== 8 | 9 | - Non Linear Filter Modulators applied to a sinewave 10 | - Head = Silence/Higher Frequencies 11 | - Bottom = Lower Frequencies 12 | - Right = No modulation 13 | - Left = Modulation n°4 14 | 15 | */ 16 | 17 | //======================== INSTRUMENT ============================= 18 | 19 | process = vgroup("NLFMs",oscil : NLFM4 : fi.lowpass(1,2000) *(0.6) *(vol)); 20 | 21 | NLFM4 = _ : instrument.nonLinearModulator((nonlinearity:si.smooth(0.999)),env,freq,typeMod,freqMod,nlfOrder) : _; 22 | oscil = os.osci(freq); 23 | 24 | //======================== GUI SPECIFICATIONS ===================== 25 | 26 | freq = hslider("[2]Frequency [unit:Hz][acc:1 1 -10 0 15]", 330, 100, 1200, 0.1):si.smooth(0.999); 27 | freqMod = hslider("[4]Modulating Frequency[style:knob][unit:Hz][acc:0 0 -10 0 10]", 1200, 900, 1700, 0.1):si.smooth(0.999); 28 | vol = (hslider("[3]Volume[style:knob][acc:1 0 -10 0 10]", 0.5, 0, 1, 0.01)^2):si.smooth(0.999); 29 | 30 | //------------------------ NLFM PARAMETERS ------------------------ 31 | nlfOrder = 6; 32 | nonlinearity = 0.8; 33 | typeMod = 4; 34 | 35 | env = ASR; 36 | ASR = en.asr(a,s,r,t); 37 | a = 3; 38 | s = 1; 39 | r = 2; 40 | t = gate; 41 | 42 | gate = hslider("[1]Modulation Type 4[acc:0 0 -30 0 10]", 0,0,1,1); 43 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SNoise.dsp: -------------------------------------------------------------------------------- 1 | declare name "White Noise"; 2 | declare version "1.1"; 3 | declare author "Grame"; 4 | declare license "BSD"; 5 | declare copyright "(c)GRAME 2009"; 6 | 7 | 8 | /* ========== DESCRIPTION =========== 9 | 10 | - White no.noise generator 11 | - Head = silence 12 | - Bottom = Maximum volume of the no.noise 13 | 14 | */ 15 | 16 | random = +(12345)~*(1103515245); 17 | noise = random/2147483647.0; 18 | 19 | process = noise * hslider("Volume[acc:1 0 -10 0 10][style:knob]", 0.5, 0, 1, 0.01); 20 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SNoiseS.dsp: -------------------------------------------------------------------------------- 1 | declare name "Noises"; 2 | declare author "ER"; 3 | declare version "1.0"; 4 | 5 | import("stdfaust.lib"); 6 | 7 | /* ============ DESCRIPTION =============: 8 | 9 | - White Noise and Pink Noise generator. 10 | - Head = silence. 11 | - Fishing rod = Volume variation. 12 | - Right = silence. 13 | - Face = pink no.noise. 14 | - Left = white no.noise. 15 | - Rocking to switch from one no.noise to another. 16 | */ 17 | 18 | // pink no.noise filter (-3dB per octave), see musicdsp.org 19 | 20 | p = f : (+ ~ g) with { 21 | f(x) = 0.04957526213389*x - 0.06305581334498*x' + 22 | 0.01483220320740*x''; 23 | g(x) = 1.80116083982126*x - 0.80257737639225*x'; 24 | }; 25 | 26 | // white no.noise generator 27 | 28 | rand = +(12345)~*(1103515245); 29 | w = rand/2147483647.0; 30 | 31 | White = w * hslider("White Noise Volume[acc:1 0 -10 0 10][style:knob]", 0.5, 0, 2, 0.01); 32 | 33 | Pink = (w : p) * (2) * hslider("Pink Noise Volume[acc:1 0 -10 0 10][tooltip:0=Mute, 1=White Noise, 2=Pink Noise][style:knob]", 0.5, 0, 2, 0.01); 34 | 35 | NoiseType = hslider("Noise Type[acc:0 0 -10 0 10]", 1,0,2,1); 36 | 37 | Ntype(n) = abs(NoiseType - n) < 0.5; 38 | 39 | Noise(0) = 0; 40 | Noise(1) = Pink; 41 | Noise(2) = White; 42 | 43 | process = par(i, 3, Noise(i) * Ntype(i)) :>_; 44 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SNoiseburst.dsp: -------------------------------------------------------------------------------- 1 | declare name "Noiseburst"; 2 | declare author "Adapted frome sfIter by Christophe Lebreton"; 3 | 4 | import("stdfaust.lib"); 5 | 6 | /* =========== DESCRITPTION ============= 7 | 8 | - Noise outbursts generator 9 | - Front = Medium size bursts 10 | - Back = short bursts 11 | - Left Slow rhythm 12 | - Right = Fast rhythm 13 | - Bottom = Regular occurrences 14 | - Head = Irregular occurrences 15 | */ 16 | 17 | process = noiseburst *(0.1); 18 | 19 | //----------------------- NOISEBURST ------------------------- 20 | 21 | noiseburst = no.noise : *(gate : trigger(P)) 22 | with { 23 | upfront(x) = (x-x') > 0; 24 | decay(n,x) = x - (x>0)/n; 25 | release(n) = + ~ decay(n); 26 | trigger(n) = upfront : release(n) : > (0.0); 27 | }; 28 | 29 | P = freq; // fundamental period in samples 30 | Pmax = 4096; // maximum P (for delay-line allocation) 31 | 32 | gate = phasor(1) :-(0.001):pulsar; 33 | gain = 1; 34 | freq = hslider("[1]Grain Size[style:knob][acc:2 0 -10 0 10]", 200,5,2205,1); 35 | // la frequence donne la largeur de bande extraite du bruit blanc 36 | 37 | // PHASOR ////////////////////////////// 38 | phasor(init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); 39 | 40 | // PULSAR ////////////////////////////// 41 | //Le pulsar permet de creer une 'pulsation' plus ou moins aleatoire (proba). 42 | 43 | pulsar = _<:((_<(ratio_env)):@(100))*(proba>(_,abs(no.noise):ba.latch)); 44 | speed = hslider ("[2]Speed[unit:Hz][style:knob][acc:0 1 -10 0 10]", 10,1,20,0.0001):fi.lowpass(1,1); 45 | ratio_env = 0.5; 46 | fade = (0.5); // min > 0 pour eviter division par 0 47 | proba = hslider ("[3]Probability[unit:%][style:knob][acc:1 0 -10 0 10]", 70,50,100,1) * (0.01):fi.lowpass(1,1); 48 | duree_env = 1/(speed: / (ratio_env*(0.25)*fade)); 49 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SOscillator.dsp: -------------------------------------------------------------------------------- 1 | declare name "os.osc"; 2 | declare version "1.0"; 3 | declare author "Grame"; 4 | declare license "BSD"; 5 | declare copyright "(c)GRAME 2009"; 6 | 7 | //----------------------------------------------- 8 | // Sinusoidal Oscillator 9 | //----------------------------------------------- 10 | 11 | /* =========== DESCRIPTION ============= 12 | 13 | - Simple sine wave oscillator 14 | - Left = low frequencies 15 | - Right = high frequencies 16 | - Front = around 300Hz 17 | - Rocking = from low to high 18 | */ 19 | 20 | import("stdfaust.lib"); 21 | 22 | freq = hslider("Frequency [unit:Hz] [acc:0 1 -10 0 10]", 300, 70, 2400, 0.01):si.smooth(0.999); 23 | process = vgroup("Oscillator", os.osc(freq)); 24 | 25 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SPentatonicBlowBottle.dsp: -------------------------------------------------------------------------------- 1 | declare name "Pentatonic BlowBottle"; 2 | declare author "ER";//Adapted from Blow Bottle by Romain Michon (rmichon@ccrma.stanford.edu); 3 | 4 | /* =========== DESCRITPION ============= 5 | 6 | - Pentatonic Blow Bottles 7 | - Left = Low frequencies/ Silence/ Slow rhythm 8 | - Right = High frequencies/ Fast rhythm 9 | - Front = Long notes 10 | - Back = Short notes 11 | 12 | */ 13 | 14 | import("stdfaust.lib"); 15 | instrument = library("instruments.lib"); 16 | 17 | 18 | //==================== INSTRUMENT ======================= 19 | 20 | process = vgroup("Blowhistle Bottles", par(i, N, blow(i)) :>*(2)); 21 | blow(n)= 22 | //differential pressure 23 | (-(breathPressure(trigger(n))) <: 24 | ((+(1))*randPressure((trigger(n))) : +(breathPressure(trigger(n)))) - *(instrument.jetTable),_ : baPaF(n),_)~_: !,_: 25 | //signal scaling 26 | fi.dcblocker*envelopeG(trigger(n))*(0.5) 27 | with { 28 | baPaF(n) = bandPassFilter(freq(n)); 29 | }; 30 | 31 | //==================== GUI SPECIFICATION ================ 32 | N = 15; 33 | 34 | position(n) = abs(hand - n) < 0.5; 35 | hand = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 8, 0, N, 1) : si.smooth(0.999) : min(24) : max(0) :int: ba.automat(bps, 15, 0.0) 36 | with{ 37 | bps = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; 38 | }; 39 | envelopeAttack = 0.01; 40 | vibratoFreq = 5; 41 | vibratoGain = 0.1; 42 | 43 | 44 | //--------------------- Non-variable Parameters ------------- 45 | 46 | gain = 0.5; 47 | noiseGain = 0.5; 48 | pressure = 1.2; 49 | vibratoBegin = 0.05; 50 | vibratoAttack = 0.5; 51 | vibratoRelease = 0.01; 52 | envelopeDecay = 0.01; 53 | envelopeRelease = 0.05; 54 | 55 | //----------------------- Frequency Table -------------------- 56 | 57 | freq(0) = 130.81; 58 | freq(1) = 146.83; 59 | freq(2) = 164.81; 60 | freq(3) = 195.99; 61 | freq(4) = 220.00; 62 | 63 | freq(d) = freq(d-5)*2; 64 | 65 | //==================== SIGNAL PROCESSING ================ 66 | 67 | //----------------------- Synthesis parameters computing and functions declaration ---------------------------- 68 | 69 | //botlle radius 70 | bottleRadius = 0.999; 71 | 72 | bandPassFilter(f) = instrument.bandPass(f,bottleRadius); 73 | 74 | //----------------------- Algorithm implementation ---------------------------- 75 | 76 | //global envelope is of type attack - decay - sustain - release 77 | envelopeG(t) = gain*en.adsr(gain*envelopeAttack,envelopeDecay,0.8,envelopeRelease,t); 78 | 79 | //pressure envelope is also ADSR 80 | envelope(t) = pressure*en.adsr(gain*0.02,0.01,0.8,gain*0.2,t); 81 | 82 | //vibrato 83 | vibrato(t) = os.osc(vibratoFreq)*vibratoGain*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*os.osc(vibratoFreq); 84 | 85 | //breat pressure 86 | breathPressure(t) = envelope(t) + vibrato(t); 87 | 88 | //breath no.noise 89 | randPressure(t) = noiseGain*no.noise*breathPressure(t) ; 90 | 91 | //------------------------- Enveloppe Trigger -------------------------------------------- 92 | 93 | trigger(n) = position(n): trig 94 | with { 95 | upfront(x) = (x-x') > 0; 96 | decay(n,x) = x - (x>0.0)/n; 97 | release(n) = + ~ decay(n); 98 | noteDuration = hslider("[3]Note Duration[unit:s][style:knob][acc:2 1 -10 0 10]", 0.166, 0.1, 0.2, 0.01)*44100 : min(8820) : max(4410):int; 99 | trig = upfront : release(noteDuration) : >(0.0); 100 | }; 101 | 102 | 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SPentatonicDryHarp.dsp: -------------------------------------------------------------------------------- 1 | declare name "PentatonicDryHarp"; 2 | declare author "ER";//Adapted from Harpe by Yann Orlarey; 3 | 4 | //Modification Grame July 2015 5 | 6 | /* =============== DESCRIPTION ================= : 7 | 8 | - Pentatonic dry harp 9 | - Left = Lower frequencies/Silence when still 10 | - Front = Resonance (longer notes) 11 | - Back = No Resonance (dry notes) 12 | - Right = Higher frequencies/Fast rhythm 13 | - Rocking = plucking all strings one by one 14 | 15 | */ 16 | 17 | //----------------------------------------------- 18 | // Harpe : simple string instrument 19 | // (based on Karplus-Strong) 20 | // 21 | //----------------------------------------------- 22 | 23 | import("stdfaust.lib"); 24 | instrument = library("instruments.lib"); 25 | 26 | KEY = 60; // basic midi key 27 | NCY = 15; // note cycle length 28 | CCY = 15; // control cycle length 29 | BPS = 360; // general tempo (ba.beat per sec) 30 | 31 | //-------------------------------Harpe---------------------------------- 32 | // Harpe is a simple string instrument. Move the "hand" to play the 33 | // various strings 34 | //----------------------------------------------------------------------- 35 | 36 | process = hgroup("harp", h : harpe(C,N,K) :> *(l),*(l)) 37 | with { 38 | N = 21; // number of strings 39 | K = 48; // Midi key of first string 40 | h = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 11, 0, N, 1) : int: ba.automat(bps, 15, 0.0) 41 | with { 42 | bps = hslider("h:[2]Parameters/[1]Speed[style:knob][acc:0 1 -12 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; 43 | }; 44 | l = 0.9; 45 | C = 0.5; 46 | }; 47 | 48 | //----------------------------------Harpe-------------------------------- 49 | // USAGE: hand : harpe(C,10,60) : _,_; 50 | // C is the filter coefficient 0..1 51 | // Build a N (10) strings harpe using a pentatonic scale 52 | // based on midi key b (60) 53 | // Each string is triggered by a specific 54 | // position of the "hand" 55 | //----------------------------------------------------------------------- 56 | harpe(C,N,b) = _ <: par(i, N, position(i+1) 57 | : string(C,Penta(b).degree2Hz(i), att, lvl) 58 | : pan((i+0.5)/N) ) 59 | :> _,_ 60 | with { 61 | att = hslider("h:[2]Parameters/[2]Resonance[style:knob][acc:2 1 -12 0 10]", 5, 0.1, 10, 0.01):min(10):max(0.1); 62 | lvl = 1; 63 | pan(p) = _ <: *(sqrt(1-p)), *(sqrt(p)); 64 | position(a,x) = abs(x - a) < 0.5; 65 | 66 | }; 67 | 68 | //----------------------------------Penta------------------------------- 69 | // Pentatonic scale with degree to midi and degree to Hz conversion 70 | // USAGE: Penta(60).degree2midi(3) ==> 67 midikey 71 | // Penta(60).degree2Hz(4) ==> 440 Hz 72 | //----------------------------------------------------------------------- 73 | 74 | Penta(key) = environment { 75 | 76 | A4Hz = 440; 77 | 78 | degree2midi(0) = key+0; 79 | degree2midi(1) = key+2; 80 | degree2midi(2) = key+4; 81 | degree2midi(3) = key+7; 82 | degree2midi(4) = key+9; 83 | degree2midi(d) = degree2midi(d-5)+12; 84 | 85 | degree2Hz(d) = A4Hz*semiton(degree2midi(d)-69) with { semiton(n) = 2.0^(n/12.0); }; 86 | 87 | }; 88 | 89 | //----------------------------------String------------------------------- 90 | // A karplus-strong string. 91 | // 92 | // USAGE: string(440Hz, 4s, 1.0, button("play")) 93 | // or button("play") : string(440Hz, 4s, 1.0) 94 | //----------------------------------------------------------------------- 95 | 96 | string(coef, freq, t60, level, trig) = no.noise*level 97 | : *(trig : trigger(freq2samples(freq))) 98 | : resonator(freq2samples(freq), att) 99 | with { 100 | resonator(d,a) = (+ : @(d-1)) ~ (average : *(a)); 101 | average(x) = (x*(1+coef)+x'*(1-coef))/2; 102 | trigger(n) = upfront : + ~ decay(n) : >(0.0); 103 | upfront(x) = (x-x') > 0.0; 104 | decay(n,x) = x - (x>0.0)/n; 105 | freq2samples(f) = 44100.0/f; 106 | att = pow(0.001,1.0/(freq*t60)); // attenuation coefficient 107 | }; 108 | 109 | 110 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SPentatonicFlute.dsp: -------------------------------------------------------------------------------- 1 | declare name "Pentatonic Flute"; 2 | declare description "Nonlinear WaveGuide Flute"; 3 | declare author "ER";// Adapted from "Flute" by Romain Michon (rmichon@ccrma.stanford.edu); 4 | 5 | /* =============== DESCRIPTION ================= : 6 | 7 | - Pentatonic flute 8 | - Rocking = playing all notes from low to high frequencies 9 | - Left = Silence/Slow rhythm 10 | - Right = Fast rhythm 11 | - Front = long notes 12 | - Back = short notes 13 | 14 | */ 15 | 16 | import("stdfaust.lib"); 17 | instrument = library("instruments.lib"); 18 | 19 | //==================== INSTRUMENT ======================= 20 | 21 | flute(n) = (_ <: (flow(trigger(n)) + *(feedBack1) : embouchureDelay(freq(n)): poly) + *(feedBack2) : reflexionFilter)~(boreDelay(freq(n))) : *(env2(trigger(n)))*gain:_; 22 | 23 | process = par(i, N, flute(i)):>_; 24 | 25 | //==================== GUI SPECIFICATION ================ 26 | 27 | vibratoFreq = 2.5; 28 | env1Attack = 0.06; 29 | env1Release = 1; 30 | 31 | //-------------------- Non-Variable Parameters ----------- 32 | N = 14; 33 | 34 | gain = 1; 35 | pressure = 0.9; 36 | breathAmp = 0.01; 37 | vibratoGain = 0.1; 38 | vibratoBegin = 0.1; 39 | vibratoAttack = 0.1; 40 | vibratoRelease = 0.2; 41 | pressureEnvelope = 0; 42 | env1Decay = 0.2; 43 | env2Attack = 0.1; 44 | env2Release = 0.1; 45 | 46 | //----------------------- Frequency Table -------------------- 47 | 48 | 49 | freq(0) = 184.99; 50 | freq(1) = 207.65; 51 | freq(2) = 233.08; 52 | freq(3) = 277.18; 53 | freq(4) = 311.12; 54 | 55 | freq(d) = freq(d-5)*2; 56 | 57 | //==================== SIGNAL PROCESSING ================ 58 | 59 | //----------------------- Synthesis parameters computing and functions declaration ---------------------------- 60 | 61 | //Loops feedbacks gains 62 | feedBack1 = 0.4; 63 | feedBack2 = 0.4; 64 | 65 | //Delay Lines 66 | embouchureDelayLength(f) = (ma.SR/f)/2-2; 67 | boreDelayLength(f) = ma.SR/f-2; 68 | embouchureDelay(f) = de.fdelay(4096,embouchureDelayLength(f)); 69 | boreDelay(f) = de.fdelay(4096,boreDelayLength(f)); 70 | 71 | //Polinomial 72 | poly = _ <: _ - _*_*_; 73 | 74 | //jet filter is a lowwpass filter (declared in filter.lib) 75 | reflexionFilter = fi.lowpass(1,2000); 76 | 77 | //----------------------- Algorithm implementation ---------------------------- 78 | 79 | //Pressure envelope 80 | env1(t) = en.adsr(env1Attack,env1Decay,0.9,env1Release,(t | pressureEnvelope))*pressure*1.1; 81 | 82 | //Global envelope 83 | env2(t) = en.asr(env2Attack,1,env2Release,t)*0.5; 84 | 85 | //Vibrato Envelope 86 | vibratoEnvelope(t) = instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,t)*vibratoGain; 87 | 88 | vibrato(t) = os.osc(vibratoFreq)*vibratoEnvelope(t); 89 | 90 | breath(t) = no.noise*env1(t); 91 | 92 | flow(t) = env1(t) + breath(t)*breathAmp + vibrato(t); 93 | 94 | //------------------------- Enveloppe Trigger -------------------------------------------- 95 | 96 | trigger(n) = position(n): trig 97 | with { 98 | upfront(x) = (x-x') > 0; 99 | decay(n,x) = x - (x>0.0)/n; 100 | release(n) = + ~ decay(n); 101 | noteDuration = hslider("[3]Note Duration[unit:s][style:knob][acc:2 1 -10 0 10]", 0.166, 0.1, 0.25, 0.01)*44100 : min(11025) : max(4410):int; 102 | trig = upfront : release(noteDuration) : >(0.0); 103 | }; 104 | 105 | position(n) = abs(hand - n) < 0.5; 106 | hand = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 7, 0, N, 1):int: ba.automat(bps, 15, 0.0)// => gate 107 | with { 108 | bps = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; 109 | }; 110 | 111 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SPentatonicSoftHarp.dsp: -------------------------------------------------------------------------------- 1 | declare name "Pentatonic Soft Harp"; 2 | declare author "ER";//Adapted from "Nonlinear EKS" by Julius Smith and Romain Michon; 3 | 4 | 5 | import("stdfaust.lib"); 6 | instrument = library("instruments.lib"); 7 | 8 | /* =============== DESCRIPTION ================= 9 | 10 | - Reverberated pentatonic soft harp 11 | - Left = Lower frequencies/Silence when still 12 | - Front = Resonance 13 | - Back = No resonance 14 | - Right = Higher frequencies/Fast rhythm 15 | - Head = Reverberation 16 | - Rocking = plucking all strings one by one 17 | 18 | */ 19 | 20 | //==================== INSTRUMENT ======================= 21 | 22 | process = par(i, N, NFLeks(i)):>_; 23 | 24 | NFLeks(n) = filtered_excitation(n,P(freq(n)),freq(n)) : stringloop(freq(n)); 25 | 26 | //==================== GUI SPECIFICATION ================ 27 | 28 | N = 20; 29 | hand = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 10, 0, N, 1) : ba.automat(bps, 15, 0.0)// => gate 30 | with{ 31 | bps = hslider("[2]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; 32 | }; 33 | gain = 1; 34 | pickangle = 0.81; 35 | 36 | beta = 0.5; 37 | t60 = hslider("[3]Resonance[unit:s][acc:2 1 -10 0 10]", 5, 0.5, 10, 0.01); // -60db decay time (sec) 38 | 39 | B = 0; 40 | L = -10 : ba.db2linear; 41 | 42 | //---------------------------------- FREQUENCY TABLE --------------------------- 43 | 44 | freq(0) = 184.99; 45 | freq(1) = 207.65; 46 | freq(2) = 233.08; 47 | freq(3) = 277.18; 48 | freq(4) = 311.12; 49 | 50 | freq(d) = freq(d-5)*2; 51 | 52 | //==================== SIGNAL PROCESSING ================ 53 | 54 | //----------------------- noiseburst ------------------------- 55 | // White no.noise burst (adapted from Faust's karplus.dsp example) 56 | // Requires music.lib (for no.noise) 57 | noiseburst(d,e) = no.noise : *(trigger(d,e)) 58 | with{ 59 | upfront(x) = (x-x') > 0; 60 | decay(n,x) = x - (x>0)/n; 61 | release(n) = + ~ decay(n); 62 | position(d) = abs(hand - d) < 0.5; 63 | trigger(d,n) = position(d) : upfront : release(n) : > (0.0); 64 | }; 65 | 66 | P(f) = ma.SR/f ; // fundamental period in samples 67 | Pmax = 4096; // maximum P (for delay-line allocation) 68 | 69 | ppdel(f) = beta*P(f); // pick position delay 70 | pickposfilter(f) = fi.ffcombfilter(Pmax,ppdel(f),-1); // defined in filter.lib 71 | 72 | excitation(d,e) = noiseburst(d,e) : *(gain); // defined in signal.lib 73 | 74 | rho(f) = pow(0.001,1.0/(f*t60)); // multiplies loop-gain 75 | 76 | // Original EKS damping filter: 77 | b1 = 0.5*B; b0 = 1.0-b1; // S and 1-S 78 | dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); 79 | 80 | // Linear phase FIR3 damping filter: 81 | h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; 82 | dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); 83 | 84 | loopfilter(f) = dampingfilter2(f); // or dampingfilter1 85 | 86 | filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) 87 | : pickposfilter(f) : fi.levelfilter(L,f); // see filter.lib 88 | 89 | stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f));// : NLFM(f)); 90 | 91 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SRandomAndHold.dsp: -------------------------------------------------------------------------------- 1 | declare name "Random and Hold"; 2 | declare author "ER"; 3 | 4 | /* ========= DESCRIPTION ============ 5 | 6 | - Random frequency generator with hold function 7 | - Head = Hold the last sampled note 8 | - Swing = Generate random notes 9 | - Left = Slow rhythm 10 | - Right = Fast rhythm 11 | 12 | */ 13 | 14 | import("stdfaust.lib"); 15 | 16 | process = no.noise : sampleAndhold(gate) * (1500) : si.smooth(0.99) : os.osc : sampleAndhold(reverse(hold))<:select2(reverse(hold),(si.smooth(0.999) : *(1500):os.osc),_); 17 | 18 | sampleAndhold(g) = select2(g) ~_; 19 | 20 | reverse(t) = select2(t,1,0); 21 | 22 | hold = hslider("[2]Hold[acc:1 1 -8 0 12]", 0, 0, 1, 1); 23 | gate = hand : upfront : counter <=(0) 24 | with { 25 | hand = hslider("[1]Instrument hand[acc:1 0 -10 0 10]", 5, 0, 10, 1):ba.automat(bps, 15, 0.0); 26 | bps = hslider("[3]Speed[style:knob][acc:0 1 -10 0 10]", 480, 120, 720, 1) : si.smooth(0.999) : min(720) : max(120) : int; 27 | upfront(x) = abs(x-x') > 0; 28 | counter(g) = (+(1):*(1-g))~_; 29 | }; 30 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SRandomFrequencyGenerator.dsp: -------------------------------------------------------------------------------- 1 | declare name "Random Frequency Generator"; 2 | declare author "ER"; 3 | 4 | /* ============ DESCRIPTION ============ 5 | 6 | - Random Frequency Generator 7 | - Head = High Frequencies 8 | - Bottom = Low frequencies 9 | - Left = Slow rhythm 10 | - Right = Fast rhythm 11 | 12 | */ 13 | 14 | import("stdfaust.lib"); 15 | 16 | process = vgroup("Random Frequency Generator", randfreq : os.osc); 17 | 18 | sampleAndhold(t) = select2(t) ~_; 19 | 20 | randfreq = no.noise : sampleAndhold(gate)*(lowhigh) : si.smooth(0.99) 21 | with{ 22 | lowhigh = hslider("[2]Hight[tooltip: frequency range hight factor][acc:1 1 -10 0 10]", 1000, 300, 2500, 1):si.smooth(0.999):min(1500):max(10); 23 | }; 24 | 25 | 26 | gate = hand : upfront : counter <=(0) 27 | with{ 28 | hand = hslider("[1]Instrument Hand[acc:0 1 -10 0 10]", 8, 0, 15, 1) :ba.automat(bps, 15, 0.0); 29 | bps = hslider("[4]Speed[style:knob][acc:0 1 -10 0 10]", 420, 180, 720, 1) : si.smooth(0.999) : min(720) : max(180) : int; 30 | upfront(x) = abs(x-x') > 0; 31 | counter(g) = (+(1):*(1-g))~_; 32 | }; 33 | 34 | 35 | -------------------------------------------------------------------------------- /public/faust-modules/generators/STinkle.dsp: -------------------------------------------------------------------------------- 1 | declare name "Tinkle"; 2 | declare description "Banded Waveguide Modeld Tibetan Bowl"; 3 | declare author "Romain Michon"; 4 | declare copyright "Romain Michon (rmichon@ccrma.stanford.edu)"; 5 | declare version "1.0"; 6 | declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license); 7 | declare description "This instrument uses banded waveguide. For more information, see Essl, G. and Cook, P. Banded Waveguides: Towards Physical Modelling of Bar Percussion Instruments, Proceedings of the 1999 International Computer Music Conference."; 8 | 9 | /* ============ DESCRIPTION ============== 10 | 11 | - Tinkling bowls 12 | - Rocking = Ringing all bowls from low to high frequencies 13 | 14 | */ 15 | 16 | import("stdfaust.lib"); 17 | instrument = library("instruments.lib"); 18 | 19 | //==================== INSTRUMENT ======================= 20 | 21 | process = hgroup("Tinkle",(((select-1)*-1) <: 22 | //nModes resonances with nModes feedbacks for bow table look-up 23 | par(i,nModes,(resonance(i)~_))):>+:fi.lowpass(1,5000)*(gain)); 24 | 25 | //==================== GUI SPECIFICATION ================ 26 | 27 | freq = hslider("[1]Frequency[unit:Hz][acc:0 1 -10 0 10]", 440,180,780,1); 28 | gain = 0.7; 29 | gate = 0; 30 | select = hslider("[2]Play[style:knob][tooltip:0=Bow; 1=Strike][acc:1 0 -10 0 10]", 1,0,1,1); 31 | integrationConstant = 0.01; 32 | baseGain = 0.5; 33 | 34 | //==================== MODAL PARAMETERS ================ 35 | 36 | preset = 0; 37 | 38 | nMode(0) = 12; 39 | 40 | modes(0,0) = 0.996108344; 41 | basegains(0,0) = 0.999925960128219; 42 | excitation(0,0) = 11.900357 / 10; 43 | 44 | modes(0,1) = 1.0038916562; 45 | basegains(0,1) = 0.999925960128219; 46 | excitation(0,1) = 11.900357 / 10; 47 | 48 | modes(0,2) = 2.979178; 49 | basegains(0,2) = 0.999982774366897; 50 | excitation(0,2) = 10.914886 / 10; 51 | 52 | modes(0,3) = 2.99329767; 53 | basegains(0,3) = 0.999982774366897; 54 | excitation(0,3) = 10.914886 / 10; 55 | 56 | modes(0,4) = 5.704452; 57 | basegains(0,4) = 1.0; 58 | excitation(0,4) = 42.995041 / 10; 59 | 60 | modes(0,5) = 5.704452; 61 | basegains(0,5) = 1.0; 62 | excitation(0,5) = 42.995041 / 10; 63 | 64 | modes(0,6) = 8.9982; 65 | basegains(0,6) = 1.0; 66 | excitation(0,6) = 40.063034 / 10; 67 | 68 | modes(0,7) = 9.01549726; 69 | basegains(0,7) = 1.0; 70 | excitation(0,7) = 40.063034 / 10; 71 | 72 | modes(0,8) = 12.83303; 73 | basegains(0,8) = 0.999965497558225; 74 | excitation(0,8) = 7.063034 / 10; 75 | 76 | modes(0,9) = 12.807382; 77 | basegains(0,9) = 0.999965497558225; 78 | excitation(0,9) = 7.063034 / 10; 79 | 80 | modes(0,10) = 17.2808219; 81 | basegains(0,10) = 0.9999999999999999999965497558225; 82 | excitation(0,10) = 57.063034 / 10; 83 | 84 | modes(0,11) = 21.97602739726; 85 | basegains(0,11) = 0.999999999999999965497558225; 86 | excitation(0,11) = 57.063034 / 10; 87 | 88 | //==================== SIGNAL PROCESSING ================ 89 | 90 | //----------------------- Synthesis parameters computing and functions declaration ---------------------------- 91 | 92 | //the number of modes depends on the preset being used 93 | nModes = nMode(preset); 94 | 95 | delayLengthBase = ma.SR/freq; 96 | 97 | //delay lengths in number of samples 98 | delayLength(x) = delayLengthBase/modes(preset,x); 99 | 100 | //delay lines 101 | delayLine(x) = de.delay(4096,delayLength(x)); 102 | 103 | //Filter bank: fi.bandpass filters (declared in instrument.lib) 104 | radius = 1 - ma.PI*32/ma.SR; 105 | bandPassFilter(x) = instrument.bandPass(freq*modes(preset,x),radius); 106 | 107 | //----------------------- Algorithm implementation ---------------------------- 108 | 109 | //One resonance 110 | resonance(x) = + : + (excitation(preset,x)*select) : delayLine(x) : *(basegains(preset,x)) : bandPassFilter(x); 111 | -------------------------------------------------------------------------------- /public/faust-modules/generators/STunedBar.dsp: -------------------------------------------------------------------------------- 1 | declare name "Tuned Bars"; 2 | declare author "ER";//From "Tuned Bar" by Romain Michon (rmichon@ccrma.stanford.edu); 3 | 4 | import("stdfaust.lib"); 5 | instrument = library("instruments.lib"); 6 | 7 | /* =============== DESCRIPTION ================= : 8 | 9 | - Cascading tuned bars 10 | - Head = Silence 11 | - Bottom = Chime 12 | - Left = Low frequencies + slow rhythm 13 | - Right = High frequencies + fast rhythm 14 | - Geiger counter = Chime 15 | 16 | */ 17 | 18 | //==================== INSTRUMENT ======================= 19 | 20 | process = par(i, N, tunedBar(i)):>_; 21 | tunedBar(n) = 22 | ((select-1)*-1) <: 23 | //nModes resonances with nModes feedbacks for bow table look-up 24 | par(i,nModes,(resonance(i,octave(n),gate(n))~_)):> + : 25 | //Signal Scaling and stereo 26 | *(15); 27 | //==================== GUI SPECIFICATION ================ 28 | N = 10; 29 | 30 | gain = 1; 31 | gate(n) = position(n) : upfront; 32 | hand = hslider("[1]Instrument Hand[acc:1 0 -10 0 10]", 5, 0, N, 1):si.smooth(0.999):min(N):max(0):int:ba.automat(B, 15, 0.0); 33 | B = hslider("[3]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 60): si.smooth(0.99) : min(720) : max(180) : int; 34 | hight = hslider("[2]Hight[acc:0 1 -10 0 10]", 4, 0.5, 8, 0.1);//:si.smooth(0.999); 35 | octave(d) = freq(d)*(hight); 36 | position(n) = abs(hand - n) < 0.5; 37 | upfront(x) = abs(x-x') > 0; 38 | 39 | select = 1; 40 | //----------------------- Frequency Table -------------------- 41 | 42 | freq(0) = 130.81; 43 | freq(1) = 146.83; 44 | freq(2) = 164.81; 45 | freq(3) = 184.99; 46 | freq(4) = 207.65; 47 | freq(5) = 233.08; 48 | 49 | freq(d) = freq(d-6)*2; 50 | 51 | //==================== MODAL PARAMETERS ================ 52 | 53 | preset = 2; 54 | 55 | nMode(2) = 4; 56 | 57 | modes(2,0) = 1; 58 | basegains(2,0) = pow(0.999,1); 59 | excitation(2,0,g) = 1*gain*g/nMode(2); 60 | 61 | modes(2,1) = 4.0198391420; 62 | basegains(2,1) = pow(0.999,2); 63 | excitation(2,1,g) = 1*gain*g/nMode(2); 64 | 65 | modes(2,2) = 10.7184986595; 66 | basegains(2,2) = pow(0.999,3); 67 | excitation(2,2,g) = 1*gain*g/nMode(2); 68 | 69 | modes(2,3) = 18.0697050938; 70 | basegains(2,3) = pow(0.999,4); 71 | excitation(2,3,g) = 1*gain*g/nMode(2); 72 | 73 | //==================== SIGNAL PROCESSING ================ 74 | //----------------------- Synthesis parameters computing and functions declaration ---------------------------- 75 | 76 | //the number of modes depends on the preset being used 77 | nModes = nMode(preset); 78 | 79 | delayLengthBase(f) = ma.SR/f; 80 | 81 | //delay lengths in number of samples 82 | delayLength(x,f) = delayLengthBase(f)/modes(preset,x); 83 | 84 | //delay lines 85 | delayLine(x,f) = de.delay(4096,delayLength(x,f)); 86 | 87 | //Filter bank: fi.bandpass filters (declared in instrument.lib) 88 | radius = 1 - ma.PI*32/ma.SR; 89 | bandPassFilter(x,f) = instrument.bandPass(f*modes(preset,x),radius); 90 | //----------------------- Algorithm implementation ---------------------------- 91 | 92 | //One resonance 93 | resonance(x,f,g) = + : + (excitation(preset,x,g)*select) : delayLine(x,f) : *(basegains(preset,x)) : bandPassFilter(x,f); 94 | -------------------------------------------------------------------------------- /public/faust-modules/generators/STunedBar3.dsp: -------------------------------------------------------------------------------- 1 | declare name "Three Rack Tuned Bars"; 2 | declare author "ER";//From "Tuned Bar" by Romain Michon (rmichon@ccrma.stanford.edu); 3 | 4 | 5 | /* =========== DESCRIPTION ============= 6 | 7 | - Three rack tuned bars 8 | - Head = Silence/Resonance 9 | - Tilt = High frequencies 10 | - Front = High + Medium frequencies 11 | - Bottom = High + Medium + Low frequencies 12 | 13 | */ 14 | 15 | import("stdfaust.lib"); 16 | instrument = library("instruments.lib"); 17 | 18 | //==================== INSTRUMENT ======================= 19 | 20 | process = vgroup("tunedBars",hgroup("[1]",par(i, 3, onerack(i,i,i))):>_); 21 | 22 | onerack(d,n,e) = hgroup("bar %n", par(i, 5, tunedBar(d,i,e))); 23 | 24 | tunedBar(d,n,e) = 25 | ((select-1)*-1) <: 26 | //nModes resonances with nModes feedbacks for bow table look-up 27 | par(i,nModes,(resonance(i,freqqy(n,e),gate(d,n))~_)):> + : 28 | //Signal Scaling and stereo 29 | *(4); 30 | 31 | 32 | //==================== GUI SPECIFICATION ================ 33 | 34 | gain = 0.8; 35 | 36 | gate(d,n) = position(d,n) : upfront; 37 | position(d,n) = abs(hand(d) - n) < 0.5; 38 | upfront(x) = x>x'; 39 | hand(0) = vslider("Instrument Hand 0 [acc:1 0 -10 0 14]", 0, 0, 5, 1):int:ba.automat(120, 15, 0.0); 40 | hand(1) = vslider("Instrument Hand 1 [acc:1 0 -10 0 14]", 2, 0, 5, 1):int:ba.automat(240, 15, 0.0); 41 | hand(2) = vslider("Instrument Hand 2 [acc:1 0 -10 0 10]", 4, 0, 5, 1):int:ba.automat(480, 15, 0.0); 42 | 43 | 44 | select = 1; 45 | 46 | //----------------------- Frequency Table -------------------- 47 | 48 | 49 | freq(0) = 184.99; 50 | freq(1) = 207.65; 51 | freq(2) = 233.08; 52 | freq(3) = 277.18; 53 | freq(4) = 311.12; 54 | 55 | freq(d) = freq(d-5)*2; 56 | freqqy(d,e) = freq(d+e*5); 57 | //==================== MODAL PARAMETERS ================ 58 | 59 | preset = 2; 60 | 61 | nMode(2) = 4; 62 | 63 | modes(2,0) = 1; 64 | basegains(2,0) = pow(0.999,1); 65 | excitation(2,0,g) = 1*gain*g/nMode(2); 66 | 67 | modes(2,1) = 4.0198391420; 68 | basegains(2,1) = pow(0.999,2); 69 | excitation(2,1,g) = 1*gain*g/nMode(2); 70 | 71 | modes(2,2) = 10.7184986595; 72 | basegains(2,2) = pow(0.999,3); 73 | excitation(2,2,g) = 1*gain*g/nMode(2); 74 | 75 | modes(2,3) = 18.0697050938; 76 | basegains(2,3) = pow(0.999,4); 77 | excitation(2,3,g) = 1*gain*g/nMode(2); 78 | 79 | //==================== SIGNAL PROCESSING ================ 80 | 81 | //----------------------- Synthesis parameters computing and functions declaration ---------------------------- 82 | 83 | //the number of modes depends on the preset being used 84 | nModes = nMode(preset); 85 | 86 | 87 | delayLengthBase(f) = ma.SR/f; 88 | 89 | //delay lengths in number of samples 90 | delayLength(x,f) = delayLengthBase(f)/modes(preset,x); 91 | 92 | //delay lines 93 | delayLine(x,f) = de.delay(4096,delayLength(x,f)); 94 | 95 | //Filter bank: fi.bandpass filters (declared in instrument.lib) 96 | radius = 1 - ma.PI*32/ma.SR; 97 | bandPassFilter(x,f) = instrument.bandPass(f*modes(preset,x),radius); 98 | 99 | //----------------------- Algorithm implementation ---------------------------- 100 | 101 | //One resonance 102 | resonance(x,f,g) = + : + (excitation(preset,x,g)*select) : delayLine(x,f) : *(basegains(preset,x)) : bandPassFilter(x,f); 103 | 104 | -------------------------------------------------------------------------------- /public/faust-modules/generators/STunedBar6.dsp: -------------------------------------------------------------------------------- 1 | declare name "Tuned Bar"; 2 | declare description "Nonlinear Banded Waveguide Models"; 3 | declare name "Six Rack Tuned Bars"; 4 | declare author "ER";//From "Tuned Bar" by Romain Michon (rmichon@ccrma.stanford.edu); 5 | 6 | 7 | /* =========== DESCRIPTION ============= 8 | 9 | - Six rack tuned bars 10 | - Head = Silence/Resonance 11 | - Tilt = High frequencies 12 | - Front = High + Medium frequencies 13 | - Bottom = High + Medium + Low frequencies 14 | 15 | */ 16 | 17 | import("stdfaust.lib"); 18 | instrument = library("instruments.lib"); 19 | 20 | //==================== INSTRUMENT ======================= 21 | 22 | process = vgroup("tunedBars",hgroup("[1]",par(i, 6, onerack(i,i,i))):>_); 23 | 24 | onerack(h,n,e) = hgroup("Bar %n", par(i, 5, tunedBar(h,i,e))); 25 | 26 | tunedBar(h,n,e) = 27 | ((select-1)*-1) <: 28 | //nModes resonances with nModes feedbacks for bow table look-up 29 | par(i,nModes,(resonance(i,freqqy(n,e),gate(h,n))~_)) :> + : 30 | //Signal Scaling and stereo 31 | *(4); 32 | 33 | //==================== GUI SPECIFICATION ================ 34 | 35 | gain = 0.8; 36 | gate(h,n) = position(h,n) : upfront; 37 | hand(0) = vslider("Instrument Hand[acc:1 0 -10 0 18]", 0, 0, 5, 1):int:ba.automat(120, 15, 0.0); 38 | hand(1) = vslider("Instrument Hand[acc:1 0 -10 0 18]", 0, 0, 5, 1):int:ba.automat(120, 15, 0.0); 39 | hand(2) = vslider("Instrument Hand[acc:1 0 -10 0 14]", 2, 0, 5, 1):int:ba.automat(240, 15, 0.0); 40 | hand(3) = vslider("Instrument Hand[acc:1 0 -10 0 14]", 2, 0, 5, 1):int:ba.automat(240, 15, 0.0); 41 | hand(4) = vslider("Instrument Hand[acc:1 0 -10 0 10]", 4, 0, 5, 1):int:ba.automat(480, 15, 0.0); 42 | hand(5) = vslider("Instrument Hand[acc:1 0 -10 0 10]", 4, 0, 5, 1):int:ba.automat(480, 15, 0.0); 43 | 44 | position(h,n) = abs(hand(h) - n) < 0.5; 45 | upfront(x) = x>x'; 46 | 47 | select = 1; 48 | integrationConstant = 0; 49 | baseGain = 1; 50 | 51 | //----------------------- Frequency Table -------------------- 52 | 53 | freq(0) = 92.49; 54 | freq(1) = 103.82; 55 | freq(2) = 116.54; 56 | freq(3) = 138.59; 57 | freq(4) = 155.56; 58 | 59 | freq(d) = freq(d-5)*2; 60 | freqqy(d,e) = freq(d+e*5); 61 | //==================== MODAL PARAMETERS ================ 62 | 63 | preset = 2; 64 | 65 | nMode(2) = 4; 66 | 67 | modes(2,0) = 1; 68 | basegains(2,0) = pow(0.999,1); 69 | excitation(2,0,g) = 1*gain*g/nMode(2); 70 | 71 | modes(2,1) = 4.0198391420; 72 | basegains(2,1) = pow(0.999,2); 73 | excitation(2,1,g) = 1*gain*g/nMode(2); 74 | 75 | modes(2,2) = 10.7184986595; 76 | basegains(2,2) = pow(0.999,3); 77 | excitation(2,2,g) = 1*gain*g/nMode(2); 78 | 79 | modes(2,3) = 18.0697050938; 80 | basegains(2,3) = pow(0.999,4); 81 | excitation(2,3,g) = 1*gain*g/nMode(2); 82 | 83 | //==================== SIGNAL PROCESSING ================ 84 | 85 | //----------------------- Nonlinear filter ---------------------------- 86 | //nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib 87 | 88 | //nonlinear filter order 89 | nlfOrder = 6; 90 | 91 | //----------------------- Synthesis parameters computing and functions declaration ---------------------------- 92 | 93 | //the number of modes depends on the preset being used 94 | nModes = nMode(preset); 95 | 96 | delayLengthBase(f) = ma.SR/f; 97 | 98 | //delay lengths in number of samples 99 | delayLength(x,f) = delayLengthBase(f)/modes(preset,x); 100 | 101 | //delay lines 102 | delayLine(x,f) = de.delay(4096,delayLength(x,f)); 103 | 104 | //Filter bank: fi.bandpass filters (declared in instrument.lib) 105 | radius = 1 - ma.PI*32/ma.SR; 106 | bandPassFilter(x,f) = instrument.bandPass(f*modes(preset,x),radius); 107 | 108 | //----------------------- Algorithm implementation ---------------------------- 109 | 110 | //One resonance 111 | resonance(x,f,g) = + : + (excitation(preset,x,g)*select) : delayLine(x,f) : *(basegains(preset,x)) : bandPassFilter(x,f); 112 | 113 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SWhistles2.dsp: -------------------------------------------------------------------------------- 1 | declare name "Whistles 2"; 2 | declare author "ER"; 3 | declare version "1.0"; 4 | 5 | /* =========== DESCRIPTION ============ 6 | 7 | - Triple whistle 8 | - Head = Silence 9 | - Rocking/Swing/Fishing Rod = Alternating the different whistles 10 | - Vary your gestures' speed to increase sound 11 | 12 | */ 13 | 14 | import("stdfaust.lib"); 15 | instrument = library("instruments.lib"); 16 | 17 | //----------------- INSTRUMENT ------------------// 18 | 19 | process = vgroup("Whistles", nOise.white * (0.5) <: par(i, 3, whistle(i))):>_; 20 | 21 | whistle(n) = BP(n) : EQ(n) : @(10 + (12000*n)) <:Reson(0),_*(1.5):> *(Env)*gain(n); 22 | 23 | //----------------- NOISES ----------------------// 24 | 25 | nOise = environment { 26 | 27 | // white no.noise generator: 28 | random = +(12345)~*(1103515245); 29 | white = random/2147483647.0; 30 | }; 31 | 32 | //----------------- FILTERS -------------------// 33 | 34 | 35 | freq = hslider("[2]Frequency[unit:Hz][acc:1 1 -10 0 10]", 400, 220, 660, 0.01):si.smooth(0.999); 36 | gain(n) = hslider("[3]Volume %n[style:knob][acc:%n 0 -10 15 0 0.5]", 0.5, 0, 2, 0.001):si.smooth(0.999); 37 | 38 | hight(n) = freq * (n+1); 39 | level = 20; 40 | Lowf(n) = hight(n) - Q; 41 | Highf(n) = hight(n) + Q; 42 | 43 | Q = 1.5 : si.smooth(0.999);//hslider("Q - Filter Bandwidth[style:knob][unit:Hz][tooltip: Band width = 2 * Frequency]",2.5,1,10,0.0001):si.smooth(0.999); 44 | 45 | BP(n) = fi.bandpass(1, Lowf(n), Highf(n)); 46 | EQ(n) = fi.peak_eq(level,hight(n),Q) : fi.lowpass(1, 6000); 47 | Reson(n) = fi.resonbp(hight(n),Q,1) : fi.lowpass(1,3000); 48 | 49 | Env = (instrument.envVibrato(b,a,s,r,t)) 50 | with { 51 | b = 0.25; 52 | a = 0.1; 53 | s = 100; 54 | r = 0.8; 55 | t = hslider("[1]ON/OFF (Vibrato Envelope)[acc:1 0 -12 0 2]", 1, 0, 1, 1); 56 | }; 57 | 58 | -------------------------------------------------------------------------------- /public/faust-modules/generators/SWhistles3.dsp: -------------------------------------------------------------------------------- 1 | declare name "Whistles 3"; 2 | declare author "ER"; 3 | declare version "1.0"; 4 | 5 | /* =========== DESCRIPTION ============ 6 | 7 | - Triple whistle 8 | - Head = Silence 9 | - Rocking/Swing/Fishing Rod = Alternating the different whistles 10 | - Vary your gestures' speed to increase sound 11 | 12 | */ 13 | 14 | import("stdfaust.lib"); 15 | instrument = library("instruments.lib"); 16 | 17 | //----------------- INSTRUMENT ------------------// 18 | 19 | process = vgroup("Whistles", nOise.white * (0.5) <: par(i, 3, whistle(i))):>_; 20 | 21 | whistle(n) = BP(n) : EQ(n) : @(10 + (12000*n)) <:Reson(0),_*(1.5):> *(Env)*gain(n); 22 | 23 | //----------------- NOISES ----------------------// 24 | 25 | nOise = environment { 26 | 27 | // white no.noise generator: 28 | random = +(12345)~*(1103515245); 29 | white = random/2147483647.0; 30 | }; 31 | 32 | //----------------- FILTERS -------------------// 33 | 34 | freq = hslider("[2]Frequency[unit:Hz][acc:1 1 -10 0 10]", 820, 660, 1100, 0.01):si.smooth(0.999); 35 | gain(n) = hslider("[3]Volume %n[style:knob][acc:%n 0 -10 15 0 0.5]", 0.5, 0, 2, 0.001):si.smooth(0.999); 36 | 37 | hight(n) = freq * (n+1); 38 | level = 20; 39 | Lowf(n) = hight(n) - Q; 40 | Highf(n) = hight(n) + Q; 41 | 42 | Q = 1.5 : si.smooth(0.999);//hslider("Q - Filter Bandwidth[style:knob][unit:Hz][tooltip: Band width = 2 * Frequency]",2.5,1,10,0.0001):si.smooth(0.999); 43 | 44 | BP(n) = fi.bandpass(1, Lowf(n), Highf(n)); 45 | EQ(n) = fi.peak_eq(level,hight(n),Q) : fi.lowpass(1, 6000); 46 | Reson(n) = fi.resonbp(hight(n),Q,1) : fi.lowpass(1,3000); 47 | 48 | 49 | Env = (instrument.envVibrato(b,a,s,r,t)) 50 | with { 51 | b = 0.25; 52 | a = 0.1; 53 | s = 100; 54 | r = 0.8; 55 | t = hslider("[1]ON/OFF (Vibrato Envelope)[acc:1 0 -12 0 2]", 1, 0, 1, 1); 56 | }; 57 | 58 | -------------------------------------------------------------------------------- /public/faust-modules/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "instruments" : ["faust-modules/generators/Kisana.dsp", "faust-modules/generators/SAtonalSoftHarp.dsp", "faust-modules/generators/SBird.dsp", "faust-modules/generators/SBlowhistleBottle.dsp", "faust-modules/generators/SBouncyHarp.dsp", "faust-modules/generators/SBrass.dsp", "faust-modules/generators/SBrassMulti.dsp", "faust-modules/generators/SCameleonKeyboard.dsp", "faust-modules/generators/SChromaticSoftHarp.dsp", "faust-modules/generators/SChromaticTunedBars.dsp", "faust-modules/generators/SClarinet.dsp", "faust-modules/generators/SCMajBlowBottle.dsp", "faust-modules/generators/SCMajDryHarp.dsp", "faust-modules/generators/SCMajFlute.dsp", "faust-modules/generators/SCMajSoftHarp.dsp", "faust-modules/generators/SCMajTunedBars.dsp", "faust-modules/generators/SFlute.dsp", "faust-modules/generators/SModulation1.dsp", "faust-modules/generators/SModulation2.dsp", "faust-modules/generators/SModulation3.dsp", "faust-modules/generators/SModulation4.dsp", "faust-modules/generators/SNoiseburst.dsp", "faust-modules/generators/SNoise.dsp", "faust-modules/generators/SNoiseS.dsp", "faust-modules/generators/SOscillator.dsp", "faust-modules/generators/SPentatonicBlowBottle.dsp", "faust-modules/generators/SPentatonicDryHarp.dsp", "faust-modules/generators/SPentatonicFlute.dsp", "faust-modules/generators/SPentatonicSoftHarp.dsp", "faust-modules/generators/SPulsaxophone.dsp", "faust-modules/generators/SRandomAndHold.dsp", "faust-modules/generators/SRandomFlute.dsp", "faust-modules/generators/SRandomFrequencyGenerator.dsp", "faust-modules/generators/STibetanBowl.dsp", "faust-modules/generators/STinkle.dsp", "faust-modules/generators/STunedBar3.dsp", "faust-modules/generators/STunedBar6.dsp", "faust-modules/generators/STunedBar.dsp", "faust-modules/generators/SWhistles2.dsp", "faust-modules/generators/SWhistles3.dsp"], 3 | "effets" : ["faust-modules/effects/ASREnvelope.dsp", "faust-modules/effects/BandPassFilter.dsp", "faust-modules/effects/CombFilter.dsp", "faust-modules/effects/Echo.dsp", "faust-modules/effects/Flanger.dsp", "faust-modules/effects/Freeverb.dsp", "faust-modules/effects/Granulator.dsp", "faust-modules/effects/HighPassFilter.dsp", "faust-modules/effects/InstrReverb.dsp", "faust-modules/effects/Loop.dsp", "faust-modules/effects/LowPassFilter.dsp", "faust-modules/effects/Modulations.dsp", "faust-modules/effects/Notch.dsp", "faust-modules/effects/PeakEqualizer.dsp", "faust-modules/effects/Phaser.dsp", "faust-modules/effects/RandomRingModulation.dsp", "faust-modules/effects/RandomVibrato.dsp", "faust-modules/effects/RingModulation.dsp", "faust-modules/effects/SLimiter.dsp", "faust-modules/effects/VibratoEnvelope.dsp", "faust-modules/effects/Volume.dsp", "faust-modules/effects/WahWah.dsp", "faust-modules/effects/ZitaReverb.dsp"], 4 | "exemples" : ["faust-modules/combined/AtonalSoftHarp.dsp", "faust-modules/combined/Birds.dsp", "faust-modules/combined/BlowhistleBottle.dsp", "faust-modules/combined/BouncyHarp.dsp", "faust-modules/combined/Brass.dsp", "faust-modules/combined/ChromaticSoftHarp.dsp", "faust-modules/combined/Clarinet.dsp", "faust-modules/combined/CMajDryHarp.dsp", "faust-modules/combined/CMajFlute.dsp", "faust-modules/combined/CMajSoftHarp.dsp", "faust-modules/combined/FlappyFlute.dsp", "faust-modules/combined/Flute.dsp", "faust-modules/combined/Meow.dsp", "faust-modules/combined/Modulations.dsp", "faust-modules/combined/PentatonicDryHarp.dsp", "faust-modules/combined/PentatonicFlute.dsp", "faust-modules/combined/PentatonicSoftHarp.dsp", "faust-modules/combined/Pulsaxophone.dsp", "faust-modules/combined/RandomFlute.dsp", "faust-modules/combined/Seaside.dsp", "faust-modules/combined/StalactiteHarp.dsp", "faust-modules/combined/TibetanBowl.dsp", "faust-modules/combined/TibetanBowlMulti.dsp", "faust-modules/combined/TunedBars.dsp", "faust-modules/combined/Whistles.dsp", "faust-modules/combined/WoodenKeyboard.dsp"] 5 | } 6 | -------------------------------------------------------------------------------- /public/faust-modules/make-json: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # echo "{" 3 | # sep1="" 4 | # for d in *; do 5 | # echo $sep1 6 | # echo "$d:" 7 | # sep2="[" 8 | # for f in "$d/*.dsp"; do 9 | # echo $sep2 "$f" 10 | # sep2="," 11 | # done 12 | # echo "]" 13 | # sep1="," 14 | # done 15 | # echo "}" 16 | 17 | echo "{" 18 | s="" 19 | for d in *; do 20 | echo $s 21 | echo -n '"'$d'"' ": [" 22 | w='' 23 | for f in $d/*.dsp; do 24 | echo -n $w '"'$f'"' 25 | w=',' 26 | done 27 | echo -n "]" 28 | s=',' 29 | done 30 | echo 31 | echo "}" 32 | -------------------------------------------------------------------------------- /public/faust-modules/update-acc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #nombre = ([-.0-9]+) 3 | sed -re 's/acc\s*:\s*([-.0-9]+)\s+([-.0-9]+)\s+([-.0-9]+)\s+([-.0-9]+)\s+([-.0-9]+)\s+([-.0-9]+)\s*]",\s*([-.0-9]+)/acc:\1 \2 \3 \5 \4]", \6/g' $1 4 | -------------------------------------------------------------------------------- /public/img/BACK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/BACK.png -------------------------------------------------------------------------------- /public/img/Oldlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/Oldlogo.png -------------------------------------------------------------------------------- /public/img/analyser-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/analyser-bg.png -------------------------------------------------------------------------------- /public/img/big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/big.png -------------------------------------------------------------------------------- /public/img/blueFilter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/blueFilter.png -------------------------------------------------------------------------------- /public/img/body-bkg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/body-bkg.gif -------------------------------------------------------------------------------- /public/img/body-bkg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/body-bkg.png -------------------------------------------------------------------------------- /public/img/cancel_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/cancel_white.png -------------------------------------------------------------------------------- /public/img/checkBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/checkBox.png -------------------------------------------------------------------------------- /public/img/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/close.png -------------------------------------------------------------------------------- /public/img/cross_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/cross_close.png -------------------------------------------------------------------------------- /public/img/cross_close_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/cross_close_menu.png -------------------------------------------------------------------------------- /public/img/curve1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/curve1.png -------------------------------------------------------------------------------- /public/img/curve2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/curve2.png -------------------------------------------------------------------------------- /public/img/curve3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/curve3.png -------------------------------------------------------------------------------- /public/img/curve4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/curve4.png -------------------------------------------------------------------------------- /public/img/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/edit.png -------------------------------------------------------------------------------- /public/img/enter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/enter.png -------------------------------------------------------------------------------- /public/img/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/export.png -------------------------------------------------------------------------------- /public/img/fullscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/fullscreen.png -------------------------------------------------------------------------------- /public/img/grame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/grame.png -------------------------------------------------------------------------------- /public/img/ico-analyser.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/ico-analyser.gif -------------------------------------------------------------------------------- /public/img/ico-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/ico-arrow.png -------------------------------------------------------------------------------- /public/img/ico-close.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/ico-close.gif -------------------------------------------------------------------------------- /public/img/ico-micro-mute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/ico-micro-mute.png -------------------------------------------------------------------------------- /public/img/ico-micro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/ico-micro.png -------------------------------------------------------------------------------- /public/img/ico-play.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/ico-play.gif -------------------------------------------------------------------------------- /public/img/ico-plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/ico-plus.png -------------------------------------------------------------------------------- /public/img/ico-speaker-mute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/ico-speaker-mute.png -------------------------------------------------------------------------------- /public/img/ico-speaker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/ico-speaker.png -------------------------------------------------------------------------------- /public/img/ico-stop.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/ico-stop.gif -------------------------------------------------------------------------------- /public/img/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/loader.gif -------------------------------------------------------------------------------- /public/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/logo.png -------------------------------------------------------------------------------- /public/img/logoAnim.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/logoAnim.gif -------------------------------------------------------------------------------- /public/img/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/minus.png -------------------------------------------------------------------------------- /public/img/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/open.png -------------------------------------------------------------------------------- /public/img/output-bkg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/output-bkg.gif -------------------------------------------------------------------------------- /public/img/pseudoRandomFilter2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/pseudoRandomFilter2.png -------------------------------------------------------------------------------- /public/img/pseudoRandomFilter3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/pseudoRandomFilter3.png -------------------------------------------------------------------------------- /public/img/slider-bkg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/slider-bkg.gif -------------------------------------------------------------------------------- /public/img/slider-handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/slider-handle.png -------------------------------------------------------------------------------- /public/img/slider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/slider.png -------------------------------------------------------------------------------- /public/img/slider_chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/slider_chrome.png -------------------------------------------------------------------------------- /public/img/sliderleft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/sliderleft.png -------------------------------------------------------------------------------- /public/img/sliderleft_chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/sliderleft_chrome.png -------------------------------------------------------------------------------- /public/img/slidermiddle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/slidermiddle.png -------------------------------------------------------------------------------- /public/img/slidermiddle_chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/slidermiddle_chrome.png -------------------------------------------------------------------------------- /public/img/sliderright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/sliderright.png -------------------------------------------------------------------------------- /public/img/sliderright_chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/sliderright_chrome.png -------------------------------------------------------------------------------- /public/img/trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/trash.png -------------------------------------------------------------------------------- /public/img/triangleClose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/triangleClose.png -------------------------------------------------------------------------------- /public/img/triangleOpen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/triangleOpen.png -------------------------------------------------------------------------------- /public/img/validate_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grame-cncm/faustplayground/fea4a6eafe465e57d9d76c1fc5dd2c0cefbc9fe6/public/img/validate_white.png -------------------------------------------------------------------------------- /public/json/patch_light.json: -------------------------------------------------------------------------------- 1 | {"1":{"patchId":"1","code":"process = vgroup(\"Echo\",environment{declare name \"Echo\";\r\n\r\nimport(\"math.lib\");\r\nimport(\"music.lib\");\r\nimport(\"filter.lib\");\r\n\r\n/* ============ DESCRIPTION =============\r\n\r\n- Variable delay echo\r\n- Echo Delay = Pick manually which amount of time in seconds must be repeated by the echo\r\n- Rocking = To vary the intensity of the echo\r\n\r\n*/\r\n\r\nprocess = echo;\r\n\r\n\r\necho = +~ @(echoDelay)*(feedback);\r\nsmooth(s) = *(1.0 - s) : + ~ *(s);\r\n\r\nechoDelay = hslider(\"Echo Delay[unit:s]\", 0.5, 0.01, 1, 0.001):min(1):max(0.01)*(44100):int;\r\nfeedback = hslider(\"Echo Intensity (Feedback)[style:knob][acc:0 0 -10 0 10]\", 0.001, 0.001, 0.65, 0.001):smooth(0.999);\r\n}.process);","name":"Echo","x":"544","y":"169","inputs":{"source":["2"]},"outputs":{"destination":["3"]},"params":{"sliders":[{"path":"/Echo/Echo_Delay","value":0.5},{"path":"/Echo/Echo_Intensity_(Feedback)","value":0.0010000000474974513}]}},"2":{"patchId":"2","code":"process = vgroup(\"SOscillator\",environment{declare name \t\t\"osc\";\r\ndeclare version \t\"1.0\";\r\ndeclare author \t\t\"Grame\";\r\ndeclare license \t\"BSD\";\r\ndeclare copyright \t\"(c)GRAME 2009\";\r\n\r\n//-----------------------------------------------\r\n// \t\t\tSinusoidal Oscillator\r\n//-----------------------------------------------\r\n\r\n/* =========== DESCRIPTION =============\r\n\r\n- Simple sine wave oscillator\r\n- Left = low frequencies\r\n- Right = high frequencies\r\n- Front = around 300Hz\r\n- Rocking = from low to high\r\n*/ \r\n\r\nimport(\"music.lib\");\r\n\r\n\r\nsmooth(c)\t\t= *(1-c) : +~*(c);\r\nfreq \t\t\t= hslider(\"Frequency [unit:Hz] [acc:0 0 -10 0 10]\", 300, 70, 2400, 0.01):smooth(0.999);\r\nprocess \t\t= vgroup(\"Oscillator\", osc(freq));\r\n\r\n}.process);","name":"SOscillator","x":"282","y":"261","inputs":{"source":[]},"outputs":{"destination":["1"]},"params":{"sliders":[{"path":"/SOscillator/Oscillator/Frequency","value":300}]}},"3":{"patchId":"3","code":"process = vgroup(\"Volume\",environment{declare name \"Volume\";\r\ndeclare author \"GRAME\";\r\n\r\n/* ========== DESCRITPION ===========\r\n\r\n- Simple volume slider\r\n- Head = Silence\r\n- Bottom = Max volume\r\n\r\n*/\r\n\r\nimport(\"filter.lib\");\r\n\r\nprocess = par(i,2,*(hslider(\"Volume[acc:1 1 -10 0 10]\", 0.75, 0, 1, 0.01):smooth(0.999)));\r\n}.process);","name":"Volume","x":"830","y":"148","inputs":{"source":["1"]},"outputs":{"destination":["output"]},"params":{"sliders":[{"path":"/Volume/Volume","value":0.75}]}}} -------------------------------------------------------------------------------- /resources/resources_en-EN.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultSceneName": "Patch", 3 | "reference": "Extension of the WebAudio Playground by", 4 | "chrisWilson": "Chris Wilson", 5 | "loading": "Loading", 6 | "drop": "Drop here", 7 | 8 | 9 | "noFileOnCloud": "No file found on Google Drive", 10 | 11 | 12 | "errorObjectNotFaustCompatible": "Content is not compatible with Faust", 13 | "errorLoading": "Error while loading the scene", 14 | "errorGettingAudioInput": "Could not enable microphone or audio input", 15 | "errorInputAPINotAvailable": "The microphone or audio input cannot be used in your browser", 16 | "errorAccSliderNotFound": "Could not find slider, modifications on the slider will not be exported in the final version of the application", 17 | "errorAccelerometerNotFound": "Could not find accelerometer, modifications on the slider will not be exported in the final version of the application", 18 | "errorNoWebAudioAPI": "It appears that your browser does not support the Web Audio API. Try with a more recent version of the browser", 19 | "errorOccuredMessage": "An error has occured:", 20 | "errorFactory": "The provided Faust code is not correct: ", 21 | "errorJsonCorrupted": "This file is corrupt and cannot be loaded", 22 | "errorCreateDSP": "Cannot create the DSP file, the Faust code contains errors", 23 | "errorCreateModuleRecall": "An error occured while creating the module, the save file is probably corrupt", 24 | "errorConnectionRecall": "An error occured while connecting modules, the save file is probably corrupt", 25 | "errorLocalStorage": "Your browser does not support local storage", 26 | "errorConnectionCloud": "Unable to connect to Google Drive", 27 | 28 | 29 | "saveDownload": "Download the scene: ", 30 | "rulesSceneName": "Only alphabet letters and numbers are accepted. Spaces, apostrophes and accents are automatically replaced. The name cannot start with a number. It must be between 1 and 50 characters.", 31 | "precompileOption": "Precompiled (heavier)", 32 | "buttonDownloadApp": "Download", 33 | "sucessSave": "File saved successfully", 34 | "buttonSuppress": "Delete", 35 | "buttonLocalSave": "Save locally", 36 | "buttonConnectCloud": "Connect to Google Drive", 37 | "buttonCloudSave": "Save online", 38 | "buttonLogoutCloud": "Log out", 39 | 40 | 41 | "confirmSuppr": "Do you really want to delete this Patch?", 42 | "confirmReplace": "The name you are using already exists, if you continue the existing file will be replaced. You can rename the scene in the Export tab. Replace?", 43 | 44 | 45 | "buttonLibrary": "Library", 46 | "buttonLoad": "Load", 47 | "buttonEdit": "Edit", 48 | "buttonSave": "Save", 49 | "buttonExport": "Export", 50 | "buttonHelp": "Help", 51 | "confirmEmptyScene": "Do you really want to empty the scene?", 52 | "buttonLoadFile": "Load file", 53 | "buttonLoadLocal": "Load local scene", 54 | "buttonLoadCloud": "Load online scene", 55 | "titleInstruments": "Instruments", 56 | "titleEffects": "Effects", 57 | "titleExemples": "Examples", 58 | "hoverLibraryElement": "Click, drag and drop!", 59 | "appNameExport": "The application is called:", 60 | "buttonChangeSceneName": "Change the name of the application", 61 | "lessOptions": "- less options", 62 | "moreOptions": "+ more options", 63 | "titleExportOptions": "Choose export", 64 | "buttonRefresh": "Refresh server", 65 | "buttonExportScene": "Export", 66 | "titleDownloadExport": "Download", 67 | "invalidSceneName": "The chosen name is invalid", 68 | "successRenameScene": "The name has been changed successfully", 69 | "curve1": "curve 1: ", 70 | "curve2": "curve 2: ", 71 | "curve3": "curve 3: ", 72 | "curve4": "curve 4: ", 73 | "axisX": "X axis: ", 74 | "axisY": "Y axis: ", 75 | "axisZ": "Z axis: ", 76 | "axis0": "off: ", 77 | "checkBox": "enable/disable accelerometer", 78 | "noDeviceMotion": "It appears that your browser does not support the Device Motion API, you will therefore be unable to access the accelerometers of your device." 79 | } 80 | -------------------------------------------------------------------------------- /resources/resources_fr-FR.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultSceneName": "Patch", 3 | "reference": "Extension de WebAudio Playground par", 4 | "chrisWilson": "Chris Wilson", 5 | "loading": "Chargement en cours", 6 | "drop": "Déposer ici", 7 | 8 | 9 | "noFileOnCloud": "Aucun fichier trouvé sur Google Drive", 10 | 11 | 12 | "errorObjectNotFaustCompatible": "Le contenu n'est pas compatible avec Faust", 13 | "errorLoading": "Erreur lors du chargement de la scène", 14 | "errorGettingAudioInput": "Le micro ou l'entrée son n'ont pas pu être activés", 15 | "errorInputAPINotAvailable": "Le micro ou l'entrée son ne peuvent pas être utilisés dans ce navigateur", 16 | "errorAccSliderNotFound": ": Slider non trouvé, les changements sur ce slider ne seront pas exportés dans l'application finale", 17 | "errorAccelerometerNotFound": "Accéléromètre non trouvé, les changements sur ce slider ne seront pas exportés dans l'application finale", 18 | "errorNoWebAudioAPI": "Il semblerait que l'API Web Audio ne soit pas supportée par votre navigateur. Vous pouvez réessayer avec un navigateur plus récent.", 19 | "errorOccuredMessage": "Une erreur s'est produite : ", 20 | "errorFactory": "Le code Faust fourni est incorrect : ", 21 | "errorJsonCorrupted": "Le fichier est corrompu, impossible de le charger", 22 | "errorCreateDSP": "Impossible de créer le DSP, le code Faust contient des erreurs", 23 | "errorCreateModuleRecall": "Une erreur s'est produite lors de la création du module, le fichier de sauvegarde est probablement corrompu", 24 | "errorConnectionRecall": "Une erreur s'est produite lors de la connexion des modules, le fichier de sauvegarde est probablement corrompu", 25 | "errorLocalStorage": "Votre navigateur ne permet pas la sauvegarde locale", 26 | "errorConnectionCloud": "Connexion à Google Drive impossible", 27 | 28 | 29 | "saveDownload": "Télécharger la scène : ", 30 | "rulesSceneName": "Seules les lettres de l'alphabet et les nombres sont acceptés. Les espaces, les apostrophes et les accents sont automatiquement remplacés. Le nom ne peut pas commencer par un nombre; il doit comporter entre 1 et 50 caractères.", 31 | "precompileOption": "Précompilé (plus lourd)", 32 | "buttonDownloadApp": "Télécharger", 33 | "sucessSave": "Sauvegarde bien effectuée", 34 | "buttonSuppress": "Supprimer", 35 | "buttonLocalSave": "Sauvegarder localement", 36 | "buttonConnectCloud": "Connexion à Google Drive", 37 | "buttonCloudSave": "Sauvegarder en ligne", 38 | "buttonLogoutCloud": "Déconnexion", 39 | 40 | 41 | "confirmSuppr": "Voulez-vous vraiment supprimer ce Patch ?", 42 | "confirmReplace": "Le nom que vous utilisez existe déjà, si vous continuez vous le remplacerez. Vous pouvez renommer la scène dans l'onglet Export. Continuer?", 43 | 44 | 45 | "buttonLibrary": "Biblio", 46 | "buttonLoad": "Charger", 47 | "buttonEdit": "Éditer", 48 | "buttonSave": "Sauver", 49 | "buttonExport": "Exporter", 50 | "buttonHelp": "Aide", 51 | "confirmEmptyScene": "Voulez-vous vraiment vider la scène ?", 52 | "buttonLoadFile": "Charger un fichier", 53 | "buttonLoadLocal": "Charger une scène locale", 54 | "buttonLoadCloud": "Charger une scène en ligne", 55 | "titleInstruments": "Instruments", 56 | "titleEffects": "Effets", 57 | "titleExemples": "Exemples", 58 | "hoverLibraryElement": "Cliquez, glissez, déposez !", 59 | "appNameExport": "Le nom de l'application est : ", 60 | "buttonChangeSceneName": "Modifier le nom de l'application", 61 | "lessOptions": "- moins d'options", 62 | "moreOptions": "+ plus d'options", 63 | "titleExportOptions": "Choix de l'export", 64 | "buttonRefresh": "Rafraîchir le serveur", 65 | "buttonExportScene": "Exporter", 66 | "titleDownloadExport": "Téléchargement", 67 | "invalidSceneName": "Le nom choisi est invalide", 68 | "successRenameScene": "Le nom a bien été changé", 69 | "curve1": "courbe 1 : ", 70 | "curve2": "courbe 2 : ", 71 | "curve3": "courbe 3 : ", 72 | "curve4": "courbe 4 : ", 73 | "axisX": "axe X : ", 74 | "axisY": "axe Y : ", 75 | "axisZ": "axe Z : ", 76 | "axis0": "off : ", 77 | "checkBox": "activer/désactiver l'accéléromètre", 78 | "noDeviceMotion": "Il semblerait que votre navigateur ne supporte pas l'API Device Motion, vous n'aurez donc pas accès aux accéléromètres de votre appareil." 79 | } 80 | -------------------------------------------------------------------------------- /src/Error.ts: -------------------------------------------------------------------------------- 1 | import { Message } from "./Messages"; 2 | 3 | class ErrorFaust { 4 | 5 | static errorCallBack(errorMessage: string) { 6 | new Message(errorMessage); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Lib/perfectScrollBar/js/perfect-scrollbar.min.d.ts: -------------------------------------------------------------------------------- 1 | declare var Ps; -------------------------------------------------------------------------------- /src/Menu/Load.ts: -------------------------------------------------------------------------------- 1 | import { DriveAPI, DriveFile } from "../DriveAPI"; 2 | import { Scene } from "../Scenes/SceneClass"; 3 | import { Utilitary } from "../Utilitary"; 4 | import { LoadView } from "./LoadView"; 5 | 6 | export class Load { 7 | loadView: LoadView; 8 | sceneCurrent: Scene; 9 | drive: DriveAPI; 10 | 11 | //Set event listener 12 | setEventListeners() { 13 | this.loadView.loadFileButton.addEventListener("click", () => { this.openFile() }) 14 | this.loadView.buttonLoadLocal.addEventListener("click", () => { this.localLoad() }) 15 | this.loadView.buttonLoadCloud.addEventListener("click", () => { this.cloudLoad() }) 16 | this.loadView.buttonConnectDrive.addEventListener("click", (e) => { this.drive.handleAuthClick(e) }) 17 | 18 | this.loadView.aBigExemple.addEventListener("click", (e) => { this.getEx(e) }) 19 | this.loadView.aLightExemple.addEventListener("click", (e) => { this.getEx(e) }) 20 | this.loadView.aBigPreExemple.addEventListener("click", (e) => { this.getEx(e) }) 21 | this.loadView.aLightPreExemple.addEventListener("click", (e) => { this.getEx(e) }) 22 | 23 | this.loadView.buttonChangeAccount.addEventListener("click", (e) => { this.logOut() }) 24 | } 25 | 26 | //open file from browser dialogue open window 27 | openFile() { 28 | if (this.loadView.loadFileInput.files!.length > 0) { 29 | var file = this.loadView.loadFileInput.files!.item(0); 30 | var event: CustomEvent = new CustomEvent("fileload", { 'detail': file }) 31 | document.dispatchEvent(event); 32 | } 33 | } 34 | 35 | //set item from local storage 'item_key' key 36 | getStorageItemValue(item_key, key) { 37 | if (localStorage.getItem(item_key)) { 38 | var item_value = JSON.parse(localStorage.getItem(item_key)!); 39 | var item_index = item_value.findIndex((obj => obj[0] === key)); 40 | return (item_index >= 0) ? item_value[item_index][1] : null; 41 | } else { 42 | return null; 43 | } 44 | } 45 | 46 | //load scene from local storage 47 | localLoad() { 48 | if (this.loadView.existingSceneSelect.selectedIndex > -1) { 49 | Utilitary.showFullPageLoading(); 50 | var option = this.loadView.existingSceneSelect.options[this.loadView.existingSceneSelect.selectedIndex]; 51 | var name = option.value; 52 | this.sceneCurrent.recallScene(this.getStorageItemValue('FaustPlayground', name)); 53 | } 54 | } 55 | 56 | //load exemple 57 | getEx(e: Event) { 58 | e.preventDefault(); 59 | var anchorTarget = e.target; 60 | Utilitary.getXHR(anchorTarget.href, (json: string) => { this.loadEx(json) }, null as any) 61 | } 62 | loadEx(json) { 63 | Utilitary.showFullPageLoading(); 64 | this.sceneCurrent.recallScene(json); 65 | } 66 | 67 | //load file scene from cloud Drive API 68 | //get id file from Drive API then is able to get content 69 | cloudLoad() { 70 | if (this.loadView.cloudSelectFile.selectedIndex > -1) { 71 | Utilitary.showFullPageLoading(); 72 | var option = this.loadView.cloudSelectFile.options[this.loadView.cloudSelectFile.selectedIndex] 73 | var id = option.value 74 | var file = this.drive.getFile(id, (resp) => { this.getContent(resp) }); 75 | console.log(file); 76 | } 77 | } 78 | // get content from file loaded from cloud 79 | getContent(resp: DriveFile) { 80 | this.drive.downloadFile(resp, (json) => { this.sceneCurrent.recallScene(json) }) 81 | } 82 | 83 | //logOut from google account 84 | logOut() { 85 | var event = new CustomEvent("authoff"); 86 | document.dispatchEvent(event); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/Modules/ModuleFaust.ts: -------------------------------------------------------------------------------- 1 | import type { FaustDspFactory } from "@grame/faustwasm"; 2 | import { Connector } from "../Connect"; 3 | import { IfDSP } from "../Utilitary"; 4 | 5 | /*MODULEFAUST.JS 6 | HAND - MADE JAVASCRIPT CLASS CONTAINING A FAUST MODULE */ 7 | 8 | export class ModuleFaust { 9 | fDSP: IfDSP; 10 | factory: FaustDspFactory; 11 | fSource: string; 12 | fTempSource: string; 13 | fName: string; 14 | fTempName: string; 15 | fOutputConnections: Connector[] = []; 16 | fInputConnections: Connector[] = []; 17 | recallOutputsDestination: string[] = []; 18 | recallInputsSource: string[] = []; 19 | constructor(name: string) { 20 | this.fName = name; 21 | } 22 | 23 | /*************** ACTIONS ON IN/OUTPUT MODULES ***************************/ 24 | 25 | // ------ Returns Connection Array OR null if there are none 26 | getInputConnections(): Connector[] { 27 | return this.fInputConnections; 28 | } 29 | getOutputConnections(): Connector[] { 30 | return this.fOutputConnections; 31 | } 32 | 33 | addOutputConnection(connector: Connector): void { 34 | this.fOutputConnections.push(connector); 35 | } 36 | addInputConnection(connector: Connector): void { 37 | this.fInputConnections.push(connector); 38 | } 39 | 40 | removeOutputConnection(connector: Connector): void { 41 | this.fOutputConnections.splice(this.fOutputConnections.indexOf(connector), 1); 42 | } 43 | removeInputConnection(connector: Connector): void { 44 | this.fInputConnections.splice(this.fInputConnections.indexOf(connector), 1); 45 | } 46 | /********************** GET/SET SOURCE/NAME/DSP ***********************/ 47 | setSource(code: string): void { 48 | this.fSource = code; 49 | } 50 | getSource(): string { return this.fSource; } 51 | getName(): string { return this.fName; } 52 | getDSP(): IfDSP { 53 | return this.fDSP; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/Resources.ts: -------------------------------------------------------------------------------- 1 | import frURL from "../resources/resources_fr-FR.json?url"; 2 | import enURL from "../resources/resources_en-EN.json?url"; 3 | 4 | import type { App } from "./App"; 5 | import { resumeInit } from "./Main"; 6 | import { Utilitary } from "./Utilitary"; 7 | 8 | //contains all the key of resources json files in folders resources 9 | 10 | export class Resources { 11 | //scene messages 12 | defaultSceneName: string; 13 | reference: string; 14 | chrisWilson: string; 15 | loading: string; 16 | drop: string; 17 | 18 | //drive Api message 19 | noFileOnCloud: string; 20 | 21 | //error 22 | errorObjectNotFaustCompatible: string; 23 | errorLoading: string; 24 | errorGettingAudioInput: string; 25 | errorInputAPINotAvailable: string; 26 | errorAccSliderNotFound: string; 27 | errorAccelerometerNotFound: string; 28 | errorNoWebAudioAPI: string; 29 | errorOccuredMessage: string; 30 | errorFactory: string; 31 | errorJsonCorrupted: string; 32 | errorCreateDSP: string; 33 | errorCreateModuleRecall: string; 34 | errorConnectionRecall: string; 35 | errorLocalStorage: string; 36 | errorConnectionCloud: string; 37 | 38 | //SaveView messages 39 | saveDownload: string; 40 | rulesSceneName: string; 41 | precompileOption: string; 42 | buttonDownloadApp: string; 43 | sucessSave: string; 44 | buttonSuppress: string; 45 | buttonLocalSave: string; 46 | buttonConnectCloud: string; 47 | buttonCloudSave: string; 48 | buttonLogoutCloud: string; 49 | 50 | //Save message 51 | confirmSuppr: string; 52 | confirmReplace: string; 53 | 54 | //MenuView messages 55 | buttonLibrary: string; 56 | buttonLoad: string; 57 | buttonEdit: string; 58 | buttonSave: string; 59 | buttonExport: string; 60 | 61 | //Menu 62 | confirmEmptyScene: string; 63 | 64 | //LoadView messages 65 | buttonLoadFile: string; 66 | buttonLoadLocal: string; 67 | buttonLoadCloud: string; 68 | 69 | //LibraryView 70 | titleInstruments: string; 71 | titleEffects: string; 72 | titleExemples: string; 73 | 74 | //Library 75 | hoverLibraryElement: string; 76 | 77 | //ExportView 78 | appNameExport: string; 79 | buttonChangeSceneName: string; 80 | lessOptions: string; 81 | moreOptions: string; 82 | titleExportOptions: string; 83 | buttonRefresh: string; 84 | buttonExportScene: string; 85 | titleDownloadExport: string; 86 | invalidSceneName: string; 87 | successRenameScene: string; 88 | 89 | //AccelerometerEditView 90 | curve1: string; 91 | curve2: string; 92 | curve3: string; 93 | curve4: string; 94 | axisX: string; 95 | axisY: string; 96 | axisZ: string; 97 | axis0: string; 98 | checkBox: string; 99 | noDeviceMotion: string; 100 | 101 | //get resource depending on the location, default is french 102 | static getResources(app: App) { 103 | var localization = navigator.language; 104 | if (localization == "fr" || localization == "fr-FR") { 105 | Utilitary.getXHR(frURL, (resource) => { Resources.loadMessages(resource, app) }, Utilitary.errorCallBack) 106 | } else { 107 | Utilitary.getXHR(enURL, (resource) => { Resources.loadMessages(resource, app) }, Utilitary.errorCallBack) 108 | } 109 | } 110 | // load the json object 111 | static loadMessages(resourceJson: string, app: App) { 112 | Utilitary.messageResource = JSON.parse(resourceJson); 113 | resumeInit(app); 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /src/Scenes/SceneView.ts: -------------------------------------------------------------------------------- 1 | /* PLAYGROUND.JS 2 | Init Normal Scene with all its graphical elements 3 | 4 | This is the unique scene of the Normal Playground 5 | */ 6 | import { Utilitary } from "../Utilitary"; 7 | import { Scene } from "./SceneClass"; 8 | 9 | export class SceneView { 10 | 11 | /******************************************************************** 12 | ************************** INITIALIZATION ************************** 13 | ********************************************************************/ 14 | //expor: Export = new Export() 15 | inputOutputModuleContainer: HTMLDivElement; 16 | sceneSensor: HTMLDivElement; 17 | dropElementScene: HTMLElement; 18 | fSceneContainer: HTMLDivElement; 19 | 20 | initNormalScene(scene: Scene) { 21 | var container = document.createElement("div"); 22 | container.id = "Normal"; 23 | 24 | var svgCanvas = document.createElementNS("http://www.w3.org/2000/svg", "svg"); 25 | svgCanvas.id = "svgCanvas"; 26 | container.appendChild(svgCanvas); 27 | 28 | //--------- HEADER 29 | var head: HTMLElement = document.createElement("header"); 30 | head.id = "header"; 31 | container.appendChild(head); 32 | 33 | var uploadDiv: HTMLDivElement = document.createElement("div"); 34 | uploadDiv.id = "upload"; 35 | uploadDiv.className = "uploading"; 36 | head.appendChild(uploadDiv); 37 | //----------- INPUT OUTPUT MODULES 38 | 39 | var inputOutputModuleContainer: HTMLDivElement = document.createElement("div"); 40 | inputOutputModuleContainer.id = "inputOutputModuleContainer"; 41 | container.appendChild(inputOutputModuleContainer); 42 | this.inputOutputModuleContainer = inputOutputModuleContainer; 43 | 44 | //----------- MODULES 45 | var moduleContainer: HTMLElement = document.createElement("section"); 46 | moduleContainer.id = "modules"; 47 | moduleContainer.className = "container"; 48 | container.appendChild(moduleContainer); 49 | 50 | //------------ MENUS 51 | 52 | var linkWilson: HTMLDivElement = document.createElement("div"); 53 | linkWilson.id = "ChrisLine" 54 | linkWilson.className = "link"; 55 | linkWilson.textContent = Utilitary.messageResource.reference; 56 | container.appendChild(linkWilson); 57 | 58 | var alink: HTMLAnchorElement = document.createElement("a"); 59 | alink.href = "https://github.com/cwilso/WebAudio"; 60 | alink.textContent = Utilitary.messageResource.chrisWilson; 61 | linkWilson.appendChild(alink); 62 | 63 | var srcDiv: HTMLDivElement = document.createElement("div"); 64 | srcDiv.id = "input"; 65 | srcDiv.className = "source"; 66 | container.appendChild(srcDiv); 67 | 68 | var imageDiv: HTMLDivElement = document.createElement('div'); 69 | imageDiv.id = "logoDiv"; 70 | srcDiv.appendChild(imageDiv); 71 | 72 | var imageLogo: HTMLImageElement = document.createElement('img'); 73 | imageLogo.className = "logoGrame"; 74 | imageLogo.src = "img/grame.png"; 75 | imageDiv.appendChild(imageLogo); 76 | 77 | var dropElementScene = document.createElement("div"); 78 | dropElementScene.className = "dropElementGraph"; 79 | dropElementScene.style.display = "none"; 80 | this.dropElementScene = dropElementScene; 81 | 82 | var dropElementText = document.createElement("div"); 83 | dropElementText.textContent = Utilitary.messageResource.drop; 84 | dropElementText.className = "dropElementText"; 85 | dropElementScene.appendChild(dropElementText); 86 | 87 | container.appendChild(dropElementScene); 88 | this.fSceneContainer = container; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/global.d.ts: -------------------------------------------------------------------------------- 1 | declare module "*?url" { 2 | const x: string 3 | export default x 4 | } 5 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | 3 | export default defineConfig({ 4 | base: "./", 5 | build: { 6 | minify: false, 7 | }, 8 | }) 9 | --------------------------------------------------------------------------------